Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-09-06 08:02:50 +02:00
Delegate to blocktype for obtaining a BlockState's material
Dieser Commit ist enthalten in:
Ursprung
ac73478827
Commit
5e1289494e
@ -26,10 +26,8 @@ import com.boydti.fawe.util.StringMan;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.extent.NullExtent;
|
||||
import com.sk89q.worldedit.extent.OutputExtent;
|
||||
@ -58,7 +56,6 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
private final int ordinal;
|
||||
private final char ordinalChar;
|
||||
private final BlockType blockType;
|
||||
private BlockMaterial material;
|
||||
private final BaseBlock emptyBaseBlock;
|
||||
private CompoundInput compoundInput = CompoundInput.NULL;
|
||||
|
||||
@ -75,7 +72,6 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
* @deprecated Magic Numbers
|
||||
* @return BlockState
|
||||
*/
|
||||
|
||||
@Deprecated
|
||||
public static BlockState getFromInternalId(int combinedId) throws InputParseException {
|
||||
return BlockTypes.getFromStateId(combinedId).withStateId(combinedId);
|
||||
@ -366,16 +362,7 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
|
||||
@Override
|
||||
public BlockMaterial getMaterial() {
|
||||
if (this.material == null) {
|
||||
if (blockType == BlockTypes.__RESERVED__) {
|
||||
return this.material = blockType.getMaterial();
|
||||
}
|
||||
this.material = WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getRegistries().getBlockRegistry().getMaterial(this);
|
||||
if (this.material.hasContainer()) {
|
||||
this.compoundInput = CompoundInput.CONTAINER;
|
||||
}
|
||||
}
|
||||
return material;
|
||||
return blockType.getMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -408,11 +395,7 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
|
||||
}
|
||||
|
||||
public boolean isAir() {
|
||||
try {
|
||||
return material.isAir();
|
||||
} catch (NullPointerException ignored) {
|
||||
return getMaterial().isAir();
|
||||
}
|
||||
return blockType.getMaterial().isAir();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren