mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-13 15:08:35 +00:00
Feature/1.17 (#1120)
* start v6 * Update classes to v6 method signatures * change rootVersion to signify p2v6 compat * Use 16 as toolchain version but target 11 for build output * add minimessage as api * Require v6 and don't attempt to "setup" hook from FAWE * Address comments * *address /all/ comments * FAWE classes should only act as a delegate * Uppercase logger * Settings for v6-hook have moved to P2-v6, remove unneeded if statements * Rename classes to Delegate * add whenDone task to setCuboids * Remove bad spaces * Fix plot swap * Initial work on 1.17 support * Remove data versions from the Bukkit adapters (#1507) * Remove data versions from the Bukkit adapters * Don't allow saving schematics without an adapter in place on Bukkit. * Removed confusing line (cherry picked from commit 2056218b4a8644836b1d127105dfa289e9cdbc1c) * More progress * Fix chunk sending * Repackage from com.boydti to com.fastasyncworldedit.<module> (#1119) * Preliminary work on repackaging * Rename build artifacts matching our pattern * Finish up repackaging * Fix a few field accesses and old imports * Dirty fix for chunks container ChunkSections outside of 0-15 * Correctly read from NibbleArrays for lighting * Fix getSections and BlockMaterial for 1.17 * Fix writing blocks to the world. - The issue isn't the presence of a "-1" chunk, it's the constructor for ChunkSection requiring the layer (0 to 15) rather than the y chord * Fix more field accesses * More work towards 1.17 * Update Upstream a57f66f Fix watchdog, add negative y support. (1782) * Add azalea tree to `/tool tree` * Don't define toolchain twice * Repackage GriefDefender * Relocate under new namespace * Bye bye ecma left overs * Add 1.17 to issue templates and instructions * Move to adventure-nbt (#918) * Initial work for adventure-nbt * Some more FAWE specific stuff * Fix erroneous deprecation check * Workflow change * Continued merging all adventure NBT related changes * Continued merging all adventure NBT related changes * Made a constructor public again This needs to be public for BlockTransformExtent.java * Finished converting all NBT data to adventure. * Make this compile * Fix conflicts Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com> * Update adapters to 1.17 * Change build prefix to 1.17 * Move more nms classes to adapters * Move left over nms classes * Move Spigot 1.17 class * Remove unneeded adapter loader code The loader will find the appropriate class now itself * Update adapters * Update adapters * Lazy fix tests * Update adapters * Update Upstream 43da91a Remove method reflection for getMinHeight in BukkitWorld. (1796) * Relocate adventure-nbt under proper namespace * Add LazyCompoundTag as a non-version-specific class to be used by adapters * Better integration between old NBT and Adventure NBT - begin fixing the issues seen recently * Correctly NBT conversion method * LazyCompoundTags should actually be overriding and correctly returning a CompoundBinaryTag. * Update worldedit-adapters Fixes #1141 * Remove unnecessary massive lag machine * Refactor apply to applyBlock in subclasses * applyBlock should be overriden by all subclasses. Default apply to applyBlock * Closes #1130 Closes #1132 * Squashed commit of the following: commit a9bfa1a07c77083c844a0c3ba62f4bd94bed107c Author: NotMyFault <mc.cache@web.de> Date: Sun Jun 27 21:53:21 2021 +0200 [ci skip] Update gradle wrapper validation commit aa7471f95317d28a16f62e4b200de8d0fea2fa95 Author: Matthew Miller <mnmiller1@me.com> Date: Sat Oct 10 15:49:13 2020 +1000 Add ^x,y,z relative offset support to the offset parser (#1545) * Add ^x,y,z relative offset support to the offset parser * Wrap in a try-catch (cherry picked from commit 28bdf7ff9254bbc85bb4f5f792b303943a3930a8) * Add `fawe.error.schematic.not.found` translation key * Update Upstream 728a152 Skip notify if chunk section doesn't exist (1794) * Fixed #1157 * Add a null check to prevent NPE in nbt code * Update adapters * Update Upstream fbb047a Optimize legacy schematic loading (1808) * Hurr durr I don't want to update Java * Update Upstream 0790e6e Fix CLI Mess (1811) * Fixes #1160 * Expose minimessage transitively thru PlotSquared Touches #32 * [ci skip] Remove unneeded maven repository * Steal tab completion from PlotSquared for P2 related commands * Don't error on startup when building locally Co-Authored-By: goldfishapp <8278196+goldfishapp@users.noreply.github.com> * [ci skip] Update gh actions to Java 16 * Update textures to grab 1.17 jar Co-authored-by: NotMyFault <mc.cache@web.de> Co-authored-by: SirYwell <hannesgreule@outlook.de> Co-authored-by: Matthew Miller <mnmiller1@me.com> Co-authored-by: Matt <4009945+MattBDev@users.noreply.github.com> Co-authored-by: goldfishapp <8278196+goldfishapp@users.noreply.github.com>
This commit is contained in:
@ -20,8 +20,7 @@
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.jnbt.StringTag;
|
||||
import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.blocks.TileEntityBlock;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
@ -29,9 +28,13 @@ import com.sk89q.worldedit.extent.OutputExtent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.registry.state.PropertyKey;
|
||||
import com.sk89q.worldedit.util.concurrency.LazyReference;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
import com.sk89q.worldedit.util.nbt.TagStringIO;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nullable;
|
||||
@ -50,7 +53,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
|
||||
private final BlockState blockState;
|
||||
@Nullable private final CompoundTag nbtData;
|
||||
@Nullable
|
||||
private final LazyReference<CompoundBinaryTag> nbtData;
|
||||
|
||||
/**
|
||||
* Construct a block with the given type and default data.
|
||||
@ -78,7 +82,19 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
* @param state The block state
|
||||
* @param nbtData NBT data, which must be provided
|
||||
*/
|
||||
@Deprecated
|
||||
public BaseBlock(BlockState state, CompoundTag nbtData) {
|
||||
this(state, LazyReference.from(checkNotNull(nbtData)::asBinaryTag));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Construct a block with the given ID, data value and NBT data structure.
|
||||
*
|
||||
* @param state The block state
|
||||
* @param nbtData NBT data, which must be provided
|
||||
*/
|
||||
protected BaseBlock(BlockState state, LazyReference<CompoundBinaryTag> nbtData) {
|
||||
checkNotNull(nbtData);
|
||||
this.blockState = state;
|
||||
this.nbtData = nbtData;
|
||||
@ -102,7 +118,6 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
}
|
||||
return blockState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a map of state to state values.
|
||||
*
|
||||
@ -120,7 +135,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
|
||||
@Override
|
||||
public <V> BaseBlock with(Property<V> property, V value) {
|
||||
return toImmutableState().with(property, value).toBaseBlock(getNbtData());
|
||||
return toImmutableState().with(property, value).toBaseBlock(getNbtReference());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -134,36 +149,23 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
return toImmutableState().getState(property);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNbtData() {
|
||||
return getNbtData() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNbtId() {
|
||||
CompoundTag nbtData = getNbtData();
|
||||
LazyReference<CompoundBinaryTag> nbtData = this.nbtData;
|
||||
if (nbtData == null) {
|
||||
return "";
|
||||
}
|
||||
Tag idTag = nbtData.getValue().get("id");
|
||||
if (idTag == null) {
|
||||
idTag = nbtData.getValue().get("Id");
|
||||
}
|
||||
if (idTag instanceof StringTag) {
|
||||
return ((StringTag) idTag).getValue();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
return nbtData.getValue().getString("id");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CompoundTag getNbtData() {
|
||||
public LazyReference<CompoundBinaryTag> getNbtReference() {
|
||||
return this.nbtData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setNbtData(@Nullable CompoundTag nbtData) {
|
||||
public void setNbtReference(@Nullable LazyReference<CompoundBinaryTag> nbtData) {
|
||||
throw new UnsupportedOperationException("This class is immutable.");
|
||||
}
|
||||
|
||||
@ -173,7 +175,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (!(o instanceof BaseBlock)) {
|
||||
if (!hasNbtData() && o instanceof BlockStateHolder) {
|
||||
if (nbtData == null && o instanceof BlockStateHolder) {
|
||||
return Objects.equals(toImmutableState(), ((BlockStateHolder<?>) o).toImmutableState());
|
||||
}
|
||||
return false;
|
||||
@ -181,7 +183,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
|
||||
final BaseBlock otherBlock = (BaseBlock) o;
|
||||
|
||||
return this.blockState.equalsFuzzy(otherBlock.blockState) && Objects.equals(getNbtData(), otherBlock.getNbtData());
|
||||
return this.blockState.equalsFuzzy(otherBlock.blockState) && Objects.equals(getNbt(), otherBlock.getNbt());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -260,7 +262,7 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock toBaseBlock(CompoundTag compoundTag) {
|
||||
public BaseBlock toBaseBlock(LazyReference<CompoundBinaryTag> compoundTag) {
|
||||
if (compoundTag == null) {
|
||||
return this.blockState.toBaseBlock();
|
||||
} else if (compoundTag == this.nbtData) {
|
||||
@ -275,15 +277,26 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
|
||||
return toImmutableState().getState(property);
|
||||
}
|
||||
|
||||
// Fawe start
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getOrdinal();
|
||||
}
|
||||
// Fawe end
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// TODO use a json serializer for the NBT data
|
||||
return blockState.getAsString() + (hasNbtData() ? "{hasNbt}" : "");
|
||||
String nbtString = "";
|
||||
CompoundBinaryTag nbtData = getNbt();
|
||||
if (nbtData != null) {
|
||||
try {
|
||||
nbtString = TagStringIO.get().asString(nbtData);
|
||||
} catch (IOException e) {
|
||||
WorldEdit.logger.error("Failed to serialize NBT of Block", e);
|
||||
}
|
||||
}
|
||||
|
||||
return blockState.getAsString() + nbtString;
|
||||
}
|
||||
|
||||
public BlockState toBlockState() {
|
||||
|
@ -1,15 +1,8 @@
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.OutputExtent;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* BaseBlock that when parsed to masks represents all BlockStates of a BlockType, whilst allowing for NBT storage
|
||||
*/
|
||||
|
@ -39,23 +39,37 @@ public final class BlockCategories {
|
||||
public static final BlockCategory BIRCH_LOGS = get("minecraft:birch_logs");
|
||||
public static final BlockCategory BUTTONS = get("minecraft:buttons");
|
||||
public static final BlockCategory CAMPFIRES = get("minecraft:campfires");
|
||||
public static final BlockCategory CANDLE_CAKES = get("minecraft:candle_cakes");
|
||||
public static final BlockCategory CANDLES = get("minecraft:candles");
|
||||
public static final BlockCategory CARPETS = get("minecraft:carpets");
|
||||
public static final BlockCategory CAULDRONS = get("minecraft:cauldrons");
|
||||
public static final BlockCategory CAVE_VINES = get("minecraft:cave_vines");
|
||||
public static final BlockCategory CLIMBABLE = get("minecraft:climbable");
|
||||
public static final BlockCategory COAL_ORES = get("minecraft:coal_ores");
|
||||
public static final BlockCategory COPPER_ORES = get("minecraft:copper_ores");
|
||||
public static final BlockCategory CORAL_BLOCKS = get("minecraft:coral_blocks");
|
||||
public static final BlockCategory CORAL_PLANTS = get("minecraft:coral_plants");
|
||||
public static final BlockCategory CORALS = get("minecraft:corals");
|
||||
public static final BlockCategory CRIMSON_STEMS = get("minecraft:crimson_stems");
|
||||
public static final BlockCategory CROPS = get("minecraft:crops");
|
||||
public static final BlockCategory CRYSTAL_SOUND_BLOCKS = get("minecraft:crystal_sound_blocks");
|
||||
public static final BlockCategory DARK_OAK_LOGS = get("minecraft:dark_oak_logs");
|
||||
public static final BlockCategory DEEPSLATE_ORE_REPLACEABLES = get("minecraft:deepslate_ore_replaceables");
|
||||
public static final BlockCategory DIAMOND_ORES = get("minecraft:diamond_ores");
|
||||
public static final BlockCategory DIRT = get("minecraft:dirt");
|
||||
@Deprecated public static final BlockCategory DIRT_LIKE = get("minecraft:dirt_like");
|
||||
public static final BlockCategory DOORS = get("minecraft:doors");
|
||||
public static final BlockCategory DRAGON_IMMUNE = get("minecraft:dragon_immune");
|
||||
public static final BlockCategory DRIPSTONE_REPLACEABLE_BLOCKS = get("minecraft:dripstone_replaceable_blocks");
|
||||
public static final BlockCategory EMERALD_ORES = get("minecraft:emerald_ores");
|
||||
public static final BlockCategory ENDERMAN_HOLDABLE = get("minecraft:enderman_holdable");
|
||||
public static final BlockCategory FEATURES_CANNOT_REPLACE = get("minecraft:features_cannot_replace");
|
||||
public static final BlockCategory FENCE_GATES = get("minecraft:fence_gates");
|
||||
public static final BlockCategory FENCES = get("minecraft:fences");
|
||||
public static final BlockCategory FIRE = get("minecraft:fire");
|
||||
public static final BlockCategory FLOWER_POTS = get("minecraft:flower_pots");
|
||||
public static final BlockCategory FLOWERS = get("minecraft:flowers");
|
||||
public static final BlockCategory GEODE_INVALID_BLOCKS = get("minecraft:geode_invalid_blocks");
|
||||
public static final BlockCategory GOLD_ORES = get("minecraft:gold_ores");
|
||||
public static final BlockCategory GUARDED_BY_PIGLINS = get("minecraft:guarded_by_piglins");
|
||||
public static final BlockCategory HOGLIN_REPELLENTS = get("minecraft:hoglin_repellents");
|
||||
@ -64,32 +78,50 @@ public final class BlockCategories {
|
||||
public static final BlockCategory INFINIBURN_END = get("minecraft:infiniburn_end");
|
||||
public static final BlockCategory INFINIBURN_NETHER = get("minecraft:infiniburn_nether");
|
||||
public static final BlockCategory INFINIBURN_OVERWORLD = get("minecraft:infiniburn_overworld");
|
||||
public static final BlockCategory INSIDE_STEP_SOUND_BLOCKS = get("minecraft:inside_step_sound_blocks");
|
||||
public static final BlockCategory IRON_ORES = get("minecraft:iron_ores");
|
||||
public static final BlockCategory JUNGLE_LOGS = get("minecraft:jungle_logs");
|
||||
public static final BlockCategory LAPIS_ORES = get("minecraft:lapis_ores");
|
||||
public static final BlockCategory LAVA_POOL_STONE_REPLACEABLES = get("minecraft:lava_pool_stone_replaceables");
|
||||
public static final BlockCategory LEAVES = get("minecraft:leaves");
|
||||
public static final BlockCategory LOGS = get("minecraft:logs");
|
||||
public static final BlockCategory LOGS_THAT_BURN = get("minecraft:logs_that_burn");
|
||||
public static final BlockCategory LUSH_GROUND_REPLACEABLE = get("minecraft:lush_ground_replaceable");
|
||||
public static final BlockCategory MINEABLE_AXE = get("minecraft:mineable/axe");
|
||||
public static final BlockCategory MINEABLE_HOE = get("minecraft:mineable/hoe");
|
||||
public static final BlockCategory MINEABLE_PICKAXE = get("minecraft:mineable/pickaxe");
|
||||
public static final BlockCategory MINEABLE_SHOVEL = get("minecraft:mineable/shovel");
|
||||
public static final BlockCategory MOSS_REPLACEABLE = get("minecraft:moss_replaceable");
|
||||
public static final BlockCategory MUSHROOM_GROW_BLOCK = get("minecraft:mushroom_grow_block");
|
||||
public static final BlockCategory NEEDS_DIAMOND_TOOL = get("minecraft:needs_diamond_tool");
|
||||
public static final BlockCategory NEEDS_IRON_TOOL = get("minecraft:needs_iron_tool");
|
||||
public static final BlockCategory NEEDS_STONE_TOOL = get("minecraft:needs_stone_tool");
|
||||
public static final BlockCategory NON_FLAMMABLE_WOOD = get("minecraft:non_flammable_wood");
|
||||
public static final BlockCategory NYLIUM = get("minecraft:nylium");
|
||||
public static final BlockCategory OAK_LOGS = get("minecraft:oak_logs");
|
||||
public static final BlockCategory OCCLUDES_VIBRATION_SIGNALS = get("minecraft:occludes_vibration_signals");
|
||||
public static final BlockCategory PIGLIN_REPELLENTS = get("minecraft:piglin_repellents");
|
||||
public static final BlockCategory PLANKS = get("minecraft:planks");
|
||||
public static final BlockCategory PORTALS = get("minecraft:portals");
|
||||
public static final BlockCategory PRESSURE_PLATES = get("minecraft:pressure_plates");
|
||||
public static final BlockCategory PREVENT_MOB_SPAWNING_INSIDE = get("minecraft:prevent_mob_spawning_inside");
|
||||
public static final BlockCategory RAILS = get("minecraft:rails");
|
||||
public static final BlockCategory REDSTONE_ORES = get("minecraft:redstone_ores");
|
||||
public static final BlockCategory SAND = get("minecraft:sand");
|
||||
public static final BlockCategory SAPLINGS = get("minecraft:saplings");
|
||||
public static final BlockCategory SHULKER_BOXES = get("minecraft:shulker_boxes");
|
||||
public static final BlockCategory SIGNS = get("minecraft:signs");
|
||||
public static final BlockCategory SLABS = get("minecraft:slabs");
|
||||
public static final BlockCategory SMALL_DRIPLEAF_PLACEABLE = get("minecraft:small_dripleaf_placeable");
|
||||
public static final BlockCategory SMALL_FLOWERS = get("minecraft:small_flowers");
|
||||
public static final BlockCategory SNOW = get("minecraft:snow");
|
||||
public static final BlockCategory SOUL_FIRE_BASE_BLOCKS = get("minecraft:soul_fire_base_blocks");
|
||||
public static final BlockCategory SOUL_SPEED_BLOCKS = get("minecraft:soul_speed_blocks");
|
||||
public static final BlockCategory SPRUCE_LOGS = get("minecraft:spruce_logs");
|
||||
public static final BlockCategory STAIRS = get("minecraft:stairs");
|
||||
public static final BlockCategory STANDING_SIGNS = get("minecraft:standing_signs");
|
||||
public static final BlockCategory STONE_BRICKS = get("minecraft:stone_bricks");
|
||||
public static final BlockCategory STONE_ORE_REPLACEABLES = get("minecraft:stone_ore_replaceables");
|
||||
public static final BlockCategory STONE_PRESSURE_PLATES = get("minecraft:stone_pressure_plates");
|
||||
public static final BlockCategory STRIDER_WARM_BLOCKS = get("minecraft:strider_warm_blocks");
|
||||
public static final BlockCategory TALL_FLOWERS = get("minecraft:tall_flowers");
|
||||
|
@ -19,10 +19,10 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.boydti.fawe.beta.ITileInput;
|
||||
import com.boydti.fawe.command.SuggestInputParseException;
|
||||
import com.boydti.fawe.object.string.MutableCharSequence;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.fastasyncworldedit.core.beta.ITileInput;
|
||||
import com.fastasyncworldedit.core.command.SuggestInputParseException;
|
||||
import com.fastasyncworldedit.core.object.string.MutableCharSequence;
|
||||
import com.fastasyncworldedit.core.util.StringMan;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
@ -40,6 +40,8 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.AbstractProperty;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.registry.state.PropertyKey;
|
||||
import com.sk89q.worldedit.util.concurrency.LazyReference;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -242,7 +244,7 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock apply(BlockVector3 position) {
|
||||
public BaseBlock applyBlock(BlockVector3 position) {
|
||||
return this.toBaseBlock();
|
||||
}
|
||||
|
||||
@ -359,8 +361,14 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
return getState(getBlockType().getProperty(key));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public BaseBlock toBaseBlock(CompoundTag compoundTag) {
|
||||
public CompoundTag getNbtData() {
|
||||
return getBlockType().getMaterial().isTile() ? getBlockType().getMaterial().getDefaultTile() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock toBaseBlock(LazyReference<CompoundBinaryTag> compoundTag) {
|
||||
if (compoundTag == null) {
|
||||
return toBaseBlock();
|
||||
}
|
||||
|
@ -19,20 +19,23 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.boydti.fawe.beta.ITileInput;
|
||||
import com.fastasyncworldedit.core.beta.ITileInput;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.blocks.TileEntityBlock;
|
||||
import com.sk89q.worldedit.extent.OutputExtent;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.util.DeprecationUtil;
|
||||
import com.sk89q.worldedit.internal.util.NonAbstractForCompatibility;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.registry.state.PropertyKey;
|
||||
import com.sk89q.worldedit.util.concurrency.LazyReference;
|
||||
import com.sk89q.worldedit.world.registry.BlockMaterial;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public interface BlockStateHolder<B extends BlockStateHolder<B>> extends TileEntityBlock, Pattern {
|
||||
|
||||
@ -143,61 +146,48 @@ public interface BlockStateHolder<B extends BlockStateHolder<B>> extends TileEnt
|
||||
*
|
||||
* @param compoundTag The NBT Data to apply
|
||||
* @return The BaseBlock
|
||||
* @deprecated Use {@link BlockStateHolder#toBaseBlock(LazyReference)}.
|
||||
*/
|
||||
BaseBlock toBaseBlock(CompoundTag compoundTag);
|
||||
@Deprecated
|
||||
default BaseBlock toBaseBlock(CompoundTag compoundTag) {
|
||||
return toBaseBlock(compoundTag == null ? null : LazyReference.from(compoundTag::asBinaryTag));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a {@link BaseBlock} from this BlockStateHolder.
|
||||
*
|
||||
* @param compoundTag The NBT Data to apply
|
||||
* @return The BaseBlock
|
||||
* @apiNote This must be overridden by new subclasses. See {@link NonAbstractForCompatibility}
|
||||
* for details
|
||||
*/
|
||||
@NonAbstractForCompatibility(
|
||||
delegateName = "toBaseBlock",
|
||||
delegateParams = { CompoundTag.class }
|
||||
)
|
||||
default BaseBlock toBaseBlock(LazyReference<CompoundBinaryTag> compoundTag) {
|
||||
DeprecationUtil.checkDelegatingOverride(getClass());
|
||||
|
||||
return toBaseBlock(compoundTag == null ? null : new CompoundTag(compoundTag.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a {@link BaseBlock} from this BlockStateHolder.
|
||||
*
|
||||
* @param compoundTag The NBT Data to apply
|
||||
* @return The BaseBlock
|
||||
*/
|
||||
default BaseBlock toBaseBlock(CompoundBinaryTag compoundTag) {
|
||||
return toBaseBlock(compoundTag == null ? null : LazyReference.computed(compoundTag));
|
||||
}
|
||||
|
||||
@Override
|
||||
default BaseBlock apply(BlockVector3 position) {
|
||||
default BaseBlock applyBlock(BlockVector3 position) {
|
||||
return toBaseBlock();
|
||||
}
|
||||
|
||||
void applyTileEntity(OutputExtent output, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* Return the name of the title entity ID.
|
||||
*
|
||||
* @return tile entity ID, non-null string
|
||||
*/
|
||||
default String getNbtId() {
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the block contains NBT data. {@link #getNbtData()}
|
||||
* must not return null if this method returns true.
|
||||
*
|
||||
* @return true if there is NBT data
|
||||
*/
|
||||
default boolean hasNbtData() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the object's NBT data (tile entity data). The returned tag, if
|
||||
* modified in any way, should be sent to {@link #setNbtData(CompoundTag)}
|
||||
* so that the instance knows of the changes. Making changes without
|
||||
* calling {@link #setNbtData(CompoundTag)} could have unintended
|
||||
* consequences.
|
||||
*
|
||||
* <p>{@link #hasNbtData()} must return true if and only if method does
|
||||
* not return null.</p>
|
||||
*
|
||||
* @return compound tag, or null
|
||||
*/
|
||||
@Nullable
|
||||
default CompoundTag getNbtData() {
|
||||
return getBlockType().getMaterial().isTile() ? getBlockType().getMaterial().getDefaultTile() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object's NBT data (tile entity data).
|
||||
*
|
||||
* @param nbtData NBT data, or null if no data
|
||||
*/
|
||||
default void setNbtData(@Nullable CompoundTag nbtData) {
|
||||
throw new UnsupportedOperationException("State is immutable");
|
||||
}
|
||||
|
||||
default BaseBlock toBaseBlock(ITileInput input, int x, int y, int z) {
|
||||
throw new UnsupportedOperationException("State is immutable");
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ public class BlockType implements Keyed, Pattern {
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseBlock apply(BlockVector3 position) {
|
||||
public BaseBlock applyBlock(BlockVector3 position) {
|
||||
return this.getDefaultState().toBaseBlock();
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.boydti.fawe.command.SuggestInputParseException;
|
||||
import com.boydti.fawe.object.string.JoinedCharSequence;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.fastasyncworldedit.core.command.SuggestInputParseException;
|
||||
import com.fastasyncworldedit.core.object.string.JoinedCharSequence;
|
||||
import com.fastasyncworldedit.core.util.StringMan;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
|
||||
@ -59,6 +59,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType ACTIVATOR_RAIL = init();
|
||||
@Nullable public static final BlockType AIR = init();
|
||||
@Nullable public static final BlockType ALLIUM = init();
|
||||
@Nullable public static final BlockType AMETHYST_BLOCK = init();
|
||||
@Nullable public static final BlockType AMETHYST_CLUSTER = init();
|
||||
@Nullable public static final BlockType ANCIENT_DEBRIS = init();
|
||||
@Nullable public static final BlockType ANDESITE = init();
|
||||
@Nullable public static final BlockType ANDESITE_SLAB = init();
|
||||
@ -67,6 +69,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType ANVIL = init();
|
||||
@Nullable public static final BlockType ATTACHED_MELON_STEM = init();
|
||||
@Nullable public static final BlockType ATTACHED_PUMPKIN_STEM = init();
|
||||
@Nullable public static final BlockType AZALEA = init();
|
||||
@Nullable public static final BlockType AZALEA_LEAVES = init();
|
||||
@Nullable public static final BlockType AZURE_BLUET = init();
|
||||
@Nullable public static final BlockType BAMBOO = init();
|
||||
@Nullable public static final BlockType BAMBOO_SAPLING = init();
|
||||
@ -79,6 +83,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType BEEHIVE = init();
|
||||
@Nullable public static final BlockType BEETROOTS = init();
|
||||
@Nullable public static final BlockType BELL = init();
|
||||
@Nullable public static final BlockType BIG_DRIPLEAF = init();
|
||||
@Nullable public static final BlockType BIG_DRIPLEAF_STEM = init();
|
||||
@Nullable public static final BlockType BIRCH_BUTTON = init();
|
||||
@Nullable public static final BlockType BIRCH_DOOR = init();
|
||||
@Nullable public static final BlockType BIRCH_FENCE = init();
|
||||
@ -96,6 +102,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType BIRCH_WOOD = init();
|
||||
@Nullable public static final BlockType BLACK_BANNER = init();
|
||||
@Nullable public static final BlockType BLACK_BED = init();
|
||||
@Nullable public static final BlockType BLACK_CANDLE = init();
|
||||
@Nullable public static final BlockType BLACK_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType BLACK_CARPET = init();
|
||||
@Nullable public static final BlockType BLACK_CONCRETE = init();
|
||||
@Nullable public static final BlockType BLACK_CONCRETE_POWDER = init();
|
||||
@ -113,6 +121,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType BLAST_FURNACE = init();
|
||||
@Nullable public static final BlockType BLUE_BANNER = init();
|
||||
@Nullable public static final BlockType BLUE_BED = init();
|
||||
@Nullable public static final BlockType BLUE_CANDLE = init();
|
||||
@Nullable public static final BlockType BLUE_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType BLUE_CARPET = init();
|
||||
@Nullable public static final BlockType BLUE_CONCRETE = init();
|
||||
@Nullable public static final BlockType BLUE_CONCRETE_POWDER = init();
|
||||
@ -138,6 +148,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType BRICKS = init();
|
||||
@Nullable public static final BlockType BROWN_BANNER = init();
|
||||
@Nullable public static final BlockType BROWN_BED = init();
|
||||
@Nullable public static final BlockType BROWN_CANDLE = init();
|
||||
@Nullable public static final BlockType BROWN_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType BROWN_CARPET = init();
|
||||
@Nullable public static final BlockType BROWN_CONCRETE = init();
|
||||
@Nullable public static final BlockType BROWN_CONCRETE_POWDER = init();
|
||||
@ -155,18 +167,25 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType BUBBLE_CORAL_BLOCK = init();
|
||||
@Nullable public static final BlockType BUBBLE_CORAL_FAN = init();
|
||||
@Nullable public static final BlockType BUBBLE_CORAL_WALL_FAN = init();
|
||||
@Nullable public static final BlockType BUDDING_AMETHYST = init();
|
||||
@Nullable public static final BlockType CACTUS = init();
|
||||
@Nullable public static final BlockType CAKE = init();
|
||||
@Nullable public static final BlockType CALCITE = init();
|
||||
@Nullable public static final BlockType CAMPFIRE = init();
|
||||
@Nullable public static final BlockType CANDLE = init();
|
||||
@Nullable public static final BlockType CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType CARROTS = init();
|
||||
@Nullable public static final BlockType CARTOGRAPHY_TABLE = init();
|
||||
@Nullable public static final BlockType CARVED_PUMPKIN = init();
|
||||
@Nullable public static final BlockType CAULDRON = init();
|
||||
@Nullable public static final BlockType CAVE_AIR = init();
|
||||
@Nullable public static final BlockType CAVE_VINES = init();
|
||||
@Nullable public static final BlockType CAVE_VINES_PLANT = init();
|
||||
@Nullable public static final BlockType CHAIN = init();
|
||||
@Nullable public static final BlockType CHAIN_COMMAND_BLOCK = init();
|
||||
@Nullable public static final BlockType CHEST = init();
|
||||
@Nullable public static final BlockType CHIPPED_ANVIL = init();
|
||||
@Nullable public static final BlockType CHISELED_DEEPSLATE = init();
|
||||
@Nullable public static final BlockType CHISELED_NETHER_BRICKS = init();
|
||||
@Nullable public static final BlockType CHISELED_POLISHED_BLACKSTONE = init();
|
||||
@Nullable public static final BlockType CHISELED_QUARTZ_BLOCK = init();
|
||||
@ -179,6 +198,10 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType COAL_BLOCK = init();
|
||||
@Nullable public static final BlockType COAL_ORE = init();
|
||||
@Nullable public static final BlockType COARSE_DIRT = init();
|
||||
@Nullable public static final BlockType COBBLED_DEEPSLATE = init();
|
||||
@Nullable public static final BlockType COBBLED_DEEPSLATE_SLAB = init();
|
||||
@Nullable public static final BlockType COBBLED_DEEPSLATE_STAIRS = init();
|
||||
@Nullable public static final BlockType COBBLED_DEEPSLATE_WALL = init();
|
||||
@Nullable public static final BlockType COBBLESTONE = init();
|
||||
@Nullable public static final BlockType COBBLESTONE_SLAB = init();
|
||||
@Nullable public static final BlockType COBBLESTONE_STAIRS = init();
|
||||
@ -189,7 +212,11 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType COMPARATOR = init();
|
||||
@Nullable public static final BlockType COMPOSTER = init();
|
||||
@Nullable public static final BlockType CONDUIT = init();
|
||||
@Nullable public static final BlockType COPPER_BLOCK = init();
|
||||
@Nullable public static final BlockType COPPER_ORE = init();
|
||||
@Nullable public static final BlockType CORNFLOWER = init();
|
||||
@Nullable public static final BlockType CRACKED_DEEPSLATE_BRICKS = init();
|
||||
@Nullable public static final BlockType CRACKED_DEEPSLATE_TILES = init();
|
||||
@Nullable public static final BlockType CRACKED_NETHER_BRICKS = init();
|
||||
@Nullable public static final BlockType CRACKED_POLISHED_BLACKSTONE_BRICKS = init();
|
||||
@Nullable public static final BlockType CRACKED_STONE_BRICKS = init();
|
||||
@ -213,12 +240,17 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType CRIMSON_TRAPDOOR = init();
|
||||
@Nullable public static final BlockType CRIMSON_WALL_SIGN = init();
|
||||
@Nullable public static final BlockType CRYING_OBSIDIAN = init();
|
||||
@Nullable public static final BlockType CUT_COPPER = init();
|
||||
@Nullable public static final BlockType CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType CUT_RED_SANDSTONE = init();
|
||||
@Nullable public static final BlockType CUT_RED_SANDSTONE_SLAB = init();
|
||||
@Nullable public static final BlockType CUT_SANDSTONE = init();
|
||||
@Nullable public static final BlockType CUT_SANDSTONE_SLAB = init();
|
||||
@Nullable public static final BlockType CYAN_BANNER = init();
|
||||
@Nullable public static final BlockType CYAN_BED = init();
|
||||
@Nullable public static final BlockType CYAN_CANDLE = init();
|
||||
@Nullable public static final BlockType CYAN_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType CYAN_CARPET = init();
|
||||
@Nullable public static final BlockType CYAN_CONCRETE = init();
|
||||
@Nullable public static final BlockType CYAN_CONCRETE_POWDER = init();
|
||||
@ -271,6 +303,23 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType DEAD_TUBE_CORAL_BLOCK = init();
|
||||
@Nullable public static final BlockType DEAD_TUBE_CORAL_FAN = init();
|
||||
@Nullable public static final BlockType DEAD_TUBE_CORAL_WALL_FAN = init();
|
||||
@Nullable public static final BlockType DEEPSLATE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_BRICK_SLAB = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_BRICK_STAIRS = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_BRICK_WALL = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_BRICKS = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_COAL_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_COPPER_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_DIAMOND_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_EMERALD_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_GOLD_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_IRON_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_LAPIS_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_REDSTONE_ORE = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_TILE_SLAB = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_TILE_STAIRS = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_TILE_WALL = init();
|
||||
@Nullable public static final BlockType DEEPSLATE_TILES = init();
|
||||
@Nullable public static final BlockType DETECTOR_RAIL = init();
|
||||
@Nullable public static final BlockType DIAMOND_BLOCK = init();
|
||||
@Nullable public static final BlockType DIAMOND_ORE = init();
|
||||
@ -279,11 +328,13 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType DIORITE_STAIRS = init();
|
||||
@Nullable public static final BlockType DIORITE_WALL = init();
|
||||
@Nullable public static final BlockType DIRT = init();
|
||||
@Nullable public static final BlockType DIRT_PATH = init();
|
||||
@Nullable public static final BlockType DISPENSER = init();
|
||||
@Nullable public static final BlockType DRAGON_EGG = init();
|
||||
@Nullable public static final BlockType DRAGON_HEAD = init();
|
||||
@Nullable public static final BlockType DRAGON_WALL_HEAD = init();
|
||||
@Nullable public static final BlockType DRIED_KELP_BLOCK = init();
|
||||
@Nullable public static final BlockType DRIPSTONE_BLOCK = init();
|
||||
@Nullable public static final BlockType DROPPER = init();
|
||||
@Nullable public static final BlockType EMERALD_BLOCK = init();
|
||||
@Nullable public static final BlockType EMERALD_ORE = init();
|
||||
@ -297,7 +348,11 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType END_STONE_BRICK_STAIRS = init();
|
||||
@Nullable public static final BlockType END_STONE_BRICK_WALL = init();
|
||||
@Nullable public static final BlockType END_STONE_BRICKS = init();
|
||||
@Nullable public static final BlockType EXPOSED_COPPER = init();
|
||||
@Nullable public static final BlockType ENDER_CHEST = init();
|
||||
@Nullable public static final BlockType EXPOSED_CUT_COPPER = init();
|
||||
@Nullable public static final BlockType EXPOSED_CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType EXPOSED_CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType FARMLAND = init();
|
||||
@Nullable public static final BlockType FERN = init();
|
||||
@Nullable public static final BlockType FIRE = init();
|
||||
@ -307,11 +362,14 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType FIRE_CORAL_WALL_FAN = init();
|
||||
@Nullable public static final BlockType FLETCHING_TABLE = init();
|
||||
@Nullable public static final BlockType FLOWER_POT = init();
|
||||
@Nullable public static final BlockType FLOWERING_AZALEA = init();
|
||||
@Nullable public static final BlockType FLOWERING_AZALEA_LEAVES = init();
|
||||
@Nullable public static final BlockType FROSTED_ICE = init();
|
||||
@Nullable public static final BlockType FURNACE = init();
|
||||
@Nullable public static final BlockType GILDED_BLACKSTONE = init();
|
||||
@Nullable public static final BlockType GLASS = init();
|
||||
@Nullable public static final BlockType GLASS_PANE = init();
|
||||
@Nullable public static final BlockType GLOW_LICHEN = init();
|
||||
@Nullable public static final BlockType GLOWSTONE = init();
|
||||
@Nullable public static final BlockType GOLD_BLOCK = init();
|
||||
@Nullable public static final BlockType GOLD_ORE = init();
|
||||
@ -321,10 +379,12 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType GRANITE_WALL = init();
|
||||
@Nullable public static final BlockType GRASS = init();
|
||||
@Nullable public static final BlockType GRASS_BLOCK = init();
|
||||
@Nullable public static final BlockType GRASS_PATH = init();
|
||||
@Deprecated @Nullable public static final BlockType GRASS_PATH = init();
|
||||
@Nullable public static final BlockType GRAVEL = init();
|
||||
@Nullable public static final BlockType GRAY_BANNER = init();
|
||||
@Nullable public static final BlockType GRAY_BED = init();
|
||||
@Nullable public static final BlockType GREEN_CANDLE = init();
|
||||
@Nullable public static final BlockType GREEN_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType GRAY_CARPET = init();
|
||||
@Nullable public static final BlockType GRAY_CONCRETE = init();
|
||||
@Nullable public static final BlockType GRAY_CONCRETE_POWDER = init();
|
||||
@ -348,6 +408,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType GREEN_WALL_BANNER = init();
|
||||
@Nullable public static final BlockType GREEN_WOOL = init();
|
||||
@Nullable public static final BlockType GRINDSTONE = init();
|
||||
@Nullable public static final BlockType HANGING_ROOTS = init();
|
||||
@Nullable public static final BlockType HAY_BLOCK = init();
|
||||
@Nullable public static final BlockType HEAVY_WEIGHTED_PRESSURE_PLATE = init();
|
||||
@Nullable public static final BlockType HONEY_BLOCK = init();
|
||||
@ -361,6 +422,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType INFESTED_CHISELED_STONE_BRICKS = init();
|
||||
@Nullable public static final BlockType INFESTED_COBBLESTONE = init();
|
||||
@Nullable public static final BlockType INFESTED_CRACKED_STONE_BRICKS = init();
|
||||
@Nullable public static final BlockType INFESTED_DEEPSLATE = init();
|
||||
@Nullable public static final BlockType INFESTED_MOSSY_STONE_BRICKS = init();
|
||||
@Nullable public static final BlockType INFESTED_STONE = init();
|
||||
@Nullable public static final BlockType INFESTED_STONE_BRICKS = init();
|
||||
@ -393,12 +455,17 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType LANTERN = init();
|
||||
@Nullable public static final BlockType LAPIS_BLOCK = init();
|
||||
@Nullable public static final BlockType LAPIS_ORE = init();
|
||||
@Nullable public static final BlockType LARGE_AMETHYST_BUD = init();
|
||||
@Nullable public static final BlockType LARGE_FERN = init();
|
||||
@Nullable public static final BlockType LAVA = init();
|
||||
@Nullable public static final BlockType LAVA_CAULDRON = init();
|
||||
@Nullable public static final BlockType LECTERN = init();
|
||||
@Nullable public static final BlockType LEVER = init();
|
||||
@Nullable public static final BlockType LIGHT = init();
|
||||
@Nullable public static final BlockType LIGHT_BLUE_BANNER = init();
|
||||
@Nullable public static final BlockType LIGHT_BLUE_BED = init();
|
||||
@Nullable public static final BlockType LIGHT_BLUE_CANDLE = init();
|
||||
@Nullable public static final BlockType LIGHT_BLUE_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType LIGHT_BLUE_CARPET = init();
|
||||
@Nullable public static final BlockType LIGHT_BLUE_CONCRETE = init();
|
||||
@Nullable public static final BlockType LIGHT_BLUE_CONCRETE_POWDER = init();
|
||||
@ -411,6 +478,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType LIGHT_BLUE_WOOL = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_BANNER = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_BED = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_CANDLE = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_CARPET = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_CONCRETE = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_CONCRETE_POWDER = init();
|
||||
@ -422,11 +491,14 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType LIGHT_GRAY_WALL_BANNER = init();
|
||||
@Nullable public static final BlockType LIGHT_GRAY_WOOL = init();
|
||||
@Nullable public static final BlockType LIGHT_WEIGHTED_PRESSURE_PLATE = init();
|
||||
@Nullable public static final BlockType LIGHTNING_ROD = init();
|
||||
@Nullable public static final BlockType LILAC = init();
|
||||
@Nullable public static final BlockType LILY_OF_THE_VALLEY = init();
|
||||
@Nullable public static final BlockType LILY_PAD = init();
|
||||
@Nullable public static final BlockType LIME_BANNER = init();
|
||||
@Nullable public static final BlockType LIME_BED = init();
|
||||
@Nullable public static final BlockType LIME_CANDLE = init();
|
||||
@Nullable public static final BlockType LIME_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType LIME_CARPET = init();
|
||||
@Nullable public static final BlockType LIME_CONCRETE = init();
|
||||
@Nullable public static final BlockType LIME_CONCRETE_POWDER = init();
|
||||
@ -441,6 +513,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType LOOM = init();
|
||||
@Nullable public static final BlockType MAGENTA_BANNER = init();
|
||||
@Nullable public static final BlockType MAGENTA_BED = init();
|
||||
@Nullable public static final BlockType MAGENTA_CANDLE = init();
|
||||
@Nullable public static final BlockType MAGENTA_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType MAGENTA_CARPET = init();
|
||||
@Nullable public static final BlockType MAGENTA_CONCRETE = init();
|
||||
@Nullable public static final BlockType MAGENTA_CONCRETE_POWDER = init();
|
||||
@ -452,8 +526,11 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType MAGENTA_WALL_BANNER = init();
|
||||
@Nullable public static final BlockType MAGENTA_WOOL = init();
|
||||
@Nullable public static final BlockType MAGMA_BLOCK = init();
|
||||
@Nullable public static final BlockType MEDIUM_AMETHYST_BUD = init();
|
||||
@Nullable public static final BlockType MELON = init();
|
||||
@Nullable public static final BlockType MELON_STEM = init();
|
||||
@Nullable public static final BlockType MOSS_BLOCK = init();
|
||||
@Nullable public static final BlockType MOSS_CARPET = init();
|
||||
@Nullable public static final BlockType MOSSY_COBBLESTONE = init();
|
||||
@Nullable public static final BlockType MOSSY_COBBLESTONE_SLAB = init();
|
||||
@Nullable public static final BlockType MOSSY_COBBLESTONE_STAIRS = init();
|
||||
@ -498,6 +575,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType OBSIDIAN = init();
|
||||
@Nullable public static final BlockType ORANGE_BANNER = init();
|
||||
@Nullable public static final BlockType ORANGE_BED = init();
|
||||
@Nullable public static final BlockType ORANGE_CANDLE = init();
|
||||
@Nullable public static final BlockType ORANGE_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType ORANGE_CARPET = init();
|
||||
@Nullable public static final BlockType ORANGE_CONCRETE = init();
|
||||
@Nullable public static final BlockType ORANGE_CONCRETE_POWDER = init();
|
||||
@ -510,11 +589,17 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType ORANGE_WALL_BANNER = init();
|
||||
@Nullable public static final BlockType ORANGE_WOOL = init();
|
||||
@Nullable public static final BlockType OXEYE_DAISY = init();
|
||||
@Nullable public static final BlockType OXIDIZED_COPPER = init();
|
||||
@Nullable public static final BlockType OXIDIZED_CUT_COPPER = init();
|
||||
@Nullable public static final BlockType OXIDIZED_CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType OXIDIZED_CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType PACKED_ICE = init();
|
||||
@Nullable public static final BlockType PEONY = init();
|
||||
@Nullable public static final BlockType PETRIFIED_OAK_SLAB = init();
|
||||
@Nullable public static final BlockType PINK_BANNER = init();
|
||||
@Nullable public static final BlockType PINK_BED = init();
|
||||
@Nullable public static final BlockType PINK_CANDLE = init();
|
||||
@Nullable public static final BlockType PINK_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType PINK_CARPET = init();
|
||||
@Nullable public static final BlockType PINK_CONCRETE = init();
|
||||
@Nullable public static final BlockType PINK_CONCRETE_POWDER = init();
|
||||
@ -531,6 +616,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType PLAYER_HEAD = init();
|
||||
@Nullable public static final BlockType PLAYER_WALL_HEAD = init();
|
||||
@Nullable public static final BlockType PODZOL = init();
|
||||
@Nullable public static final BlockType POINTED_DRIPSTONE = init();
|
||||
@Nullable public static final BlockType POLISHED_ANDESITE = init();
|
||||
@Nullable public static final BlockType POLISHED_ANDESITE_SLAB = init();
|
||||
@Nullable public static final BlockType POLISHED_ANDESITE_STAIRS = init();
|
||||
@ -545,6 +631,10 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType POLISHED_BLACKSTONE_SLAB = init();
|
||||
@Nullable public static final BlockType POLISHED_BLACKSTONE_STAIRS = init();
|
||||
@Nullable public static final BlockType POLISHED_BLACKSTONE_WALL = init();
|
||||
@Nullable public static final BlockType POLISHED_DEEPSLATE = init();
|
||||
@Nullable public static final BlockType POLISHED_DEEPSLATE_SLAB = init();
|
||||
@Nullable public static final BlockType POLISHED_DEEPSLATE_STAIRS = init();
|
||||
@Nullable public static final BlockType POLISHED_DEEPSLATE_WALL = init();
|
||||
@Nullable public static final BlockType POLISHED_DIORITE = init();
|
||||
@Nullable public static final BlockType POLISHED_DIORITE_SLAB = init();
|
||||
@Nullable public static final BlockType POLISHED_DIORITE_STAIRS = init();
|
||||
@ -555,6 +645,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType POTATOES = init();
|
||||
@Nullable public static final BlockType POTTED_ACACIA_SAPLING = init();
|
||||
@Nullable public static final BlockType POTTED_ALLIUM = init();
|
||||
@Nullable public static final BlockType POTTED_AZALEA_BUSH = init();
|
||||
@Nullable public static final BlockType POTTED_AZURE_BLUET = init();
|
||||
@Nullable public static final BlockType POTTED_BAMBOO = init();
|
||||
@Nullable public static final BlockType POTTED_BIRCH_SAPLING = init();
|
||||
@ -568,6 +659,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType POTTED_DARK_OAK_SAPLING = init();
|
||||
@Nullable public static final BlockType POTTED_DEAD_BUSH = init();
|
||||
@Nullable public static final BlockType POTTED_FERN = init();
|
||||
@Nullable public static final BlockType POTTED_FLOWERING_AZALEA_BUSH = init();
|
||||
@Nullable public static final BlockType POTTED_JUNGLE_SAPLING = init();
|
||||
@Nullable public static final BlockType POTTED_LILY_OF_THE_VALLEY = init();
|
||||
@Nullable public static final BlockType POTTED_OAK_SAPLING = init();
|
||||
@ -582,6 +674,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType POTTED_WARPED_ROOTS = init();
|
||||
@Nullable public static final BlockType POTTED_WHITE_TULIP = init();
|
||||
@Nullable public static final BlockType POTTED_WITHER_ROSE = init();
|
||||
@Nullable public static final BlockType POWDER_SNOW = init();
|
||||
@Nullable public static final BlockType POWDER_SNOW_CAULDRON = init();
|
||||
@Nullable public static final BlockType POWERED_RAIL = init();
|
||||
@Nullable public static final BlockType PRISMARINE = init();
|
||||
@Nullable public static final BlockType PRISMARINE_BRICK_SLAB = init();
|
||||
@ -594,6 +688,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType PUMPKIN_STEM = init();
|
||||
@Nullable public static final BlockType PURPLE_BANNER = init();
|
||||
@Nullable public static final BlockType PURPLE_BED = init();
|
||||
@Nullable public static final BlockType PURPLE_CANDLE = init();
|
||||
@Nullable public static final BlockType PURPLE_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType PURPLE_CARPET = init();
|
||||
@Nullable public static final BlockType PURPLE_CONCRETE = init();
|
||||
@Nullable public static final BlockType PURPLE_CONCRETE_POWDER = init();
|
||||
@ -614,8 +710,13 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType QUARTZ_SLAB = init();
|
||||
@Nullable public static final BlockType QUARTZ_STAIRS = init();
|
||||
@Nullable public static final BlockType RAIL = init();
|
||||
@Nullable public static final BlockType RAW_COPPER_BLOCK = init();
|
||||
@Nullable public static final BlockType RAW_GOLD_BLOCK = init();
|
||||
@Nullable public static final BlockType RAW_IRON_BLOCK = init();
|
||||
@Nullable public static final BlockType RED_BANNER = init();
|
||||
@Nullable public static final BlockType RED_BED = init();
|
||||
@Nullable public static final BlockType RED_CANDLE = init();
|
||||
@Nullable public static final BlockType RED_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType RED_CARPET = init();
|
||||
@Nullable public static final BlockType RED_CONCRETE = init();
|
||||
@Nullable public static final BlockType RED_CONCRETE_POWDER = init();
|
||||
@ -647,6 +748,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType REPEATER = init();
|
||||
@Nullable public static final BlockType REPEATING_COMMAND_BLOCK = init();
|
||||
@Nullable public static final BlockType RESPAWN_ANCHOR = init();
|
||||
@Nullable public static final BlockType ROOTED_DIRT = init();
|
||||
@Nullable public static final BlockType ROSE_BUSH = init();
|
||||
@Nullable public static final BlockType SAND = init();
|
||||
@Nullable public static final BlockType SANDSTONE = init();
|
||||
@ -654,6 +756,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType SANDSTONE_STAIRS = init();
|
||||
@Nullable public static final BlockType SANDSTONE_WALL = init();
|
||||
@Nullable public static final BlockType SCAFFOLDING = init();
|
||||
@Nullable public static final BlockType SCULK_SENSOR = init();
|
||||
@Nullable public static final BlockType SEA_LANTERN = init();
|
||||
@Nullable public static final BlockType SEA_PICKLE = init();
|
||||
@Nullable public static final BlockType SEAGRASS = init();
|
||||
@ -663,8 +766,11 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType SKELETON_SKULL = init();
|
||||
@Nullable public static final BlockType SKELETON_WALL_SKULL = init();
|
||||
@Nullable public static final BlockType SLIME_BLOCK = init();
|
||||
@Nullable public static final BlockType SMALL_AMETHYST_BUD = init();
|
||||
@Nullable public static final BlockType SMALL_DRIPLEAF = init();
|
||||
@Nullable public static final BlockType SMITHING_TABLE = init();
|
||||
@Nullable public static final BlockType SMOKER = init();
|
||||
@Nullable public static final BlockType SMOOTH_BASALT = init();
|
||||
@Nullable public static final BlockType SMOOTH_QUARTZ = init();
|
||||
@Nullable public static final BlockType SMOOTH_QUARTZ_SLAB = init();
|
||||
@Nullable public static final BlockType SMOOTH_QUARTZ_STAIRS = init();
|
||||
@ -687,6 +793,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType SOUL_WALL_TORCH = init();
|
||||
@Nullable public static final BlockType SPAWNER = init();
|
||||
@Nullable public static final BlockType SPONGE = init();
|
||||
@Nullable public static final BlockType SPORE_BLOSSOM = init();
|
||||
@Nullable public static final BlockType SPRUCE_BUTTON = init();
|
||||
@Nullable public static final BlockType SPRUCE_DOOR = init();
|
||||
@Nullable public static final BlockType SPRUCE_FENCE = init();
|
||||
@ -738,6 +845,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType TALL_SEAGRASS = init();
|
||||
@Nullable public static final BlockType TARGET = init();
|
||||
@Nullable public static final BlockType TERRACOTTA = init();
|
||||
@Nullable public static final BlockType TINTED_GLASS = init();
|
||||
@Nullable public static final BlockType TNT = init();
|
||||
@Nullable public static final BlockType TORCH = init();
|
||||
@Nullable public static final BlockType TRAPPED_CHEST = init();
|
||||
@ -747,6 +855,7 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType TUBE_CORAL_BLOCK = init();
|
||||
@Nullable public static final BlockType TUBE_CORAL_FAN = init();
|
||||
@Nullable public static final BlockType TUBE_CORAL_WALL_FAN = init();
|
||||
@Nullable public static final BlockType TUFF = init();
|
||||
@Nullable public static final BlockType TURTLE_EGG = init();
|
||||
@Nullable public static final BlockType TWISTING_VINES = init();
|
||||
@Nullable public static final BlockType TWISTING_VINES_PLANT = init();
|
||||
@ -772,12 +881,35 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType WARPED_WALL_SIGN = init();
|
||||
@Nullable public static final BlockType WARPED_WART_BLOCK = init();
|
||||
@Nullable public static final BlockType WATER = init();
|
||||
@Nullable public static final BlockType WATER_CAULDRON = init();
|
||||
@Nullable public static final BlockType WAXED_COPPER_BLOCK = init();
|
||||
@Nullable public static final BlockType WAXED_CUT_COPPER = init();
|
||||
@Nullable public static final BlockType WAXED_CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType WAXED_CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType WAXED_EXPOSED_COPPER = init();
|
||||
@Nullable public static final BlockType WAXED_EXPOSED_CUT_COPPER = init();
|
||||
@Nullable public static final BlockType WAXED_EXPOSED_CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType WAXED_EXPOSED_CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType WAXED_OXIDIZED_COPPER = init();
|
||||
@Nullable public static final BlockType WAXED_OXIDIZED_CUT_COPPER = init();
|
||||
@Nullable public static final BlockType WAXED_OXIDIZED_CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType WAXED_OXIDIZED_CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType WAXED_WEATHERED_COPPER = init();
|
||||
@Nullable public static final BlockType WAXED_WEATHERED_CUT_COPPER = init();
|
||||
@Nullable public static final BlockType WAXED_WEATHERED_CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType WAXED_WEATHERED_CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType WEATHERED_COPPER = init();
|
||||
@Nullable public static final BlockType WEATHERED_CUT_COPPER = init();
|
||||
@Nullable public static final BlockType WEATHERED_CUT_COPPER_SLAB = init();
|
||||
@Nullable public static final BlockType WEEPING_VINES = init();
|
||||
@Nullable public static final BlockType WEATHERED_CUT_COPPER_STAIRS = init();
|
||||
@Nullable public static final BlockType WEEPING_VINES_PLANT = init();
|
||||
@Nullable public static final BlockType WET_SPONGE = init();
|
||||
@Nullable public static final BlockType WHEAT = init();
|
||||
@Nullable public static final BlockType WHITE_BANNER = init();
|
||||
@Nullable public static final BlockType WHITE_BED = init();
|
||||
@Nullable public static final BlockType WHITE_CANDLE = init();
|
||||
@Nullable public static final BlockType WHITE_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType WHITE_CARPET = init();
|
||||
@Nullable public static final BlockType WHITE_CONCRETE = init();
|
||||
@Nullable public static final BlockType WHITE_CONCRETE_POWDER = init();
|
||||
@ -794,6 +926,8 @@ public final class BlockTypes {
|
||||
@Nullable public static final BlockType WITHER_SKELETON_WALL_SKULL = init();
|
||||
@Nullable public static final BlockType YELLOW_BANNER = init();
|
||||
@Nullable public static final BlockType YELLOW_BED = init();
|
||||
@Nullable public static final BlockType YELLOW_CANDLE = init();
|
||||
@Nullable public static final BlockType YELLOW_CANDLE_CAKE = init();
|
||||
@Nullable public static final BlockType YELLOW_CARPET = init();
|
||||
@Nullable public static final BlockType YELLOW_CONCRETE = init();
|
||||
@Nullable public static final BlockType YELLOW_CONCRETE_POWDER = init();
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.fastasyncworldedit.core.util.MathMan;
|
||||
import com.google.common.primitives.Booleans;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.boydti.fawe.beta.ITileInput;
|
||||
import com.fastasyncworldedit.core.beta.ITileInput;
|
||||
|
||||
public enum CompoundInput {
|
||||
NULL,
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.world.block;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.registry.state.Property;
|
||||
import com.sk89q.worldedit.registry.state.PropertyKey;
|
||||
|
||||
@ -123,6 +124,12 @@ public class FuzzyBlockState extends BlockState {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public CompoundTag getNbtData() {
|
||||
return getBlockType().getMaterial().isTile() ? getBlockType().getMaterial().getDefaultTile() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder for FuzzyBlockState
|
||||
*/
|
||||
|
Reference in New Issue
Block a user