Java 类net.minecraft.tileentity.TileEntityComparator 实例源码

项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
项目:Backmemed    文件:BlockRedstoneComparator.java   
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
项目:CustomWorldGen    文件:BlockRedstoneComparator.java   
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
项目:ExpandedRailsMod    文件:BlockRedstoneComparator.java   
protected void updateState(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isBlockTickPending(pos, this))
    {
        int i = this.calculateOutput(worldIn, pos, state);
        TileEntity tileentity = worldIn.getTileEntity(pos);
        int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;

        if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
        {
            if (this.isFacingTowardsRepeater(worldIn, pos, state))
            {
                worldIn.updateBlockTick(pos, this, 2, -1);
            }
            else
            {
                worldIn.updateBlockTick(pos, this, 2, 0);
            }
        }
    }
}
项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
private void onStateChange(World worldIn, BlockPos pos, IBlockState state)
{
    int i = this.calculateOutput(worldIn, pos, state);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    int j = 0;

    if (tileentity instanceof TileEntityComparator)
    {
        TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
        j = tileentitycomparator.getOutputSignal();
        tileentitycomparator.setOutputSignal(i);
    }

    if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
    {
        boolean flag1 = this.shouldBePowered(worldIn, pos, state);
        boolean flag = this.isPowered(state);

        if (flag && !flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
        }
        else if (!flag && flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
        }

        this.notifyNeighbors(worldIn, pos, state);
    }
}
项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
private void onStateChange(World worldIn, BlockPos pos, IBlockState state)
{
    int i = this.calculateOutput(worldIn, pos, state);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    int j = 0;

    if (tileentity instanceof TileEntityComparator)
    {
        TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
        j = tileentitycomparator.getOutputSignal();
        tileentitycomparator.setOutputSignal(i);
    }

    if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
    {
        boolean flag1 = this.shouldBePowered(worldIn, pos, state);
        boolean flag = this.isPowered(state);

        if (flag && !flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
        }
        else if (!flag && flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
        }

        this.notifyNeighbors(worldIn, pos, state);
    }
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
private void onStateChange(World worldIn, BlockPos pos, IBlockState state)
{
    int i = this.calculateOutput(worldIn, pos, state);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    int j = 0;

    if (tileentity instanceof TileEntityComparator)
    {
        TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
        j = tileentitycomparator.getOutputSignal();
        tileentitycomparator.setOutputSignal(i);
    }

    if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
    {
        boolean flag1 = this.shouldBePowered(worldIn, pos, state);
        boolean flag = this.isPowered(state);

        if (flag && !flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
        }
        else if (!flag && flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
        }

        this.notifyNeighbors(worldIn, pos, state);
    }
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
private void onStateChange(World worldIn, BlockPos pos, IBlockState state)
{
    int i = this.calculateOutput(worldIn, pos, state);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    int j = 0;

    if (tileentity instanceof TileEntityComparator)
    {
        TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
        j = tileentitycomparator.getOutputSignal();
        tileentitycomparator.setOutputSignal(i);
    }

    if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
    {
        boolean flag1 = this.shouldBePowered(worldIn, pos, state);
        boolean flag = this.isPowered(state);

        if (flag && !flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
        }
        else if (!flag && flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
        }

        this.notifyNeighbors(worldIn, pos, state);
    }
}
项目:Backmemed    文件:BlockRedstoneComparator.java   
private void onStateChange(World worldIn, BlockPos pos, IBlockState state)
{
    int i = this.calculateOutput(worldIn, pos, state);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    int j = 0;

    if (tileentity instanceof TileEntityComparator)
    {
        TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
        j = tileentitycomparator.getOutputSignal();
        tileentitycomparator.setOutputSignal(i);
    }

    if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
    {
        boolean flag1 = this.shouldBePowered(worldIn, pos, state);
        boolean flag = this.isPowered(state);

        if (flag && !flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
        }
        else if (!flag && flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
        }

        this.notifyNeighbors(worldIn, pos, state);
    }
}
项目:CustomWorldGen    文件:BlockRedstoneComparator.java   
private void onStateChange(World worldIn, BlockPos pos, IBlockState state)
{
    int i = this.calculateOutput(worldIn, pos, state);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    int j = 0;

    if (tileentity instanceof TileEntityComparator)
    {
        TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
        j = tileentitycomparator.getOutputSignal();
        tileentitycomparator.setOutputSignal(i);
    }

    if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
    {
        boolean flag1 = this.shouldBePowered(worldIn, pos, state);
        boolean flag = this.isPowered(state);

        if (flag && !flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
        }
        else if (!flag && flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
        }

        this.notifyNeighbors(worldIn, pos, state);
    }
}
项目:ExpandedRailsMod    文件:BlockRedstoneComparator.java   
private void onStateChange(World worldIn, BlockPos pos, IBlockState state)
{
    int i = this.calculateOutput(worldIn, pos, state);
    TileEntity tileentity = worldIn.getTileEntity(pos);
    int j = 0;

    if (tileentity instanceof TileEntityComparator)
    {
        TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
        j = tileentitycomparator.getOutputSignal();
        tileentitycomparator.setOutputSignal(i);
    }

    if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
    {
        boolean flag1 = this.shouldBePowered(worldIn, pos, state);
        boolean flag = this.isPowered(state);

        if (flag && !flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
        }
        else if (!flag && flag1)
        {
            worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
        }

        this.notifyNeighbors(worldIn, pos, state);
    }
}
项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World worldIn, int meta)
{
    return new TileEntityComparator();
}
项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
项目:DecompiledMinecraft    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World worldIn, int meta)
{
    return new TileEntityComparator();
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World worldIn, int meta)
{
    return new TileEntityComparator();
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
项目:BaseClient    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World worldIn, int meta)
{
    return new TileEntityComparator();
}
项目:Backmemed    文件:BlockRedstoneComparator.java   
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
项目:Backmemed    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World worldIn, int meta)
{
    return new TileEntityComparator();
}
项目:CustomWorldGen    文件:BlockRedstoneComparator.java   
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
项目:CustomWorldGen    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World worldIn, int meta)
{
    return new TileEntityComparator();
}
项目:Resilience-Client-Source    文件:BlockRedstoneComparator.java   
public TileEntityComparator func_149971_e(IBlockAccess p_149971_1_, int p_149971_2_, int p_149971_3_, int p_149971_4_)
{
    return (TileEntityComparator)p_149971_1_.getTileEntity(p_149971_2_, p_149971_3_, p_149971_4_);
}
项目:Resilience-Client-Source    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
    return new TileEntityComparator();
}
项目:Easy-Editors    文件:NBTTagHandler.java   
private static void registerVanillaTileEntityHandlers() {
    registerTileEntityHandler(TileEntityComparator.class, ComparatorHandler.class);
}
项目:OpenPeripheral-Integration    文件:AdapterComparator.java   
@Override
public Class<?> getTargetClass() {
    return TileEntityComparator.class;
}
项目:OpenPeripheral-Integration    文件:AdapterComparator.java   
@ScriptCallable(returnTypes = ReturnType.NUMBER, description = "Get the strength of the output signal")
public int getOutputSignal(TileEntityComparator comparator) {
    return comparator.getOutputSignal();
}
项目:ExpandedRailsMod    文件:BlockRedstoneComparator.java   
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
项目:ExpandedRailsMod    文件:BlockRedstoneComparator.java   
/**
 * Returns a new instance of a block's tile entity class. Called on placing the block.
 */
public TileEntity createNewTileEntity(World worldIn, int meta)
{
    return new TileEntityComparator();
}
项目:Cauldron    文件:BlockRedstoneComparator.java   
public TileEntityComparator getTileEntityComparator(IBlockAccess p_149971_1_, int p_149971_2_, int p_149971_3_, int p_149971_4_)
{
    return (TileEntityComparator)p_149971_1_.getTileEntity(p_149971_2_, p_149971_3_, p_149971_4_);
}
项目:Cauldron    文件:BlockRedstoneComparator.java   
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
    return new TileEntityComparator();
}
项目:Cauldron    文件:BlockRedstoneComparator.java   
public TileEntityComparator getTileEntityComparator(IBlockAccess p_149971_1_, int p_149971_2_, int p_149971_3_, int p_149971_4_)
{
    return (TileEntityComparator)p_149971_1_.getTileEntity(p_149971_2_, p_149971_3_, p_149971_4_);
}
项目:Cauldron    文件:BlockRedstoneComparator.java   
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
    return new TileEntityComparator();
}
项目:RuneCraftery    文件:BlockComparator.java   
public TileEntityComparator func_96475_a_(IBlockAccess p_96475_1_, int p_96475_2_, int p_96475_3_, int p_96475_4_) {
   return (TileEntityComparator)p_96475_1_.func_72796_p(p_96475_2_, p_96475_3_, p_96475_4_);
}
项目:RuneCraftery    文件:BlockComparator.java   
public TileEntity func_72274_a(World p_72274_1_) {
   return new TileEntityComparator();
}
项目:RuneCraftery    文件:BlockComparator.java   
/**
 * Returns the blockTileEntity at given coordinates.
 */
public TileEntityComparator getTileEntityComparator(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
    return (TileEntityComparator)par1IBlockAccess.getBlockTileEntity(par2, par3, par4);
}