mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-24 14:06:42 +01:00
Merge branch 'master' into mc1.15/dev
This commit is contained in:
commit
170f154b74
3 changed files with 24 additions and 12 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);
|
||||
}
|
||||
|
@ -565,11 +570,15 @@ public abstract class Contraption {
|
|||
state = state.with(SawBlock.RUNNING, false);
|
||||
|
||||
BlockState blockState = world.getBlockState(targetPos);
|
||||
if (blockState.getBlockHardness(world, targetPos) == -1)
|
||||
continue;
|
||||
if (state.getCollisionShape(world, targetPos).isEmpty()
|
||||
&& !blockState.getCollisionShape(world, targetPos).isEmpty())
|
||||
if (blockState.getBlockHardness(world, targetPos) == -1
|
||||
|| (state.getCollisionShape(world, targetPos).isEmpty()
|
||||
&& !blockState.getCollisionShape(world, targetPos).isEmpty())) {
|
||||
if (targetPos.getY() == 0)
|
||||
targetPos = targetPos.up();
|
||||
world.playEvent(2001, targetPos, Block.getStateId(state));
|
||||
Block.spawnDrops(state, world, targetPos, null);
|
||||
continue;
|
||||
}
|
||||
|
||||
world.destroyBlock(targetPos, true);
|
||||
world.setBlockState(targetPos, state, 3 | BlockFlags.IS_MOVING);
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.simibubi.create.modules.schematics.ISpecialEntityItemRequirement;
|
|||
import com.simibubi.create.modules.schematics.ItemRequirement;
|
||||
import com.simibubi.create.modules.schematics.ItemRequirement.ItemUseType;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
|
@ -161,11 +162,13 @@ public class SuperGlueEntity extends Entity implements IEntityAdditionalSpawnDat
|
|||
}
|
||||
|
||||
public static boolean isValidFace(World world, BlockPos pos, Direction direction) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (BlockMovementTraits.isBlockAttachedTowards(state, direction))
|
||||
return true;
|
||||
if (!BlockMovementTraits.movementNecessary(world, pos))
|
||||
return false;
|
||||
if (BlockMovementTraits.notSupportive(world.getBlockState(pos), direction)) {
|
||||
if (BlockMovementTraits.notSupportive(state, direction))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,8 +89,8 @@ public class SuperGlueRenderer extends EntityRenderer<SuperGlueEntity> {
|
|||
BlockPos pos = entity.hangingPosition;
|
||||
BlockPos pos2 = pos.offset(entity.getFacingDirection()
|
||||
.getOpposite());
|
||||
return !SuperGlueEntity.isValidFace(entity.world, pos2, entity.getFacingDirection())
|
||||
|| !SuperGlueEntity.isValidFace(entity.world, pos, entity.getFacingDirection()
|
||||
return SuperGlueEntity.isValidFace(entity.world, pos2, entity.getFacingDirection()) != SuperGlueEntity
|
||||
.isValidFace(entity.world, pos, entity.getFacingDirection()
|
||||
.getOpposite());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue