Java 类net.minecraft.block.material.EnumPushReaction 实例源码

项目:pnc-repressurized    文件:BlockFluidEtchingAcid.java   
public BlockFluidEtchingAcid(Fluid fluid) {
    super(fluid, new MaterialLiquid(MapColor.EMERALD) {
        @Override
        public EnumPushReaction getMobilityFlag() {
            return EnumPushReaction.DESTROY;
        }
    });
}
项目:UniversalRemote    文件:EntityPlayerMPProxy.java   
@Override
public EnumPushReaction getPushReaction() {
    if (m_realPlayer == null) {
        return super.getPushReaction();
    } else {
        syncToRealPlayer();
        return syncPublicFieldsFromRealAndReturn(m_realPlayer.getPushReaction());
    }
}
项目:UniversalRemote    文件:EntityPlayerProxy.java   
@Override
public EnumPushReaction getPushReaction() {
    if (m_realPlayer == null) {
        return super.getPushReaction();
    } else {
        return m_realPlayer.getPushReaction();
    }
}
项目:Backmemed    文件:BlockPistonStructureHelper.java   
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;
    }
}
项目:CustomWorldGen    文件:BlockPistonStructureHelper.java   
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;
    }
}
项目:Structure    文件:StructureBlock.java   
@Override
@Deprecated
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    // total immobility and stop pistons
    return EnumPushReaction.BLOCK;
}
项目:geomastery    文件:BlockMaterial.java   
@Override
public EnumPushReaction getMobilityFlag() {

    return this.isImmovable ? EnumPushReaction.BLOCK :
            (this.isReplaceable ? EnumPushReaction.DESTROY :
            EnumPushReaction.NORMAL);
}
项目:ExpandedRailsMod    文件:BlockPistonStructureHelper.java   
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;
    }
}
项目:HardVox    文件:BlockStateDelegate.java   
@Override
public EnumPushReaction getMobilityFlag() {
    return delegate.getMobilityFlag();
}
项目:Bewitchment    文件:EntityBrewLinger.java   
@Override
public EnumPushReaction getPushReaction() {
    return EnumPushReaction.IGNORE;
}
项目:Bewitchment    文件:BlockWitchAltar.java   
@SuppressWarnings("deprecation")
@Override
public EnumPushReaction getMobilityFlag(IBlockState state) {
    return EnumPushReaction.BLOCK;
}
项目:Bewitchment    文件:BlockCircleGlyph.java   
@SuppressWarnings("deprecation")
@Override
public EnumPushReaction getMobilityFlag(IBlockState state) {
    return EnumPushReaction.DESTROY;
}
项目:Backmemed    文件:EntityArmorStand.java   
public EnumPushReaction getPushReaction()
{
    return this.hasMarker() ? EnumPushReaction.IGNORE : super.getPushReaction();
}
项目:Backmemed    文件:Entity.java   
public EnumPushReaction getPushReaction()
{
    return EnumPushReaction.NORMAL;
}
项目:Backmemed    文件:EntityAreaEffectCloud.java   
public EnumPushReaction getPushReaction()
{
    return EnumPushReaction.IGNORE;
}
项目:Backmemed    文件:BlockIce.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.NORMAL;
}
项目:Backmemed    文件:Block.java   
@Deprecated
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return this.blockMaterial.getMobilityFlag();
}
项目:Backmemed    文件:BlockRailBase.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.NORMAL;
}
项目:Backmemed    文件:BlockDoor.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:Backmemed    文件:BlockBed.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:Backmemed    文件:BlockStateContainer.java   
public EnumPushReaction getMobilityFlag()
{
    return this.block.getMobilityFlag(this);
}
项目:Backmemed    文件:BlockEndRod.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.NORMAL;
}
项目:Backmemed    文件:BlockBasePressurePlate.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:Backmemed    文件:BlockPistonBase.java   
/**
 * 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;
    }
}
项目:Backmemed    文件:BlockStructureVoid.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:Backmemed    文件:BlockShulkerBox.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:Backmemed    文件:TileEntityShulkerBox.java   
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());
                }
            }
        }
    }
}
项目:Backmemed    文件:TileEntityPiston.java   
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);
                        }
                    }
                }
            }
        }
    }
}
项目:CustomWorldGen    文件:Entity.java   
public EnumPushReaction getPushReaction()
{
    return EnumPushReaction.NORMAL;
}
项目:CustomWorldGen    文件:EntityAreaEffectCloud.java   
public EnumPushReaction getPushReaction()
{
    return EnumPushReaction.IGNORE;
}
项目:CustomWorldGen    文件:BlockIce.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.NORMAL;
}
项目:CustomWorldGen    文件:Block.java   
@Deprecated
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return this.blockMaterial.getMobilityFlag();
}
项目:CustomWorldGen    文件:BlockRailBase.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.NORMAL;
}
项目:CustomWorldGen    文件:BlockDoor.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:CustomWorldGen    文件:BlockBed.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:CustomWorldGen    文件:BlockStateContainer.java   
public EnumPushReaction getMobilityFlag()
{
    return this.block.getMobilityFlag(this);
}
项目:CustomWorldGen    文件:BlockEndRod.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.NORMAL;
}
项目:CustomWorldGen    文件:BlockBasePressurePlate.java   
public EnumPushReaction getMobilityFlag(IBlockState state)
{
    return EnumPushReaction.DESTROY;
}
项目:CustomWorldGen    文件:BlockPistonBase.java   
/**
 * 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;
    }
}
项目:ExPetrum    文件:BlockIce.java   
@SuppressWarnings("deprecation")
@Override
public EnumPushReaction getMobilityFlag(IBlockState state)
   {
       return EnumPushReaction.NORMAL;
   }