geforkt von Mirrors/FastAsyncWorldEdit
Check by setting blocks with BlockBagExtend for changed materials.
Dieser Commit ist enthalten in:
Ursprung
b276907dcd
Commit
63bf01fdaf
@ -86,38 +86,37 @@ public class BlockBagExtent extends AbstractDelegateExtent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
//<<<<<<< HEAD
|
|
||||||
public boolean setBlock(BlockVector3 pos, BlockStateHolder block) throws WorldEditException {
|
public boolean setBlock(BlockVector3 pos, BlockStateHolder block) throws WorldEditException {
|
||||||
return setBlock(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ(), block);
|
return setBlock(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ(), block);
|
||||||
}
|
}
|
||||||
//=======
|
|
||||||
// public boolean setBlock(BlockVector3 position, BlockStateHolder block) throws WorldEditException {
|
|
||||||
// if (blockBag != null) {
|
|
||||||
// BlockState existing = getExtent().getBlock(position);
|
|
||||||
//>>>>>>> 399e0ad5... Refactor vector system to be cleaner
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
|
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
|
||||||
BlockType type = block.getBlockType();
|
if(blockBag != null) {
|
||||||
if (!type.getMaterial().isAir()) {
|
|
||||||
try {
|
|
||||||
blockBag.fetchPlacedBlock(block.toImmutableState());
|
|
||||||
} catch (UnplaceableBlockException e) {
|
|
||||||
throw new FaweException.FaweBlockBagException();
|
|
||||||
} catch (BlockBagException e) {
|
|
||||||
missingBlocks[type.getInternalId()]++;
|
|
||||||
throw new FaweException.FaweBlockBagException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mine) {
|
|
||||||
BlockStateHolder lazyBlock = getExtent().getLazyBlock(x, y, z);
|
BlockStateHolder lazyBlock = getExtent().getLazyBlock(x, y, z);
|
||||||
BlockType fromType = lazyBlock.getBlockType();
|
BlockType fromType = lazyBlock.getBlockType();
|
||||||
if (!fromType.getMaterial().isAir()) {
|
if(!block.getBlockType().equals(fromType)) {
|
||||||
try {
|
BlockType type = block.getBlockType();
|
||||||
blockBag.storeDroppedBlock(fromType.getDefaultState());
|
if (!type.getMaterial().isAir()) {
|
||||||
} catch (BlockBagException ignored) {
|
try {
|
||||||
}
|
blockBag.fetchPlacedBlock(block.toImmutableState());
|
||||||
}
|
} catch (UnplaceableBlockException e) {
|
||||||
|
throw new FaweException.FaweBlockBagException();
|
||||||
|
} catch (BlockBagException e) {
|
||||||
|
missingBlocks[type.getInternalId()]++;
|
||||||
|
throw new FaweException.FaweBlockBagException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mine) {
|
||||||
|
|
||||||
|
if (!fromType.getMaterial().isAir()) {
|
||||||
|
try {
|
||||||
|
blockBag.storeDroppedBlock(fromType.getDefaultState());
|
||||||
|
} catch (BlockBagException ignored) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return getExtent().setBlock(x, y, z, block);
|
return getExtent().setBlock(x, y, z, block);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren