当前位置: 首页>>代码示例>>Java>>正文


Java TileEntityComparator类代码示例

本文整理汇总了Java中net.minecraft.tileentity.TileEntityComparator的典型用法代码示例。如果您正苦于以下问题:Java TileEntityComparator类的具体用法?Java TileEntityComparator怎么用?Java TileEntityComparator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TileEntityComparator类属于net.minecraft.tileentity包,在下文中一共展示了TileEntityComparator类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateState

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
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);
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:BlockRedstoneComparator.java

示例2: onStateChange

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
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);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:31,代码来源:BlockRedstoneComparator.java

示例3: getActiveSignal

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
protected int getActiveSignal(IBlockAccess worldIn, BlockPos pos, IBlockState state)
{
    TileEntity tileentity = worldIn.getTileEntity(pos);
    return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:BlockRedstoneComparator.java

示例4: createNewTileEntity

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:BlockRedstoneComparator.java

示例5: func_149971_e

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
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_);
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:5,代码来源:BlockRedstoneComparator.java

示例6: createNewTileEntity

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:8,代码来源:BlockRedstoneComparator.java

示例7: registerVanillaTileEntityHandlers

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
private static void registerVanillaTileEntityHandlers() {
	registerTileEntityHandler(TileEntityComparator.class, ComparatorHandler.class);
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:4,代码来源:NBTTagHandler.java

示例8: getTargetClass

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
@Override
public Class<?> getTargetClass() {
	return TileEntityComparator.class;
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:5,代码来源:AdapterComparator.java

示例9: getOutputSignal

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
@ScriptCallable(returnTypes = ReturnType.NUMBER, description = "Get the strength of the output signal")
public int getOutputSignal(TileEntityComparator comparator) {
	return comparator.getOutputSignal();
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:5,代码来源:AdapterComparator.java

示例10: getTileEntityComparator

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
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_);
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:5,代码来源:BlockRedstoneComparator.java

示例11: createNewTileEntity

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
    return new TileEntityComparator();
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:5,代码来源:BlockRedstoneComparator.java

示例12: func_96475_a_

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
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_);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:BlockComparator.java

示例13: func_72274_a

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
public TileEntity func_72274_a(World p_72274_1_) {
   return new TileEntityComparator();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:BlockComparator.java

示例14: getTileEntityComparator

import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
/**
 * Returns the blockTileEntity at given coordinates.
 */
public TileEntityComparator getTileEntityComparator(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
    return (TileEntityComparator)par1IBlockAccess.getBlockTileEntity(par2, par3, par4);
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:8,代码来源:BlockComparator.java


注:本文中的net.minecraft.tileentity.TileEntityComparator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。