Java Code Examples for protocolsupport.api.ProtocolVersion#isAfterOrEq()

The following examples show how to use protocolsupport.api.ProtocolVersion#isAfterOrEq() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProtocolSupportVersionProvider.java    From BungeeTabListPlus with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean has18OrLater(ProxiedPlayer player) {
    ProtocolVersion protocolVersion = ProtocolSupportAPI.getProtocolVersion(player);
    if (psb12) {
        switch (protocolVersion) {
            case MINECRAFT_1_8:
                return true;
            default:
                return false;
        }
    } else {
        return protocolVersion.isAfterOrEq(ProtocolVersion.MINECRAFT_1_8);
    }
}
 
Example 2
Source File: NetworkEntityMetadataObjectPosition.java    From ProtocolSupport with GNU Affero General Public License v3.0 5 votes vote down vote up
protected static void writePositionL(ByteBuf to, ProtocolVersion version, Position position) {
	if (version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_14)) {
		PositionSerializer.writePosition(to, position);
	} else {
		PositionSerializer.writeLegacyPositionL(to, position);
	}
}
 
Example 3
Source File: AbstractDeclareRecipes.java    From ProtocolSupport with GNU Affero General Public License v3.0 5 votes vote down vote up
public boolean writeRecipe(ByteBuf to, ProtocolVersion version, T recipe) {
	if (version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_14)) {
		StringSerializer.writeVarIntUTF8String(to, recipe.getType().getInternalName());
		StringSerializer.writeVarIntUTF8String(to, recipe.getId());
	} else {
		StringSerializer.writeVarIntUTF8String(to, recipe.getId());
		StringSerializer.writeVarIntUTF8String(to, NamespacedKeyUtils.fromString(recipe.getType().getInternalName()).getKey());
	}
	writeRecipeData(to, version, recipe);
	return true;
}
 
Example 4
Source File: PSInitialHandler.java    From ProtocolSupportBungee with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean hasCompression(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_8);
}
 
Example 5
Source File: PSInitialHandler.java    From ProtocolSupportBungee with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean isFullEncryption(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_7_5);
}
 
Example 6
Source File: StringSerializer.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
private static boolean isUsingUTF8(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_7_5);
}
 
Example 7
Source File: MerchantDataSerializer.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean isUsingAdvancedTrading(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_14);
}
 
Example 8
Source File: MerchantDataSerializer.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean isUsingUsesCount(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_8);
}
 
Example 9
Source File: MerchantDataSerializer.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean isUsingRestockingVillagerField(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_14_3);
}
 
Example 10
Source File: MerchantDataSerializer.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean isUsingDemand(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_14_4);
}
 
Example 11
Source File: AbstractLoginListener.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean isFullEncryption(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_7_5);
}
 
Example 12
Source File: AbstractLoginListener.java    From ProtocolSupport with GNU Affero General Public License v3.0 4 votes vote down vote up
protected static boolean hasCompression(ProtocolVersion version) {
	return (version.getProtocolType() == ProtocolType.PC) && version.isAfterOrEq(ProtocolVersion.MINECRAFT_1_8);
}