public BlockFluidEtchingAcid(Fluid fluid) { super(fluid, new MaterialLiquid(MapColor.EMERALD) { @Override public EnumPushReaction getMobilityFlag() { return EnumPushReaction.DESTROY; } }); }
@Override public EnumPushReaction getPushReaction() { if (m_realPlayer == null) { return super.getPushReaction(); } else { syncToRealPlayer(); return syncPublicFieldsFromRealAndReturn(m_realPlayer.getPushReaction()); } }
@Override public EnumPushReaction getPushReaction() { if (m_realPlayer == null) { return super.getPushReaction(); } else { return m_realPlayer.getPushReaction(); } }
public boolean canMove() { this.toMove.clear(); this.toDestroy.clear(); IBlockState iblockstate = this.world.getBlockState(this.blockToMove); if (!BlockPistonBase.canPush(iblockstate, this.world, this.blockToMove, this.moveDirection, false)) { if (iblockstate.getMobilityFlag() == EnumPushReaction.DESTROY) { this.toDestroy.add(this.blockToMove); return true; } else { return false; } } else if (!this.addBlockLine(this.blockToMove)) { return false; } else { for (int i = 0; i < this.toMove.size(); ++i) { BlockPos blockpos = (BlockPos)this.toMove.get(i); if (this.world.getBlockState(blockpos).getBlock() == Blocks.SLIME_BLOCK && !this.addBranchingBlocks(blockpos)) { return false; } } return true; } }
@Override @Deprecated public EnumPushReaction getMobilityFlag(IBlockState state) { // total immobility and stop pistons return EnumPushReaction.BLOCK; }
@Override public EnumPushReaction getMobilityFlag() { return this.isImmovable ? EnumPushReaction.BLOCK : (this.isReplaceable ? EnumPushReaction.DESTROY : EnumPushReaction.NORMAL); }
@Override public EnumPushReaction getMobilityFlag() { return delegate.getMobilityFlag(); }
@Override public EnumPushReaction getPushReaction() { return EnumPushReaction.IGNORE; }
@SuppressWarnings("deprecation") @Override public EnumPushReaction getMobilityFlag(IBlockState state) { return EnumPushReaction.BLOCK; }
@SuppressWarnings("deprecation") @Override public EnumPushReaction getMobilityFlag(IBlockState state) { return EnumPushReaction.DESTROY; }
public EnumPushReaction getPushReaction() { return this.hasMarker() ? EnumPushReaction.IGNORE : super.getPushReaction(); }
public EnumPushReaction getPushReaction() { return EnumPushReaction.NORMAL; }
public EnumPushReaction getPushReaction() { return EnumPushReaction.IGNORE; }
public EnumPushReaction getMobilityFlag(IBlockState state) { return EnumPushReaction.NORMAL; }
@Deprecated public EnumPushReaction getMobilityFlag(IBlockState state) { return this.blockMaterial.getMobilityFlag(); }
public EnumPushReaction getMobilityFlag(IBlockState state) { return EnumPushReaction.DESTROY; }
public EnumPushReaction getMobilityFlag() { return this.block.getMobilityFlag(this); }
/** * Checks if the piston can push the given BlockState. */ public static boolean canPush(IBlockState blockStateIn, World worldIn, BlockPos pos, EnumFacing facing, boolean destroyBlocks) { Block block = blockStateIn.getBlock(); if (block == Blocks.OBSIDIAN) { return false; } else if (!worldIn.getWorldBorder().contains(pos)) { return false; } else if (pos.getY() >= 0 && (facing != EnumFacing.DOWN || pos.getY() != 0)) { if (pos.getY() <= worldIn.getHeight() - 1 && (facing != EnumFacing.UP || pos.getY() != worldIn.getHeight() - 1)) { if (block != Blocks.PISTON && block != Blocks.STICKY_PISTON) { if (blockStateIn.getBlockHardness(worldIn, pos) == -1.0F) { return false; } if (blockStateIn.getMobilityFlag() == EnumPushReaction.BLOCK) { return false; } if (blockStateIn.getMobilityFlag() == EnumPushReaction.DESTROY) { return destroyBlocks; } } else if (((Boolean)blockStateIn.getValue(EXTENDED)).booleanValue()) { return false; } return !block.hasTileEntity(); } else { return false; } } else { return false; } }
private void func_190589_G() { IBlockState iblockstate = this.world.getBlockState(this.getPos()); if (iblockstate.getBlock() instanceof BlockShulkerBox) { EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(BlockShulkerBox.field_190957_a); AxisAlignedBB axisalignedbb = this.func_190588_c(enumfacing).offset(this.pos); List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity((Entity)null, axisalignedbb); if (!list.isEmpty()) { for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity)list.get(i); if (entity.getPushReaction() != EnumPushReaction.IGNORE) { double d0 = 0.0D; double d1 = 0.0D; double d2 = 0.0D; AxisAlignedBB axisalignedbb1 = entity.getEntityBoundingBox(); switch (enumfacing.getAxis()) { case X: if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE) { d0 = axisalignedbb.maxX - axisalignedbb1.minX; } else { d0 = axisalignedbb1.maxX - axisalignedbb.minX; } d0 = d0 + 0.01D; break; case Y: if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE) { d1 = axisalignedbb.maxY - axisalignedbb1.minY; } else { d1 = axisalignedbb1.maxY - axisalignedbb.minY; } d1 = d1 + 0.01D; break; case Z: if (enumfacing.getAxisDirection() == EnumFacing.AxisDirection.POSITIVE) { d2 = axisalignedbb.maxZ - axisalignedbb1.minZ; } else { d2 = axisalignedbb1.maxZ - axisalignedbb.minZ; } d2 = d2 + 0.01D; } entity.moveEntity(MoverType.SHULKER_BOX, d0 * (double)enumfacing.getFrontOffsetX(), d1 * (double)enumfacing.getFrontOffsetY(), d2 * (double)enumfacing.getFrontOffsetZ()); } } } } }
private void moveCollidedEntities(float p_184322_1_) { EnumFacing enumfacing = this.extending ? this.pistonFacing : this.pistonFacing.getOpposite(); double d0 = (double)(p_184322_1_ - this.progress); List<AxisAlignedBB> list = Lists.<AxisAlignedBB>newArrayList(); this.func_190606_j().addCollisionBoxToList(this.world, BlockPos.ORIGIN, new AxisAlignedBB(BlockPos.ORIGIN), list, (Entity)null, true); if (!((List)list).isEmpty()) { AxisAlignedBB axisalignedbb = this.func_190607_a(this.func_191515_a(list)); List<Entity> list1 = this.world.getEntitiesWithinAABBExcludingEntity((Entity)null, this.func_190610_a(axisalignedbb, enumfacing, d0).union(axisalignedbb)); if (!list1.isEmpty()) { boolean flag = this.pistonState.getBlock() == Blocks.SLIME_BLOCK; for (int i = 0; i < list1.size(); ++i) { Entity entity = (Entity)list1.get(i); if (entity.getPushReaction() != EnumPushReaction.IGNORE) { if (flag) { switch (enumfacing.getAxis()) { case X: entity.motionX = (double)enumfacing.getFrontOffsetX(); break; case Y: entity.motionY = (double)enumfacing.getFrontOffsetY(); break; case Z: entity.motionZ = (double)enumfacing.getFrontOffsetZ(); } } double d1 = 0.0D; for (int j = 0; j < ((List)list).size(); ++j) { AxisAlignedBB axisalignedbb1 = this.func_190610_a(this.func_190607_a((AxisAlignedBB)list.get(j)), enumfacing, d0); AxisAlignedBB axisalignedbb2 = entity.getEntityBoundingBox(); if (axisalignedbb1.intersectsWith(axisalignedbb2)) { d1 = Math.max(d1, this.func_190612_a(axisalignedbb1, enumfacing, axisalignedbb2)); if (d1 >= d0) { break; } } } if (d1 > 0.0D) { d1 = Math.min(d1, d0) + 0.01D; field_190613_i.set(enumfacing); entity.moveEntity(MoverType.PISTON, d1 * (double)enumfacing.getFrontOffsetX(), d1 * (double)enumfacing.getFrontOffsetY(), d1 * (double)enumfacing.getFrontOffsetZ()); field_190613_i.set((EnumFacing)null); if (!this.extending && this.shouldHeadBeRendered) { this.func_190605_a(entity, enumfacing, d0); } } } } } } }
/** * Checks if the piston can push the given BlockState. */ public static boolean canPush(IBlockState blockStateIn, World worldIn, BlockPos pos, EnumFacing facing, boolean destroyBlocks) { Block block = blockStateIn.getBlock(); if (block == Blocks.OBSIDIAN) { return false; } else if (!worldIn.getWorldBorder().contains(pos)) { return false; } else if (pos.getY() >= 0 && (facing != EnumFacing.DOWN || pos.getY() != 0)) { if (pos.getY() <= worldIn.getHeight() - 1 && (facing != EnumFacing.UP || pos.getY() != worldIn.getHeight() - 1)) { if (block != Blocks.PISTON && block != Blocks.STICKY_PISTON) { if (blockStateIn.getBlockHardness(worldIn, pos) == -1.0F) { return false; } if (blockStateIn.getMobilityFlag() == EnumPushReaction.BLOCK) { return false; } if (blockStateIn.getMobilityFlag() == EnumPushReaction.DESTROY) { return destroyBlocks; } } else if (((Boolean)blockStateIn.getValue(EXTENDED)).booleanValue()) { return false; } return !block.hasTileEntity(blockStateIn); } else { return false; } } else { return false; } }
@SuppressWarnings("deprecation") @Override public EnumPushReaction getMobilityFlag(IBlockState state) { return EnumPushReaction.NORMAL; }