Package net.minecraft.item
Class BlockPredicatesChecker
java.lang.Object
net.minecraft.item.BlockPredicatesChecker
Checks if a block predicate stored inside
ItemStack
's NBT
matches the block in a world. The predicate must be stored inside
the key
sub NBT of the item stack.
The result is cached to reduce cost for successive lookups on the same block.
- API Note:
- This is used to implement checks for restrictions specified
using
CanPlaceOn
orCanDestroy
. - Mappings:
Namespace Name named net/minecraft/item/BlockPredicatesChecker
intermediary net/minecraft/class_6538
official cvk
-
Field Summary
Modifier and TypeFieldDescriptionprivate @Nullable CachedBlockPosition
static final Text
static final Text
private static final Text
static final com.mojang.serialization.Codec
<BlockPredicatesChecker> private static final com.mojang.serialization.Codec
<BlockPredicatesChecker> private boolean
private boolean
static final PacketCodec
<RegistryByteBuf, BlockPredicatesChecker> private final List
<BlockPredicate> private final boolean
private static final com.mojang.serialization.Codec
<BlockPredicatesChecker> -
Constructor Summary
ConstructorDescriptionBlockPredicatesChecker
(List<BlockPredicate> predicates, boolean showInTooltip) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTooltips
(Consumer<Text> adder) private static boolean
canUseCache
(CachedBlockPosition pos, @Nullable CachedBlockPosition cachedPos, boolean nbtAware) boolean
check
(CachedBlockPosition cachedPos) Returns true if any of the predicates in thestack
's NBT matched against the block atpos
, false otherwise.createTooltipText
(List<BlockPredicate> blockPredicates) boolean
int
hashCode()
boolean
toString()
withShowInTooltip
(boolean showInTooltip)
-
Field Details
-
SINGLE_CODEC
- Mappings:
Namespace Name Mixin selector named SINGLE_CODEC
Lnet/minecraft/item/BlockPredicatesChecker;SINGLE_CODEC:Lcom/mojang/serialization/Codec;
intermediary field_49249
Lnet/minecraft/class_6538;field_49249:Lcom/mojang/serialization/Codec;
official e
Lcvk;e:Lcom/mojang/serialization/Codec;
-
FULL_CODEC
- Mappings:
Namespace Name Mixin selector named FULL_CODEC
Lnet/minecraft/item/BlockPredicatesChecker;FULL_CODEC:Lcom/mojang/serialization/Codec;
intermediary field_49250
Lnet/minecraft/class_6538;field_49250:Lcom/mojang/serialization/Codec;
official f
Lcvk;f:Lcom/mojang/serialization/Codec;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/item/BlockPredicatesChecker;CODEC:Lcom/mojang/serialization/Codec;
intermediary field_49245
Lnet/minecraft/class_6538;field_49245:Lcom/mojang/serialization/Codec;
official a
Lcvk;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODEC
Lnet/minecraft/item/BlockPredicatesChecker;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
intermediary field_49246
Lnet/minecraft/class_6538;field_49246:Lnet/minecraft/class_9139;
official b
Lcvk;b:Lzt;
-
CAN_BREAK_TEXT
- Mappings:
Namespace Name Mixin selector named CAN_BREAK_TEXT
Lnet/minecraft/item/BlockPredicatesChecker;CAN_BREAK_TEXT:Lnet/minecraft/text/Text;
intermediary field_49247
Lnet/minecraft/class_6538;field_49247:Lnet/minecraft/class_2561;
official c
Lcvk;c:Lxv;
-
CAN_PLACE_TEXT
- Mappings:
Namespace Name Mixin selector named CAN_PLACE_TEXT
Lnet/minecraft/item/BlockPredicatesChecker;CAN_PLACE_TEXT:Lnet/minecraft/text/Text;
intermediary field_49248
Lnet/minecraft/class_6538;field_49248:Lnet/minecraft/class_2561;
official d
Lcvk;d:Lxv;
-
CAN_USE_UNKNOWN_TEXT
- Mappings:
Namespace Name Mixin selector named CAN_USE_UNKNOWN_TEXT
Lnet/minecraft/item/BlockPredicatesChecker;CAN_USE_UNKNOWN_TEXT:Lnet/minecraft/text/Text;
intermediary field_49251
Lnet/minecraft/class_6538;field_49251:Lnet/minecraft/class_2561;
official g
Lcvk;g:Lxv;
-
predicates
- Mappings:
Namespace Name Mixin selector named predicates
Lnet/minecraft/item/BlockPredicatesChecker;predicates:Ljava/util/List;
intermediary field_49252
Lnet/minecraft/class_6538;field_49252:Ljava/util/List;
official h
Lcvk;h:Ljava/util/List;
-
showInTooltip
private final boolean showInTooltip- Mappings:
Namespace Name Mixin selector named showInTooltip
Lnet/minecraft/item/BlockPredicatesChecker;showInTooltip:Z
intermediary field_49253
Lnet/minecraft/class_6538;field_49253:Z
official i
Lcvk;i:Z
-
tooltipText
- Mappings:
Namespace Name Mixin selector named tooltipText
Lnet/minecraft/item/BlockPredicatesChecker;tooltipText:Ljava/util/List;
intermediary field_49254
Lnet/minecraft/class_6538;field_49254:Ljava/util/List;
official j
Lcvk;j:Ljava/util/List;
-
cachedPos
- Mappings:
Namespace Name Mixin selector named cachedPos
Lnet/minecraft/item/BlockPredicatesChecker;cachedPos:Lnet/minecraft/block/pattern/CachedBlockPosition;
intermediary field_34450
Lnet/minecraft/class_6538;field_34450:Lnet/minecraft/class_2694;
official k
Lcvk;k:Ldxy;
-
lastResult
private boolean lastResult- Mappings:
Namespace Name Mixin selector named lastResult
Lnet/minecraft/item/BlockPredicatesChecker;lastResult:Z
intermediary field_34451
Lnet/minecraft/class_6538;field_34451:Z
official l
Lcvk;l:Z
-
nbtAware
private boolean nbtAware- Mappings:
Namespace Name Mixin selector named nbtAware
Lnet/minecraft/item/BlockPredicatesChecker;nbtAware:Z
intermediary field_34452
Lnet/minecraft/class_6538;field_34452:Z
official m
Lcvk;m:Z
-
-
Constructor Details
-
BlockPredicatesChecker
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/item/BlockPredicatesChecker;<init>(Ljava/util/List;Z)V
intermediary <init>
Lnet/minecraft/class_6538;<init>(Ljava/util/List;Z)V
official <init>
Lcvk;<init>(Ljava/util/List;Z)V
-
-
Method Details
-
canUseCache
private static boolean canUseCache(CachedBlockPosition pos, @Nullable @Nullable CachedBlockPosition cachedPos, boolean nbtAware) - Mappings:
Namespace Name Mixin selector named canUseCache
Lnet/minecraft/item/BlockPredicatesChecker;canUseCache(Lnet/minecraft/block/pattern/CachedBlockPosition;Lnet/minecraft/block/pattern/CachedBlockPosition;Z)Z
intermediary method_38071
Lnet/minecraft/class_6538;method_38071(Lnet/minecraft/class_2694;Lnet/minecraft/class_2694;Z)Z
official a
Lcvk;a(Ldxy;Ldxy;Z)Z
-
check
Returns true if any of the predicates in thestack
's NBT matched against the block atpos
, false otherwise.- Returns:
- true if any of the predicates in the
stack
's NBT matched against the block atpos
, false otherwise - Mappings:
Namespace Name Mixin selector named check
Lnet/minecraft/item/BlockPredicatesChecker;check(Lnet/minecraft/block/pattern/CachedBlockPosition;)Z
intermediary method_38070
Lnet/minecraft/class_6538;method_38070(Lnet/minecraft/class_2694;)Z
official a
Lcvk;a(Ldxy;)Z
-
getOrCreateTooltipText
- Mappings:
Namespace Name Mixin selector named getOrCreateTooltipText
Lnet/minecraft/item/BlockPredicatesChecker;getOrCreateTooltipText()Ljava/util/List;
intermediary method_65042
Lnet/minecraft/class_6538;method_65042()Ljava/util/List;
official b
Lcvk;b()Ljava/util/List;
-
addTooltips
- Mappings:
Namespace Name Mixin selector named addTooltips
Lnet/minecraft/item/BlockPredicatesChecker;addTooltips(Ljava/util/function/Consumer;)V
intermediary method_57330
Lnet/minecraft/class_6538;method_57330(Ljava/util/function/Consumer;)V
official a
Lcvk;a(Ljava/util/function/Consumer;)V
-
withShowInTooltip
- Mappings:
Namespace Name Mixin selector named withShowInTooltip
Lnet/minecraft/item/BlockPredicatesChecker;withShowInTooltip(Z)Lnet/minecraft/item/BlockPredicatesChecker;
intermediary method_58402
Lnet/minecraft/class_6538;method_58402(Z)Lnet/minecraft/class_6538;
official a
Lcvk;a(Z)Lcvk;
-
createTooltipText
- Mappings:
Namespace Name Mixin selector named createTooltipText
Lnet/minecraft/item/BlockPredicatesChecker;createTooltipText(Ljava/util/List;)Ljava/util/List;
intermediary method_57329
Lnet/minecraft/class_6538;method_57329(Ljava/util/List;)Ljava/util/List;
official a
Lcvk;a(Ljava/util/List;)Ljava/util/List;
-
showInTooltip
public boolean showInTooltip()- Mappings:
Namespace Name Mixin selector named showInTooltip
Lnet/minecraft/item/BlockPredicatesChecker;showInTooltip()Z
intermediary method_57324
Lnet/minecraft/class_6538;method_57324()Z
official a
Lcvk;a()Z
-
equals
-
hashCode
public int hashCode() -
toString
-