本文整理汇总了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);
}
}
}
}
示例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);
}
}
示例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;
}
示例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();
}
示例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_);
}
示例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();
}
示例7: registerVanillaTileEntityHandlers
import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
private static void registerVanillaTileEntityHandlers() {
registerTileEntityHandler(TileEntityComparator.class, ComparatorHandler.class);
}
示例8: getTargetClass
import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
@Override
public Class<?> getTargetClass() {
return TileEntityComparator.class;
}
示例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();
}
示例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_);
}
示例11: createNewTileEntity
import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_)
{
return new TileEntityComparator();
}
示例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_);
}
示例13: func_72274_a
import net.minecraft.tileentity.TileEntityComparator; //导入依赖的package包/类
public TileEntity func_72274_a(World p_72274_1_) {
return new TileEntityComparator();
}
示例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);
}