3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

the material seems to hold state data for some reason.

- This requires a more complicated fix. Reverting this change for now
Dieser Commit ist enthalten in:
dordsor21 2021-01-14 13:42:37 +00:00
Ursprung 54712e268a
Commit af34bd4e57
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -26,8 +26,10 @@ import com.boydti.fawe.util.StringMan;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.extension.input.InputParseException; 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.Extent;
import com.sk89q.worldedit.extent.NullExtent; import com.sk89q.worldedit.extent.NullExtent;
import com.sk89q.worldedit.extent.OutputExtent; import com.sk89q.worldedit.extent.OutputExtent;
@ -56,6 +58,7 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
private final int ordinal; private final int ordinal;
private final char ordinalChar; private final char ordinalChar;
private final BlockType blockType; private final BlockType blockType;
private BlockMaterial material;
private final BaseBlock emptyBaseBlock; private final BaseBlock emptyBaseBlock;
private CompoundInput compoundInput = CompoundInput.NULL; private CompoundInput compoundInput = CompoundInput.NULL;
@ -362,7 +365,16 @@ public class BlockState implements BlockStateHolder<BlockState>, Pattern {
@Override @Override
public BlockMaterial getMaterial() { public BlockMaterial getMaterial() {
return blockType.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;
} }
@Override @Override