A tribute to Jesse
This commit is contained in:
MattBDev
2019-09-20 21:52:35 -04:00
parent 68c8fca672
commit 8b96cdc9a5
121 changed files with 1196 additions and 1130 deletions

View File

@ -47,8 +47,8 @@ import javax.annotation.Nullable;
*/
public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
private final BlockState blockState;
private final CompoundTag nbtData;
private BlockState blockState;
@Nullable private CompoundTag nbtData;
@Deprecated
public BaseBlock() {
@ -105,25 +105,6 @@ public class BaseBlock implements BlockStateHolder<BaseBlock>, TileEntityBlock {
return blockState;
}
protected BaseBlock(int internalId, CompoundTag nbtData) {
this(BlockState.getFromInternalId(internalId), nbtData);
}
@Deprecated
public static BaseBlock getFromInternalId(int internalId, CompoundTag nbtData) {
return BlockState.getFromInternalId(internalId).toBaseBlock(nbtData);
}
/**
* Create a clone of another block.
*
* @param other the other block
*/
@Deprecated
public BaseBlock(BaseBlock other) {
this(other.toImmutableState(), other.getNbtData());
}
/**
* Gets a map of state to statevalue
*

View File

@ -34,11 +34,6 @@ import java.util.stream.Collectors;
public interface BlockStateHolder<B extends BlockStateHolder<B>> extends FawePattern, TileEntityBlock {
@Override
default BaseBlock apply(BlockVector3 position) {
return this.toBaseBlock();
}
/**
* Get the block type
*
@ -68,13 +63,13 @@ public interface BlockStateHolder<B extends BlockStateHolder<B>> extends FawePat
char getOrdinalChar();
BlockMaterial getMaterial();
/**
* Get type id (legacy uses)
* @return
*/
@Deprecated
int getInternalBlockTypeId();
/**
* Get the block data (legacy uses)
* @return
@ -153,6 +148,11 @@ public interface BlockStateHolder<B extends BlockStateHolder<B>> extends FawePat
*/
BaseBlock toBaseBlock(CompoundTag compoundTag);
@Override
default BaseBlock apply(BlockVector3 position) {
return toBaseBlock();
}
/**
* Return the name of the title entity ID.
*

View File

@ -37,12 +37,10 @@ import com.sk89q.worldedit.world.item.ItemType;
import com.sk89q.worldedit.world.item.ItemTypes;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.world.registry.LegacyMapper;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import javax.annotation.Nullable;
@ -103,18 +101,6 @@ public class BlockType implements FawePattern, Keyed {
}
}
public BlockState withProperties(String properties) { //
int id = getInternalId();
for (String keyPair : properties.split(",")) {
String[] split = keyPair.split("=");
String name = split[0];
String value = split[1];
AbstractProperty btp = settings.propertiesMap.get(name);
id = btp.modify(id, btp.getValueFor(value));
}
return withStateId(id);
}
@Deprecated
public BlockState withPropertyId(int propertyId) {
if (settings.stateOrdinals == null) return settings.defaultState;
@ -177,14 +163,10 @@ public class BlockType implements FawePattern, Keyed {
*
* @return The default state
*/
public final BlockState getDefaultState() {
public BlockState getDefaultState() {
return this.settings.defaultState;
}
/**
* @Deprecated use a Mask instead
* @return
*/
@Deprecated
public FuzzyBlockState getFuzzyMatcher() {
return new FuzzyBlockState(this);
@ -305,10 +287,6 @@ public class BlockType implements FawePattern, Keyed {
return this.getDefaultState().toBaseBlock();
}
public SingleBlockTypeMask toMask() {
return toMask(null);
}
public SingleBlockTypeMask toMask(Extent extent) {
return new SingleBlockTypeMask(extent, this);
}