mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-24 14:06:42 +01:00
Fix potential item duplicating (Block like bell)
This commit is contained in:
parent
1578a2ac68
commit
6ed79de6c7
1 changed files with 7 additions and 2 deletions
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -519,16 +520,20 @@ public abstract class Contraption {
|
|||
glueToRemove.forEach(SuperGlueEntity::remove);
|
||||
|
||||
for (boolean brittles : Iterate.trueAndFalse) {
|
||||
for (BlockInfo block : blocks.values()) {
|
||||
for (Iterator<BlockInfo> iterator = blocks.values().iterator(); iterator.hasNext();) {
|
||||
BlockInfo block = iterator.next();
|
||||
if (brittles != BlockMovementTraits.isBrittle(block.state))
|
||||
continue;
|
||||
|
||||
BlockPos add = block.pos.add(anchor).add(offset);
|
||||
if (customRemoval.test(add, block.state))
|
||||
continue;
|
||||
Block blockIn = world.getBlockState(add).getBlock();
|
||||
if (block.state.getBlock() != blockIn)
|
||||
iterator.remove();
|
||||
world.getWorld().removeTileEntity(add);
|
||||
int flags = 67;
|
||||
if (world.getBlockState(add).getBlock() instanceof DoorBlock)
|
||||
if (blockIn instanceof DoorBlock)
|
||||
flags = flags | 32 | 16;
|
||||
world.setBlockState(add, Blocks.AIR.getDefaultState(), flags);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue