Make AbstractProperty abstract

This commit is contained in:
MattBDev
2019-06-28 19:00:31 -04:00
parent 8dd5f0c298
commit 0feebac44b
3 changed files with 10 additions and 20 deletions

View File

@ -46,8 +46,7 @@ import java.util.Objects;
*/
public class BaseBlock implements BlockStateHolder<BaseBlock> {
private final BlockState blockState;
private BlockState blockState;
@Nullable protected CompoundTag nbtData;
@Deprecated
@ -55,16 +54,6 @@ public class BaseBlock implements BlockStateHolder<BaseBlock> {
this(BlockTypes.AIR.getDefaultState());
}
// /**
// * Construct a block with a state.
// * @deprecated Just use the BlockStateHolder instead
// * @param blockState The blockstate
// */
// @Deprecated
// public BaseBlock(BlockStateHolder blockState) {
// this(blockState, blockState.getNbtData());
// }
/**
* Construct a block with the given type and default data.
* @deprecated Just use the BlockType.getDefaultState()

View File

@ -19,15 +19,16 @@
package com.sk89q.worldedit.world.block;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.blocks.TileEntityBlock;
import com.sk89q.worldedit.function.pattern.FawePattern;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.registry.state.PropertyKey;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import javax.annotation.Nullable;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
@ -198,9 +199,11 @@ public interface BlockStateHolder<B extends BlockStateHolder<B>> extends FawePat
if (getStates().isEmpty()) {
return this.getBlockType().getId();
} else {
String properties =
getStates().entrySet().stream().map(entry -> entry.getKey().getName() + "=" + entry.getValue().toString().toLowerCase()).collect(Collectors.joining(
","));
String properties = getStates().entrySet().stream()
.map(entry -> entry.getKey().getName()
+ "="
+ entry.getValue().toString().toLowerCase(Locale.ROOT))
.collect(Collectors.joining(","));
return this.getBlockType().getId() + "[" + properties + "]";
}
}