mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Merge pull request #437 from JOO200/master
Add check for unchanged materials in BlockBagExtent
This commit is contained in:
commit
b1d8d4901d
@ -86,25 +86,27 @@ public class BlockBagExtent extends AbstractDelegateExtent {
|
||||
if (blockBag != null) {
|
||||
BlockState existing = getExtent().getBlock(position);
|
||||
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
try {
|
||||
blockBag.fetchPlacedBlock(block.toImmutableState());
|
||||
} catch (UnplaceableBlockException e) {
|
||||
return false;
|
||||
} catch (BlockBagException e) {
|
||||
if (!missingBlocks.containsKey(block.getBlockType())) {
|
||||
missingBlocks.put(block.getBlockType(), 1);
|
||||
} else {
|
||||
missingBlocks.put(block.getBlockType(), missingBlocks.get(block.getBlockType()) + 1);
|
||||
if (!block.getBlockType().equals(existing.getBlockType())) {
|
||||
if (!block.getBlockType().getMaterial().isAir()) {
|
||||
try {
|
||||
blockBag.fetchPlacedBlock(block.toImmutableState());
|
||||
} catch (UnplaceableBlockException e) {
|
||||
return false;
|
||||
} catch (BlockBagException e) {
|
||||
if (!missingBlocks.containsKey(block.getBlockType())) {
|
||||
missingBlocks.put(block.getBlockType(), 1);
|
||||
} else {
|
||||
missingBlocks.put(block.getBlockType(), missingBlocks.get(block.getBlockType()) + 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!existing.getBlockType().getMaterial().isAir()) {
|
||||
try {
|
||||
blockBag.storeDroppedBlock(existing);
|
||||
} catch (BlockBagException ignored) {
|
||||
if (!existing.getBlockType().getMaterial().isAir()) {
|
||||
try {
|
||||
blockBag.storeDroppedBlock(existing);
|
||||
} catch (BlockBagException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user