Interface Limitations
public interface Limitations
Version-dependent limitations.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanbannerPatternExists(net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.entity.BannerPattern> pattern, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) booleaneffectExists(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) booleanenchantmentExists(net.minecraft.resources.ResourceKey<net.minecraft.world.item.enchantment.Enchantment> enchantment, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) intgetStackCount(net.minecraft.world.item.ItemStack stack) Similar toItemStack.getCount(), but also handles negative item counts in pre 1.11 versionsbooleanitemExists(net.minecraft.world.item.Item item, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) booleanitemExistsInConnection(net.minecraft.world.item.Item item) Similar toitemExists(net.minecraft.world.item.Item, ProtocolVersion), but takes in the current connection details (e.g., classic protocol extensions being loaded)booleanitemExistsInConnection(net.minecraft.world.item.ItemStack stack) Same asitemExists(net.minecraft.world.item.Item, ProtocolVersion), but for item stacks.default intCalculates the maximum chat length for the current target version.intmaxChatLength(com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) Calculates the maximum chat length for givenProtocolVersioninstance.
-
Method Details
-
maxChatLength
default int maxChatLength()Calculates the maximum chat length for the current target version.- Returns:
- The maximum chat length
-
maxChatLength
int maxChatLength(com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) Calculates the maximum chat length for givenProtocolVersioninstance.- Returns:
- The maximum chat length
-
itemExists
boolean itemExists(net.minecraft.world.item.Item item, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) - Parameters:
item- The item to checkversion- The version to check for- Returns:
- true if the item exists in the given version, false otherwise; this will also check for CPE items (CustomBlocks V1 extension)
-
enchantmentExists
boolean enchantmentExists(net.minecraft.resources.ResourceKey<net.minecraft.world.item.enchantment.Enchantment> enchantment, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) - Parameters:
enchantment- The enchantment to checkversion- The version to check for- Returns:
- true if the enchantment exists in the given version, false otherwise
-
effectExists
boolean effectExists(net.minecraft.core.Holder<net.minecraft.world.effect.MobEffect> effect, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) - Parameters:
effect- The status effect to checkversion- The version to check for- Returns:
- true if the status effect exists in the given version, false otherwise
-
bannerPatternExists
boolean bannerPatternExists(net.minecraft.resources.ResourceKey<net.minecraft.world.level.block.entity.BannerPattern> pattern, com.viaversion.viaversion.api.protocol.version.ProtocolVersion version) - Parameters:
pattern- The banner pattern to checkversion- The version to check for- Returns:
- true if the banner pattern exists in the given version, false otherwise
-
itemExistsInConnection
boolean itemExistsInConnection(net.minecraft.world.item.Item item) Similar toitemExists(net.minecraft.world.item.Item, ProtocolVersion), but takes in the current connection details (e.g., classic protocol extensions being loaded)- Parameters:
item- The item to check- Returns:
- true if the item exists in the current connection, false otherwise
-
itemExistsInConnection
boolean itemExistsInConnection(net.minecraft.world.item.ItemStack stack) Same asitemExists(net.minecraft.world.item.Item, ProtocolVersion), but for item stacks. This also compares against certain data components like enchantments or banner patterns.- Parameters:
stack- The item stack to check- Returns:
- true if the item stack exists in the given version, false otherwise
-
getStackCount
int getStackCount(net.minecraft.world.item.ItemStack stack) Similar toItemStack.getCount(), but also handles negative item counts in pre 1.11 versions- Parameters:
stack- The item stack to get the count of- Returns:
- the count of the item stack can be negative in pre 1.11 versions
-