Package net.minecraftforge.common
Class TierSortingRegistry
java.lang.Object
net.minecraftforge.common.TierSortingRegistry
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprivate static classprivate static final record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final ResourceLocationprivate static final com.google.common.collect.Multimap<ResourceLocation,ResourceLocation> private static booleanprivate static final ResourceLocationprivate static final org.apache.logging.log4j.Loggerprivate static final SimpleChannelprivate static final com.google.common.collect.BiMap<ResourceLocation,Tier> private static final com.google.common.collect.Multimap<ResourceLocation,ResourceLocation> 
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription(package private) static booleanstatic @Nullable TierbyName(ResourceLocation name) Returns the tier associated with a name, if registered into the sorting system.static @Nullable ResourceLocationReturns the name associated with a tier, if the tier is registered into the sorting system.(package private) static PreparableReloadListenerReturns the list of tiers in the order defined by the dependencies.private static ResourceLocationgetTierName(Object entry) getTiersLowerThan(Tier tier) Helper to query all tiers that are lower than the given tierprivate static voidhandle(TierSortingRegistry.SyncPacket packet, CustomPayloadEvent.Context context) (package private) static voidinit()static booleanisCorrectTierForDrops(Tier tier, BlockState state) Queries if a tier is high enough to be able to get drops for the given blockstate.private static booleanisCorrectTierVanilla(Tier tier, BlockState state) Fallback for when a tier isn't in the registry, copy of the logic inDiggerItem.isCorrectToolForDrops(net.minecraft.world.level.block.state.BlockState)static booleanisTierSorted(Tier tier) Queries if a tier should be evaluated using the sorting system, by calling isCorrectTierForDropsprivate static voidprivate static voidprocessTier(Tier tier, ResourceLocation name, List<Object> afters, List<Object> befores) private static voidprivate static TierSortingRegistry.SyncPacketreceive(FriendlyByteBuf buffer) static TierregisterTier(Tier tier, ResourceLocation name, List<Object> after, List<Object> before) Registers a tier into the tier sorting registry.private static voidrunInServerThreadIfPossible(it.unimi.dsi.fastutil.booleans.BooleanConsumer runnable) private static voidsetTierOrder(List<Tier> tierList) private static voidprivate static voidsyncToPlayer(ServerPlayer serverPlayer) 
- 
Field Details- 
LOGGERprivate static final org.apache.logging.log4j.Logger LOGGER
- 
ITEM_TIER_ORDERING_JSON
- 
hasCustomTiersprivate static boolean hasCustomTiers
- 
tiers
- 
edges
- 
vanillaEdgesprivate static final com.google.common.collect.Multimap<ResourceLocation,ResourceLocation> vanillaEdges
- 
sortedTiers
- 
sortedTiersUnmodifiable
- 
CHANNEL_NAME
- 
SYNC_CHANNEL
 
- 
- 
Constructor Details- 
TierSortingRegistrypublic TierSortingRegistry()
 
- 
- 
Method Details- 
registerTierpublic static Tier registerTier(Tier tier, ResourceLocation name, List<Object> after, List<Object> before) Registers a tier into the tier sorting registry.- Parameters:
- tier- The tier to register
- name- The name to use internally for dependency resolution
- after- List of tiers to place this tier after (the tiers in the list will be considered lesser tiers)
- before- List of tiers to place this tier before (the tiers in the list will be considered better tiers)
 
- 
getSortedTiersReturns the list of tiers in the order defined by the dependencies. This list will remain valid- Returns:
- An unmodifiable list of tiers ordered lesser to greater
 
- 
byNameReturns the tier associated with a name, if registered into the sorting system.- Parameters:
- name- The name to look up
- Returns:
- The tier, or null if not registered
 
- 
getNameReturns the name associated with a tier, if the tier is registered into the sorting system.- Parameters:
- tier- The tier to look up
- Returns:
- The name for the tier, or null if not registered
 
- 
isTierSortedQueries if a tier should be evaluated using the sorting system, by calling isCorrectTierForDrops- Parameters:
- tier- The tier to query
- Returns:
- True if isCorrectTierForDrops should be called for the tier
 
- 
isCorrectTierForDropsQueries if a tier is high enough to be able to get drops for the given blockstate.- Parameters:
- tier- The tier to look up
- state- The state to test against
- Returns:
- True if the tier is good enough
 
- 
getTiersLowerThanHelper to query all tiers that are lower than the given tier- Parameters:
- tier- The tier
- Returns:
- All the lower tiers
 
- 
isCorrectTierVanillaFallback for when a tier isn't in the registry, copy of the logic inDiggerItem.isCorrectToolForDrops(net.minecraft.world.level.block.state.BlockState)
- 
processTier
- 
getTierName
- 
allowVanillastatic boolean allowVanilla()
- 
initstatic void init()
- 
getReloadListener
- 
recalculateItemTiersprivate static void recalculateItemTiers()
- 
setTierOrder
- 
runInServerThreadIfPossibleprivate static void runInServerThreadIfPossible(it.unimi.dsi.fastutil.booleans.BooleanConsumer runnable) 
- 
syncToAllprivate static void syncToAll()
- 
playerLoggedIn
- 
syncToPlayer
- 
receive
- 
handleprivate static void handle(TierSortingRegistry.SyncPacket packet, CustomPayloadEvent.Context context) 
 
-