Package net.minecraft.block
Class ComparatorBlock
java.lang.Object
net.minecraft.block.Block
net.minecraft.block.HorizontalFacingBlock
net.minecraft.block.RedstoneComponentBlock
net.minecraft.block.ComparatorBlock
- All Implemented Interfaces:
BlockEntityProvider
public class ComparatorBlock extends RedstoneComponentBlock implements BlockEntityProvider
- Mappings:
Namespace Name official afxintermediary net/minecraft/class_178named net/minecraft/block/ComparatorBlock
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComparatorBlock.ComparatorTypeNested classes/interfaces inherited from class net.minecraft.block.Block
Block.OffsetType, Block.Sound -
Field Summary
Fields Modifier and Type Field Description static EnumProperty<ComparatorBlock.ComparatorType>MODEstatic BooleanPropertyPOWEREDFields inherited from class net.minecraft.block.RedstoneComponentBlock
field_851Fields inherited from class net.minecraft.block.HorizontalFacingBlock
FACINGFields inherited from class net.minecraft.block.Block
ANVIL, BLOCK_STATES, blockEntity, boundingBoxMaxX, boundingBoxMaxY, boundingBoxMaxZ, boundingBoxMinX, boundingBoxMinY, boundingBoxMinZ, CLOTH, fullBlock, GLASS, GRASS, GRAVEL, LADDER, lightLevel, material, materialColor, opacity, ORE, particleGravity, RAIL, randomTicks, REGISTRY, resistance, SAND, SLIME, slipperiness, SNOW, sound, stateManager, stats, STONE, strength, transluscent, useNeighbourLight, WOOD -
Constructor Summary
Constructors Constructor Description ComparatorBlock(boolean bool) -
Method Summary
Modifier and Type Method Description protected StateManagerappendProperties()Returns a new state manager with a property array.private intcalculateOutputSignal(World world, BlockPos pos, BlockState state)BlockEntitycreateBlockEntity(World world, int id)intgetData(BlockState state)Returns the data value for a blockstate Throws anIllegalArmumentExceptionas this method does not workItemgetDropItem(BlockState blockState, Random random, int state)Returns the item that must be dropped when the block is brokenItemgetPickItem(World world, BlockPos pos)Called when a player presses the pick block key while facing the block.BlockStategetStateFromData(World world, BlockPos pos, Direction dir, float float2, float float3, float float4, int id, LivingEntity entity)Returns a BlockState from an idStringgetTranslatedName()Translates and returns the translation keyprivate ItemFrameEntitymethod_774(World world, Direction direction, BlockPos blockPos)protected intmethod_788(WorldView worldView, BlockPos blockPos, BlockState blockState)protected intmethod_794(BlockState blockState)protected booleanmethod_796(World world, BlockPos blockPos, BlockState blockState)protected BlockStatemethod_798(BlockState blockState)protected intmethod_799(World world, BlockPos blockPos, BlockState blockState)protected voidmethod_800(World world, BlockPos blockPos, BlockState blockState)protected BlockStatemethod_803(BlockState blockState)protected booleanmethod_804(BlockState blockState)voidonBreaking(World world, BlockPos pos, BlockState state)Runs when the block is removed (by an entity or explosion).voidonCreation(World world, BlockPos pos, BlockState state)Runs when the block is placed (by a player or enderman).booleanonEvent(World world, BlockPos pos, BlockState state, int id, int meta)Runs when an event takes placebooleanonUse(World world, BlockPos pos, BlockState state, PlayerEntity player, Direction direction, float float2, float float3, float float4)Runs when the block is used, i.e.voidscheduledTick(World world, BlockPos pos, BlockState state, Random rand)Runs when the block is updated as per a scheduleBlockStatestateFromData(int data)Returns a blockstate of the current block from it's idprivate voidupdate(World world, BlockPos pos, BlockState state)Methods inherited from class net.minecraft.block.RedstoneComponentBlock
canBePlacedAtPos, emitsRedstonePower, getRenderLayerType, getStrongRedstonePower, getWeakRedstonePower, hasTransperancy, isEqualTo, isSideInvisible, method_789, method_790, method_791, method_792, method_793, method_795, method_797, method_801, method_802, method_805, neighborUpdate, onBreakByPlayer, onPlaced, onUpdateTick, renderAsNormalBlockMethods inherited from class net.minecraft.block.Block
appendCollisionBoxes, appendItemStacks, areBlocksEqual, blocksMovement, calcBlockBreakingData, canBePlacedAdjacent, canBeReplaced, canCollide, canMobSpawnInside, createStackFromBlock, disableStats, dropAsItem, dropExperience, get, getAmbientOcclusionLightLevel, getBlastResistance, getBlendColor, getBlockColor, getBlockFromItem, getBlockState, getBlockType, getBonusDrops, getBrightness, getByBlockState, getById, getCollisionBox, getColor, getColor, getComparatorOutput, getDefaultState, getDropCount, getIdByBlock, getItemGroup, getLightLevel, getMaterial, getMaterialColor, getMaxX, getMaxY, getMaxZ, getMeta, getMeta, getMinX, getMinY, getMinZ, getOffsetType, getOpacity, getPistonInteractionType, getSelectionBox, getStateFromRawId, getStateManager, getStrength, getTickRate, getTranslationKey, harvest, hasBlockEntity, hasCollision, hasCollision, hasComparatorOutput, hasStats, isFire, isFlowerPot, isFullBlock, isFullCube, isLeafBlock, isNormalBlock, isReplaceable, isTransluscent, method_655, method_696, onBlockBreak, onBlockBreakStart, onBreakByPlayer, onDestroyedByExplosion, onEntityCollision, onEntityCollision, onLandedUpon, onSteppedOn, rainTick, randomDisplayTick, randomDropAsItem, requiresSilkTouch, setBlockItemBounds, setBoundingBox, setBoundingBox, setDefaultState, setEntityVelocity, setItemGroup, setLightLevel, setOpacity, setResistance, setSound, setStrength, setTickRandomly, setTranslationKey, setUnbreakable, setup, shouldDropItemsOnExplosion, ticksRandomly, toString, usesNeighbourLight
-
Field Details
-
POWERED
- Mappings:
Namespace Name Mixin selector official aLafx;a:Lamk;intermediary field_836Lnet/minecraft/class_178;field_836:Lnet/minecraft/class_388;named POWEREDLnet/minecraft/block/ComparatorBlock;POWERED:Lnet/minecraft/state/property/BooleanProperty;
-
MODE
- Mappings:
Namespace Name Mixin selector official bLafx;b:Lamm;intermediary field_837Lnet/minecraft/class_178;field_837:Lnet/minecraft/class_390;named MODELnet/minecraft/block/ComparatorBlock;MODE:Lnet/minecraft/state/property/EnumProperty;
-
-
Constructor Details
-
ComparatorBlock
public ComparatorBlock(boolean bool)
-
-
Method Details
-
getTranslatedName
Translates and returns the translation key- Overrides:
getTranslatedNamein classBlock- Returns:
- Translated name
- Mappings:
Namespace Name Mixin selector official fLafh;f()Ljava/lang/String;intermediary method_716Lnet/minecraft/class_160;method_716()Ljava/lang/String;named getTranslatedNameLnet/minecraft/block/Block;getTranslatedName()Ljava/lang/String;
-
getDropItem
Returns the item that must be dropped when the block is broken- Overrides:
getDropItemin classBlock- Parameters:
blockState- The block's BlockStaterandom- Random objectstate- State- Returns:
- The Item that drops after the block breaks
- Mappings:
Namespace Name Mixin selector official aLafh;a(Lalz;Ljava/util/Random;I)Lzw;intermediary method_674Lnet/minecraft/class_160;method_674(Lnet/minecraft/class_376;Ljava/util/Random;I)Lnet/minecraft/class_2054;named getDropItemLnet/minecraft/block/Block;getDropItem(Lnet/minecraft/block/BlockState;Ljava/util/Random;I)Lnet/minecraft/item/Item;
-
getPickItem
Called when a player presses the pick block key while facing the block. It returns the item that must be placed into the player's inventory.- Overrides:
getPickItemin classBlock- Returns:
- The Item that must be placed into the player's inventory
- Mappings:
Namespace Name Mixin selector official cLafh;c(Ladm;Lcj;)Lzw;intermediary method_702Lnet/minecraft/class_160;method_702(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;)Lnet/minecraft/class_2054;named getPickItemLnet/minecraft/block/Block;getPickItem(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/item/Item;
-
method_794
- Specified by:
method_794in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official dLagd;d(Lalz;)Iintermediary method_794Lnet/minecraft/class_187;method_794(Lnet/minecraft/class_376;)Inamed method_794Lnet/minecraft/block/RedstoneComponentBlock;method_794(Lnet/minecraft/block/BlockState;)I
-
method_798
- Specified by:
method_798in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official eLagd;e(Lalz;)Lalz;intermediary method_798Lnet/minecraft/class_187;method_798(Lnet/minecraft/class_376;)Lnet/minecraft/class_376;named method_798Lnet/minecraft/block/RedstoneComponentBlock;method_798(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockState;
-
method_803
- Specified by:
method_803in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official kLagd;k(Lalz;)Lalz;intermediary method_803Lnet/minecraft/class_187;method_803(Lnet/minecraft/class_376;)Lnet/minecraft/class_376;named method_803Lnet/minecraft/block/RedstoneComponentBlock;method_803(Lnet/minecraft/block/BlockState;)Lnet/minecraft/block/BlockState;
-
method_804
- Overrides:
method_804in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official lLagd;l(Lalz;)Zintermediary method_804Lnet/minecraft/class_187;method_804(Lnet/minecraft/class_376;)Znamed method_804Lnet/minecraft/block/RedstoneComponentBlock;method_804(Lnet/minecraft/block/BlockState;)Z
-
method_788
- Overrides:
method_788in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official aLagd;a(Ladq;Lcj;Lalz;)Iintermediary method_788Lnet/minecraft/class_187;method_788(Lnet/minecraft/class_104;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Inamed method_788Lnet/minecraft/block/RedstoneComponentBlock;method_788(Lnet/minecraft/world/WorldView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)I
-
calculateOutputSignal
- Mappings:
Namespace Name Mixin selector official jLafx;j(Ladm;Lcj;Lalz;)Iintermediary method_775Lnet/minecraft/class_178;method_775(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Inamed calculateOutputSignalLnet/minecraft/block/ComparatorBlock;calculateOutputSignal(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)I
-
method_796
- Overrides:
method_796in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official eLagd;e(Ladm;Lcj;Lalz;)Zintermediary method_796Lnet/minecraft/class_187;method_796(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Znamed method_796Lnet/minecraft/block/RedstoneComponentBlock;method_796(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Z
-
method_799
- Overrides:
method_799in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official fLagd;f(Ladm;Lcj;Lalz;)Iintermediary method_799Lnet/minecraft/class_187;method_799(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Inamed method_799Lnet/minecraft/block/RedstoneComponentBlock;method_799(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)I
-
method_774
- Mappings:
Namespace Name Mixin selector official aLafx;a(Ladm;Lcq;Lcj;)Luo;intermediary method_774Lnet/minecraft/class_178;method_774(Lnet/minecraft/class_99;Lnet/minecraft/class_1383;Lnet/minecraft/class_1372;)Lnet/minecraft/class_1883;named method_774Lnet/minecraft/block/ComparatorBlock;method_774(Lnet/minecraft/world/World;Lnet/minecraft/util/math/Direction;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/entity/decoration/ItemFrameEntity;
-
onUse
public boolean onUse(World world, BlockPos pos, BlockState state, PlayerEntity player, Direction direction, float float2, float float3, float float4)Runs when the block is used, i.e. right clicked in most cases. It is similar to the same method in Item, but this method is called only when the player uses it when the block is placed, not when the player is holding the BlockItem.- Overrides:
onUsein classBlock- Parameters:
world- The world that the block is placed inpos- The block's positionstate- The block's BlockStateplayer- The player who used the blockdirection- The direction that the block is facing- Returns:
- Whether the action is succesful
- Mappings:
Namespace Name Mixin selector official aLafh;a(Ladm;Lcj;Lalz;Lwn;Lcq;FFF)Zintermediary method_654Lnet/minecraft/class_160;method_654(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;Lnet/minecraft/class_1963;Lnet/minecraft/class_1383;FFF)Znamed onUseLnet/minecraft/block/Block;onUse(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/Direction;FFF)Z
-
method_800
- Overrides:
method_800in classRedstoneComponentBlock- Mappings:
Namespace Name Mixin selector official gLagd;g(Ladm;Lcj;Lalz;)Vintermediary method_800Lnet/minecraft/class_187;method_800(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Vnamed method_800Lnet/minecraft/block/RedstoneComponentBlock;method_800(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
update
- Mappings:
Namespace Name Mixin selector official kLafx;k(Ladm;Lcj;Lalz;)Vintermediary method_776Lnet/minecraft/class_178;method_776(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Vnamed updateLnet/minecraft/block/ComparatorBlock;update(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
scheduledTick
Runs when the block is updated as per a schedule- Overrides:
scheduledTickin classRedstoneComponentBlock- Parameters:
world- The world that the block is placed inpos- The block's positionstate- The block's BlockStaterand- Random object- Mappings:
Namespace Name Mixin selector official bLafh;b(Ladm;Lcj;Lalz;Ljava/util/Random;)Vintermediary method_690Lnet/minecraft/class_160;method_690(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;Ljava/util/Random;)Vnamed scheduledTickLnet/minecraft/block/Block;scheduledTick(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Ljava/util/Random;)V
-
onCreation
Runs when the block is placed (by a player or enderman).- Overrides:
onCreationin classRedstoneComponentBlock- Parameters:
world- The world that the block is placed inpos- The block's positionstate- The block's BlockState- Mappings:
Namespace Name Mixin selector official cLafh;c(Ladm;Lcj;Lalz;)Vintermediary method_703Lnet/minecraft/class_160;method_703(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Vnamed onCreationLnet/minecraft/block/Block;onCreation(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
onBreaking
Runs when the block is removed (by an entity or explosion).- Overrides:
onBreakingin classBlock- Parameters:
world- The world that the block is placed inpos- The block's positionstate- The block's BlockState- Mappings:
Namespace Name Mixin selector official bLafh;b(Ladm;Lcj;Lalz;)Vintermediary method_688Lnet/minecraft/class_160;method_688(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;)Vnamed onBreakingLnet/minecraft/block/Block;onBreaking(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V
-
onEvent
Runs when an event takes place- Overrides:
onEventin classBlock- Parameters:
world- The world that the block is placed inpos- The block's positionstate- The block's BlockStateid- Idmeta- Metadata- Returns:
- Whether the event is successful
- Mappings:
Namespace Name Mixin selector official aLafh;a(Ladm;Lcj;Lalz;II)Zintermediary method_647Lnet/minecraft/class_160;method_647(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_376;II)Znamed onEventLnet/minecraft/block/Block;onEvent(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z
-
createBlockEntity
- Specified by:
createBlockEntityin interfaceBlockEntityProvider- Mappings:
Namespace Name Mixin selector official aLagq;a(Ladm;I)Lakw;intermediary method_841Lnet/minecraft/class_205;method_841(Lnet/minecraft/class_99;I)Lnet/minecraft/class_348;named createBlockEntityLnet/minecraft/block/BlockEntityProvider;createBlockEntity(Lnet/minecraft/world/World;I)Lnet/minecraft/block/entity/BlockEntity;
-
stateFromData
Returns a blockstate of the current block from it's id- Overrides:
stateFromDatain classBlock- Parameters:
data- The Blockstate's associated data value- Returns:
- The Default state
- Mappings:
Namespace Name Mixin selector official aLafh;a(I)Lalz;intermediary method_637Lnet/minecraft/class_160;method_637(I)Lnet/minecraft/class_376;named stateFromDataLnet/minecraft/block/Block;stateFromData(I)Lnet/minecraft/block/BlockState;
-
getData
Returns the data value for a blockstate Throws anIllegalArmumentExceptionas this method does not work- Overrides:
getDatain classBlock- Parameters:
state- The Blockstate- Returns:
- Zero
- Mappings:
Namespace Name Mixin selector official cLafh;c(Lalz;)Iintermediary method_706Lnet/minecraft/class_160;method_706(Lnet/minecraft/class_376;)Inamed getDataLnet/minecraft/block/Block;getData(Lnet/minecraft/block/BlockState;)I
-
appendProperties
Returns a new state manager with a property array.- Overrides:
appendPropertiesin classBlock- Returns:
- New state manager
- Mappings:
Namespace Name Mixin selector official eLafh;e()Lama;intermediary method_714Lnet/minecraft/class_160;method_714()Lnet/minecraft/class_378;named appendPropertiesLnet/minecraft/block/Block;appendProperties()Lnet/minecraft/state/StateManager;
-
getStateFromData
public BlockState getStateFromData(World world, BlockPos pos, Direction dir, float float2, float float3, float float4, int id, LivingEntity entity)Returns a BlockState from an id- Overrides:
getStateFromDatain classRedstoneComponentBlock- Parameters:
world- The world that the block is placed inpos- The block's positiondir- The block's direction- Mappings:
Namespace Name Mixin selector official aLafh;a(Ladm;Lcj;Lcq;FFFILpr;)Lalz;intermediary method_656Lnet/minecraft/class_160;method_656(Lnet/minecraft/class_99;Lnet/minecraft/class_1372;Lnet/minecraft/class_1383;FFFILnet/minecraft/class_1752;)Lnet/minecraft/class_376;named getStateFromDataLnet/minecraft/block/Block;getStateFromData(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;FFFILnet/minecraft/entity/LivingEntity;)Lnet/minecraft/block/BlockState;
-