From 9fe71ee548f134e13faacf2f495441ce22e5a0cc Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 28 May 2023 19:49:13 +0200 Subject: [PATCH] Migrated to ViaLoader / ViaVersion organisation --- build.gradle | 2 +- gradle.properties | 4 +- .../event/ChangeProtocolVersionCallback.java | 4 +- ...a => FinishViaVersionStartupCallback.java} | 10 +- .../event/ViaLoadingBaseBuilderCallback.java | 33 - .../base/settings/SettingsSystem.java | 10 +- .../base/settings/groups/DebugSettings.java | 27 +- .../base/settings/groups/VisualSettings.java | 26 +- .../type_impl/ProtocolSyncBooleanSetting.java | 8 +- .../definition/ChatLengthCalculation.java | 6 +- .../command/impl/ListExtensionsCommand.java | 6 +- .../c0_30/command/impl/SetTimeCommand.java | 5 +- .../protocol/ClassicWorldHeightInjection.java | 9 +- .../definition/v1_12_2/FontCacheFix.java | 10 +- .../v1_14_4/LegacyServerAddress.java | 17 +- .../injection/access/IServerInfo.java | 6 +- .../mixin/base/MixinAddServerScreen.java | 4 +- .../mixin/base/MixinClientConnection.java | 28 +- .../base/MixinClientLoginNetworkHandler.java | 3 +- .../mixin/base/MixinConnectScreen_1.java | 4 +- .../injection/mixin/base/MixinDebugHud.java | 4 +- .../MixinMultiplayerServerListPinger.java | 7 +- .../injection/mixin/base/MixinServerInfo.java | 11 +- .../MixinClientPlayNetworkHandler.java | 21 +- .../MixinClientPlayerInteractionManager.java | 15 +- .../fixes/minecraft/MixinItemRenderer.java | 3 +- .../fixes/minecraft/MixinMinecraftClient.java | 9 +- .../minecraft/MixinPlayerEntityRenderer.java | 5 +- .../MixinServerResourcePackProvider.java | 11 +- ...MixinAbstractBlock_AbstractBlockState.java | 9 +- .../minecraft/block/MixinAnvilBlock.java | 3 +- .../minecraft/block/MixinBambooBlock.java | 3 +- .../fixes/minecraft/block/MixinBedBlock.java | 5 +- .../fixes/minecraft/block/MixinBlock.java | 7 +- .../block/MixinBrewingStandBlock.java | 3 +- .../minecraft/block/MixinCauldronBlock.java | 3 +- .../minecraft/block/MixinChestBlock.java | 3 +- .../minecraft/block/MixinEndPortalBlock.java | 5 +- .../block/MixinEndPortalFrameBlock.java | 3 +- .../minecraft/block/MixinFarmlandBlock.java | 3 +- .../minecraft/block/MixinFenceBlock.java | 8 +- .../fixes/minecraft/block/MixinFireBlock.java | 3 +- .../minecraft/block/MixinFlowerPotBlock.java | 3 +- .../minecraft/block/MixinHopperBlock.java | 5 +- .../minecraft/block/MixinLadderBlock.java | 3 +- .../minecraft/block/MixinLightBlock.java | 3 +- .../minecraft/block/MixinLilyPadBlock.java | 3 +- .../fixes/minecraft/block/MixinPaneBlock.java | 5 +- .../minecraft/block/MixinPistonHeadBlock.java | 5 +- .../fixes/minecraft/block/MixinSnowBlock.java | 3 +- .../minecraft/block/MixinSoulSandBlock.java | 5 +- .../minecraft/block/MixinSugarCaneBlock.java | 3 +- .../fixes/minecraft/block/MixinWallBlock.java | 9 +- .../entity/MixinAbstractDonkeyEntity.java | 3 +- .../minecraft/entity/MixinAllayEntity.java | 3 +- .../minecraft/entity/MixinAnimalEntity.java | 3 +- .../entity/MixinClientPlayerEntity.java | 23 +- .../minecraft/entity/MixinCowEntity.java | 3 +- .../minecraft/entity/MixinCreeperEntity.java | 3 +- .../fixes/minecraft/entity/MixinEntity.java | 19 +- .../minecraft/entity/MixinEntityIndex.java | 5 +- .../entity/MixinEntityPredicates.java | 3 +- .../minecraft/entity/MixinItemEntity.java | 3 +- .../minecraft/entity/MixinLivingEntity.java | 31 +- .../entity/MixinOtherClientPlayerEntity.java | 3 +- .../minecraft/entity/MixinPiglinEntity.java | 3 +- .../minecraft/entity/MixinPlayerEntity.java | 13 +- .../minecraft/entity/MixinSquidEntity.java | 3 +- .../minecraft/entity/MixinVexEntity.java | 3 +- .../minecraft/entity/MixinWolfEntity.java | 3 +- .../fixes/minecraft/input/MixinKeyboard.java | 3 +- .../minecraft/input/MixinKeyboardInput.java | 5 +- .../fixes/minecraft/item/MixinArmorItem.java | 3 +- .../fixes/minecraft/item/MixinAxeItem.java | 3 +- .../fixes/minecraft/item/MixinBlockItem.java | 3 +- .../fixes/minecraft/item/MixinElytraItem.java | 3 +- .../minecraft/item/MixinEnderPearlItem.java | 3 +- .../item/MixinFireworkRocketItem.java | 3 +- .../minecraft/item/MixinHeldItemRenderer.java | 3 +- .../fixes/minecraft/item/MixinHoeItem.java | 7 +- .../fixes/minecraft/item/MixinItemGroups.java | 4 +- .../item/MixinItemPlacementContext.java | 5 +- .../fixes/minecraft/item/MixinItemStack.java | 9 +- .../minecraft/item/MixinMiningToolItem.java | 3 +- .../minecraft/item/MixinPickaxeItem.java | 7 +- .../fixes/minecraft/item/MixinShovelItem.java | 3 +- .../fixes/minecraft/item/MixinSwordItem.java | 7 +- .../minecraft/packet/MixinPacketByteBuf.java | 3 +- .../MixinUpdatePlayerAbilitiesC2SPacket.java | 3 +- .../screen/MixinConnectScreen_1.java | 19 +- .../screen/MixinDownloadingTerrainScreen.java | 5 +- .../screen/MixinGameModeSelectionScreen.java | 10 +- ...ModeSelectionScreen_GameModeSelection.java | 8 +- .../screen/MixinStructureBlockScreen_1.java | 3 +- .../merchant/MixinMerchantScreenHandler.java | 3 +- ...xinBrewingStandScreenHandler_FuelSlot.java | 5 +- .../MixinPlayerScreenHandler.java | 5 +- .../screenhandler/MixinScreenHandler.java | 3 +- .../vialoadingbase/MixinVLBViaConfig.java | 48 - .../viaversion/MixinProtocolVersion.java | 1 + .../MixinAbstractFenceConnectionHandler.java | 3 +- .../MixinGlassConnectionHandler.java | 3 +- .../mappings/ItemReleaseVersionMappings.java | 2426 +++++++++-------- .../mappings/PackFormatsMappings.java | 81 +- .../protocolhack/ProtocolHack.java | 168 +- ...ava => ViaFabricPlusVLCommandHandler.java} | 6 +- .../impl/ViaFabricPlusVLInjector.java | 69 + .../impl/ViaFabricPlusVLLoader.java | 72 + .../netty/ViaFabricPlusVLBPipeline.java | 137 - .../netty/ViaFabricPlusVLLegacyPipeline.java | 99 + .../netty/viabedrock/DisconnectAdapter.java | 36 - .../codec/PingEncapsulationCodec.java | 64 - .../codec/RakMessageEncapsulationCodec.java | 61 - .../platform/ViaAprilFoolsPlatformImpl.java | 44 - .../platform/ViaBedrockPlatformImpl.java | 44 - .../platform/ViaLegacyPlatformImpl.java | 49 - .../ViaFabricPlusBaseVersionProvider.java} | 21 +- .../ViaFabricPlusHandItemProvider.java | 3 +- .../protocolhack/usage/ItemTranslator.java | 5 +- .../information/AbstractInformationGroup.java | 12 +- .../information/impl/BedrockInformation.java | 6 +- .../information/impl/C0_30CPEInformation.java | 6 +- .../information/impl/GeneralInformation.java | 3 +- .../ui/information/impl/V1_1Information.java | 6 +- .../information/impl/V1_2_4_5Information.java | 6 +- .../information/impl/V1_5_2Information.java | 6 +- .../information/impl/V1_7_10Information.java | 6 +- .../impl/ClassicItemSelectionScreen.java | 11 +- .../screen/impl/base/ForceVersionScreen.java | 23 +- .../impl/base/ProtocolSelectionScreen.java | 20 +- .../ClassiCubeServerListScreen.java | 5 +- src/main/resources/viafabricplus.mixins.json | 1 - 132 files changed, 1969 insertions(+), 2263 deletions(-) rename src/main/java/de/florianmichael/viafabricplus/base/event/{FinishViaLoadingBaseStartupCallback.java => FinishViaVersionStartupCallback.java} (72%) delete mode 100644 src/main/java/de/florianmichael/viafabricplus/base/event/ViaLoadingBaseBuilderCallback.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialoadingbase/MixinVLBViaConfig.java rename src/main/java/de/florianmichael/viafabricplus/protocolhack/command/{ViaFabricPlusVLBViaCommandHandler.java => ViaFabricPlusVLCommandHandler.java} (93%) create mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLInjector.java create mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLLoader.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java create mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLLegacyPipeline.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/DisconnectAdapter.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/PingEncapsulationCodec.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/RakMessageEncapsulationCodec.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaAprilFoolsPlatformImpl.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaBedrockPlatformImpl.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaLegacyPlatformImpl.java rename src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/{vialoadingbase/ViaFabricPlusVLBBaseVersionProvider.java => viaversion/ViaFabricPlusBaseVersionProvider.java} (89%) diff --git a/build.gradle b/build.gradle index 8aeaacd1..bf48e2f4 100644 --- a/build.gradle +++ b/build.gradle @@ -53,8 +53,8 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}" - library "com.github.FlorianMichael:ViaLoadingBase:${project.vialoadingbase_version}" library "com.github.FlorianMichael:Classic4J:${project.classic4j_version}" + library "net.raphimc:ViaLoader:${project.vialoader_version}" library "com.viaversion:viaversion:${project.viaversion_version}" library ("com.viaversion:viabackwards-common:${project.viabackwards_version}") { diff --git a/gradle.properties b/gradle.properties index 921b9aeb..83083bc4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,6 @@ maven_group=de.florianmichael archives_base_name=viafabricplus # base lib -vialoadingbase_version=1f4e409d86 raknet_transport_version=1.0.0.CR1-SNAPSHOT classic4j_version=1.2.0 @@ -24,10 +23,11 @@ viabackwards_version=4.7.0-1.20-pre5-SNAPSHOT snake_yml_version=2.0 # raphimc libs -vialegacy_version=2.2.16 +vialegacy_version=2.2.17-SNAPSHOT viaaprilfools_version=2.0.7-SNAPSHOT viabedrock_version=0.0.1-SNAPSHOT minecraftauth_version=2.1.4-SNAPSHOT +vialoader_version=2.2.5-SNAPSHOT # lenni0451 libs mcstructs_text_version=2.2.5 diff --git a/src/main/java/de/florianmichael/viafabricplus/base/event/ChangeProtocolVersionCallback.java b/src/main/java/de/florianmichael/viafabricplus/base/event/ChangeProtocolVersionCallback.java index eb230833..f769031a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/base/event/ChangeProtocolVersionCallback.java +++ b/src/main/java/de/florianmichael/viafabricplus/base/event/ChangeProtocolVersionCallback.java @@ -17,9 +17,9 @@ */ package de.florianmichael.viafabricplus.base.event; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.EventFactory; +import net.raphimc.vialoader.util.VersionEnum; public interface ChangeProtocolVersionCallback { @@ -29,5 +29,5 @@ public interface ChangeProtocolVersionCallback { } }); - void onChangeProtocolVersion(final ComparableProtocolVersion protocolVersion); + void onChangeProtocolVersion(final VersionEnum protocolVersion); } diff --git a/src/main/java/de/florianmichael/viafabricplus/base/event/FinishViaLoadingBaseStartupCallback.java b/src/main/java/de/florianmichael/viafabricplus/base/event/FinishViaVersionStartupCallback.java similarity index 72% rename from src/main/java/de/florianmichael/viafabricplus/base/event/FinishViaLoadingBaseStartupCallback.java rename to src/main/java/de/florianmichael/viafabricplus/base/event/FinishViaVersionStartupCallback.java index 533fa7dc..426afa4b 100644 --- a/src/main/java/de/florianmichael/viafabricplus/base/event/FinishViaLoadingBaseStartupCallback.java +++ b/src/main/java/de/florianmichael/viafabricplus/base/event/FinishViaVersionStartupCallback.java @@ -20,13 +20,13 @@ package de.florianmichael.viafabricplus.base.event; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.EventFactory; -public interface FinishViaLoadingBaseStartupCallback { +public interface FinishViaVersionStartupCallback { - Event EVENT = EventFactory.createArrayBacked(FinishViaLoadingBaseStartupCallback.class, listeners -> () -> { - for (FinishViaLoadingBaseStartupCallback listener : listeners) { - listener.onFinishViaLoadingBaseStartup(); + Event EVENT = EventFactory.createArrayBacked(FinishViaVersionStartupCallback.class, listeners -> () -> { + for (FinishViaVersionStartupCallback listener : listeners) { + listener.onFinishViaVersionStartup(); } }); - void onFinishViaLoadingBaseStartup(); + void onFinishViaVersionStartup(); } diff --git a/src/main/java/de/florianmichael/viafabricplus/base/event/ViaLoadingBaseBuilderCallback.java b/src/main/java/de/florianmichael/viafabricplus/base/event/ViaLoadingBaseBuilderCallback.java deleted file mode 100644 index 2ea0f3df..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/base/event/ViaLoadingBaseBuilderCallback.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.base.event; - -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import net.fabricmc.fabric.api.event.Event; -import net.fabricmc.fabric.api.event.EventFactory; - -public interface ViaLoadingBaseBuilderCallback { - - Event EVENT = EventFactory.createArrayBacked(ViaLoadingBaseBuilderCallback.class, listeners -> builder -> { - for (ViaLoadingBaseBuilderCallback listener : listeners) { - listener.onBuildViaLoadingBase(builder); - } - }); - - void onBuildViaLoadingBase(final ViaLoadingBase.ViaLoadingBaseBuilder builder); -} diff --git a/src/main/java/de/florianmichael/viafabricplus/base/settings/SettingsSystem.java b/src/main/java/de/florianmichael/viafabricplus/base/settings/SettingsSystem.java index de0c1560..6ddc37cb 100644 --- a/src/main/java/de/florianmichael/viafabricplus/base/settings/SettingsSystem.java +++ b/src/main/java/de/florianmichael/viafabricplus/base/settings/SettingsSystem.java @@ -23,8 +23,8 @@ import de.florianmichael.viafabricplus.base.settings.base.AbstractSetting; import de.florianmichael.viafabricplus.base.settings.base.SettingGroup; import de.florianmichael.viafabricplus.base.settings.groups.*; import de.florianmichael.viafabricplus.base.FileSaver; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; +import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; +import net.raphimc.vialoader.util.VersionEnum; import java.util.ArrayList; import java.util.Collections; @@ -54,7 +54,7 @@ public class SettingsSystem extends FileSaver { @Override public void write(JsonObject object) { - object.addProperty("protocol", ViaLoadingBase.getInstance().getTargetVersion().getVersion()); + object.addProperty("protocol", ProtocolHack.getTargetVersion().getVersion()); for (SettingGroup group : groups) { for (AbstractSetting setting : group.getSettings()) { setting.write(object); @@ -65,9 +65,9 @@ public class SettingsSystem extends FileSaver { @Override public void read(JsonObject object) { if (object.has("protocol")) { - final ComparableProtocolVersion protocolVersion = ViaLoadingBase.fromProtocolId(object.get("protocol").getAsInt()); + final VersionEnum protocolVersion = VersionEnum.fromProtocolId(object.get("protocol").getAsInt()); - if (protocolVersion != null) ViaLoadingBase.getInstance().reload(protocolVersion); + if (protocolVersion != null) ProtocolHack.setTargetVersion(protocolVersion); } for (SettingGroup group : groups) { for (AbstractSetting setting : group.getSettings()) { diff --git a/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/DebugSettings.java b/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/DebugSettings.java index c6dc78e0..177972ac 100644 --- a/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/DebugSettings.java +++ b/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/DebugSettings.java @@ -17,40 +17,43 @@ */ package de.florianmichael.viafabricplus.base.settings.groups; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.settings.base.SettingGroup; import de.florianmichael.viafabricplus.base.settings.type_impl.ProtocolSyncBooleanSetting; -import de.florianmichael.vialoadingbase.model.ProtocolRange; import net.minecraft.text.Text; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; public class DebugSettings extends SettingGroup { public final static DebugSettings INSTANCE = new DebugSettings(); // 1.19 -> 1.18.2 - public final ProtocolSyncBooleanSetting disableSequencing = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.sequence"), ProtocolRange.andOlder(ProtocolVersion.v1_18_2)); + public final ProtocolSyncBooleanSetting disableSequencing = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.sequence"), VersionRange.andOlder(VersionEnum.r1_18_2)); // 1.14 -> 1.13.2 - public final ProtocolSyncBooleanSetting smoothOutMerchantScreens = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.merchant"), ProtocolRange.andOlder(ProtocolVersion.v1_13_2)); + public final ProtocolSyncBooleanSetting smoothOutMerchantScreens = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.merchant"), VersionRange.andOlder(VersionEnum.r1_13_2)); // 1.13 -> 1.12.2 - public final ProtocolSyncBooleanSetting executeInputsInSync = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.postfix"), ProtocolRange.andOlder(ProtocolVersion.v1_12_2)); - public final ProtocolSyncBooleanSetting sneakInstant = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.sneakinstant"), new ProtocolRange(ProtocolVersion.v1_12_2, ProtocolVersion.v1_8)); + public final ProtocolSyncBooleanSetting executeInputsInSync = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.postfix"), VersionRange.andOlder(VersionEnum.r1_12_2)); + public final ProtocolSyncBooleanSetting sneakInstant = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.sneakinstant"), new VersionRange(VersionEnum.r1_12_2, VersionEnum.r1_8)); // 1.12 -> 1.11.1-1.11.2 - public final ProtocolSyncBooleanSetting sendOpenInventoryPacket = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.inventory"), ProtocolRange.andOlder(ProtocolVersion.v1_11_1)); + public final ProtocolSyncBooleanSetting sendOpenInventoryPacket = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.inventory"), VersionRange.andOlder(VersionEnum.r1_11_1to1_11_2)); // 1.9 -> 1.8.x - public final ProtocolSyncBooleanSetting removeCooldowns = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.cooldown"), ProtocolRange.andOlder(ProtocolVersion.v1_8)); - public final ProtocolSyncBooleanSetting sendIdlePacket = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.idle"), new ProtocolRange(ProtocolVersion.v1_8, LegacyProtocolVersion.r1_3_1tor1_3_2)); - public final ProtocolSyncBooleanSetting replaceAttributeModifiers = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.attribute"), ProtocolRange.andOlder(ProtocolVersion.v1_8)); + public final ProtocolSyncBooleanSetting removeCooldowns = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.cooldown"), VersionRange.andOlder(VersionEnum.r1_8)); + public final ProtocolSyncBooleanSetting sendIdlePacket = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.idle"), new VersionRange(VersionEnum.r1_8, VersionEnum.r1_3_1tor1_3_2)); + public final ProtocolSyncBooleanSetting replaceAttributeModifiers = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.attribute"), VersionRange.andOlder(VersionEnum.r1_8)); // 1.8.x -> 1.7.6 - public final ProtocolSyncBooleanSetting replaceSneaking = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.replacesneak"), ProtocolRange.andOlder(ProtocolVersion.v1_7_6)); - public final ProtocolSyncBooleanSetting longSneaking = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.longsneak"), ProtocolRange.andOlder(ProtocolVersion.v1_7_6)); + public final ProtocolSyncBooleanSetting replaceSneaking = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.replacesneak"), VersionRange.andOlder(VersionEnum.r1_7_6tor1_7_10)); + public final ProtocolSyncBooleanSetting longSneaking = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.longsneak"), VersionRange.andOlder(VersionEnum.r1_7_6tor1_7_10)); // r1_5tor1_5_1 -> r1_4_6tor1_4_7 - public final ProtocolSyncBooleanSetting legacyMiningSpeeds = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.legacypseeds"), ProtocolRange.andOlder(LegacyProtocolVersion.r1_4_6tor1_4_7)); + public final ProtocolSyncBooleanSetting legacyMiningSpeeds = new ProtocolSyncBooleanSetting(this, Text.translatable("debug.viafabricplus.legacypseeds"), VersionRange.andOlder(VersionEnum.r1_4_6tor1_4_7)); public DebugSettings() { super("Debug"); diff --git a/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/VisualSettings.java b/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/VisualSettings.java index 8980ffa9..6aa15fd2 100644 --- a/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/VisualSettings.java +++ b/src/main/java/de/florianmichael/viafabricplus/base/settings/groups/VisualSettings.java @@ -17,42 +17,44 @@ */ package de.florianmichael.viafabricplus.base.settings.groups; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.settings.base.SettingGroup; import de.florianmichael.viafabricplus.base.settings.type_impl.ProtocolSyncBooleanSetting; -import de.florianmichael.vialoadingbase.model.ProtocolRange; import net.minecraft.text.Text; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.util.VersionRange; public class VisualSettings extends SettingGroup { public final static VisualSettings INSTANCE = new VisualSettings(); // 1.19.2 -> 1.19 - public final ProtocolSyncBooleanSetting disableSecureChatWarning = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.secure"), ProtocolRange.andOlder(ProtocolVersion.v1_19)); + public final ProtocolSyncBooleanSetting disableSecureChatWarning = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.secure"), VersionRange.andOlder(VersionEnum.r1_19)); // 1.19 -> 1.18.2 - public final ProtocolSyncBooleanSetting hideSignatureIndicator = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.indicator"), ProtocolRange.andOlder(ProtocolVersion.v1_18_2)); + public final ProtocolSyncBooleanSetting hideSignatureIndicator = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.indicator"), VersionRange.andOlder(VersionEnum.r1_18_2)); // 1.16 -> 1.15.2 - public final ProtocolSyncBooleanSetting removeNewerFeaturesFromJigsawScreen = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.jigsaw"), ProtocolRange.andOlder(ProtocolVersion.v1_15_2)); + public final ProtocolSyncBooleanSetting removeNewerFeaturesFromJigsawScreen = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.jigsaw"), VersionRange.andOlder(VersionEnum.r1_15_2)); // 1.13 -> 1.12.2 - public final ProtocolSyncBooleanSetting replacePetrifiedOakSlab = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.stoneslab"), new ProtocolRange(ProtocolVersion.v1_12_2, LegacyProtocolVersion.r1_3_1tor1_3_2)); + public final ProtocolSyncBooleanSetting replacePetrifiedOakSlab = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.stoneslab"), new VersionRange(VersionEnum.r1_12_2, VersionEnum.r1_3_1tor1_3_2)); // 1.9 -> 1.8.x - public final ProtocolSyncBooleanSetting emulateArmorHud = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.armor"), ProtocolRange.andOlder(ProtocolVersion.v1_8)); - public final ProtocolSyncBooleanSetting removeNewerFeaturesFromCommandBlockScreen = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.command"), ProtocolRange.andOlder(ProtocolVersion.v1_8)); + public final ProtocolSyncBooleanSetting emulateArmorHud = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.armor"), VersionRange.andOlder(VersionEnum.r1_8)); + public final ProtocolSyncBooleanSetting removeNewerFeaturesFromCommandBlockScreen = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.command"), VersionRange.andOlder(VersionEnum.r1_8)); // r1_0_0tor1_0_1 -> b1_8tob1_8_1 - public final ProtocolSyncBooleanSetting replaceHurtSoundWithOOFSound = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.oof"), ProtocolRange.andOlder(LegacyProtocolVersion.b1_8tob1_8_1)); + public final ProtocolSyncBooleanSetting replaceHurtSoundWithOOFSound = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.oof"), VersionRange.andOlder(VersionEnum.b1_8tob1_8_1)); // b1_8tob1_8_1 -> b1_7tob1_7_3 - public final ProtocolSyncBooleanSetting removeNewerHudElements = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.betahud"), ProtocolRange.andOlder(LegacyProtocolVersion.b1_7tob1_7_3)); + public final ProtocolSyncBooleanSetting removeNewerHudElements = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.betahud"), VersionRange.andOlder(VersionEnum.b1_7tob1_7_3)); // a1_0_15 -> c0_28toc0_30 - public final ProtocolSyncBooleanSetting replaceCreativeInventory = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.classic"), ProtocolRange.andOlder(LegacyProtocolVersion.c0_28toc0_30)); - public final ProtocolSyncBooleanSetting oldWalkingAnimation = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.walkanimation"), ProtocolRange.andOlder(LegacyProtocolVersion.c0_28toc0_30)); - public final ProtocolSyncBooleanSetting fixSodiumChunkRendering = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.sodium"), ProtocolRange.andOlder(LegacyProtocolVersion.c0_28toc0_30)); + public final ProtocolSyncBooleanSetting replaceCreativeInventory = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.classic"), VersionRange.andOlder(VersionEnum.c0_28toc0_30)); + public final ProtocolSyncBooleanSetting oldWalkingAnimation = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.walkanimation"), VersionRange.andOlder(VersionEnum.c0_28toc0_30)); + public final ProtocolSyncBooleanSetting fixSodiumChunkRendering = new ProtocolSyncBooleanSetting(this, Text.translatable("visual.viafabricplus.sodium"), VersionRange.andOlder(VersionEnum.c0_28toc0_30)); public VisualSettings() { super("Visual"); diff --git a/src/main/java/de/florianmichael/viafabricplus/base/settings/type_impl/ProtocolSyncBooleanSetting.java b/src/main/java/de/florianmichael/viafabricplus/base/settings/type_impl/ProtocolSyncBooleanSetting.java index 295a56aa..81806580 100644 --- a/src/main/java/de/florianmichael/viafabricplus/base/settings/type_impl/ProtocolSyncBooleanSetting.java +++ b/src/main/java/de/florianmichael/viafabricplus/base/settings/type_impl/ProtocolSyncBooleanSetting.java @@ -23,13 +23,13 @@ import de.florianmichael.viafabricplus.ui.screen.impl.settings.settingrenderer.P import de.florianmichael.viafabricplus.base.settings.base.SettingGroup; import de.florianmichael.viafabricplus.base.settings.groups.GeneralSettings; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.vialoadingbase.model.ProtocolRange; import net.minecraft.text.MutableText; +import net.raphimc.vialoader.util.VersionRange; public class ProtocolSyncBooleanSetting extends BooleanSetting { - private final ProtocolRange protocolRange; + private final VersionRange protocolRange; - public ProtocolSyncBooleanSetting(SettingGroup parent, MutableText name, ProtocolRange protocolRange) { + public ProtocolSyncBooleanSetting(SettingGroup parent, MutableText name, VersionRange protocolRange) { super(parent, name, true); this.protocolRange = protocolRange; @@ -59,7 +59,7 @@ public class ProtocolSyncBooleanSetting extends BooleanSetting { return super.getValue(); } - public ProtocolRange getProtocolRange() { + public VersionRange getProtocolRange() { return protocolRange; } } diff --git a/src/main/java/de/florianmichael/viafabricplus/definition/ChatLengthCalculation.java b/src/main/java/de/florianmichael/viafabricplus/definition/ChatLengthCalculation.java index 7d13435d..feaa9cdc 100644 --- a/src/main/java/de/florianmichael/viafabricplus/definition/ChatLengthCalculation.java +++ b/src/main/java/de/florianmichael/viafabricplus/definition/ChatLengthCalculation.java @@ -17,10 +17,12 @@ */ package de.florianmichael.viafabricplus.definition; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.event.ChangeProtocolVersionCallback; import de.florianmichael.viafabricplus.base.event.LoadClassicProtocolExtensionCallback; import net.minecraft.client.MinecraftClient; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.classic.protocolc0_28_30toc0_28_30cpe.data.ClassicProtocolExtension; @@ -34,10 +36,10 @@ public class ChatLengthCalculation { ChangeProtocolVersionCallback.EVENT.register(protocolVersion -> { INSTANCE.maxLength = 256; - if (protocolVersion.isOlderThanOrEqualTo(ProtocolVersion.v1_10)) { + if (protocolVersion.isOlderThanOrEqualTo(VersionEnum.r1_10)) { INSTANCE.maxLength = 100; - if (protocolVersion.isOlderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { + if (protocolVersion.isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) { INSTANCE.maxLength = 64 - MinecraftClient.getInstance().getSession().getUsername().length() - 2; } } diff --git a/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/ListExtensionsCommand.java b/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/ListExtensionsCommand.java index 2a347943..9d4cda0d 100644 --- a/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/ListExtensionsCommand.java +++ b/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/ListExtensionsCommand.java @@ -22,7 +22,7 @@ import com.viaversion.viaversion.api.connection.UserConnection; import de.florianmichael.viafabricplus.definition.c0_30.command.ClassicViaSubCommand; import de.florianmichael.viafabricplus.injection.access.IExtensionProtocolMetadataStorage; import net.minecraft.util.Formatting; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.protocols.classic.protocolc0_28_30toc0_28_30cpe.storage.ExtensionProtocolMetadataStorage; public class ListExtensionsCommand extends ClassicViaSubCommand { @@ -33,14 +33,14 @@ public class ListExtensionsCommand extends ClassicViaSubCommand { @Override public String description() { - return "Shows all classic extensions (only for " + LegacyProtocolVersion.c0_30cpe.getName() + ")"; + return "Shows all classic extensions (only for " + VersionEnum.c0_30cpe.getName() + ")"; } @Override public boolean execute(ViaCommandSender sender, String[] args) { final UserConnection connection = getUser(); if (!connection.has(ExtensionProtocolMetadataStorage.class)) { - sendMessage(sender, Formatting.RED + "Only for " + LegacyProtocolVersion.c0_30cpe.getName()); + sendMessage(sender, Formatting.RED + "Only for " + VersionEnum.c0_30cpe.getName()); return true; } ((IExtensionProtocolMetadataStorage) connection.get(ExtensionProtocolMetadataStorage.class)).getServerExtensions().forEach((extension, version) -> { diff --git a/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/SetTimeCommand.java b/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/SetTimeCommand.java index 0c299a85..063fcedb 100644 --- a/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/SetTimeCommand.java +++ b/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/SetTimeCommand.java @@ -21,6 +21,7 @@ import com.viaversion.viaversion.api.command.ViaCommandSender; import com.viaversion.viaversion.api.connection.UserConnection; import de.florianmichael.viafabricplus.definition.c0_30.command.ClassicViaSubCommand; import net.minecraft.util.Formatting; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.alpha.protocola1_0_17_1_0_17_4toa1_0_16_2.storage.TimeLockStorage; @@ -32,7 +33,7 @@ public class SetTimeCommand extends ClassicViaSubCommand { @Override public String description() { - return "Changes the time (Only for <= " + LegacyProtocolVersion.a1_0_16toa1_0_16_2.getName() + ")"; + return "Changes the time (Only for <= " + VersionEnum.a1_0_16toa1_0_16_2.getName() + ")"; } @Override @@ -44,7 +45,7 @@ public class SetTimeCommand extends ClassicViaSubCommand { public boolean execute(ViaCommandSender sender, String[] args) { final UserConnection connection = getUser(); if (!connection.has(TimeLockStorage.class)) { - sendMessage(sender, Formatting.RED + "Only for <= " + LegacyProtocolVersion.a1_0_16toa1_0_16_2.getName()); + sendMessage(sender, Formatting.RED + "Only for <= " + VersionEnum.a1_0_16toa1_0_16_2.getName()); return true; } try { diff --git a/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/protocol/ClassicWorldHeightInjection.java b/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/protocol/ClassicWorldHeightInjection.java index fe44c9af..2890eeb6 100644 --- a/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/protocol/ClassicWorldHeightInjection.java +++ b/src/main/java/de/florianmichael/viafabricplus/definition/c0_30/protocol/ClassicWorldHeightInjection.java @@ -30,6 +30,7 @@ import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag; import com.viaversion.viaversion.protocols.protocol1_17to1_16_4.types.Chunk1_17Type; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.model.ClassicLevel; import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicWorldHeightProvider; @@ -46,7 +47,7 @@ public class ClassicWorldHeightInjection { parentHandler.handle(wrapper); if (wrapper.isCancelled()) return; - if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { + if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) { for (Tag dimension : wrapper.get(Type.NBT, 0).get("minecraft:dimension_type").get("value")) { changeDimensionTagHeight(wrapper.user(), ((CompoundTag) dimension).get("element")); } @@ -60,7 +61,7 @@ public class ClassicWorldHeightInjection { parentHandler.handle(wrapper); if (wrapper.isCancelled()) return; - if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { + if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) { changeDimensionTagHeight(wrapper.user(), wrapper.get(Type.NBT, 0)); } }; @@ -71,7 +72,7 @@ public class ClassicWorldHeightInjection { parentHandler.handle(wrapper); if (wrapper.isCancelled()) return; - if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { + if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) { wrapper.resetReader(); final Chunk chunk = wrapper.read(new Chunk1_17Type(16)); wrapper.write(new Chunk1_17Type(chunk.getSections().length), chunk); @@ -161,7 +162,7 @@ public class ClassicWorldHeightInjection { }; return wrapper -> { - if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { + if (ProtocolHack.getTargetVersion(wrapper.user().getChannel()).isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) { classicLightHandler.handle(wrapper); } else { parentHandler.handle(wrapper); diff --git a/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java b/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java index 2883b79c..b7c9c9f1 100644 --- a/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java +++ b/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java @@ -18,18 +18,18 @@ package de.florianmichael.viafabricplus.definition.v1_12_2; import com.mojang.blaze3d.systems.RenderSystem; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.event.ChangeProtocolVersionCallback; import de.florianmichael.viafabricplus.injection.access.IFontStorage; import de.florianmichael.viafabricplus.base.settings.groups.ExperimentalSettings; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.Glyph; import net.minecraft.client.font.GlyphRenderer; import net.minecraft.client.font.RenderableGlyph; import net.minecraft.client.texture.NativeImage; +import net.raphimc.vialoader.util.VersionEnum; import java.util.function.Function; import java.util.function.Supplier; @@ -37,7 +37,7 @@ import java.util.function.Supplier; public class FontCacheFix { public final static boolean DASH_LOADER = FabricLoader.getInstance().isModLoaded("dashloader"); - private static ComparableProtocolVersion protocolVersion; + private static VersionEnum protocolVersion; public static void init() { if (DASH_LOADER) return; @@ -50,9 +50,9 @@ public class FontCacheFix { } public static boolean shouldReplaceFontRenderer() { - if (ViaLoadingBase.getInstance() == null || DASH_LOADER || protocolVersion == null) return false; + if (DASH_LOADER || protocolVersion == null) return false; - return ExperimentalSettings.INSTANCE.fixFontCache.getValue() && protocolVersion.isOlderThanOrEqualTo(ProtocolVersion.v1_12_2); + return ExperimentalSettings.INSTANCE.fixFontCache.getValue() && protocolVersion.isOlderThanOrEqualTo(VersionEnum.r1_12_2); } public enum BuiltinEmptyGlyph1_12_2 implements Glyph { diff --git a/src/main/java/de/florianmichael/viafabricplus/definition/v1_14_4/LegacyServerAddress.java b/src/main/java/de/florianmichael/viafabricplus/definition/v1_14_4/LegacyServerAddress.java index d18d6569..f829c389 100644 --- a/src/main/java/de/florianmichael/viafabricplus/definition/v1_14_4/LegacyServerAddress.java +++ b/src/main/java/de/florianmichael/viafabricplus/definition/v1_14_4/LegacyServerAddress.java @@ -17,22 +17,19 @@ */ package de.florianmichael.viafabricplus.definition.v1_14_4; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; -import de.florianmichael.vialoadingbase.model.ProtocolRange; +import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.network.AllowedAddressResolver; import net.minecraft.client.network.ServerAddress; -import net.raphimc.viabedrock.api.BedrockProtocolVersion; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; public class LegacyServerAddress { - private final static ProtocolRange SRV_RANGE = new ProtocolRange(ProtocolVersion.v1_16_4, LegacyProtocolVersion.r1_3_1tor1_3_2); + private final static VersionRange SRV_RANGE = new VersionRange(VersionEnum.r1_16_4tor1_16_5, VersionEnum.r1_3_1tor1_3_2); - public static ServerAddress parse(ComparableProtocolVersion version, String address) { - if (version == null) version = ViaLoadingBase.getInstance().getTargetVersion(); + public static ServerAddress parse(VersionEnum version, String address) { + if (version == null) version = ProtocolHack.getTargetVersion(); final ServerAddress mc = ServerAddress.parse(address); - if (SRV_RANGE.contains(version) || version.isEqualTo(BedrockProtocolVersion.bedrockLatest)) { + if (SRV_RANGE.contains(version) || version == VersionEnum.bedrockLatest) { if (!mc.equals(ServerAddress.INVALID)) { return AllowedAddressResolver.DEFAULT.redirectResolver.lookupRedirect(mc).orElse(mc); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/access/IServerInfo.java b/src/main/java/de/florianmichael/viafabricplus/injection/access/IServerInfo.java index f7324e50..1e67177d 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/access/IServerInfo.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/access/IServerInfo.java @@ -17,10 +17,10 @@ */ package de.florianmichael.viafabricplus.injection.access; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; public interface IServerInfo { - ComparableProtocolVersion viafabricplus_forcedVersion(); - void viafabricplus_forceVersion(ComparableProtocolVersion version); + VersionEnum viafabricplus_forcedVersion(); + void viafabricplus_forceVersion(VersionEnum version); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinAddServerScreen.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinAddServerScreen.java index af4b6c39..96b6a4ce 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinAddServerScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinAddServerScreen.java @@ -19,12 +19,12 @@ package de.florianmichael.viafabricplus.injection.mixin.base; import de.florianmichael.viafabricplus.injection.access.IServerInfo; import de.florianmichael.viafabricplus.ui.screen.impl.base.ForceVersionScreen; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.client.gui.screen.AddServerScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.network.ServerInfo; import net.minecraft.text.Text; +import net.raphimc.vialoader.util.VersionEnum; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -43,7 +43,7 @@ public class MixinAddServerScreen extends Screen { @Inject(method = "init", at = @At("RETURN")) public void injectButton(CallbackInfo ci) { - final ComparableProtocolVersion forcedVersion = ((IServerInfo) server).viafabricplus_forcedVersion(); + final VersionEnum forcedVersion = ((IServerInfo) server).viafabricplus_forcedVersion(); this.addDrawableChild(ButtonWidget.builder(Text.literal(forcedVersion == null ? "Set version for this server" : forcedVersion.getName()), button -> client.setScreen(new ForceVersionScreen(this, version -> ((IServerInfo) server).viafabricplus_forceVersion(version)))). position(width - (forcedVersion == null ? 150 : 98) - 5, 5).size(forcedVersion == null ? 150 : 98, 20).build()); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientConnection.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientConnection.java index dabbaee9..b45ffd63 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientConnection.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientConnection.java @@ -21,10 +21,8 @@ import de.florianmichael.viafabricplus.base.event.ChangeProtocolVersionCallback; import de.florianmichael.viafabricplus.base.event.DisconnectConnectionCallback; import de.florianmichael.viafabricplus.injection.access.IClientConnection; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.viafabricplus.protocolhack.netty.ViaFabricPlusVLBPipeline; +import de.florianmichael.viafabricplus.protocolhack.netty.ViaFabricPlusVLLegacyPipeline; import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.RakNetClientConnection; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.netty.event.CompressionReorderEvent; import io.netty.channel.*; import net.minecraft.network.ClientConnection; import net.minecraft.network.encryption.PacketDecryptor; @@ -32,9 +30,10 @@ import net.minecraft.network.encryption.PacketEncryptor; import net.minecraft.network.packet.Packet; import net.minecraft.text.Text; import net.minecraft.util.Lazy; -import net.raphimc.viabedrock.api.BedrockProtocolVersion; import net.raphimc.viabedrock.netty.*; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.netty.VLLegacyPipeline; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.netty.CompressionReorderEvent; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -70,12 +69,12 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler< @Inject(method = "setCompressionThreshold", at = @At("RETURN")) private void reorderCompression(int compressionThreshold, boolean rejectBad, CallbackInfo ci) { - channel.pipeline().fireUserEventTriggered(new CompressionReorderEvent()); + channel.pipeline().fireUserEventTriggered(CompressionReorderEvent.INSTANCE); } @Inject(method = "setupEncryption", at = @At("HEAD"), cancellable = true) private void storeEncryptionCiphers(Cipher decryptionCipher, Cipher encryptionCipher, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion(channel).isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) { + if (ProtocolHack.getTargetVersion(channel).isOlderThanOrEqualTo(VersionEnum.r1_6_4)) { ci.cancel(); this.viafabricplus_decryptionCipher = decryptionCipher; this.viafabricplus_setupPreNettyEncryption(encryptionCipher); @@ -86,7 +85,8 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler< private static void captureAddress(InetSocketAddress address, boolean useEpoll, CallbackInfoReturnable cir, final ClientConnection clientConnection, Class class_, Lazy lazy) { ((IClientConnection) clientConnection).viafabricplus_captureAddress(address); - if (ProtocolHack.getForcedVersions().containsKey(address) ? (ProtocolHack.getForcedVersions().get(address).getVersion() == BedrockProtocolVersion.bedrockLatest.getVersion()) : ProtocolHack.getTargetVersion().isEqualTo(BedrockProtocolVersion.bedrockLatest)) { + if (ProtocolHack.getForcedVersions().containsKey(address) ? (ProtocolHack.getForcedVersions().get(address).getVersion() == VersionEnum.bedrockLatest.getVersion()) : + ProtocolHack.getTargetVersion() == VersionEnum.bedrockLatest) { RakNetClientConnection.connectRakNet(clientConnection, address, lazy, class_); cir.setReturnValue(clientConnection); } @@ -104,20 +104,20 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler< @Inject(method = "disconnect", at = @At("RETURN")) public void resetStorages(Text disconnectReason, CallbackInfo ci) { - ChangeProtocolVersionCallback.EVENT.invoker().onChangeProtocolVersion(ViaLoadingBase.getInstance().getTargetVersion()); + ChangeProtocolVersionCallback.EVENT.invoker().onChangeProtocolVersion(ProtocolHack.getTargetVersion()); DisconnectConnectionCallback.EVENT.invoker().onDisconnect(); } @Unique public void viafabricplus_setupPreNettyEncryption(final Cipher encryptionCipher) { this.encrypted = true; - this.channel.pipeline().addBefore(ViaFabricPlusVLBPipeline.VIA_LEGACY_PRE_NETTY_LENGTH_REMOVER_HANDLER_NAME, "encrypt", new PacketEncryptor(encryptionCipher)); + this.channel.pipeline().addBefore(VLLegacyPipeline.VIALEGACY_PRE_NETTY_LENGTH_REMOVER_NAME, "encrypt", new PacketEncryptor(encryptionCipher)); } @Override public void viafabricplus_setupPreNettyDecryption() { this.encrypted = true; - this.channel.pipeline().addBefore(ViaFabricPlusVLBPipeline.VIA_LEGACY_PRE_NETTY_LENGTH_PREPENDER_HANDLER_NAME, "decrypt", new PacketDecryptor(this.viafabricplus_decryptionCipher)); + this.channel.pipeline().addBefore(VLLegacyPipeline.VIALEGACY_PRE_NETTY_LENGTH_PREPENDER_NAME, "decrypt", new PacketDecryptor(this.viafabricplus_decryptionCipher)); } @Override @@ -135,7 +135,7 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler< if (this.viafabricplus_compressionEnabled) throw new IllegalStateException("Compression is already enabled"); this.viafabricplus_compressionEnabled = true; - this.channel.pipeline().addBefore(ViaFabricPlusVLBPipeline.VIA_BEDROCK_BATCH_LENGTH_HANDLER_NAME, ViaFabricPlusVLBPipeline.VIA_BEDROCK_COMPRESSION_HANDLER_NAME, new ZLibCompression()); + this.channel.pipeline().addBefore("splitter", ViaFabricPlusVLLegacyPipeline.VIABEDROCK_COMPRESSION_HANDLER_NAME, new ZLibCompression()); } @Override @@ -143,7 +143,7 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler< if (this.viafabricplus_compressionEnabled) throw new IllegalStateException("Compression is already enabled"); this.viafabricplus_compressionEnabled = true; - this.channel.pipeline().addBefore(ViaFabricPlusVLBPipeline.VIA_BEDROCK_BATCH_LENGTH_HANDLER_NAME, ViaFabricPlusVLBPipeline.VIA_BEDROCK_COMPRESSION_HANDLER_NAME, new SnappyCompression()); + this.channel.pipeline().addBefore("splitter", ViaFabricPlusVLLegacyPipeline.VIABEDROCK_COMPRESSION_HANDLER_NAME, new SnappyCompression()); } @Override @@ -151,6 +151,6 @@ public abstract class MixinClientConnection extends SimpleChannelInboundHandler< if (this.encrypted) throw new IllegalStateException("Encryption is already enabled"); this.encrypted = true; - this.channel.pipeline().addAfter(ViaFabricPlusVLBPipeline.VIA_BEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, ViaFabricPlusVLBPipeline.VIA_BEDROCK_ENCRYPTION_HANDLER_NAME, new AesEncryption(secretKey)); + this.channel.pipeline().addAfter(ViaFabricPlusVLLegacyPipeline.VIABEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, ViaFabricPlusVLLegacyPipeline.VIABEDROCK_ENCRYPTION_HANDLER_NAME, new AesEncryption(secretKey)); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientLoginNetworkHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientLoginNetworkHandler.java index fe12a0ad..32abaf64 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientLoginNetworkHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinClientLoginNetworkHandler.java @@ -22,6 +22,7 @@ import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.network.ClientLoginNetworkHandler; import net.minecraft.network.ClientConnection; import net.minecraft.text.Text; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.storage.ProtocolMetadataStorage; import org.spongepowered.asm.mixin.Final; @@ -39,7 +40,7 @@ public class MixinClientLoginNetworkHandler { @Inject(method = "joinServerSession", at = @At("HEAD"), cancellable = true) public void dontVerifySessionIfCracked(String serverId, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion(connection.channel).isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) { + if (ProtocolHack.getTargetVersion(connection.channel).isOlderThanOrEqualTo(VersionEnum.r1_6_4)) { if (!connection.channel.attr(ProtocolHack.LOCAL_VIA_CONNECTION).get().get(ProtocolMetadataStorage.class).authenticate) { cir.setReturnValue(null); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java index 6c6b53dc..d921e73c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java @@ -20,8 +20,8 @@ package de.florianmichael.viafabricplus.injection.mixin.base; import de.florianmichael.viafabricplus.base.event.ChangeProtocolVersionCallback; import de.florianmichael.viafabricplus.injection.access.IServerInfo; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.client.network.ServerInfo; +import net.raphimc.vialoader.util.VersionEnum; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -43,7 +43,7 @@ public class MixinConnectScreen_1 { final InetSocketAddress address = instance.get(); if (field_40415 == null) return address; - final ComparableProtocolVersion forcedVersion = ((IServerInfo) field_40415).viafabricplus_forcedVersion(); + final VersionEnum forcedVersion = ((IServerInfo) field_40415).viafabricplus_forcedVersion(); if (forcedVersion != null) { ProtocolHack.getForcedVersions().put(address, forcedVersion); ChangeProtocolVersionCallback.EVENT.invoker().onChangeProtocolVersion(forcedVersion); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinDebugHud.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinDebugHud.java index c73a34ef..7331f77b 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinDebugHud.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinDebugHud.java @@ -48,7 +48,7 @@ public class MixinDebugHud { information.add(Formatting.GOLD + "[ViaFabricPlus] " + Formatting.WHITE); for (AbstractInformationGroup group : ViaFabricPlus.INSTANCE.getInformationSystem().getGroups()) { - if (group.getProtocolRange() != null && !group.getProtocolRange().contains(ProtocolHack.getTargetVersion())) continue; + if (group.getVersionRange() != null && !group.getVersionRange().contains(ProtocolHack.getTargetVersion())) continue; final List groupInformation = new ArrayList<>(); try { @@ -56,7 +56,7 @@ public class MixinDebugHud { } catch (Exception ignored) {} if (groupInformation.isEmpty()) continue; - information.add(group.getProtocolRange() == null ? "General" : group.getProtocolRange().toString()); + information.add(group.getVersionRange() == null ? "General" : group.getVersionRange().toString()); information.addAll(groupInformation); information.add(""); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinMultiplayerServerListPinger.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinMultiplayerServerListPinger.java index 93f9377b..aa0ea078 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinMultiplayerServerListPinger.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinMultiplayerServerListPinger.java @@ -20,11 +20,10 @@ package de.florianmichael.viafabricplus.injection.mixin.base; import de.florianmichael.viafabricplus.injection.access.IServerInfo; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.RakNetClientConnection; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.client.network.MultiplayerServerListPinger; import net.minecraft.client.network.ServerAddress; import net.minecraft.client.network.ServerInfo; -import net.raphimc.viabedrock.api.BedrockProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -39,12 +38,12 @@ public class MixinMultiplayerServerListPinger { @Inject(method = "add", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;connect(Ljava/net/InetSocketAddress;Z)Lnet/minecraft/network/ClientConnection;"), locals = LocalCapture.CAPTURE_FAILHARD) public void trackSessions(ServerInfo entry, Runnable saver, CallbackInfo ci, ServerAddress serverAddress, Optional optional, InetSocketAddress inetSocketAddress) { - final ComparableProtocolVersion version = ((IServerInfo) entry).viafabricplus_forcedVersion(); + final VersionEnum version = ((IServerInfo) entry).viafabricplus_forcedVersion(); if (version != null) { ProtocolHack.getForcedVersions().put(inetSocketAddress, version); } - if (ProtocolHack.getTargetVersion(inetSocketAddress).isEqualTo(BedrockProtocolVersion.bedrockLatest)) { + if (ProtocolHack.getTargetVersion(inetSocketAddress) == VersionEnum.bedrockLatest) { RakNetClientConnection.getRakNetPingSessions().add(inetSocketAddress); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinServerInfo.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinServerInfo.java index ab8c13aa..ac457756 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinServerInfo.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinServerInfo.java @@ -18,10 +18,9 @@ package de.florianmichael.viafabricplus.injection.mixin.base; import de.florianmichael.viafabricplus.injection.access.IServerInfo; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.client.network.ServerInfo; import net.minecraft.nbt.NbtCompound; +import net.raphimc.vialoader.util.VersionEnum; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @@ -37,15 +36,15 @@ public class MixinServerInfo implements IServerInfo { @Shadow public String name; @Unique - private ComparableProtocolVersion viafabricplus_forcedVersion = null; + private VersionEnum viafabricplus_forcedVersion = null; @Override - public ComparableProtocolVersion viafabricplus_forcedVersion() { + public VersionEnum viafabricplus_forcedVersion() { return viafabricplus_forcedVersion; } @Override - public void viafabricplus_forceVersion(ComparableProtocolVersion version) { + public void viafabricplus_forceVersion(VersionEnum version) { viafabricplus_forcedVersion = version; } @@ -60,7 +59,7 @@ public class MixinServerInfo implements IServerInfo { private static void loadForcedVersion(NbtCompound root, CallbackInfoReturnable cir, ServerInfo serverInfo) { if (root.contains("viafabricplus_forcedversion")) { try { - ((IServerInfo) serverInfo).viafabricplus_forceVersion(ViaLoadingBase.fromProtocolId(root.getInt("viafabricplus_forcedversion"))); + ((IServerInfo) serverInfo).viafabricplus_forceVersion(VersionEnum.fromProtocolId(root.getInt("viafabricplus_forcedversion"))); } catch (Exception ignored) { // Version doesn't exist anymore } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java index af1c0297..9c0b8537 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java @@ -19,6 +19,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft; import com.llamalad7.mixinextras.injector.WrapWithCondition; import com.mojang.authlib.GameProfile; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.ViaFabricPlus; import de.florianmichael.viafabricplus.base.settings.groups.VisualSettings; @@ -74,14 +75,14 @@ public abstract class MixinClientPlayNetworkHandler { @Inject(method = "", at = @At("RETURN")) public void fixPlayerListOrdering(MinecraftClient client, Screen screen, ClientConnection connection, ServerInfo serverInfo, GameProfile profile, WorldSession worldSession, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { this.listedPlayerListEntries = new LinkedHashSet<>(); } } @Inject(method = "onPing", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetworkThreadUtils;forceMainThread(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;Lnet/minecraft/util/thread/ThreadExecutor;)V", shift = At.Shift.AFTER), cancellable = true) private void onPing(PlayPingS2CPacket packet, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(ProtocolVersion.v1_17)) { + if (ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_17)) { return; } @@ -98,14 +99,14 @@ public abstract class MixinClientPlayNetworkHandler { @Inject(method = "onChunkLoadDistance", at = @At("RETURN")) public void emulateSimulationDistance(ChunkLoadDistanceS2CPacket packet, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_17_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_17_1)) { this.onSimulationDistance(new SimulationDistanceS2CPacket(packet.getDistance())); } } @Inject(method = { "onGameJoin", "onPlayerRespawn" }, at = @At("TAIL")) private void injectOnOnGameJoinOrRespawn(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { ClientPlayerEntity player = MinecraftClient.getInstance().player; assert player != null; onEntityStatus(new EntityStatusS2CPacket(player, (byte) 28)); @@ -114,12 +115,12 @@ public abstract class MixinClientPlayNetworkHandler { @WrapWithCondition(method = "onPlayerSpawnPosition", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen;setReady()V")) public boolean moveDownloadingTerrainClosing(DownloadingTerrainScreen instance) { - return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(ProtocolVersion.v1_19); + return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_19); } @Inject(method = "onPlayerPositionLook", at = @At("RETURN")) public void closeDownloadingTerrain(PlayerPositionLookS2CPacket packet, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_18_2) && MinecraftClient.getInstance().currentScreen instanceof DownloadingTerrainScreen) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_18_2) && MinecraftClient.getInstance().currentScreen instanceof DownloadingTerrainScreen) { MinecraftClient.getInstance().setScreen(null); } } @@ -127,7 +128,7 @@ public abstract class MixinClientPlayNetworkHandler { @SuppressWarnings("InvalidInjectorMethodSignature") @ModifyConstant(method = "onEntityPassengersSet", constant = @Constant(classValue = BoatEntity.class)) public Class dontChangePlayerYaw(Object entity, Class constant) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_18_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_18_2)) { return Integer.class; } return constant; @@ -135,12 +136,12 @@ public abstract class MixinClientPlayNetworkHandler { @WrapWithCondition(method = "onPlayerList", at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V", remap = false)) public boolean removeWarning(Logger instance, String s, Object o) { - return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(ProtocolVersion.v1_19_3); + return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_19_3); } @Redirect(method = "onKeepAlive", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;Ljava/util/function/BooleanSupplier;Ljava/time/Duration;)V")) public void forceSendKeepAlive(ClientPlayNetworkHandler instance, Packet packet, BooleanSupplier sendCondition, Duration expirationTime) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_3)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) { sendPacket(packet); return; } @@ -154,7 +155,7 @@ public abstract class MixinClientPlayNetworkHandler { @Inject(method = "onSetTradeOffers", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetworkThreadUtils;forceMainThread(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;Lnet/minecraft/util/thread/ThreadExecutor;)V", shift = At.Shift.AFTER), cancellable = true) public void checkLoginPacket(SetTradeOffersS2CPacket packet, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion(connection.channel).isOlderThanOrEqualTo(ProtocolVersion.v1_13_2) && this.client.player == null) { + if (ProtocolHack.getTargetVersion(connection.channel).isOlderThanOrEqualTo(VersionEnum.r1_13_2) && this.client.player == null) { ViaFabricPlus.LOGGER.error("Server tried to send Play packet in Login process, dropping \"SetTradeOffers\""); ci.cancel(); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayerInteractionManager.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayerInteractionManager.java index 816448dd..e67adb00 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayerInteractionManager.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayerInteractionManager.java @@ -21,6 +21,7 @@ import com.llamalad7.mixinextras.injector.WrapWithCondition; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.ServerboundPackets1_16_2; @@ -76,7 +77,7 @@ public abstract class MixinClientPlayerInteractionManager { @Inject(method = "attackEntity", at = @At("HEAD")) private void injectAttackEntity(PlayerEntity player, Entity target, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && player instanceof IClientPlayerEntity) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8) && player instanceof IClientPlayerEntity) { player.swingHand(Hand.MAIN_HAND); ((IClientPlayerEntity) player).viafabricplus_cancelSwingOnce(); } @@ -96,7 +97,7 @@ public abstract class MixinClientPlayerInteractionManager { if (type == SlotActionType.QUICK_CRAFT) return true; // quick move always uses empty stack for verification since 1.12 - if (type == SlotActionType.QUICK_MOVE && ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_11_1)) return true; + if (type == SlotActionType.QUICK_MOVE && ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_11_1to1_11_2)) return true; // pickup with slot -999 (outside window) to throw items always uses empty stack for verification return type == SlotActionType.PICKUP && slot == -999; @@ -104,7 +105,7 @@ public abstract class MixinClientPlayerInteractionManager { @WrapWithCondition(method = "clickSlot", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V")) private boolean modifySlotClickPacket(ClientPlayNetworkHandler instance, Packet packet) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4) && packet instanceof ClickSlotC2SPacket clickSlot) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5) && packet instanceof ClickSlotC2SPacket clickSlot) { ItemStack slotItemBeforeModification; if (this.viafabricplus_shouldEmpty(clickSlot.getActionType(), clickSlot.getSlot())) @@ -120,7 +121,7 @@ public abstract class MixinClientPlayerInteractionManager { final byte button = (byte) clickSlot.getButton(); final short lastActionId = ((IScreenHandler) client.player.currentScreenHandler).viafabricplus_getAndIncrementLastActionId(); final int actionType = clickSlot.getActionType().ordinal(); - final Item item = ItemTranslator.minecraftToViaVersion(viaConnection, slotItemBeforeModification, ProtocolVersion.v1_16.getVersion()); + final Item item = ItemTranslator.minecraftToViaVersion(viaConnection, slotItemBeforeModification, VersionEnum.r1_16.getVersion()); viaConnection.getChannel().eventLoop().submit(() -> { final PacketWrapper clickSlotPacket = PacketWrapper.create(ServerboundPackets1_16_2.CLICK_WINDOW, viaConnection); @@ -149,7 +150,7 @@ public abstract class MixinClientPlayerInteractionManager { slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;syncSelectedSlot()V"), to = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;sendSequencedPacket(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/network/SequencedPacketCreator;)V", ordinal = 0))) private boolean redirectInteractItem(ClientPlayNetworkHandler instance, Packet packet) { - return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(ProtocolVersion.v1_17); + return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_17); } @Inject(method = "interactItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V", ordinal = 0, shift = At.Shift.BEFORE)) @@ -167,7 +168,7 @@ public abstract class MixinClientPlayerInteractionManager { @Inject(method = "interactBlock", at = @At("HEAD"), cancellable = true) public void cacheActionResult(ClientPlayerEntity player, Hand hand, BlockHitResult hitResult, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { this.viafabricplus_actionResult = this.interactBlockInternal(player, hand, hitResult); if (this.viafabricplus_actionResult == ActionResult.FAIL) { @@ -178,7 +179,7 @@ public abstract class MixinClientPlayerInteractionManager { @Redirect(method = "method_41933", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;interactBlockInternal(Lnet/minecraft/client/network/ClientPlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/util/hit/BlockHitResult;)Lnet/minecraft/util/ActionResult;")) public ActionResult provideCachedResult(ClientPlayerInteractionManager instance, ClientPlayerEntity player, Hand hand, BlockHitResult hitResult) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { return this.viafabricplus_actionResult; } return interactBlockInternal(player, hand, hitResult); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinItemRenderer.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinItemRenderer.java index ec7c23e9..736372b5 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinItemRenderer.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinItemRenderer.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.base.settings.groups.VisualSettings; @@ -53,7 +54,7 @@ public class MixinItemRenderer { @Redirect(method = "renderGuiItemOverlay(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/item/ItemStack;IILjava/lang/String;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/font/TextRenderer;draw(Ljava/lang/String;FFIZLorg/joml/Matrix4f;Lnet/minecraft/client/render/VertexConsumerProvider;Lnet/minecraft/client/font/TextRenderer$TextLayerType;II)I")) public int recolor(TextRenderer instance, String text, float x, float y, int color, boolean shadow, Matrix4f matrix, VertexConsumerProvider vertexConsumers, TextRenderer.TextLayerType layerType, int backgroundColor, int light) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_10) && text.startsWith("-")) color = -43213; + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_10) && text.startsWith("-")) color = -43213; return instance.draw(text, x, y, color, shadow, matrix, vertexConsumers, layerType, backgroundColor, light); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java index fce63549..a80f7137 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java @@ -26,6 +26,7 @@ import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ServerboundPac import de.florianmichael.viafabricplus.injection.access.IMinecraftClient; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.base.settings.groups.DebugSettings; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; @@ -61,14 +62,14 @@ public abstract class MixinMinecraftClient implements IMinecraftClient { slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;interactItem(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;")), at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;resetEquipProgress(Lnet/minecraft/util/Hand;)V", ordinal = 0)) public boolean removeEquipProgressReset(HeldItemRenderer instance, Hand hand) { - return ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_8) || !(player.getStackInHand(hand).getItem() instanceof SwordItem); + return ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_8) || !(player.getStackInHand(hand).getItem() instanceof SwordItem); } @Redirect(method = "doItemUse", slice = @Slice(to = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;interactEntity(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/Entity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;")), at = @At(value = "INVOKE", target = "Lnet/minecraft/util/ActionResult;isAccepted()Z", ordinal = 0)) private boolean preventGenericInteract(ActionResult instance) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_7_6)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) { return false; } @@ -77,7 +78,7 @@ public abstract class MixinMinecraftClient implements IMinecraftClient { @Redirect(method = "tick", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;attackCooldown:I", ordinal = 1)) public int unwrapOperation(MinecraftClient instance) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return 0; } return attackCooldown; @@ -85,7 +86,7 @@ public abstract class MixinMinecraftClient implements IMinecraftClient { @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;handleInputEvents()V", shift = At.Shift.BEFORE)) public void updateCooldown(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { if (this.attackCooldown > 0) { --this.attackCooldown; } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinPlayerEntityRenderer.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinPlayerEntityRenderer.java index cf0b6b3b..ae9e0b47 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinPlayerEntityRenderer.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinPlayerEntityRenderer.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.network.AbstractClientPlayerEntity; @@ -34,7 +35,7 @@ public class MixinPlayerEntityRenderer { @Inject(method = "getPositionOffset*", at = @At("RETURN"), cancellable = true) private void injectGetPositionOffset(AbstractClientPlayerEntity player, float delta, CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { if (player.getSleepingDirection() != null) { ci.setReturnValue(ci.getReturnValue().subtract(player.getSleepingDirection().getOffsetX() * 0.4, 0, player.getSleepingDirection().getOffsetZ() * 0.4)); } @@ -44,6 +45,6 @@ public class MixinPlayerEntityRenderer { @Redirect(method = "getPositionOffset(Lnet/minecraft/client/network/AbstractClientPlayerEntity;F)Lnet/minecraft/util/math/Vec3d;", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;isInSneakingPose()Z")) private boolean redirectGetPositionOffset(AbstractClientPlayerEntity player) { - return (ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_11_1)) && player.isInSneakingPose(); + return (ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_11_1to1_11_2)) && player.isInSneakingPose(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinServerResourcePackProvider.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinServerResourcePackProvider.java index 1667a1df..4ed70dbe 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinServerResourcePackProvider.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinServerResourcePackProvider.java @@ -20,6 +20,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft; import com.google.common.hash.HashCode; import com.google.common.hash.Hashing; import com.google.common.io.Files; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.mappings.PackFormatsMappings; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; @@ -54,10 +55,10 @@ public class MixinServerResourcePackProvider { @Inject(method = "getDownloadHeaders", at = @At("TAIL"), cancellable = true) private static void removeHeaders(CallbackInfoReturnable> cir) { final LinkedHashMap modifiableMap = new LinkedHashMap<>(cir.getReturnValue()); - if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_14)) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_14)) { modifiableMap.remove("X-Minecraft-Version-ID"); } - if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_13)) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_13)) { modifiableMap.remove("X-Minecraft-Pack-Format"); modifiableMap.remove("User-Agent"); } @@ -73,10 +74,10 @@ public class MixinServerResourcePackProvider { @Redirect(method = "verifyFile", at = @At(value = "INVOKE", target = "Lcom/google/common/hash/HashCode;toString()Ljava/lang/String;", remap = false)) public String revertHashAlgorithm(HashCode instance) { try { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { //noinspection deprecation return Hashing.sha1().hashBytes(Files.toByteArray(viafabricplus_trackedFile)).toString(); - } else if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_18)) { + } else if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_18tor1_18_1)) { return DigestUtils.sha1Hex(new FileInputStream(viafabricplus_trackedFile)); } } catch (IOException ignored) { @@ -86,7 +87,7 @@ public class MixinServerResourcePackProvider { @Redirect(method = "verifyFile", at = @At(value = "INVOKE", target = "Ljava/lang/String;toLowerCase(Ljava/util/Locale;)Ljava/lang/String;")) public String disableIgnoreCase(String instance, Locale locale) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return instance; } return instance.toLowerCase(locale); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAbstractBlock_AbstractBlockState.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAbstractBlock_AbstractBlockState.java index 19664f66..8922367a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAbstractBlock_AbstractBlockState.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAbstractBlock_AbstractBlockState.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.AbstractBlock; @@ -41,25 +42,25 @@ public abstract class MixinAbstractBlock_AbstractBlockState { public void changeHardness(BlockView world, BlockPos pos, CallbackInfoReturnable cir) { final BlockState state = this.asBlockState(); - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { if (state.getBlock() instanceof InfestedBlock) { cir.setReturnValue(0.75F); } } - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) { if (state.getBlock() == Blocks.END_STONE_BRICKS || state.getBlock() == Blocks.END_STONE_BRICK_SLAB || state.getBlock() == Blocks.END_STONE_BRICK_STAIRS || state.getBlock() == Blocks.END_STONE_BRICK_WALL) { cir.setReturnValue(0.8F); } } - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { if (state.getBlock() == Blocks.PISTON || state.getBlock() == Blocks.STICKY_PISTON || state.getBlock() == Blocks.PISTON_HEAD) { cir.setReturnValue(0.5F); } } - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { if (state.getBlock() instanceof InfestedBlock) { cir.setReturnValue(0F); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAnvilBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAnvilBlock.java index 098f93e8..4f9adfbb 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAnvilBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinAnvilBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.AnvilBlock; @@ -51,7 +52,7 @@ public class MixinAnvilBlock { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(state.get(FACING).getAxis() == Direction.Axis.X ? viafabricplus_x_axis_shape_v1_12_2 : viafabricplus_z_axis_shape_v1_12_2); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBambooBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBambooBlock.java index 5ffd634c..a9090326 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBambooBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBambooBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.BambooBlock; @@ -33,7 +34,7 @@ public class MixinBambooBlock { @Inject(method = "isShapeFullCube", at = @At("HEAD"), cancellable = true) public void changeFullCube(BlockState state, BlockView world, BlockPos pos, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_17)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_17)) { cir.setReturnValue(true); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBedBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBedBlock.java index 3be0c73e..c108ef35 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBedBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBedBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.BedBlock; @@ -42,14 +43,14 @@ public class MixinBedBlock { @Inject(method = "bounceEntity", at = @At("HEAD"), cancellable = true) public void injectBounceEntity(Entity entity, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_11_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_11_1to1_11_2)) { ci.cancel(); } } @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { cir.setReturnValue(viafabricplus_bed_shape_v1_13_2); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBlock.java index f86b0df9..c363935c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -34,19 +35,19 @@ public class MixinBlock { private void modifyBlastResistance(CallbackInfoReturnable ci) { final Block block = ((Block) (Object) this); - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) { if (block == Blocks.END_STONE_BRICKS || block == Blocks.END_STONE_BRICK_SLAB || block == Blocks.END_STONE_BRICK_STAIRS || block == Blocks.END_STONE_BRICK_WALL) { ci.setReturnValue(0.8F); } } - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { if (block == Blocks.PISTON || block == Blocks.STICKY_PISTON || block == Blocks.PISTON_HEAD) { ci.setReturnValue(0.5F); } } - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { if (block instanceof InfestedBlock) { ci.setReturnValue(0.75F); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBrewingStandBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBrewingStandBlock.java index 78dc0bc2..83ecbfff 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBrewingStandBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinBrewingStandBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -44,7 +45,7 @@ public class MixinBrewingStandBlock { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(viafabricplus_base_shape_v1_12_2); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinCauldronBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinCauldronBlock.java index 77a26d59..2946b90b 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinCauldronBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinCauldronBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.*; @@ -48,7 +49,7 @@ public abstract class MixinCauldronBlock extends AbstractCauldronBlock { @Override public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { return viafabricplus_cauldron_shape_v1_12_2; } return super.getOutlineShape(state, world, pos, context); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinChestBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinChestBlock.java index 701e003a..9781d596 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinChestBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinChestBlock.java @@ -25,6 +25,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import org.spongepowered.asm.mixin.Mixin; @@ -39,7 +40,7 @@ public abstract class MixinChestBlock extends AbstractChestBlock cir) { if (MinecraftClient.getInstance() == null || MinecraftClient.getInstance().world == null) return; - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { cir.setReturnValue(viafabricplus_shape_v1_8_x); } - else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { cir.setReturnValue(viafabricplus_shape_v1_16_5); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinEndPortalFrameBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinEndPortalFrameBlock.java index 8528bdbe..0e51631f 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinEndPortalFrameBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinEndPortalFrameBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -44,7 +45,7 @@ public class MixinEndPortalFrameBlock { @Redirect(method = "getOutlineShape", at = @At(value = "FIELD", target = "Lnet/minecraft/block/EndPortalFrameBlock;FRAME_WITH_EYE_SHAPE:Lnet/minecraft/util/shape/VoxelShape;")) public VoxelShape redirectGetOutlineShape() { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { return VoxelShapes.union(FRAME_SHAPE, viafabricplus_eye_shape_v1_12_2); } return FRAME_WITH_EYE_SHAPE; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFarmlandBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFarmlandBlock.java index 4b8a3fd5..02526573 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFarmlandBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFarmlandBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -50,7 +51,7 @@ public class MixinFarmlandBlock extends Block { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_9_3)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_9_3tor1_9_4)) { cir.setReturnValue(viafabricplus_shape_v1_9_4); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFenceBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFenceBlock.java index c23cab58..a013dcbf 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFenceBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFenceBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.*; @@ -25,6 +26,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -41,7 +43,7 @@ public class MixinFenceBlock extends HorizontalConnectingBlock { @Inject(method = "onUse", at = @At("HEAD"), cancellable = true) private void injectOnUse(CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_10)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_10)) { ci.setReturnValue(ActionResult.SUCCESS); } } @@ -51,7 +53,7 @@ public class MixinFenceBlock extends HorizontalConnectingBlock { @Override public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.b1_8tob1_8_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.b1_8tob1_8_1)) { return viafabricplus_fence_shape_b1_8_1; } return super.getCollisionShape(state, world, pos, context); @@ -59,7 +61,7 @@ public class MixinFenceBlock extends HorizontalConnectingBlock { @Override public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.b1_8tob1_8_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.b1_8tob1_8_1)) { return VoxelShapes.fullCube(); } return super.getOutlineShape(state, world, pos, context); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFireBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFireBlock.java index 8eeed35b..41168fe6 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFireBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFireBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.BlockState; @@ -36,7 +37,7 @@ public class MixinFireBlock { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { cir.setReturnValue(VoxelShapes.empty()); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFlowerPotBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFlowerPotBlock.java index e12136b6..aebb5ce2 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFlowerPotBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinFlowerPotBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -39,7 +40,7 @@ public class MixinFlowerPotBlock { @Inject(method = "onUse", at = @At(value = "FIELD", target = "Lnet/minecraft/block/FlowerPotBlock;content:Lnet/minecraft/block/Block;", ordinal = 0), cancellable = true) private void injectOnUse(CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_10) && content != Blocks.AIR) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_10) && content != Blocks.AIR) { ci.setReturnValue(ActionResult.CONSUME); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinHopperBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinHopperBlock.java index 51db70a0..20447cb4 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinHopperBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinHopperBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -48,14 +49,14 @@ public class MixinHopperBlock { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(viafabricplus_hopper_shape_v1_12_2); } } @Inject(method = "getRaycastShape", at = @At("HEAD"), cancellable = true) public void injectGetRaycastShape(BlockState state, BlockView world, BlockPos pos, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(viafabricplus_inside_shape_v1_12_2); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLadderBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLadderBlock.java index 32d215dc..d68e4bb2 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLadderBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLadderBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -49,7 +50,7 @@ public class MixinLadderBlock { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) private void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { switch (state.get(LadderBlock.FACING)) { case NORTH -> ci.setReturnValue(viafabricplus_north_shape_v1_8_x); case SOUTH -> ci.setReturnValue(viafabricplus_south_shape_v1_8_x); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLightBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLightBlock.java index fee6892c..ede20af1 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLightBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLightBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.LightBlock; @@ -31,7 +32,7 @@ public class MixinLightBlock { // Not relevant for GamePlay @Redirect(method = "onUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isCreativeLevelTwoOp()Z")) public boolean removeIf(PlayerEntity instance) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { return true; } return instance.isCreativeLevelTwoOp(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLilyPadBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLilyPadBlock.java index ebde95a8..414af65c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLilyPadBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinLilyPadBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -40,7 +41,7 @@ public class MixinLilyPadBlock { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void changeBoundingBox(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { cir.setReturnValue(viafabricplus_shape_v1_8_x); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPaneBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPaneBlock.java index 49b67d3b..be38c236 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPaneBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPaneBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.*; @@ -36,7 +37,7 @@ public class MixinPaneBlock extends HorizontalConnectingBlock { @Override public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return viafabricplus_get1_8Shape(state); } return super.getOutlineShape(state, world, pos, context); @@ -44,7 +45,7 @@ public class MixinPaneBlock extends HorizontalConnectingBlock { @Override public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return viafabricplus_get1_8Shape(state); } return super.getCollisionShape(state, world, pos, context); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPistonHeadBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPistonHeadBlock.java index a0e11359..824c57c7 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPistonHeadBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinPistonHeadBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.*; @@ -40,14 +41,14 @@ public class MixinPistonHeadBlock extends FacingBlock { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(viafabricplus_getCoreShape_v1_8_x(state)); } } @Override public VoxelShape getCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return VoxelShapes.union(viafabricplus_getHeadShape_v1_8_x(state), viafabricplus_getCoreShape_v1_8_x(state)); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSnowBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSnowBlock.java index 0e9183bb..6cb82c37 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSnowBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSnowBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -56,7 +57,7 @@ public class MixinSnowBlock { @Inject(method = "getCollisionShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(viafabricplus_layers_to_shape_v1_12_2[state.get(LAYERS) - 1]); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSoulSandBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSoulSandBlock.java index bad8dccb..24d1cb88 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSoulSandBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSoulSandBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -43,7 +44,7 @@ public class MixinSoulSandBlock extends Block { public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { super.onEntityCollision(state, world, pos, entity); - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) { final Vec3d velocity = entity.getVelocity(); this.viafabricplus_forceValue = true; entity.setVelocity(velocity.getX() * this.getVelocityMultiplier(), velocity.getY(), velocity.getZ() * this.getVelocityMultiplier()); @@ -53,7 +54,7 @@ public class MixinSoulSandBlock extends Block { @Override public float getVelocityMultiplier() { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4) && !this.viafabricplus_forceValue) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4) && !this.viafabricplus_forceValue) { return 1.0F; } return super.getVelocityMultiplier(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSugarCaneBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSugarCaneBlock.java index 352205a8..f918ab93 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSugarCaneBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinSugarCaneBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -33,7 +34,7 @@ public class MixinSugarCaneBlock { @Redirect(method = "canPlaceAt", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isIn(Lnet/minecraft/registry/tag/TagKey;)Z")) public boolean changePlaceTarget(BlockState instance, TagKey tagKey) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_17)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_17)) { return instance.isOf(Blocks.GRASS_BLOCK) || instance.isOf(Blocks.DIRT) || instance.isOf(Blocks.COARSE_DIRT) || instance.isOf(Blocks.PODZOL); } return instance.isIn(tagKey); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinWallBlock.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinWallBlock.java index 919bbed0..6be1122a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinWallBlock.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/block/MixinWallBlock.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.block; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -150,21 +151,21 @@ public class MixinWallBlock extends Block { @Inject(method = "getPlacementState", at = @At("RETURN"), cancellable = true) public void injectGetPlacementState(ItemPlacementContext ctx, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { cir.setReturnValue(viafabricplus_oldWallPlacementLogic(cir.getReturnValue())); } } @Inject(method = "getStateForNeighborUpdate", at = @At("RETURN"), cancellable = true) public void injectGetStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { cir.setReturnValue(viafabricplus_oldWallPlacementLogic(cir.getReturnValue())); } } @Inject(method = "getCollisionShape", at = @At("HEAD"), cancellable = true) public void injectGetCollisionShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(viafabricplus_cip_shape_by_index_v1_12_2[viafabricplus_getShapeIndex_v1_12_2(state)]); } } @@ -176,7 +177,7 @@ public class MixinWallBlock extends Block { @Inject(method = "getOutlineShape", at = @At("HEAD"), cancellable = true) public void injectGetOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(viafabricplus_shape_by_index_v1_12_2[viafabricplus_getShapeIndex_v1_12_2(state)]); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAbstractDonkeyEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAbstractDonkeyEntity.java index 97753213..d58a3762 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAbstractDonkeyEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAbstractDonkeyEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Blocks; @@ -50,7 +51,7 @@ public abstract class MixinAbstractDonkeyEntity extends AbstractHorseEntity { @Inject(method = "interactMob", at = @At("HEAD"), cancellable = true) public void fixInteraction(PlayerEntity player, Hand hand, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { ItemStack lv = player.getStackInHand(hand); if (!this.isBaby()) { if (this.isTame() && player.shouldCancelInteraction()) { diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java index ac75cb87..b30269e0 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAllayEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.passive.AllayEntity; @@ -30,7 +31,7 @@ public class MixinAllayEntity { @Inject(method = "getHeightOffset", at = @At("HEAD"), cancellable = true) public void changeHeightOffset(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { cir.setReturnValue(0.0); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAnimalEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAnimalEntity.java index 334cce37..82ae4097 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAnimalEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinAnimalEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.passive.AnimalEntity; @@ -30,6 +31,6 @@ public class MixinAnimalEntity { @Redirect(method = "interactMob", at = @At(value = "FIELD", target = "Lnet/minecraft/world/World;isClient:Z")) public boolean redirectInteractMob(World instance) { - return instance.isClient && ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(ProtocolVersion.v1_15); + return instance.isClient && ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_15); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java index e01383cd..2687e7ed 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java @@ -18,6 +18,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; import com.mojang.authlib.GameProfile; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.settings.groups.DebugSettings; import de.florianmichael.viafabricplus.definition.v1_8.ArmorPointCalculation; @@ -69,7 +70,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Redirect(method = "sendMovementPackets", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;square(D)D")) public double changeMagnitude(double n) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_18_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_18_2)) { n = 9.0E-4D; } return MathHelper.square(n); @@ -78,7 +79,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Redirect(method = "sendMovementPackets", at = @At(value = "FIELD", target = "Lnet/minecraft/client/network/ClientPlayerEntity;ticksSinceLastPositionPacketSent:I", ordinal = 0)) public int revertLastPositionPacketSentIncrementor(ClientPlayerEntity instance) { // Mixin calls the redirector and sets the original field to the return value of the redirector + 1, therefore the -1 results, so we truncate the + 1 again and the field does not change - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return ticksSinceLastPositionPacketSent - 1; } return ticksSinceLastPositionPacketSent; @@ -86,7 +87,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Inject(method = "sendMovementPackets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;hasVehicle()Z")) public void incrementLastPositionPacketSentCounter(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { ++this.ticksSinceLastPositionPacketSent; } } @@ -101,7 +102,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Inject(method = "swingHand", at = @At("HEAD"), cancellable = true) public void injectSwingHand(Hand hand, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && viafabricplus_areSwingCanceledThisTick) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8) && viafabricplus_areSwingCanceledThisTick) { ci.cancel(); } @@ -114,7 +115,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity at = @At(value = "FIELD", target = "Lnet/minecraft/client/input/Input;sneaking:Z", ordinal = 0) ) private void injectTickMovement(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) { if (this.input.sneaking) { this.input.movementSideways = (float) ((double) this.input.movementSideways / 0.3D); this.input.movementForward = (float) ((double) this.input.movementForward / 0.3D); @@ -126,7 +127,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isWalking()Z")), at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSwimming()Z", ordinal = 0)) public boolean redirectIsSneakingWhileSwimming(ClientPlayerEntity _this) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_1)) { return false; } else { return _this.isSwimming(); @@ -135,7 +136,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Redirect(method = "isWalking", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSubmergedInWater()Z")) public boolean easierUnderwaterSprinting(ClientPlayerEntity instance) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_1)) { return false; } return instance.isSubmergedInWater(); @@ -143,7 +144,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Redirect(method = "tickMovement()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/input/Input;hasForwardMovement()Z", ordinal = 0)) private boolean disableSprintSneak(Input input) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_1)) { return input.movementForward >= 0.8F; } @@ -152,7 +153,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isTouchingWater()Z")) private boolean redirectTickMovement(ClientPlayerEntity self) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { return false; // Disable all water related movement } @@ -161,14 +162,14 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity @Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;sendSprintingPacket()V")) public void removeSprintingPacket(ClientPlayerEntity instance) { - if (ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(ProtocolVersion.v1_19_3)) { + if (ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_19_3)) { sendSprintingPacket(); } } @Redirect(method = "autoJump", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;inverseSqrt(F)F")) public float useFastInverse(float x) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_3)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) { final float var1 = 0.5F * x; int var2 = Float.floatToIntBits(x); var2 = 1597463007 - (var2 >> 1); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCowEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCowEntity.java index 40872519..1d7b185e 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCowEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCowEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.EntityType; @@ -40,7 +41,7 @@ public abstract class MixinCowEntity extends AnimalEntity { @Inject(method = "interactMob", at = @At("HEAD"), cancellable = true) public void injectInteractMob(PlayerEntity player, Hand hand, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2) && player.getAbilities().creativeMode) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2) && player.getAbilities().creativeMode) { cir.setReturnValue(super.interactMob(player, hand)); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCreeperEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCreeperEntity.java index e700bdac..4ce6549f 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCreeperEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinCreeperEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.mob.CreeperEntity; @@ -31,7 +32,7 @@ public class MixinCreeperEntity { @Redirect(method = "interactMob", at = @At(value = "FIELD", target = "Lnet/minecraft/sound/SoundEvents;ITEM_FIRECHARGE_USE:Lnet/minecraft/sound/SoundEvent;")) public SoundEvent fixSound() { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { return SoundEvents.ITEM_FLINTANDSTEEL_USE; } return SoundEvents.ITEM_FIRECHARGE_USE; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java index cc9a06aa..a2b816af 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import it.unimi.dsi.fastutil.objects.Object2DoubleMap; @@ -59,7 +60,7 @@ public abstract class MixinEntity { @ModifyConstant(method = "movementInputToVelocity", constant = @Constant(doubleValue = 1E-7)) private static double injectMovementInputToVelocity(double epsilon) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { return 1E-4; } return epsilon; @@ -67,21 +68,21 @@ public abstract class MixinEntity { @Inject(method = "getVelocityAffectingPos", at = @At("HEAD"), cancellable = true) public void injectGetVelocityAffectingPos(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) { cir.setReturnValue(BlockPos.ofFloored(pos.x, getBoundingBox().minY - 1, pos.z)); } } @Inject(method = "getRotationVector(FF)Lnet/minecraft/util/math/Vec3d;", at = @At("HEAD"), cancellable = true) public void onGetRotationVector(float pitch, float yaw, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(Vec3d.fromPolar(pitch, yaw)); } } @Inject(method = "setSwimming", at = @At("HEAD"), cancellable = true) private void onSetSwimming(boolean swimming, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2) && swimming) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2) && swimming) { ci.cancel(); } } @@ -89,7 +90,7 @@ public abstract class MixinEntity { @SuppressWarnings("deprecation") @Inject(method = "updateMovementInFluid", at = @At("HEAD"), cancellable = true) private void modifyFluidMovementBoundingBox(TagKey fluidTag, double d, CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_12_2)) { return; } @@ -139,19 +140,19 @@ public abstract class MixinEntity { @Inject(method = "getTargetingMargin", at = @At("HEAD"), cancellable = true) public void expandHitBox(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { cir.setReturnValue(0.1F); } } @Redirect(method = {"setYaw", "setPitch"}, at = @At(value = "INVOKE", target = "Ljava/lang/Float;isFinite(F)Z")) public boolean modifyIsFinite(float f) { - return Float.isFinite(f) || ((Object) this instanceof ClientPlayerEntity && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)); + return Float.isFinite(f) || ((Object) this instanceof ClientPlayerEntity && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)); } @ModifyConstant(method = "checkBlockCollision", constant = @Constant(doubleValue = 1.0E-7)) public double changeBlockCollisionConstant(double constant) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { return 0.001; } return constant; @@ -160,7 +161,7 @@ public abstract class MixinEntity { // Not relevant for GamePlay @Redirect(method = "move", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;onLanding()V")) public void revertOnLanding(Entity instance) { - if (ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(ProtocolVersion.v1_19)) { + if (ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_19)) { instance.onLanding(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityIndex.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityIndex.java index 8ce47b4f..5b040043 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityIndex.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityIndex.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; @@ -42,12 +43,12 @@ public class MixinEntityIndex { @Redirect(method = "add", at = @At(value = "INVOKE", target = "Ljava/util/Map;containsKey(Ljava/lang/Object;)Z", remap = false)) private boolean allowDuplicateUuid(Map instance, Object o) { - return instance.containsKey(o) && ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_16_4); + return instance.containsKey(o) && ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_16_4tor1_16_5); } @Inject(method = "size", at = @At("HEAD"), cancellable = true) private void returnRealSize(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { cir.setReturnValue(this.idToEntity.size()); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityPredicates.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityPredicates.java index b16f89fd..4f0b5632 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityPredicates.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinEntityPredicates.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.player.PlayerEntity; @@ -31,7 +32,7 @@ public class MixinEntityPredicates { @SuppressWarnings("target") @Redirect(method = "method_5915(Lnet/minecraft/entity/Entity;Lnet/minecraft/scoreboard/AbstractTeam;Lnet/minecraft/scoreboard/AbstractTeam$CollisionRule;Lnet/minecraft/entity/Entity;)Z", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isMainPlayer()Z")) private static boolean makeMainPlayerUnpushable(PlayerEntity player) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return false; } return player.isMainPlayer(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinItemEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinItemEntity.java index 96d5bdc8..1b65f0b8 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinItemEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinItemEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.ItemEntity; @@ -30,7 +31,7 @@ public class MixinItemEntity { @Inject(method = "applyWaterBuoyancy", at = @At("HEAD"), cancellable = true) public void injectApplyWaterBuoyancy(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { ci.cancel(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinLivingEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinLivingEntity.java index 7136330b..23f80b40 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinLivingEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinLivingEntity.java @@ -18,6 +18,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; import com.llamalad7.mixinextras.injector.WrapWithCondition; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.base.settings.groups.ExperimentalSettings; @@ -52,7 +53,7 @@ public abstract class MixinLivingEntity extends Entity { @Inject(method = "getPreferredEquipmentSlot", at = @At("HEAD"), cancellable = true) private static void removeShieldSlotPreference(ItemStack stack, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_9_3) && stack.isOf(Items.SHIELD)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_9_3tor1_9_4) && stack.isOf(Items.SHIELD)) { cir.setReturnValue(EquipmentSlot.MAINHAND); } } @@ -62,7 +63,7 @@ public abstract class MixinLivingEntity extends Entity { @Redirect(method = "applyMovementInput", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/LivingEntity;jumping:Z")) private boolean disableJumpOnLadder(LivingEntity self) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { return false; } @@ -73,7 +74,7 @@ public abstract class MixinLivingEntity extends Entity { slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/entity/effect/StatusEffects;DOLPHINS_GRACE:Lnet/minecraft/entity/effect/StatusEffect;")), at = @At(value = "FIELD", target = "Lnet/minecraft/entity/LivingEntity;horizontalCollision:Z", ordinal = 0)) private boolean disableClimbing(LivingEntity self) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { return false; } @@ -82,7 +83,7 @@ public abstract class MixinLivingEntity extends Entity { @ModifyVariable(method = "applyFluidMovingSpeed", ordinal = 0, at = @At("HEAD"), argsOnly = true) private boolean modifyMovingDown(boolean movingDown) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { return true; } @@ -93,12 +94,12 @@ public abstract class MixinLivingEntity extends Entity { slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/entity/effect/StatusEffects;LEVITATION:Lnet/minecraft/entity/effect/StatusEffect;", ordinal = 0)), at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;onLanding()V", ordinal = 0)) private boolean dontResetLevitationFallDistance(LivingEntity instance) { - return ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_12_2); + return ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_12_2); } @Redirect(method = "travel", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;isSprinting()Z", ordinal = 0)) private boolean modifySwimSprintSpeed(LivingEntity self) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { return false; } return self.isSprinting(); @@ -106,7 +107,7 @@ public abstract class MixinLivingEntity extends Entity { @Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;getFluidHeight(Lnet/minecraft/registry/tag/TagKey;)D")) private double redirectFluidHeight(LivingEntity instance, TagKey tagKey) { - if (ExperimentalSettings.INSTANCE.waterMovementEdgeDetection.getValue() && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2) && tagKey == FluidTags.WATER) { + if (ExperimentalSettings.INSTANCE.waterMovementEdgeDetection.getValue() && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2) && tagKey == FluidTags.WATER) { if (instance.getFluidHeight(tagKey) > 0) { return 1; } @@ -116,14 +117,14 @@ public abstract class MixinLivingEntity extends Entity { @Inject(method = "applyFluidMovingSpeed", at = @At("HEAD"), cancellable = true) private void modifySwimSprintFallSpeed(double gravity, boolean movingDown, Vec3d velocity, CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2) && !hasNoGravity()) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2) && !hasNoGravity()) { ci.setReturnValue(new Vec3d(velocity.x, velocity.y - 0.02, velocity.z)); } } @ModifyConstant(method = "tickMovement", constant = @Constant(doubleValue = 0.003D)) public double modifyVelocityZero(final double constant) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return 0.005D; } return constant; @@ -131,14 +132,14 @@ public abstract class MixinLivingEntity extends Entity { @Inject(method = "canEnterTrapdoor", at = @At("HEAD"), cancellable = true) private void onCanEnterTrapdoor(CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { ci.setReturnValue(false); } } @ModifyConstant(method = "travel", constant = @Constant(floatValue = 0.9F)) private float changeEntitySpeed(float constant) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { //noinspection ConstantConditions if ((Entity) this instanceof SkeletonHorseEntity) { return this.getBaseMovementSpeedMultiplier(); // 0.96F @@ -150,7 +151,7 @@ public abstract class MixinLivingEntity extends Entity { @Redirect(method = "travel", at = @At(value = "INVOKE", target = "Ljava/lang/Math;cos(D)D")) public double fixCosTable(double a) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_18_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_18_2)) { return MathHelper.cos((float) a); } return Math.cos(a); @@ -160,7 +161,7 @@ public abstract class MixinLivingEntity extends Entity { public double fixLavaMovement(LivingEntity instance, TagKey tagKey) { double height = instance.getFluidHeight(tagKey); - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { height += getSwimHeight() + 4; } return height; @@ -168,7 +169,7 @@ public abstract class MixinLivingEntity extends Entity { @ModifyConstant(method = "isBlocking", constant = @Constant(intValue = 5)) public int shieldBlockCounter(int constant) { - if(ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if(ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return 0; } return constant; @@ -176,7 +177,7 @@ public abstract class MixinLivingEntity extends Entity { @Redirect(method = "tickCramming", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;isClient()Z")) public boolean revertOnlyPlayerCramming(World instance) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { return false; } return instance.isClient(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinOtherClientPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinOtherClientPlayerEntity.java index 74351eea..942706de 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinOtherClientPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinOtherClientPlayerEntity.java @@ -18,6 +18,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; import com.mojang.authlib.GameProfile; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.network.AbstractClientPlayerEntity; @@ -37,7 +38,7 @@ public class MixinOtherClientPlayerEntity extends AbstractClientPlayerEntity { @Inject(method = "updatePose", at = @At("HEAD")) public void injectUpdatePose(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { super.updatePose(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPiglinEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPiglinEntity.java index 5dfa127f..ebfcecb7 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPiglinEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPiglinEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.EntityDimensions; @@ -35,7 +36,7 @@ public abstract class MixinPiglinEntity { @Inject(method = "getActiveEyeHeight", at = @At("HEAD"), cancellable = true) public void changeEyeHeight(EntityPose pose, EntityDimensions dimensions, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { cir.setReturnValue(this.isBaby() ? 0.93F : 1.74F); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java index 22037d4f..c094f186 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.settings.groups.VisualSettings; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; @@ -59,7 +60,7 @@ public abstract class MixinPlayerEntity extends LivingEntity { @Inject(method = "updatePose", at = @At("HEAD"), cancellable = true) private void onUpdatePose(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { EntityPose pose; if (isFallFlying()) @@ -83,9 +84,9 @@ public abstract class MixinPlayerEntity extends LivingEntity { @Inject(method = "getDimensions", at = @At("HEAD"), cancellable = true) private void onGetDimensions(EntityPose pose, CallbackInfoReturnable ci) { if (pose == EntityPose.CROUCHING) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { ci.setReturnValue(PlayerEntity.STANDING_DIMENSIONS); - } else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2) || ProtocolHack.getTargetVersion().isEqualTo(BedrockProtocolVersion.bedrockLatest)) { + } else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2) || ProtocolHack.getTargetVersion() == VersionEnum.bedrockLatest) { ci.setReturnValue(viafabricplus_sneaking_dimensions_v1_13_2); } } @@ -93,7 +94,7 @@ public abstract class MixinPlayerEntity extends LivingEntity { @Inject(method = "getAttackCooldownProgress", at = @At("HEAD"), cancellable = true) private void injectGetAttackCooldownProgress(CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { ci.setReturnValue(1f); } } @@ -107,7 +108,7 @@ public abstract class MixinPlayerEntity extends LivingEntity { @ModifyConstant(method = "getActiveEyeHeight", constant = @Constant(floatValue = 1.27f)) private float modifySneakEyeHeight(float prevEyeHeight) { - if (ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_13_2)) { return prevEyeHeight; } else { return 1.54f; @@ -124,7 +125,7 @@ public abstract class MixinPlayerEntity extends LivingEntity { @Redirect(method = "getOffGroundSpeed", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isSprinting()Z")) public boolean useOldField(PlayerEntity instance) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_3)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) { return viafabricplus_isSprinting; } return instance.isSprinting(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinSquidEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinSquidEntity.java index 692f2983..00dcc36e 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinSquidEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinSquidEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.passive.SquidEntity; @@ -31,7 +32,7 @@ public class MixinSquidEntity { @Inject(method = "canBeLeashedBy", at = @At("HEAD"), cancellable = true) public void injectCanBeLeashedBy(PlayerEntity player, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { cir.setReturnValue(false); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinVexEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinVexEntity.java index 5674566d..b61279d9 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinVexEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinVexEntity.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.EntityType; @@ -37,7 +38,7 @@ public class MixinVexEntity extends HostileEntity { @Inject(method = "getHeightOffset", at = @At("HEAD"), cancellable = true) public void changeHeightOffset(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { cir.setReturnValue(0.0); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinWolfEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinWolfEntity.java index 00e25c3f..d4c881a0 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinWolfEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinWolfEntity.java @@ -18,6 +18,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; import com.viaversion.viaversion.api.connection.UserConnection; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.definition.v1_14_4.Meta18Storage; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; @@ -35,7 +36,7 @@ public class MixinWolfEntity { @Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/WolfEntity;getHealth()F")) public float rewriteHealth(WolfEntity instance) { float health = instance.getHealth(); - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) { final UserConnection userConnection = MinecraftClient.getInstance().getNetworkHandler().getConnection().channel.attr(ProtocolHack.LOCAL_VIA_CONNECTION).get(); if (!userConnection.has(Meta18Storage.class)) userConnection.put(new Meta18Storage(userConnection)); return userConnection.get(Meta18Storage.class).getHealthDataMap().getOrDefault(instance.getId(), health); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboard.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboard.java index daa0e3cb..3745bca4 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboard.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboard.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.input; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.injection.access.IMinecraftClient; import de.florianmichael.viafabricplus.base.settings.groups.DebugSettings; @@ -43,7 +44,7 @@ public class MixinKeyboard { @Redirect(method = "processF3", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendCommand(Ljava/lang/String;)Z", ordinal = 0)) public boolean replaceSpectatorCommand(ClientPlayNetworkHandler instance, String command) { - if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { return false; } return instance.sendCommand(command); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboardInput.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboardInput.java index a682b76f..af7e1d2e 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboardInput.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/input/MixinKeyboardInput.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.input; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.MinecraftClient; @@ -31,9 +32,9 @@ public class MixinKeyboardInput extends Input { @ModifyVariable(method = "tick", at = @At(value = "LOAD", ordinal = 0), argsOnly = true) private boolean injectTick(boolean slowDown) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { return this.sneaking; - } else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_14_4)) { + } else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_14_4)) { return !MinecraftClient.getInstance().player.isSpectator() && (this.sneaking || slowDown); } return slowDown; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinArmorItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinArmorItem.java index 67b8fe0c..4765a272 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinArmorItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinArmorItem.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.EquipmentSlot; @@ -43,7 +44,7 @@ public class MixinArmorItem extends Item { @Inject(method = "use", at = @At("HEAD"), cancellable = true) public void implementLegacyAction(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable> cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_3)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) { ItemStack itemStack = user.getStackInHand(hand); EquipmentSlot equipmentSlot = MobEntity.getPreferredEquipmentSlot(itemStack); ItemStack itemStack2 = user.getEquippedStack(equipmentSlot); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinAxeItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinAxeItem.java index 57ea9037..2a072849 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinAxeItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinAxeItem.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.item.AxeItem; @@ -32,7 +33,7 @@ public class MixinAxeItem { @Inject(method = "useOnBlock", at = @At("HEAD"), cancellable = true) public void injectUseOnBlock(ItemUsageContext context, CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { cir.setReturnValue(ActionResult.PASS); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBlockItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBlockItem.java index 9ab5c94b..76cd1629 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBlockItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBlockItem.java @@ -23,6 +23,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -45,7 +46,7 @@ public class MixinBlockItem { @Inject(method = "canPlace", at = @At("HEAD"), cancellable = true) private void injectCanPlace(ItemPlacementContext context, BlockState state, CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { Block block = state.getBlock(); if (block == Blocks.CHEST || block == Blocks.TRAPPED_CHEST) { World world = context.getWorld(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinElytraItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinElytraItem.java index b6771b53..b8687d30 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinElytraItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinElytraItem.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.EquipmentSlot; @@ -43,7 +44,7 @@ public class MixinElytraItem extends Item { @Inject(method = "use", at = @At("HEAD"), cancellable = true) public void implementLegacyAction(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable> cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_3)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) { ItemStack itemStack = user.getStackInHand(hand); EquipmentSlot equipmentSlot = MobEntity.getPreferredEquipmentSlot(itemStack); ItemStack itemStack2 = user.getEquippedStack(equipmentSlot); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinEnderPearlItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinEnderPearlItem.java index 9446cfbc..38df1f7f 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinEnderPearlItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinEnderPearlItem.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.player.PlayerEntity; @@ -35,7 +36,7 @@ public class MixinEnderPearlItem { @Inject(method = "use", at = @At("HEAD"), cancellable = true) private void injectUse(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable> ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && user.getAbilities().creativeMode) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8) && user.getAbilities().creativeMode) { ci.setReturnValue(TypedActionResult.pass(user.getStackInHand(hand))); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinFireworkRocketItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinFireworkRocketItem.java index c24921fb..18ad121c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinFireworkRocketItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinFireworkRocketItem.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.player.PlayerEntity; @@ -30,7 +31,7 @@ public class MixinFireworkRocketItem { @Redirect(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;isFallFlying()Z", ordinal = 0)) private boolean disableFireworkElytraBoost(PlayerEntity player) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_11)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_11)) { return false; } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHeldItemRenderer.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHeldItemRenderer.java index 085d460f..37fa6141 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHeldItemRenderer.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHeldItemRenderer.java @@ -23,6 +23,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.MinecraftClient; @@ -53,7 +54,7 @@ public class MixinHeldItemRenderer { at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderItem(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformationMode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V")) private void onRenderFirstPersonItem(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack item, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) { //noinspection DataFlowIssue - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && client.player.isBlocking()) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8) && client.player.isBlocking()) { matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-102.25f)); matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(13.365f)); matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(78.05f)); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHoeItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHoeItem.java index f8cdfd97..6b14704a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHoeItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinHoeItem.java @@ -18,6 +18,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; import com.google.common.collect.ImmutableSet; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -60,7 +61,7 @@ public abstract class MixinHoeItem extends MiningToolItem { @Override public boolean isSuitableFor(BlockState state) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { return false; } @@ -69,10 +70,10 @@ public abstract class MixinHoeItem extends MiningToolItem { @Override public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { return 1.0F; } - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { return viafabricplus_EFFECTIVE_BLOCKS_1165.contains(state.getBlock()) ? this.miningSpeed : 1.0F; } return super.getMiningSpeedMultiplier(stack, state); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemGroups.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemGroups.java index 351f9d7d..c6c79214 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemGroups.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemGroups.java @@ -19,11 +19,11 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; import de.florianmichael.viafabricplus.base.settings.groups.GeneralSettings; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroups; import net.minecraft.registry.RegistryWrapper; import net.minecraft.resource.featuretoggle.FeatureSet; +import net.raphimc.vialoader.util.VersionEnum; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -41,7 +41,7 @@ public abstract class MixinItemGroups { protected static void updateEntries(ItemGroup.DisplayContext displayContext) { } @Unique - private static ComparableProtocolVersion viafabricplus_version; + private static VersionEnum viafabricplus_version; @Unique private static boolean viafabricplus_state; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemPlacementContext.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemPlacementContext.java index de3bf2f1..b8988034 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemPlacementContext.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemPlacementContext.java @@ -23,6 +23,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.player.PlayerEntity; @@ -42,9 +43,9 @@ public class MixinItemPlacementContext { final ItemPlacementContext self = (ItemPlacementContext) (Object) this; final PlayerEntity player = self.getPlayer(); - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2) && player != null) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2) && player != null) { final BlockPos placementPos = self.getBlockPos(); - final double blockPosCenterFactor = ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_10) ? 0.5 : 0; + final double blockPosCenterFactor = ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_10) ? 0.5 : 0; if (Math.abs(player.getX() - (placementPos.getX() + blockPosCenterFactor)) < 2 && Math.abs(player.getZ() - (placementPos.getZ() + blockPosCenterFactor)) < 2) { final double eyeY = player.getY() + player.getEyeHeight(player.getPose()); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemStack.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemStack.java index 7f841b12..171da4ae 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemStack.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemStack.java @@ -19,6 +19,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.settings.groups.DebugSettings; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; @@ -50,7 +51,7 @@ public abstract class MixinItemStack { @Inject(method = "updateEmptyState", at = @At("HEAD"), cancellable = true) public void allowNegativeItems(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_10)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_10)) { this.empty = false; final ItemStack self = (ItemStack) (Object) this; this.empty = self == EMPTY || this.getItem() == null || self.isOf(Items.AIR) || count == 0; @@ -60,7 +61,7 @@ public abstract class MixinItemStack { @Inject(method = "isEmpty", at = @At("HEAD"), cancellable = true) public void dontRecalculateState(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_10)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_10)) { cir.setReturnValue(this.empty); } } @@ -69,7 +70,7 @@ public abstract class MixinItemStack { private void modifyMiningSpeedMultiplier(BlockState state, CallbackInfoReturnable ci) { final Item toolItem = ((ItemStack) (Object) this).getItem(); - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2) && toolItem instanceof HoeItem) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2) && toolItem instanceof HoeItem) { ci.setReturnValue(1F); } } @@ -78,7 +79,7 @@ public abstract class MixinItemStack { slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/entity/attribute/EntityAttributes;GENERIC_ATTACK_DAMAGE:Lnet/minecraft/entity/attribute/EntityAttribute;", ordinal = 0)), at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;getAttributeBaseValue(Lnet/minecraft/entity/attribute/EntityAttribute;)D", ordinal = 0)) private double redirectGetTooltip(PlayerEntity player, EntityAttribute attribute) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return 0; } else { return player.getAttributeBaseValue(attribute); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinMiningToolItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinMiningToolItem.java index 4a02bef5..9fdc70a7 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinMiningToolItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinMiningToolItem.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.BlockState; @@ -34,7 +35,7 @@ public class MixinMiningToolItem { @Inject(method = "getMiningSpeedMultiplier", at = @At("RETURN"), cancellable = true) public void changeHoeEffectiveBlocks(ItemStack stack, BlockState state, CallbackInfoReturnable cir) { //noinspection ConstantValue - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2) && (Object) this instanceof HoeItem) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2) && (Object) this instanceof HoeItem) { cir.setReturnValue(1.0F); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinPickaxeItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinPickaxeItem.java index d657f300..2143b07f 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinPickaxeItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinPickaxeItem.java @@ -18,6 +18,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; import com.google.common.collect.ImmutableSet; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.block.Block; @@ -52,7 +53,7 @@ public abstract class MixinPickaxeItem extends MiningToolItem { @Override public boolean isSuitableFor(BlockState state) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { Block block = state.getBlock(); int i = this.getMaterial().getMiningLevel(); if (block == Blocks.OBSIDIAN) { @@ -70,9 +71,9 @@ public abstract class MixinPickaxeItem extends MiningToolItem { @Override public float getMiningSpeedMultiplier(ItemStack stack, BlockState state) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { return viafabricplus_EFFECTIVE_MATERIALS.contains(state.getMaterial()) || viafabricplus_EFFECTIVE_BLOCKS_1152.contains(state.getBlock()) ? this.miningSpeed : 1.0F; - } else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_16_4)) { + } else if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_16_4tor1_16_5)) { return viafabricplus_EFFECTIVE_MATERIALS.contains(state.getMaterial()) || viafabricplus_EFFECTIVE_BLOCKS_1165.contains(state.getBlock()) ? this.miningSpeed : 1.0F; } return super.getMiningSpeedMultiplier(stack, state); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinShovelItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinShovelItem.java index 12e3f3f1..c28ac768 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinShovelItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinShovelItem.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.item.ShovelItem; @@ -34,7 +35,7 @@ public class MixinShovelItem { at = @At(value = "INVOKE", target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;", ordinal = 0), slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/item/ShovelItem;PATH_STATES:Ljava/util/Map;"))) private Object redirectUseOnBlock(Map map, Object grassBlock) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return null; } else { return map.get(grassBlock); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinSwordItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinSwordItem.java index 09960970..87120419 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinSwordItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinSwordItem.java @@ -23,6 +23,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.player.PlayerEntity; @@ -45,7 +46,7 @@ public class MixinSwordItem extends ToolItem { @Override public TypedActionResult use(World world, PlayerEntity user, Hand hand) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { ItemStack itemStack = user.getStackInHand(hand); user.setCurrentHand(hand); return TypedActionResult.consume(itemStack); @@ -55,7 +56,7 @@ public class MixinSwordItem extends ToolItem { @Override public UseAction getUseAction(ItemStack stack) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return UseAction.BLOCK; } return super.getUseAction(stack); @@ -63,7 +64,7 @@ public class MixinSwordItem extends ToolItem { @Override public int getMaxUseTime(ItemStack stack) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) { return 72000; } return super.getMaxUseTime(stack); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinPacketByteBuf.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinPacketByteBuf.java index b037ce49..54216771 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinPacketByteBuf.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinPacketByteBuf.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.packet; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.network.PacketByteBuf; @@ -31,7 +32,7 @@ public class MixinPacketByteBuf { @Inject(method = "readText", at = @At(value = "INVOKE", target = "Lio/netty/handler/codec/DecoderException;(Ljava/lang/String;)V", shift = At.Shift.BEFORE, remap = false), cancellable = true) public void injectReadText(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_18)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_18tor1_18_1)) { cir.setReturnValue(null); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinUpdatePlayerAbilitiesC2SPacket.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinUpdatePlayerAbilitiesC2SPacket.java index 3c810017..5b4aa4bf 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinUpdatePlayerAbilitiesC2SPacket.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/packet/MixinUpdatePlayerAbilitiesC2SPacket.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.packet; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import io.netty.buffer.ByteBuf; @@ -33,7 +34,7 @@ public class MixinUpdatePlayerAbilitiesC2SPacket { @Redirect(method = "write", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/PacketByteBuf;writeByte(I)Lio/netty/buffer/ByteBuf;")) public ByteBuf implementFlags(PacketByteBuf instance, int value) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_15_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_15_2)) { final PlayerAbilities playerAbilities = MinecraftClient.getInstance().player.getAbilities(); if (playerAbilities.invulnerable) value |= 1; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java index 38b4812f..4aa9d88c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinConnectScreen_1.java @@ -19,6 +19,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.ProfileKey; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.ViaFabricPlus; import de.florianmichael.viafabricplus.definition.bedrock.BedrockAccountHandler; @@ -29,18 +30,16 @@ import de.florianmichael.viafabricplus.definition.v1_19_2.storage.ChatSession1_1 import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.protocolhack.provider.vialegacy.ViaFabricPlusClassicMPPassProvider; import de.florianmichael.viafabricplus.base.settings.groups.AuthenticationSettings; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ConnectScreen; import net.minecraft.client.network.ServerAddress; import net.minecraft.network.ClientConnection; -import net.minecraft.network.encryption.PlayerKeyPair; import net.minecraft.network.encryption.PlayerPublicKey; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.c2s.login.LoginHelloC2SPacket; import net.raphimc.mcauth.step.bedrock.StepMCChain; -import net.raphimc.viabedrock.api.BedrockProtocolVersion; import net.raphimc.viabedrock.protocol.storage.AuthChainData; +import net.raphimc.vialoader.util.VersionEnum; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -66,7 +65,7 @@ public class MixinConnectScreen_1 { @Redirect(method = "run", at = @At(value = "INVOKE", target = "Ljava/net/InetSocketAddress;getHostName()Ljava/lang/String;", ordinal = 0)) public String replaceAddress(InetSocketAddress instance) { - if (ProtocolHack.getTargetVersion(instance).isOlderThanOrEqualTo(ProtocolVersion.v1_17) || ProtocolHack.getTargetVersion(instance).isEqualTo(BedrockProtocolVersion.bedrockLatest)) { + if (ProtocolHack.getTargetVersion(instance).isOlderThanOrEqualTo(VersionEnum.r1_17) || ProtocolHack.getTargetVersion(instance) == VersionEnum.bedrockLatest) { return field_33737.getAddress(); } return instance.getHostName(); @@ -74,7 +73,7 @@ public class MixinConnectScreen_1 { @Redirect(method = "run", at = @At(value = "INVOKE", target = "Ljava/net/InetSocketAddress;getPort()I")) public int replacePort(InetSocketAddress instance) { - if (ProtocolHack.getTargetVersion(instance).isOlderThanOrEqualTo(ProtocolVersion.v1_17) || ProtocolHack.getTargetVersion(instance).isEqualTo(BedrockProtocolVersion.bedrockLatest)) { + if (ProtocolHack.getTargetVersion(instance).isOlderThanOrEqualTo(VersionEnum.r1_17) || ProtocolHack.getTargetVersion(instance) == VersionEnum.bedrockLatest) { return field_33737.getPort(); } return instance.getPort(); @@ -97,9 +96,9 @@ public class MixinConnectScreen_1 { final UserConnection userConnection = connection.channel.attr(ProtocolHack.LOCAL_VIA_CONNECTION).get(); if (userConnection == null) return; - final ComparableProtocolVersion targetVersion = ProtocolHack.getTargetVersion(connection.channel); + final VersionEnum targetVersion = ProtocolHack.getTargetVersion(connection.channel); - if (targetVersion.isEqualTo(BedrockProtocolVersion.bedrockLatest)) { + if (targetVersion == VersionEnum.bedrockLatest) { final StepMCChain.MCChain account = BedrockAccountHandler.INSTANCE.getAccount(); if (account != null) { @@ -109,16 +108,16 @@ public class MixinConnectScreen_1 { return; } - if (targetVersion.isOlderThan(ProtocolVersion.v1_19)) { + if (targetVersion.isOlderThan(VersionEnum.r1_19)) { return; // This disables the chat session emulation for all versions <= 1.18.2 } - if (targetVersion.isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (targetVersion.isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { MinecraftClient.getInstance().getProfileKeys().fetchKeyPair().thenAcceptAsync(optional -> optional.ifPresentOrElse(playerKeyPair -> { final PlayerPublicKey.PublicKeyData publicKeyData = playerKeyPair.publicKey().data(); userConnection.put(new ChatSession1_19_2(userConnection, new ProfileKey(publicKeyData.expiresAt().toEpochMilli(), publicKeyData.key().getEncoded(), publicKeyData.keySignature()), playerKeyPair.privateKey())); - if (targetVersion.isEqualTo(ProtocolVersion.v1_19)) { + if (targetVersion == VersionEnum.r1_19) { final var legacyKey = ((IPublicKeyData) (Object) publicKeyData).viafabricplus_getV1Key(); if (legacyKey != null) { userConnection.put(new ChatSession1_19_0(userConnection, new ProfileKey(publicKeyData.expiresAt().toEpochMilli(), publicKeyData.key().getEncoded(), legacyKey.array()), playerKeyPair.privateKey())); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinDownloadingTerrainScreen.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinDownloadingTerrainScreen.java index fb00370d..2f31fe45 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinDownloadingTerrainScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinDownloadingTerrainScreen.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.MinecraftClient; @@ -48,14 +49,14 @@ public class MixinDownloadingTerrainScreen extends Screen { @Inject(method = "tick", at = @At("HEAD"), cancellable = true) public void injectTick(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_1)) { viafabricplus_tickCounter++; if (viafabricplus_tickCounter % 20 == 0) { MinecraftClient.getInstance().getNetworkHandler().sendPacket(new KeepAliveC2SPacket(0)); } } - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_19_1)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2)) { final boolean isTimeOver = this.closeOnNextTick || System.currentTimeMillis() > this.loadStartTime + 2000L; if (isTimeOver && this.client != null && this.client.player != null) { diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java index a314187e..f430d475 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen.java @@ -17,9 +17,11 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.gui.screen.GameModeSelectionScreen; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.At; @@ -42,11 +44,11 @@ public class MixinGameModeSelectionScreen { @Inject(method = "", at = @At("RETURN")) public void fixUIWidth(CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { final List gameModeSelections = new ArrayList<>(Arrays.stream(GameModeSelectionScreen.GameModeSelection.values()).toList()); - if (ProtocolHack.getTargetVersion().isOlderThan(LegacyProtocolVersion.r1_3_1tor1_3_2)) gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.ADVENTURE); - if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_8)) gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.SPECTATOR); + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_3_1tor1_3_2)) gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.ADVENTURE); + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) gameModeSelections.remove(GameModeSelectionScreen.GameModeSelection.SPECTATOR); viafabricplus_unwrappedGameModes = gameModeSelections.toArray(GameModeSelectionScreen.GameModeSelection[]::new); UI_WIDTH = viafabricplus_unwrappedGameModes.length * 31 - 5; @@ -55,7 +57,7 @@ public class MixinGameModeSelectionScreen { @Redirect(method = "init", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection;VALUES:[Lnet/minecraft/client/gui/screen/GameModeSelectionScreen$GameModeSelection;")) public GameModeSelectionScreen.GameModeSelection[] removeNewerGameModes() { - if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { return viafabricplus_unwrappedGameModes; } return GameModeSelectionScreen.GameModeSelection.values(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java index 540ead67..0119a428 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinGameModeSelectionScreen_GameModeSelection.java @@ -17,10 +17,12 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.GameModeSelectionScreen; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -41,7 +43,7 @@ public class MixinGameModeSelectionScreen_GameModeSelection { @Inject(method = "getCommand", at = @At("HEAD"), cancellable = true) private void oldCommand(CallbackInfoReturnable cir) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(LegacyProtocolVersion.r1_2_4tor1_2_5)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_2_4tor1_2_5)) { cir.setReturnValue( "gamemode " + MinecraftClient.getInstance().getSession().getUsername() + ' ' + switch (((Enum)(Object)this).ordinal()) { case 0, 3 -> 1; @@ -54,11 +56,11 @@ public class MixinGameModeSelectionScreen_GameModeSelection { @Inject(method = "next", at = @At("HEAD"), cancellable = true) public void unwrapGameModes(CallbackInfoReturnable> cir) { - if (ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_8)) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_8)) { switch ((GameModeSelectionScreen.GameModeSelection)(Object)this) { case CREATIVE -> cir.setReturnValue(Optional.of(SURVIVAL)); case SURVIVAL -> { - if (ProtocolHack.getTargetVersion().isOlderThan(LegacyProtocolVersion.r1_2_4tor1_2_5)) { + if (ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_2_4tor1_2_5)) { cir.setReturnValue(Optional.of(CREATIVE)); } else { cir.setReturnValue(Optional.of(GameModeSelectionScreen.GameModeSelection.ADVENTURE)); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinStructureBlockScreen_1.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinStructureBlockScreen_1.java index ea9b4102..58a3cac6 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinStructureBlockScreen_1.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/MixinStructureBlockScreen_1.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.font.TextRenderer; @@ -36,7 +37,7 @@ public class MixinStructureBlockScreen_1 extends TextFieldWidget { @Inject(method = "charTyped(CI)Z", at = @At("HEAD"), cancellable = true) private void onCharTyped(char chr, int keyCode, CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_12_2)) { ci.setReturnValue(super.charTyped(chr, keyCode)); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/merchant/MixinMerchantScreenHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/merchant/MixinMerchantScreenHandler.java index de143725..f2d414f8 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/merchant/MixinMerchantScreenHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/merchant/MixinMerchantScreenHandler.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen.merchant; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.screen.MerchantScreenHandler; @@ -30,7 +31,7 @@ public class MixinMerchantScreenHandler { @Inject(method = "switchTo", at = @At("HEAD"), cancellable = true) private void injectSwitchTo(int recipeId, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2)) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_13_2)) { ci.cancel(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinBrewingStandScreenHandler_FuelSlot.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinBrewingStandScreenHandler_FuelSlot.java index cdeed428..2d8cb1d3 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinBrewingStandScreenHandler_FuelSlot.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinBrewingStandScreenHandler_FuelSlot.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen.screenhandler; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.inventory.Inventory; @@ -35,12 +36,12 @@ public class MixinBrewingStandScreenHandler_FuelSlot extends Slot { @Inject(method = "matches(Lnet/minecraft/item/ItemStack;)Z", at = @At("HEAD"), cancellable = true) private static void removeFuelSlot(CallbackInfoReturnable ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) ci.setReturnValue(false); } @Override public boolean isEnabled() { - return ProtocolHack.getTargetVersion().isNewerThan(ProtocolVersion.v1_8); + return ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_8); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinPlayerScreenHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinPlayerScreenHandler.java index a60d2094..cafbb5d4 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinPlayerScreenHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinPlayerScreenHandler.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen.screenhandler; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.entity.EquipmentSlot; @@ -42,7 +43,7 @@ public abstract class MixinPlayerScreenHandler extends AbstractRecipeScreenHandl slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/screen/PlayerScreenHandler$2;(Lnet/minecraft/screen/PlayerScreenHandler;Lnet/minecraft/inventory/Inventory;IIILnet/minecraft/entity/player/PlayerEntity;)V")), at = @At(value = "INVOKE", target = "Lnet/minecraft/screen/PlayerScreenHandler;addSlot(Lnet/minecraft/screen/slot/Slot;)Lnet/minecraft/screen/slot/Slot;", ordinal = 0)) private Slot redirectAddOffhandSlot(PlayerScreenHandler screenHandler, Slot slot) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8)) + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8)) return null; return addSlot(slot); } @@ -50,7 +51,7 @@ public abstract class MixinPlayerScreenHandler extends AbstractRecipeScreenHandl @SuppressWarnings("InvalidInjectorMethodSignature") @ModifyVariable(method = "quickMove", ordinal = 0, at = @At(value = "STORE", ordinal = 0)) private EquipmentSlot injectTransferSlot(EquipmentSlot slot) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && slot == EquipmentSlot.OFFHAND) + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8) && slot == EquipmentSlot.OFFHAND) return EquipmentSlot.MAINHAND; else return slot; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinScreenHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinScreenHandler.java index 9b4095c2..72de0590 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinScreenHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/screenhandler/MixinScreenHandler.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen.screenhandler; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.injection.access.IScreenHandler; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; @@ -37,7 +38,7 @@ public class MixinScreenHandler implements IScreenHandler { @Inject(method = "internalOnSlotClick", at = @At("HEAD"), cancellable = true) private void injectInternalOnSlotClick(int slot, int clickData, SlotActionType actionType, PlayerEntity player, CallbackInfo ci) { - if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && actionType == SlotActionType.SWAP && clickData == 40) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8) && actionType == SlotActionType.SWAP && clickData == 40) { ci.cancel(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialoadingbase/MixinVLBViaConfig.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialoadingbase/MixinVLBViaConfig.java deleted file mode 100644 index 42e5e09a..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/vialoadingbase/MixinVLBViaConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.injection.mixin.fixes.vialoadingbase; - -import com.viaversion.viaversion.configuration.AbstractViaConfig; -import de.florianmichael.viafabricplus.base.settings.groups.ExperimentalSettings; -import de.florianmichael.vialoadingbase.platform.viaversion.VLBViaConfig; -import org.spongepowered.asm.mixin.Mixin; - -import java.io.File; - -@Mixin(value = VLBViaConfig.class, remap = false) -public abstract class MixinVLBViaConfig extends AbstractViaConfig { - - protected MixinVLBViaConfig(File configFile) { - super(configFile); - } - - @Override - public boolean isLeftHandedHandling() { - return false; - } - - @Override - public boolean isShieldBlocking() { - return false; - } - - @Override - public boolean isChunkBorderFix() { - return ExperimentalSettings.INSTANCE.fixChunkBorders.getValue(); - } -} diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinProtocolVersion.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinProtocolVersion.java index b964d1f9..828c94b8 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinProtocolVersion.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/MixinProtocolVersion.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.protocol.version.VersionRange; import com.viaversion.viaversion.util.Pair; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinAbstractFenceConnectionHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinAbstractFenceConnectionHandler.java index 1f5e02b6..e1a10355 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinAbstractFenceConnectionHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinAbstractFenceConnectionHandler.java @@ -20,6 +20,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protoco import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.BlockFace; import com.viaversion.viaversion.api.minecraft.Position; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.blockconnections.AbstractFenceConnectionHandler; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; @@ -41,7 +42,7 @@ public abstract class MixinAbstractFenceConnectionHandler { @Overwrite public byte getStates(UserConnection user, Position position, int blockState) { byte states = 0; - boolean pre1_12 = ProtocolHack.getTargetVersion().isOlderThan(ProtocolVersion.v1_12); + boolean pre1_12 = ProtocolHack.getTargetVersion().isOlderThan(VersionEnum.r1_12); if (connects(BlockFace.EAST, getBlockData(user, position.getRelative(BlockFace.EAST)), pre1_12)) states |= 1; if (connects(BlockFace.NORTH, getBlockData(user, position.getRelative(BlockFace.NORTH)), pre1_12)) states |= 2; if (connects(BlockFace.SOUTH, getBlockData(user, position.getRelative(BlockFace.SOUTH)), pre1_12)) states |= 4; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinGlassConnectionHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinGlassConnectionHandler.java index 215e7e4d..29e594b4 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinGlassConnectionHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viaversion/protocol1_13to1_12_2/MixinGlassConnectionHandler.java @@ -20,6 +20,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.viaversion.protoco import com.viaversion.viaversion.api.connection.ProtocolInfo; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.Position; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.blockconnections.AbstractFenceConnectionHandler; import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.blockconnections.GlassConnectionHandler; @@ -44,6 +45,6 @@ public abstract class MixinGlassConnectionHandler extends AbstractFenceConnectio if (states != 0) return states; ProtocolInfo protocolInfo = user.getProtocolInfo(); - return ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_8) && protocolInfo.getServerProtocolVersion() != -1 ? 0xF : states; + return ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_8) && protocolInfo.getServerProtocolVersion() != -1 ? 0xF : states; } } diff --git a/src/main/java/de/florianmichael/viafabricplus/mappings/ItemReleaseVersionMappings.java b/src/main/java/de/florianmichael/viafabricplus/mappings/ItemReleaseVersionMappings.java index a0256219..1e64d475 100644 --- a/src/main/java/de/florianmichael/viafabricplus/mappings/ItemReleaseVersionMappings.java +++ b/src/main/java/de/florianmichael/viafabricplus/mappings/ItemReleaseVersionMappings.java @@ -17,15 +17,17 @@ */ package de.florianmichael.viafabricplus.mappings; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.base.event.ChangeProtocolVersionCallback; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; -import de.florianmichael.vialoadingbase.model.ProtocolRange; import net.minecraft.item.Item; import net.minecraft.item.Items; import net.minecraft.registry.Registries; +import net.raphimc.vialoader.util.VersionEnum; import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; import java.util.*; @@ -40,1325 +42,1325 @@ public class ItemReleaseVersionMappings { ChangeProtocolVersionCallback.EVENT.register(protocolVersion -> INSTANCE.update(protocolVersion)); } - private final Map itemMap = new HashMap<>(); + private final Map itemMap = new HashMap<>(); private final List currentMap = new ArrayList<>(); - public void update(final ComparableProtocolVersion protocolVersion) { + public void update(final VersionEnum versionEnum) { INSTANCE.currentMap.clear(); - INSTANCE.currentMap.addAll(Registries.ITEM.stream().filter(item -> INSTANCE.contains(item, protocolVersion)).toList()); + INSTANCE.currentMap.addAll(Registries.ITEM.stream().filter(item -> INSTANCE.contains(item, versionEnum)).toList()); } - public boolean contains(final Item item, final ComparableProtocolVersion protocolVersion) { + public boolean contains(final Item item, final VersionEnum versionEnum) { if (!itemMap.containsKey(item)) return true; - return Arrays.stream(itemMap.get(item)).anyMatch(protocolRange -> protocolRange.contains(protocolVersion)); + return Arrays.stream(itemMap.get(item)).anyMatch(versionRange -> versionRange.contains(versionEnum)); } public void load() { - register(Items.BRUSH, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_HANGING_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_LEAVES, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_PLANKS, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_SAPLING, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.CHERRY_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.COAST_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.DECORATED_POT, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.EYE_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.PINK_PETALS, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.POTTERY_SHARD_ARCHER, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.POTTERY_SHARD_ARMS_UP, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.POTTERY_SHARD_PRIZE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.POTTERY_SHARD_SKULL, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.RIB_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.SNIFFER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.STRIPPED_CHERRY_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.STRIPPED_CHERRY_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.SUSPICIOUS_SAND, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.TIDE_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.TORCHFLOWER, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.TORCHFLOWER_SEEDS, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.VEX_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.WARD_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); - register(Items.WILD_ARMOR_TRIM_SMITHING_TEMPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19_4)); + register(Items.BRUSH, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_BOAT, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_BUTTON, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_DOOR, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_FENCE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_HANGING_SIGN, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_LEAVES, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_LOG, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_PLANKS, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_SAPLING, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_SIGN, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_SLAB, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_STAIRS, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.CHERRY_WOOD, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.COAST_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.DECORATED_POT, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.EYE_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.PINK_PETALS, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.POTTERY_SHARD_ARCHER, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.POTTERY_SHARD_ARMS_UP, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.POTTERY_SHARD_PRIZE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.POTTERY_SHARD_SKULL, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.RIB_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.SNIFFER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.STRIPPED_CHERRY_LOG, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.STRIPPED_CHERRY_WOOD, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.SUSPICIOUS_SAND, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.TIDE_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.TORCHFLOWER, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.TORCHFLOWER_SEEDS, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.VEX_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.WARD_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); + register(Items.WILD_ARMOR_TRIM_SMITHING_TEMPLATE, VersionRange.andNewer(VersionEnum.r1_19_4)); - register(Items.IRON_GOLEM_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_19_3)); - register(Items.SNOW_GOLEM_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_19_3)); + register(Items.IRON_GOLEM_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_19_3)); + register(Items.SNOW_GOLEM_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_19_3)); - register(Items.ACACIA_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.ALLAY_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.BIRCH_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.DARK_OAK_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.DISC_FRAGMENT_5, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.ECHO_SHARD, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.FROG_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.FROGSPAWN, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.GOAT_HORN, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.JUNGLE_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_LEAVES, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_PLANKS, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_PROPAGULE, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_ROOTS, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MANGROVE_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MUD, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MUD_BRICK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MUD_BRICK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MUD_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MUD_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MUDDY_MANGROVE_ROOTS, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.MUSIC_DISC_5, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.OAK_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.OCHRE_FROGLIGHT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.PACKED_MUD, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.PEARLESCENT_FROGLIGHT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.RECOVERY_COMPASS, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.REINFORCED_DEEPSLATE, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.SCULK, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.SCULK_CATALYST, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.SCULK_SHRIEKER, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.SCULK_VEIN, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.SPRUCE_CHEST_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.STRIPPED_MANGROVE_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.STRIPPED_MANGROVE_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.TADPOLE_BUCKET, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.TADPOLE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.VERDANT_FROGLIGHT, ProtocolRange.andNewer(ProtocolVersion.v1_19)); - register(Items.WARDEN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_19)); + register(Items.ACACIA_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.ALLAY_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.BIRCH_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.DARK_OAK_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.DISC_FRAGMENT_5, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.ECHO_SHARD, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.FROG_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.FROGSPAWN, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.GOAT_HORN, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.JUNGLE_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_BUTTON, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_DOOR, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_FENCE, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_LEAVES, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_LOG, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_PLANKS, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_PROPAGULE, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_ROOTS, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_SIGN, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_SLAB, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_STAIRS, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MANGROVE_WOOD, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MUD, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MUD_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MUD_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MUD_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MUD_BRICKS, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MUDDY_MANGROVE_ROOTS, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.MUSIC_DISC_5, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.OAK_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.OCHRE_FROGLIGHT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.PACKED_MUD, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.PEARLESCENT_FROGLIGHT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.RECOVERY_COMPASS, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.REINFORCED_DEEPSLATE, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.SCULK, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.SCULK_CATALYST, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.SCULK_SHRIEKER, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.SCULK_VEIN, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.SPRUCE_CHEST_BOAT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.STRIPPED_MANGROVE_LOG, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.STRIPPED_MANGROVE_WOOD, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.TADPOLE_BUCKET, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.TADPOLE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.VERDANT_FROGLIGHT, VersionRange.andNewer(VersionEnum.r1_19)); + register(Items.WARDEN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_19)); - register(Items.MUSIC_DISC_OTHERSIDE, ProtocolRange.andNewer(ProtocolVersion.v1_18)); + register(Items.MUSIC_DISC_OTHERSIDE, VersionRange.andNewer(VersionEnum.r1_18tor1_18_1)); - register(Items.AMETHYST_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.AMETHYST_CLUSTER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.AMETHYST_SHARD, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.AXOLOTL_BUCKET, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.AXOLOTL_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.AZALEA, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.AZALEA_LEAVES, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.BIG_DRIPLEAF, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.BLACK_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.BLUE_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.BROWN_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.BUDDING_AMETHYST, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.BUNDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CALCITE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CHISELED_DEEPSLATE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.COBBLED_DEEPSLATE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.COBBLED_DEEPSLATE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.COBBLED_DEEPSLATE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.COBBLED_DEEPSLATE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.COPPER_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.COPPER_INGOT, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.COPPER_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CRACKED_DEEPSLATE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CRACKED_DEEPSLATE_TILES, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.CYAN_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_BRICK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_BRICK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_COAL_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_COPPER_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_DIAMOND_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_EMERALD_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_GOLD_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_IRON_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_LAPIS_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_REDSTONE_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_TILE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_TILE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_TILE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DEEPSLATE_TILES, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.DRIPSTONE_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.EXPOSED_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.EXPOSED_CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.EXPOSED_CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.EXPOSED_CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.FLOWERING_AZALEA, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.FLOWERING_AZALEA_LEAVES, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GLOW_BERRIES, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GLOW_INK_SAC, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GLOW_ITEM_FRAME, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GLOW_LICHEN, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GLOW_SQUID_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GOAT_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GRAY_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.GREEN_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.HANGING_ROOTS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.INFESTED_DEEPSLATE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.LARGE_AMETHYST_BUD, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.LIGHT, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.LIGHT_BLUE_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.LIGHT_GRAY_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.LIGHTNING_ROD, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.LIME_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.MAGENTA_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.MEDIUM_AMETHYST_BUD, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.MOSS_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.MOSS_CARPET, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.ORANGE_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.OXIDIZED_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.OXIDIZED_CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.OXIDIZED_CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.OXIDIZED_CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.PINK_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.POINTED_DRIPSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.POLISHED_DEEPSLATE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.POLISHED_DEEPSLATE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.POLISHED_DEEPSLATE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.POLISHED_DEEPSLATE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.POWDER_SNOW_BUCKET, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.PURPLE_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.RAW_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.RAW_COPPER_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.RAW_GOLD, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.RAW_GOLD_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.RAW_IRON, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.RAW_IRON_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.RED_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.ROOTED_DIRT, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.SCULK_SENSOR, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.SMALL_AMETHYST_BUD, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.SMALL_DRIPLEAF, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.SMOOTH_BASALT, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.SPORE_BLOSSOM, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.SPYGLASS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.TINTED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.TUFF, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_COPPER_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_EXPOSED_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_EXPOSED_CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_EXPOSED_CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_EXPOSED_CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_OXIDIZED_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_OXIDIZED_CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_OXIDIZED_CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_OXIDIZED_CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_WEATHERED_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_WEATHERED_CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_WEATHERED_CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WAXED_WEATHERED_CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WEATHERED_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WEATHERED_CUT_COPPER, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WEATHERED_CUT_COPPER_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WEATHERED_CUT_COPPER_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.WHITE_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); - register(Items.YELLOW_CANDLE, ProtocolRange.andNewer(ProtocolVersion.v1_17)); + register(Items.AMETHYST_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.AMETHYST_CLUSTER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.AMETHYST_SHARD, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.AXOLOTL_BUCKET, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.AXOLOTL_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.AZALEA, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.AZALEA_LEAVES, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.BIG_DRIPLEAF, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.BLACK_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.BLUE_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.BROWN_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.BUDDING_AMETHYST, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.BUNDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CALCITE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CHISELED_DEEPSLATE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.COBBLED_DEEPSLATE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.COBBLED_DEEPSLATE_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.COBBLED_DEEPSLATE_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.COBBLED_DEEPSLATE_WALL, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.COPPER_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.COPPER_INGOT, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.COPPER_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CRACKED_DEEPSLATE_BRICKS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CRACKED_DEEPSLATE_TILES, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.CYAN_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_BRICKS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_COAL_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_COPPER_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_DIAMOND_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_EMERALD_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_GOLD_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_IRON_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_LAPIS_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_REDSTONE_ORE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_TILE_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_TILE_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_TILE_WALL, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DEEPSLATE_TILES, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.DRIPSTONE_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.EXPOSED_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.EXPOSED_CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.EXPOSED_CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.EXPOSED_CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.FLOWERING_AZALEA, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.FLOWERING_AZALEA_LEAVES, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GLOW_BERRIES, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GLOW_INK_SAC, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GLOW_ITEM_FRAME, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GLOW_LICHEN, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GLOW_SQUID_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GOAT_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GRAY_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.GREEN_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.HANGING_ROOTS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.INFESTED_DEEPSLATE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.LARGE_AMETHYST_BUD, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.LIGHT, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.LIGHT_BLUE_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.LIGHT_GRAY_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.LIGHTNING_ROD, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.LIME_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.MAGENTA_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.MEDIUM_AMETHYST_BUD, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.MOSS_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.MOSS_CARPET, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.ORANGE_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.OXIDIZED_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.OXIDIZED_CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.OXIDIZED_CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.OXIDIZED_CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.PINK_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.POINTED_DRIPSTONE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.POLISHED_DEEPSLATE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.POLISHED_DEEPSLATE_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.POLISHED_DEEPSLATE_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.POLISHED_DEEPSLATE_WALL, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.POWDER_SNOW_BUCKET, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.PURPLE_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.RAW_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.RAW_COPPER_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.RAW_GOLD, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.RAW_GOLD_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.RAW_IRON, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.RAW_IRON_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.RED_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.ROOTED_DIRT, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.SCULK_SENSOR, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.SMALL_AMETHYST_BUD, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.SMALL_DRIPLEAF, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.SMOOTH_BASALT, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.SPORE_BLOSSOM, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.SPYGLASS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.TINTED_GLASS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.TUFF, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_COPPER_BLOCK, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_EXPOSED_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_EXPOSED_CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_EXPOSED_CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_EXPOSED_CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_OXIDIZED_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_OXIDIZED_CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_OXIDIZED_CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_OXIDIZED_CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_WEATHERED_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_WEATHERED_CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_WEATHERED_CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WAXED_WEATHERED_CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WEATHERED_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WEATHERED_CUT_COPPER, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WEATHERED_CUT_COPPER_SLAB, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WEATHERED_CUT_COPPER_STAIRS, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.WHITE_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); + register(Items.YELLOW_CANDLE, VersionRange.andNewer(VersionEnum.r1_17)); - register(Items.ANCIENT_DEBRIS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.BASALT, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.BLACKSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.BLACKSTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.BLACKSTONE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.BLACKSTONE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CHAIN, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CHISELED_NETHER_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CHISELED_POLISHED_BLACKSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRACKED_NETHER_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRACKED_POLISHED_BLACKSTONE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_FUNGUS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_HYPHAE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_NYLIUM, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_PLANKS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_ROOTS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_STEM, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRIMSON_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.CRYING_OBSIDIAN, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.GILDED_BLACKSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.HOGLIN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.LODESTONE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.MUSIC_DISC_PIGSTEP, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHER_GOLD_ORE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHER_SPROUTS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_AXE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_BOOTS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_CHESTPLATE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_HELMET, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_HOE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_INGOT, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_LEGGINGS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_PICKAXE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_SCRAP, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_SHOVEL, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.NETHERITE_SWORD, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.PIGLIN_BANNER_PATTERN, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.PIGLIN_BRUTE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.PIGLIN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BASALT, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_BRICK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_BRICK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.POLISHED_BLACKSTONE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.QUARTZ_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.RESPAWN_ANCHOR, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.SHROOMLIGHT, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.SOUL_CAMPFIRE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.SOUL_LANTERN, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.SOUL_SOIL, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.SOUL_TORCH, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.STRIDER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.STRIPPED_CRIMSON_HYPHAE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.STRIPPED_CRIMSON_STEM, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.STRIPPED_WARPED_HYPHAE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.STRIPPED_WARPED_STEM, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.TARGET, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.TWISTING_VINES, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_FUNGUS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_FUNGUS_ON_A_STICK, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_HYPHAE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_NYLIUM, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_PLANKS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_ROOTS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_STEM, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WARPED_WART_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.WEEPING_VINES, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.ZOGLIN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_16)); - register(Items.ZOMBIFIED_PIGLIN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_16)); + register(Items.ANCIENT_DEBRIS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.BASALT, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.BLACKSTONE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.BLACKSTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.BLACKSTONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.BLACKSTONE_WALL, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CHAIN, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CHISELED_NETHER_BRICKS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CHISELED_POLISHED_BLACKSTONE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRACKED_NETHER_BRICKS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRACKED_POLISHED_BLACKSTONE_BRICKS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_BUTTON, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_DOOR, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_FENCE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_FUNGUS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_HYPHAE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_NYLIUM, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_PLANKS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_ROOTS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_SIGN, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_SLAB, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_STAIRS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_STEM, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRIMSON_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.CRYING_OBSIDIAN, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.GILDED_BLACKSTONE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.HOGLIN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.LODESTONE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.MUSIC_DISC_PIGSTEP, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHER_GOLD_ORE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHER_SPROUTS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_AXE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_BLOCK, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_BOOTS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_CHESTPLATE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_HELMET, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_HOE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_INGOT, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_LEGGINGS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_PICKAXE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_SCRAP, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_SHOVEL, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.NETHERITE_SWORD, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.PIGLIN_BANNER_PATTERN, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.PIGLIN_BRUTE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.PIGLIN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BASALT, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_BRICKS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_BUTTON, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.POLISHED_BLACKSTONE_WALL, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.QUARTZ_BRICKS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.RESPAWN_ANCHOR, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.SHROOMLIGHT, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.SOUL_CAMPFIRE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.SOUL_LANTERN, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.SOUL_SOIL, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.SOUL_TORCH, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.STRIDER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.STRIPPED_CRIMSON_HYPHAE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.STRIPPED_CRIMSON_STEM, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.STRIPPED_WARPED_HYPHAE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.STRIPPED_WARPED_STEM, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.TARGET, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.TWISTING_VINES, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_BUTTON, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_DOOR, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_FENCE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_FUNGUS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_FUNGUS_ON_A_STICK, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_HYPHAE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_NYLIUM, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_PLANKS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_ROOTS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_SIGN, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_SLAB, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_STAIRS, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_STEM, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WARPED_WART_BLOCK, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.WEEPING_VINES, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.ZOGLIN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_16)); + register(Items.ZOMBIFIED_PIGLIN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_16)); - register(Items.BEE_NEST, ProtocolRange.andNewer(ProtocolVersion.v1_15)); - register(Items.BEE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_15)); - register(Items.BEEHIVE, ProtocolRange.andNewer(ProtocolVersion.v1_15)); - register(Items.HONEY_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_15)); - register(Items.HONEY_BOTTLE, ProtocolRange.andNewer(ProtocolVersion.v1_15)); - register(Items.HONEYCOMB, ProtocolRange.andNewer(ProtocolVersion.v1_15)); - register(Items.HONEYCOMB_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_15)); + register(Items.BEE_NEST, VersionRange.andNewer(VersionEnum.r1_15)); + register(Items.BEE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_15)); + register(Items.BEEHIVE, VersionRange.andNewer(VersionEnum.r1_15)); + register(Items.HONEY_BLOCK, VersionRange.andNewer(VersionEnum.r1_15)); + register(Items.HONEY_BOTTLE, VersionRange.andNewer(VersionEnum.r1_15)); + register(Items.HONEYCOMB, VersionRange.andNewer(VersionEnum.r1_15)); + register(Items.HONEYCOMB_BLOCK, VersionRange.andNewer(VersionEnum.r1_15)); - register(Items.ACACIA_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.ANDESITE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.ANDESITE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.ANDESITE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BAMBOO, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BARREL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BELL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BIRCH_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BLACK_DYE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BLAST_FURNACE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BLUE_DYE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.BROWN_DYE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CAMPFIRE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CARTOGRAPHY_TABLE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CAT_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.COMPOSTER, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CORNFLOWER, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CREEPER_BANNER_PATTERN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CROSSBOW, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CUT_RED_SANDSTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.CUT_SANDSTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.DARK_OAK_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.DIORITE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.DIORITE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.DIORITE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.END_STONE_BRICK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.END_STONE_BRICK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.END_STONE_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.FLETCHING_TABLE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.FLOWER_BANNER_PATTERN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.FOX_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.GLOBE_BANNER_PATTERN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.GRANITE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.GRANITE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.GRANITE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.GRINDSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.JIGSAW, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.JUNGLE_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.LANTERN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.LEATHER_HORSE_ARMOR, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.LECTERN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.LILY_OF_THE_VALLEY, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.LOOM, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.MOJANG_BANNER_PATTERN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.MOSSY_COBBLESTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.MOSSY_COBBLESTONE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.MOSSY_STONE_BRICK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.MOSSY_STONE_BRICK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.MOSSY_STONE_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.NETHER_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.PANDA_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.PILLAGER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.POLISHED_ANDESITE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.POLISHED_ANDESITE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.POLISHED_DIORITE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.POLISHED_DIORITE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.POLISHED_GRANITE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.POLISHED_GRANITE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.PRISMARINE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.RAVAGER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.RED_NETHER_BRICK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.RED_NETHER_BRICK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.RED_NETHER_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.RED_SANDSTONE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SANDSTONE_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SCAFFOLDING, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SKULL_BANNER_PATTERN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMITHING_TABLE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMOKER, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMOOTH_QUARTZ_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMOOTH_QUARTZ_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMOOTH_RED_SANDSTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMOOTH_RED_SANDSTONE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMOOTH_SANDSTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SMOOTH_SANDSTONE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SPRUCE_SIGN, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.STONE_BRICK_WALL, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.STONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.STONE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.STONECUTTER, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SUSPICIOUS_STEW, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.SWEET_BERRIES, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.TRADER_LLAMA_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.WANDERING_TRADER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.WHITE_DYE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); - register(Items.WITHER_ROSE, ProtocolRange.andNewer(ProtocolVersion.v1_14)); + register(Items.ACACIA_SIGN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.ANDESITE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.ANDESITE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.ANDESITE_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BAMBOO, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BARREL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BELL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BIRCH_SIGN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BLACK_DYE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BLAST_FURNACE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BLUE_DYE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.BROWN_DYE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CAMPFIRE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CARTOGRAPHY_TABLE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CAT_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.COMPOSTER, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CORNFLOWER, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CREEPER_BANNER_PATTERN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CROSSBOW, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CUT_RED_SANDSTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.CUT_SANDSTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.DARK_OAK_SIGN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.DIORITE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.DIORITE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.DIORITE_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.END_STONE_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.END_STONE_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.END_STONE_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.FLETCHING_TABLE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.FLOWER_BANNER_PATTERN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.FOX_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.GLOBE_BANNER_PATTERN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.GRANITE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.GRANITE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.GRANITE_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.GRINDSTONE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.JIGSAW, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.JUNGLE_SIGN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.LANTERN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.LEATHER_HORSE_ARMOR, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.LECTERN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.LILY_OF_THE_VALLEY, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.LOOM, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.MOJANG_BANNER_PATTERN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.MOSSY_COBBLESTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.MOSSY_COBBLESTONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.MOSSY_STONE_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.MOSSY_STONE_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.MOSSY_STONE_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.NETHER_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.PANDA_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.PILLAGER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.POLISHED_ANDESITE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.POLISHED_ANDESITE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.POLISHED_DIORITE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.POLISHED_DIORITE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.POLISHED_GRANITE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.POLISHED_GRANITE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.PRISMARINE_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.RAVAGER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.RED_NETHER_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.RED_NETHER_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.RED_NETHER_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.RED_SANDSTONE_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SANDSTONE_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SCAFFOLDING, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SKULL_BANNER_PATTERN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMITHING_TABLE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMOKER, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMOOTH_QUARTZ_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMOOTH_QUARTZ_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMOOTH_RED_SANDSTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMOOTH_RED_SANDSTONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMOOTH_SANDSTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SMOOTH_SANDSTONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SPRUCE_SIGN, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.STONE_BRICK_WALL, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.STONE_SLAB, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.STONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.STONECUTTER, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SUSPICIOUS_STEW, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.SWEET_BERRIES, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.TRADER_LLAMA_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.WANDERING_TRADER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.WHITE_DYE, VersionRange.andNewer(VersionEnum.r1_14)); + register(Items.WITHER_ROSE, VersionRange.andNewer(VersionEnum.r1_14)); - register(Items.ACACIA_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.ACACIA_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.ACACIA_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BIRCH_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BIRCH_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BIRCH_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BLUE_ICE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BRAIN_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BRAIN_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BRAIN_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BUBBLE_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BUBBLE_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.BUBBLE_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.CARVED_PUMPKIN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.CHIPPED_ANVIL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.COD_BUCKET, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.COD_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.CONDUIT, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DAMAGED_ANVIL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DARK_OAK_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DARK_OAK_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DARK_OAK_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DARK_PRISMARINE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DARK_PRISMARINE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_BRAIN_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_BRAIN_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_BRAIN_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_BUBBLE_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_BUBBLE_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_BUBBLE_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_FIRE_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_FIRE_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_FIRE_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_HORN_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_HORN_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_HORN_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_TUBE_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_TUBE_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEAD_TUBE_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DEBUG_STICK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DOLPHIN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DRIED_KELP, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DRIED_KELP_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.DROWNED_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.FIRE_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.FIRE_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.FIRE_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.HEART_OF_THE_SEA, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.HORN_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.HORN_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.HORN_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.JUNGLE_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.JUNGLE_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.JUNGLE_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.KELP, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.MUSHROOM_STEM, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.NAUTILUS_SHELL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.OAK_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - //register(Items.PETRIFIED_OAK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_13)); it's right, but the item exists in another form before, so it's actually wrong - register(Items.PHANTOM_MEMBRANE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.PHANTOM_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.PRISMARINE_BRICK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.PRISMARINE_BRICK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.PRISMARINE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.PRISMARINE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.PUFFERFISH_BUCKET, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.PUFFERFISH_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SALMON_BUCKET, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SALMON_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SCUTE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SEA_PICKLE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SEAGRASS, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SMOOTH_QUARTZ, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SMOOTH_RED_SANDSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SMOOTH_SANDSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SMOOTH_STONE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SPRUCE_PRESSURE_PLATE, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SPRUCE_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.SPRUCE_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_ACACIA_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_ACACIA_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_BIRCH_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_BIRCH_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_DARK_OAK_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_DARK_OAK_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_JUNGLE_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_JUNGLE_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_OAK_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_OAK_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_SPRUCE_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.STRIPPED_SPRUCE_WOOD, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TRIDENT, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TROPICAL_FISH_BUCKET, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TROPICAL_FISH_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TUBE_CORAL, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TUBE_CORAL_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TUBE_CORAL_FAN, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TURTLE_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TURTLE_HELMET, ProtocolRange.andNewer(ProtocolVersion.v1_13)); - register(Items.TURTLE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_13)); + register(Items.ACACIA_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.ACACIA_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.ACACIA_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BIRCH_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BIRCH_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BIRCH_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BLUE_ICE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BRAIN_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BRAIN_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BRAIN_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BUBBLE_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BUBBLE_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.BUBBLE_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.CARVED_PUMPKIN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.CHIPPED_ANVIL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.COD_BUCKET, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.COD_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.CONDUIT, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DAMAGED_ANVIL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DARK_OAK_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DARK_OAK_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DARK_OAK_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DARK_PRISMARINE_SLAB, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DARK_PRISMARINE_STAIRS, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_BRAIN_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_BRAIN_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_BRAIN_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_BUBBLE_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_BUBBLE_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_BUBBLE_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_FIRE_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_FIRE_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_FIRE_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_HORN_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_HORN_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_HORN_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_TUBE_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_TUBE_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEAD_TUBE_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DEBUG_STICK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DOLPHIN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DRIED_KELP, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DRIED_KELP_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.DROWNED_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.FIRE_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.FIRE_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.FIRE_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.HEART_OF_THE_SEA, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.HORN_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.HORN_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.HORN_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.JUNGLE_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.JUNGLE_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.JUNGLE_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.KELP, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.MUSHROOM_STEM, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.NAUTILUS_SHELL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.OAK_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + //register(Items.PETRIFIED_OAK_SLAB, VersionRange.andNewer(VersionEnum.r1_13)); it's right, but the item exists in another form before, so it's actually wrong + register(Items.PHANTOM_MEMBRANE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.PHANTOM_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.PRISMARINE_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.PRISMARINE_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.PRISMARINE_SLAB, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.PRISMARINE_STAIRS, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.PUFFERFISH_BUCKET, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.PUFFERFISH_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SALMON_BUCKET, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SALMON_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SCUTE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SEA_PICKLE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SEAGRASS, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SMOOTH_QUARTZ, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SMOOTH_RED_SANDSTONE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SMOOTH_SANDSTONE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SMOOTH_STONE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SPRUCE_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SPRUCE_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.SPRUCE_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_ACACIA_LOG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_ACACIA_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_BIRCH_LOG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_BIRCH_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_DARK_OAK_LOG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_DARK_OAK_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_JUNGLE_LOG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_JUNGLE_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_OAK_LOG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_OAK_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_SPRUCE_LOG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.STRIPPED_SPRUCE_WOOD, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TRIDENT, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TROPICAL_FISH_BUCKET, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TROPICAL_FISH_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TUBE_CORAL, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TUBE_CORAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TUBE_CORAL_FAN, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TURTLE_EGG, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TURTLE_HELMET, VersionRange.andNewer(VersionEnum.r1_13)); + register(Items.TURTLE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_13)); - register(Items.BLACK_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BLACK_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BLACK_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BLACK_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BLUE_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BLUE_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BLUE_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BLUE_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BROWN_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BROWN_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BROWN_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.BROWN_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.CYAN_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.CYAN_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.CYAN_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.CYAN_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GRAY_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GRAY_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GRAY_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GRAY_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GREEN_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GREEN_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GREEN_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.GREEN_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.KNOWLEDGE_BOOK, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_BLUE_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_BLUE_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_BLUE_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_BLUE_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_GRAY_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_GRAY_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_GRAY_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIGHT_GRAY_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIME_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIME_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIME_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.LIME_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.MAGENTA_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.MAGENTA_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.MAGENTA_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.MAGENTA_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.ORANGE_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.ORANGE_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.ORANGE_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.ORANGE_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PARROT_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PINK_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PINK_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PINK_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PINK_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PURPLE_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PURPLE_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PURPLE_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.PURPLE_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.RED_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.RED_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.RED_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.WHITE_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.WHITE_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.WHITE_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.WHITE_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.YELLOW_BED, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.YELLOW_CONCRETE, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.YELLOW_CONCRETE_POWDER, ProtocolRange.andNewer(ProtocolVersion.v1_12)); - register(Items.YELLOW_GLAZED_TERRACOTTA, ProtocolRange.andNewer(ProtocolVersion.v1_12)); + register(Items.BLACK_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BLACK_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BLACK_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BLACK_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BLUE_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BLUE_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BLUE_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BLUE_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BROWN_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BROWN_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BROWN_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.BROWN_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.CYAN_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.CYAN_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.CYAN_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.CYAN_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GRAY_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GRAY_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GRAY_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GRAY_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GREEN_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GREEN_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GREEN_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.GREEN_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.KNOWLEDGE_BOOK, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_BLUE_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_BLUE_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_BLUE_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_BLUE_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_GRAY_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_GRAY_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_GRAY_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIGHT_GRAY_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIME_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIME_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIME_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.LIME_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.MAGENTA_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.MAGENTA_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.MAGENTA_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.MAGENTA_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.ORANGE_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.ORANGE_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.ORANGE_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.ORANGE_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PARROT_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PINK_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PINK_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PINK_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PINK_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PURPLE_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PURPLE_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PURPLE_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.PURPLE_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.RED_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.RED_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.RED_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.WHITE_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.WHITE_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.WHITE_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.WHITE_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.YELLOW_BED, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.YELLOW_CONCRETE, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.YELLOW_CONCRETE_POWDER, VersionRange.andNewer(VersionEnum.r1_12)); + register(Items.YELLOW_GLAZED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_12)); - register(Items.BLACK_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.BLUE_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.BROWN_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.CYAN_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.DONKEY_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.EVOKER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.FILLED_MAP, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.GRAY_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.GREEN_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.HUSK_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.IRON_NUGGET, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.LIGHT_BLUE_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.LIGHT_GRAY_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.LIME_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.LLAMA_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.MAGENTA_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.MULE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.OBSERVER, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.ORANGE_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.PINK_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.PURPLE_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.RED_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.SHULKER_SHELL, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.SKELETON_HORSE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.STRAY_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.TOTEM_OF_UNDYING, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.VEX_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.VINDICATOR_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.WHITE_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.WITHER_SKELETON_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.YELLOW_SHULKER_BOX, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.ZOMBIE_HORSE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); - register(Items.ZOMBIE_VILLAGER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_11)); + register(Items.BLACK_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.BLUE_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.BROWN_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.CYAN_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.DONKEY_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.EVOKER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.FILLED_MAP, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.GRAY_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.GREEN_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.HUSK_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.IRON_NUGGET, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.LIGHT_BLUE_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.LIGHT_GRAY_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.LIME_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.LLAMA_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.MAGENTA_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.MULE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.OBSERVER, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.ORANGE_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.PINK_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.PURPLE_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.RED_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.SHULKER_SHELL, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.SKELETON_HORSE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.STRAY_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.TOTEM_OF_UNDYING, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.VEX_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.VINDICATOR_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.WHITE_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.WITHER_SKELETON_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.YELLOW_SHULKER_BOX, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.ZOMBIE_HORSE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); + register(Items.ZOMBIE_VILLAGER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_11)); - register(Items.BONE_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_10)); - register(Items.MAGMA_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_10), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.NETHER_WART_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_10)); - register(Items.POLAR_BEAR_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_10)); - register(Items.RED_NETHER_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_10)); - register(Items.STRUCTURE_VOID, ProtocolRange.andNewer(ProtocolVersion.v1_10)); + register(Items.BONE_BLOCK, VersionRange.andNewer(VersionEnum.r1_10)); + register(Items.MAGMA_BLOCK, VersionRange.andNewer(VersionEnum.r1_10), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.NETHER_WART_BLOCK, VersionRange.andNewer(VersionEnum.r1_10)); + register(Items.POLAR_BEAR_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_10)); + register(Items.RED_NETHER_BRICKS, VersionRange.andNewer(VersionEnum.r1_10)); + register(Items.STRUCTURE_VOID, VersionRange.andNewer(VersionEnum.r1_10)); - register(Items.ACACIA_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.BEETROOT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.BEETROOT_SEEDS, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.BEETROOT_SOUP, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.BIRCH_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.CHAIN_COMMAND_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.CHORUS_FLOWER, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.CHORUS_FRUIT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.CHORUS_PLANT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.DARK_OAK_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.DIRT_PATH, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.DRAGON_BREATH, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.DRAGON_HEAD, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.ELYTRA, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.END_CRYSTAL, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.END_ROD, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.END_STONE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.JUNGLE_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.LINGERING_POTION, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.POPPED_CHORUS_FRUIT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.PURPUR_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.PURPUR_PILLAR, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.PURPUR_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.PURPUR_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.REPEATING_COMMAND_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.SHIELD, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.SHULKER_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.SPECTRAL_ARROW, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.SPRUCE_BOAT, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.STRUCTURE_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_9)); - register(Items.TIPPED_ARROW, ProtocolRange.andNewer(ProtocolVersion.v1_9)); + register(Items.ACACIA_BOAT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.BEETROOT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.BEETROOT_SEEDS, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.BEETROOT_SOUP, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.BIRCH_BOAT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.CHAIN_COMMAND_BLOCK, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.CHORUS_FLOWER, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.CHORUS_FRUIT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.CHORUS_PLANT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.DARK_OAK_BOAT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.DIRT_PATH, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.DRAGON_BREATH, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.DRAGON_HEAD, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.ELYTRA, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.END_CRYSTAL, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.END_ROD, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.END_STONE_BRICKS, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.JUNGLE_BOAT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.LINGERING_POTION, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.POPPED_CHORUS_FRUIT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.PURPUR_BLOCK, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.PURPUR_PILLAR, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.PURPUR_SLAB, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.PURPUR_STAIRS, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.REPEATING_COMMAND_BLOCK, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.SHIELD, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.SHULKER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.SPECTRAL_ARROW, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.SPRUCE_BOAT, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.STRUCTURE_BLOCK, VersionRange.andNewer(VersionEnum.r1_9)); + register(Items.TIPPED_ARROW, VersionRange.andNewer(VersionEnum.r1_9)); - register(Items.ACACIA_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ACACIA_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ACACIA_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ANDESITE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ARMOR_STAND, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.BARRIER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.BIRCH_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.BIRCH_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.BIRCH_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.BLACK_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.BLUE_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.BROWN_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.CHISELED_RED_SANDSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.COARSE_DIRT, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.COOKED_MUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.COOKED_RABBIT, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.CREEPER_HEAD, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.CUT_RED_SANDSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.CYAN_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.DARK_OAK_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.DARK_OAK_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.DARK_OAK_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.DARK_PRISMARINE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.DIORITE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ELDER_GUARDIAN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ENDERMITE_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.GRANITE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.GRAY_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.GREEN_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.GUARDIAN_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.IRON_TRAPDOOR, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.JUNGLE_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.JUNGLE_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.JUNGLE_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.LIGHT_BLUE_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.LIGHT_GRAY_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.LIME_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.MAGENTA_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.MUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ORANGE_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.PINK_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.PLAYER_HEAD, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.POLISHED_ANDESITE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.POLISHED_DIORITE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.POLISHED_GRANITE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.PRISMARINE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.PRISMARINE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.PRISMARINE_CRYSTALS, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.PRISMARINE_SHARD, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.PURPLE_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RABBIT, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RABBIT_FOOT, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RABBIT_HIDE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RABBIT_SPAWN_EGG, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RABBIT_STEW, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RED_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RED_SANDSTONE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RED_SANDSTONE_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.RED_SANDSTONE_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.SEA_LANTERN, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.SKELETON_SKULL, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.SLIME_BLOCK, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.SPONGE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.SPRUCE_DOOR, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.SPRUCE_FENCE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.SPRUCE_FENCE_GATE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.WET_SPONGE, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.WHITE_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.WITHER_SKELETON_SKULL, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.YELLOW_BANNER, ProtocolRange.andNewer(ProtocolVersion.v1_8)); - register(Items.ZOMBIE_HEAD, ProtocolRange.andNewer(ProtocolVersion.v1_8)); + register(Items.ACACIA_DOOR, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ACACIA_FENCE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ACACIA_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ANDESITE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ARMOR_STAND, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.BARRIER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.BIRCH_DOOR, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.BIRCH_FENCE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.BIRCH_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.BLACK_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.BLUE_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.BROWN_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.CHISELED_RED_SANDSTONE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.COARSE_DIRT, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.COOKED_MUTTON, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.COOKED_RABBIT, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.CREEPER_HEAD, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.CUT_RED_SANDSTONE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.CYAN_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.DARK_OAK_DOOR, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.DARK_OAK_FENCE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.DARK_OAK_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.DARK_PRISMARINE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.DIORITE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ELDER_GUARDIAN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ENDERMITE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.GRANITE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.GRAY_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.GREEN_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.GUARDIAN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.IRON_TRAPDOOR, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.JUNGLE_DOOR, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.JUNGLE_FENCE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.JUNGLE_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.LIGHT_BLUE_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.LIGHT_GRAY_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.LIME_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.MAGENTA_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.MUTTON, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ORANGE_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.PINK_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.PLAYER_HEAD, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.POLISHED_ANDESITE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.POLISHED_DIORITE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.POLISHED_GRANITE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.PRISMARINE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.PRISMARINE_BRICKS, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.PRISMARINE_CRYSTALS, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.PRISMARINE_SHARD, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.PURPLE_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RABBIT, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RABBIT_FOOT, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RABBIT_HIDE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RABBIT_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RABBIT_STEW, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RED_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RED_SANDSTONE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RED_SANDSTONE_SLAB, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.RED_SANDSTONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.SEA_LANTERN, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.SKELETON_SKULL, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.SLIME_BLOCK, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.SPONGE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.SPRUCE_DOOR, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.SPRUCE_FENCE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.SPRUCE_FENCE_GATE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.WET_SPONGE, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.WHITE_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.WITHER_SKELETON_SKULL, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.YELLOW_BANNER, VersionRange.andNewer(VersionEnum.r1_8)); + register(Items.ZOMBIE_HEAD, VersionRange.andNewer(VersionEnum.r1_8)); - register(Items.ACACIA_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ACACIA_LEAVES, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ACACIA_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ACACIA_PLANKS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ACACIA_SAPLING, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ACACIA_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ACACIA_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ALLIUM, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.AZURE_BLUET, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BIRCH_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BLACK_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BLACK_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BLUE_ORCHID, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BLUE_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BLUE_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BROWN_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.BROWN_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.COMMAND_BLOCK_MINECART, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.COOKED_SALMON, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.CYAN_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.CYAN_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.DARK_OAK_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.DARK_OAK_LEAVES, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.DARK_OAK_LOG, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.DARK_OAK_PLANKS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.DARK_OAK_SAPLING, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.DARK_OAK_SLAB, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.DARK_OAK_STAIRS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.GRAY_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.GRAY_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.GREEN_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.GREEN_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.INFESTED_CHISELED_STONE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.INFESTED_CRACKED_STONE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.INFESTED_MOSSY_STONE_BRICKS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.JUNGLE_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LARGE_FERN, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LIGHT_BLUE_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LIGHT_BLUE_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LIGHT_GRAY_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LIGHT_GRAY_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LILAC, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LIME_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.LIME_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.MAGENTA_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.MAGENTA_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ORANGE_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ORANGE_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ORANGE_TULIP, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.OXEYE_DAISY, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PACKED_ICE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PEONY, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PINK_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PINK_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PINK_TULIP, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PODZOL, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PUFFERFISH, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PURPLE_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.PURPLE_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.RED_SAND, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.RED_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.RED_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.RED_TULIP, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.ROSE_BUSH, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.SALMON, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.SPRUCE_BUTTON, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.SUNFLOWER, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.TALL_GRASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.TROPICAL_FISH, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.WHITE_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.WHITE_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.WHITE_TULIP, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.YELLOW_STAINED_GLASS, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); - register(Items.YELLOW_STAINED_GLASS_PANE, ProtocolRange.andNewer(ProtocolVersion.v1_7_1)); + register(Items.ACACIA_BUTTON, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ACACIA_LEAVES, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ACACIA_LOG, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ACACIA_PLANKS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ACACIA_SAPLING, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ACACIA_SLAB, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ACACIA_STAIRS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ALLIUM, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.AZURE_BLUET, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BIRCH_BUTTON, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BLACK_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BLACK_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BLUE_ORCHID, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BLUE_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BLUE_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BROWN_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.BROWN_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.COMMAND_BLOCK_MINECART, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.COOKED_SALMON, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.CYAN_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.CYAN_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.DARK_OAK_BUTTON, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.DARK_OAK_LEAVES, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.DARK_OAK_LOG, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.DARK_OAK_PLANKS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.DARK_OAK_SAPLING, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.DARK_OAK_SLAB, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.DARK_OAK_STAIRS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.GRAY_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.GRAY_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.GREEN_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.GREEN_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.INFESTED_CHISELED_STONE_BRICKS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.INFESTED_CRACKED_STONE_BRICKS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.INFESTED_MOSSY_STONE_BRICKS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.JUNGLE_BUTTON, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LARGE_FERN, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LIGHT_BLUE_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LIGHT_BLUE_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LIGHT_GRAY_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LIGHT_GRAY_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LILAC, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LIME_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.LIME_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.MAGENTA_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.MAGENTA_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ORANGE_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ORANGE_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ORANGE_TULIP, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.OXEYE_DAISY, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PACKED_ICE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PEONY, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PINK_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PINK_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PINK_TULIP, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PODZOL, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PUFFERFISH, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PURPLE_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.PURPLE_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.RED_SAND, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.RED_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.RED_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.RED_TULIP, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.ROSE_BUSH, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.SALMON, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.SPRUCE_BUTTON, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.SUNFLOWER, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.TALL_GRASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.TROPICAL_FISH, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.WHITE_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.WHITE_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.WHITE_TULIP, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.YELLOW_STAINED_GLASS, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); + register(Items.YELLOW_STAINED_GLASS_PANE, VersionRange.andNewer(VersionEnum.r1_7_2tor1_7_5)); - register(Items.BLACK_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.BLACK_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.BLUE_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.BLUE_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.BROWN_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.BROWN_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.COAL_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.CYAN_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.CYAN_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.DIAMOND_HORSE_ARMOR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.GOLDEN_HORSE_ARMOR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.GRAY_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.GRAY_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.GREEN_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.GREEN_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.HAY_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.HORSE_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.IRON_HORSE_ARMOR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.LEAD, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.LIGHT_BLUE_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.LIGHT_BLUE_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.LIGHT_GRAY_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.LIGHT_GRAY_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.LIME_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.LIME_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.MAGENTA_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.MAGENTA_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.NAME_TAG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.ORANGE_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.ORANGE_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.PINK_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.PINK_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.PURPLE_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.PURPLE_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.RED_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.RED_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.WHITE_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.WHITE_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.YELLOW_CARPET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); - register(Items.YELLOW_TERRACOTTA, ProtocolRange.andNewer(LegacyProtocolVersion.r1_6_1)); + register(Items.BLACK_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.BLACK_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.BLUE_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.BLUE_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.BROWN_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.BROWN_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.COAL_BLOCK, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.CYAN_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.CYAN_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.DIAMOND_HORSE_ARMOR, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.GOLDEN_HORSE_ARMOR, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.GRAY_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.GRAY_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.GREEN_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.GREEN_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.HAY_BLOCK, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.HORSE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.IRON_HORSE_ARMOR, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.LEAD, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.LIGHT_BLUE_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.LIGHT_BLUE_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.LIGHT_GRAY_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.LIGHT_GRAY_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.LIME_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.LIME_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.MAGENTA_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.MAGENTA_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.NAME_TAG, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.ORANGE_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.ORANGE_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.PINK_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.PINK_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.PURPLE_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.PURPLE_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.RED_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.RED_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.WHITE_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.WHITE_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.YELLOW_CARPET, VersionRange.andNewer(VersionEnum.r1_6_1)); + register(Items.YELLOW_TERRACOTTA, VersionRange.andNewer(VersionEnum.r1_6_1)); - register(Items.ACTIVATOR_RAIL, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.CHISELED_QUARTZ_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.COMPARATOR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.DAYLIGHT_DETECTOR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.DROPPER, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.HEAVY_WEIGHTED_PRESSURE_PLATE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.HOPPER, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.HOPPER_MINECART, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.LIGHT_WEIGHTED_PRESSURE_PLATE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.NETHER_BRICK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.NETHER_QUARTZ_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.QUARTZ, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.QUARTZ_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.QUARTZ_PILLAR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.QUARTZ_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.QUARTZ_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.REDSTONE_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.TNT_MINECART, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); - register(Items.TRAPPED_CHEST, ProtocolRange.andNewer(LegacyProtocolVersion.r1_5tor1_5_1)); + register(Items.ACTIVATOR_RAIL, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.CHISELED_QUARTZ_BLOCK, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.COMPARATOR, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.DAYLIGHT_DETECTOR, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.DROPPER, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.HEAVY_WEIGHTED_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.HOPPER, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.HOPPER_MINECART, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.LIGHT_WEIGHTED_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.NETHER_BRICK, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.NETHER_QUARTZ_ORE, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.QUARTZ, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.QUARTZ_BLOCK, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.QUARTZ_PILLAR, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.QUARTZ_SLAB, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.QUARTZ_STAIRS, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.REDSTONE_BLOCK, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.TNT_MINECART, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); + register(Items.TRAPPED_CHEST, VersionRange.andNewer(VersionEnum.r1_5tor1_5_1)); - register(Items.ANVIL, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.BAKED_POTATO, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.BAT_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.BEACON, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.CARROT, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.CARROT_ON_A_STICK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.COBBLESTONE_WALL, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.COMMAND_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.ENCHANTED_BOOK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.FIREWORK_ROCKET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.FIREWORK_STAR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.FLOWER_POT, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.GOLDEN_CARROT, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.ITEM_FRAME, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.MAP, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.MOSSY_COBBLESTONE_WALL, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); + register(Items.ANVIL, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.BAKED_POTATO, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.BAT_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.BEACON, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.CARROT, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.CARROT_ON_A_STICK, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.COBBLESTONE_WALL, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.COMMAND_BLOCK, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.ENCHANTED_BOOK, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.FIREWORK_ROCKET, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.FIREWORK_STAR, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.FLOWER_POT, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.GOLDEN_CARROT, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.ITEM_FRAME, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.MAP, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.MOSSY_COBBLESTONE_WALL, VersionRange.andNewer(VersionEnum.r1_4_2)); // "[The disc was] made available in survival" Is this the release in which it was added or made available? - register(Items.MUSIC_DISC_WAIT, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.NETHER_BRICK_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.NETHER_STAR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.OAK_BUTTON, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.POISONOUS_POTATO, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.POTATO, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.PUMPKIN_PIE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); - register(Items.WITCH_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_4_2)); + register(Items.MUSIC_DISC_WAIT, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.NETHER_BRICK_SLAB, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.NETHER_STAR, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.OAK_BUTTON, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.POISONOUS_POTATO, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.POTATO, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.PUMPKIN_PIE, VersionRange.andNewer(VersionEnum.r1_4_2)); + register(Items.WITCH_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_4_2)); - register(Items.BIRCH_PLANKS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.BIRCH_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.BIRCH_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.COCOA_BEANS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.EMERALD, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.EMERALD_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.EMERALD_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.ENCHANTED_GOLDEN_APPLE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.ENDER_CHEST, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.JUNGLE_PLANKS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.JUNGLE_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.JUNGLE_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.SANDSTONE_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.SPRUCE_PLANKS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.SPRUCE_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.SPRUCE_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.TRIPWIRE_HOOK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.WRITABLE_BOOK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); - register(Items.WRITTEN_BOOK, ProtocolRange.andNewer(LegacyProtocolVersion.r1_3_1tor1_3_2)); + register(Items.BIRCH_PLANKS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.BIRCH_SLAB, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.BIRCH_STAIRS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.COCOA_BEANS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.EMERALD, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.EMERALD_BLOCK, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.EMERALD_ORE, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.ENCHANTED_GOLDEN_APPLE, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.ENDER_CHEST, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.JUNGLE_PLANKS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.JUNGLE_SLAB, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.JUNGLE_STAIRS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.SANDSTONE_STAIRS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.SPRUCE_PLANKS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.SPRUCE_SLAB, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.SPRUCE_STAIRS, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.TRIPWIRE_HOOK, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.WRITABLE_BOOK, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); + register(Items.WRITTEN_BOOK, VersionRange.andNewer(VersionEnum.r1_3_1tor1_3_2)); - register(Items.CHISELED_SANDSTONE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.CHISELED_STONE_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.CUT_SANDSTONE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.EXPERIENCE_BOTTLE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.FIRE_CHARGE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.JUNGLE_LEAVES, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.JUNGLE_LOG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.JUNGLE_SAPLING, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.OCELOT_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); - register(Items.REDSTONE_LAMP, ProtocolRange.andNewer(LegacyProtocolVersion.r1_2_1tor1_2_3)); + register(Items.CHISELED_SANDSTONE, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.CHISELED_STONE_BRICKS, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.CUT_SANDSTONE, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.EXPERIENCE_BOTTLE, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.FIRE_CHARGE, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.JUNGLE_LEAVES, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.JUNGLE_LOG, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.JUNGLE_SAPLING, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.OCELOT_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); + register(Items.REDSTONE_LAMP, VersionRange.andNewer(VersionEnum.r1_2_1tor1_2_3)); - register(Items.BLAZE_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.CAVE_SPIDER_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.CHICKEN_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.COW_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.CREEPER_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.ENDERMAN_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.GHAST_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.MAGMA_CUBE_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.MOOSHROOM_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.PIG_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.SHEEP_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.SILVERFISH_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.SKELETON_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.SLIME_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.SPIDER_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.SQUID_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.VILLAGER_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.WOLF_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.ZOMBIE_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); - register(Items.ZOMBIFIED_PIGLIN_SPAWN_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_1)); + register(Items.BLAZE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.CAVE_SPIDER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.CHICKEN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.COW_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.CREEPER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.ENDERMAN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.GHAST_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.MAGMA_CUBE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.MOOSHROOM_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.PIG_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.SHEEP_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.SILVERFISH_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.SKELETON_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.SLIME_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.SPIDER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.SQUID_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.VILLAGER_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.WOLF_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.ZOMBIE_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); + register(Items.ZOMBIFIED_PIGLIN_SPAWN_EGG, VersionRange.andNewer(VersionEnum.r1_1)); - register(Items.BLAZE_POWDER, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.BLAZE_ROD, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.BREWING_STAND, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.CAULDRON, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.DRAGON_EGG, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.ENCHANTING_TABLE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.END_PORTAL_FRAME, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.END_STONE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.ENDER_EYE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.FERMENTED_SPIDER_EYE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.GHAST_TEAR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.GLASS_BOTTLE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.GLISTERING_MELON_SLICE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.GOLD_NUGGET, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MAGMA_CREAM, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_11, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_BLOCKS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_CHIRP, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_FAR, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_MALL, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_MELLOHI, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_STAL, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_STRAD, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MUSIC_DISC_WARD, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.NETHER_BRICK_FENCE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.NETHER_BRICK_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.NETHER_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.NETHER_WART, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.POTION, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.SPIDER_EYE, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.SPLASH_POTION, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); + register(Items.BLAZE_POWDER, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.BLAZE_ROD, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.BREWING_STAND, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.CAULDRON, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.DRAGON_EGG, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.ENCHANTING_TABLE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.END_PORTAL_FRAME, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.END_STONE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.ENDER_EYE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.FERMENTED_SPIDER_EYE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.GHAST_TEAR, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.GLASS_BOTTLE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.GLISTERING_MELON_SLICE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.GOLD_NUGGET, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MAGMA_CREAM, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_11, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_BLOCKS, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_CHIRP, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_FAR, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_MALL, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_MELLOHI, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_STAL, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_STRAD, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MUSIC_DISC_WARD, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.NETHER_BRICK_FENCE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.NETHER_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.NETHER_BRICKS, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.NETHER_WART, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.POTION, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.SPIDER_EYE, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.SPLASH_POTION, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); // b1.9-pre1 - register(Items.LILY_PAD, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); - register(Items.MYCELIUM, ProtocolRange.andNewer(LegacyProtocolVersion.r1_0_0tor1_0_1)); + register(Items.LILY_PAD, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); + register(Items.MYCELIUM, VersionRange.andNewer(VersionEnum.r1_0_0tor1_0_1)); - register(Items.BEEF, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.BRICK_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.BRICK_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.BROWN_MUSHROOM_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.CHICKEN, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.COOKED_BEEF, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.COOKED_CHICKEN, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.CRACKED_STONE_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.ENDER_PEARL, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.GLASS_PANE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.INFESTED_COBBLESTONE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.INFESTED_CRACKED_STONE_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.INFESTED_MOSSY_STONE_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.INFESTED_STONE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.INFESTED_STONE_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.IRON_BARS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.MELON, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.MELON_SEEDS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.MELON_SLICE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.MOSSY_STONE_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.MUSHROOM_STEM, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.OAK_FENCE_GATE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.PUMPKIN_SEEDS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.RED_MUSHROOM_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.ROTTEN_FLESH, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.STONE_BRICK_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.STONE_BRICK_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); - register(Items.STONE_BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.VINE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_8tob1_8_1)); + register(Items.BEEF, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.BRICK_SLAB, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.BRICK_STAIRS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.BROWN_MUSHROOM_BLOCK, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.CHICKEN, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.COOKED_BEEF, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.COOKED_CHICKEN, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.CRACKED_STONE_BRICKS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.ENDER_PEARL, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.GLASS_PANE, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.INFESTED_COBBLESTONE, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.INFESTED_CRACKED_STONE_BRICKS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.INFESTED_MOSSY_STONE_BRICKS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.INFESTED_STONE, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.INFESTED_STONE_BRICKS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.IRON_BARS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.MELON, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.MELON_SEEDS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.MELON_SLICE, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.MOSSY_STONE_BRICKS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.MUSHROOM_STEM, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.OAK_FENCE_GATE, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.PUMPKIN_SEEDS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.RED_MUSHROOM_BLOCK, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.ROTTEN_FLESH, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.STONE_BRICK_SLAB, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.STONE_BRICK_STAIRS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); + register(Items.STONE_BRICKS, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.VINE, VersionRange.andNewer(VersionEnum.b1_8tob1_8_1)); - register(Items.PISTON, ProtocolRange.andNewer(LegacyProtocolVersion.b1_7tob1_7_3)); - register(Items.SHEARS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_7tob1_7_3)); - register(Items.STICKY_PISTON, ProtocolRange.andNewer(LegacyProtocolVersion.b1_7tob1_7_3)); + register(Items.PISTON, VersionRange.andNewer(VersionEnum.b1_7tob1_7_3)); + register(Items.SHEARS, VersionRange.andNewer(VersionEnum.b1_7tob1_7_3)); + register(Items.STICKY_PISTON, VersionRange.andNewer(VersionEnum.b1_7tob1_7_3)); - register(Items.DEAD_BUSH, ProtocolRange.andNewer(LegacyProtocolVersion.b1_6tob1_6_6)); - register(Items.FERN, ProtocolRange.andNewer(LegacyProtocolVersion.b1_6tob1_6_6)); - register(Items.GRASS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_6tob1_6_6)); - register(Items.MAP, ProtocolRange.andNewer(LegacyProtocolVersion.b1_6tob1_6_6)); - register(Items.OAK_TRAPDOOR, ProtocolRange.andNewer(LegacyProtocolVersion.b1_6tob1_6_6)); + register(Items.DEAD_BUSH, VersionRange.andNewer(VersionEnum.b1_6tob1_6_6)); + register(Items.FERN, VersionRange.andNewer(VersionEnum.b1_6tob1_6_6)); + register(Items.GRASS, VersionRange.andNewer(VersionEnum.b1_6tob1_6_6)); + register(Items.MAP, VersionRange.andNewer(VersionEnum.b1_6tob1_6_6)); + register(Items.OAK_TRAPDOOR, VersionRange.andNewer(VersionEnum.b1_6tob1_6_6)); - register(Items.BIRCH_SAPLING, ProtocolRange.andNewer(LegacyProtocolVersion.b1_5tob1_5_2)); - register(Items.COBWEB, ProtocolRange.andNewer(LegacyProtocolVersion.b1_5tob1_5_2)); - register(Items.DETECTOR_RAIL, ProtocolRange.andNewer(LegacyProtocolVersion.b1_5tob1_5_2)); - register(Items.POWERED_RAIL, ProtocolRange.andNewer(LegacyProtocolVersion.b1_5tob1_5_2)); - register(Items.SPRUCE_SAPLING, ProtocolRange.andNewer(LegacyProtocolVersion.b1_5tob1_5_2)); + register(Items.BIRCH_SAPLING, VersionRange.andNewer(VersionEnum.b1_5tob1_5_2)); + register(Items.COBWEB, VersionRange.andNewer(VersionEnum.b1_5tob1_5_2)); + register(Items.DETECTOR_RAIL, VersionRange.andNewer(VersionEnum.b1_5tob1_5_2)); + register(Items.POWERED_RAIL, VersionRange.andNewer(VersionEnum.b1_5tob1_5_2)); + register(Items.SPRUCE_SAPLING, VersionRange.andNewer(VersionEnum.b1_5tob1_5_2)); - register(Items.COOKIE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_4tob1_4_1)); - register(Items.TRAPPED_CHEST, ProtocolRange.andNewer(LegacyProtocolVersion.b1_4tob1_4_1)); + register(Items.COOKIE, VersionRange.andNewer(VersionEnum.b1_4tob1_4_1)); + register(Items.TRAPPED_CHEST, VersionRange.andNewer(VersionEnum.b1_4tob1_4_1)); - register(Items.COBBLESTONE_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.b1_3tob1_3_1), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.OAK_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.b1_3tob1_3_1)); - register(Items.RED_BED, ProtocolRange.andNewer(LegacyProtocolVersion.b1_3tob1_3_1)); - register(Items.REPEATER, ProtocolRange.andNewer(LegacyProtocolVersion.b1_3tob1_3_1)); - register(Items.SANDSTONE_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.b1_3tob1_3_1)); + register(Items.COBBLESTONE_SLAB, VersionRange.andNewer(VersionEnum.b1_3tob1_3_1), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.OAK_SLAB, VersionRange.andNewer(VersionEnum.b1_3tob1_3_1)); + register(Items.RED_BED, VersionRange.andNewer(VersionEnum.b1_3tob1_3_1)); + register(Items.REPEATER, VersionRange.andNewer(VersionEnum.b1_3tob1_3_1)); + register(Items.SANDSTONE_SLAB, VersionRange.andNewer(VersionEnum.b1_3tob1_3_1)); - register(Items.BIRCH_LEAVES, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.BIRCH_LOG, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.BLACK_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.BLUE_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.BONE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.BONE_MEAL, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.BROWN_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.CAKE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.CHARCOAL, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.COCOA_BEANS, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.CYAN_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.DISPENSER, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.GRAY_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.GREEN_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.INK_SAC, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.LAPIS_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.LAPIS_LAZULI, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.LAPIS_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.LIGHT_BLUE_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.LIGHT_GRAY_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.LIME_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.MAGENTA_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.NOTE_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.ORANGE_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.PINK_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.PURPLE_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.RED_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.SANDSTONE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.SPRUCE_LEAVES, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.SPRUCE_LOG, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.SUGAR, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.WHITE_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); - register(Items.YELLOW_DYE, ProtocolRange.andNewer(LegacyProtocolVersion.b1_2_0tob1_2_2)); + register(Items.BIRCH_LEAVES, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.BIRCH_LOG, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.BLACK_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.BLUE_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.BONE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.BONE_MEAL, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.BROWN_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.CAKE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.CHARCOAL, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.COCOA_BEANS, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.CYAN_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.DISPENSER, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.GRAY_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.GREEN_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.INK_SAC, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.LAPIS_BLOCK, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.LAPIS_LAZULI, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.LAPIS_ORE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.LIGHT_BLUE_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.LIGHT_GRAY_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.LIME_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.MAGENTA_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.NOTE_BLOCK, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.ORANGE_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.PINK_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.PURPLE_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.RED_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.SANDSTONE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.SPRUCE_LEAVES, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.SPRUCE_LOG, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.SUGAR, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.WHITE_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); + register(Items.YELLOW_DYE, VersionRange.andNewer(VersionEnum.b1_2_0tob1_2_2)); - register(Items.CARVED_PUMPKIN, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.CLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.COD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.COOKED_COD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.GLOWSTONE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.GLOWSTONE_DUST, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.JACK_O_LANTERN, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.NETHERRACK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.PUMPKIN, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); - register(Items.SOUL_SAND, ProtocolRange.andNewer(LegacyProtocolVersion.a1_2_0toa1_2_1_1)); + register(Items.CARVED_PUMPKIN, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.CLOCK, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.COD, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.COOKED_COD, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.GLOWSTONE, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.GLOWSTONE_DUST, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.JACK_O_LANTERN, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.NETHERRACK, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.PUMPKIN, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); + register(Items.SOUL_SAND, VersionRange.andNewer(VersionEnum.a1_2_0toa1_2_1_1)); - register(Items.COMPASS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_1_0toa1_1_2_1)); - register(Items.FISHING_ROD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_1_0toa1_1_2_1)); + register(Items.COMPASS, VersionRange.andNewer(VersionEnum.a1_1_0toa1_1_2_1)); + register(Items.FISHING_ROD, VersionRange.andNewer(VersionEnum.a1_1_0toa1_1_2_1)); // Indev with former 20100223 (it's not known) - register(Items.PAINTING, ProtocolRange.andNewer(LegacyProtocolVersion.a1_1_0toa1_1_2_1)); + register(Items.PAINTING, VersionRange.andNewer(VersionEnum.a1_1_0toa1_1_2_1)); - register(Items.OAK_FENCE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_17toa1_0_17_4)); + register(Items.OAK_FENCE, VersionRange.andNewer(VersionEnum.a1_0_17toa1_0_17_4)); // a1.0.14 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.CHEST_MINECART, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.EGG, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.FURNACE_MINECART, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.JUKEBOX, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.MUSIC_DISC_13, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.MUSIC_DISC_CAT, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.CHEST_MINECART, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.EGG, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.FURNACE_MINECART, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.JUKEBOX, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.MUSIC_DISC_13, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.MUSIC_DISC_CAT, VersionRange.andNewer(VersionEnum.a1_0_15)); // a1.0.11 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.BOOK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.BRICK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.CLAY, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.CLAY_BALL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.PAPER, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.SLIME_BALL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.SUGAR_CANE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.BOOK, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.BRICK, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.CLAY, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.CLAY_BALL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.PAPER, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.SLIME_BALL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.SUGAR_CANE, VersionRange.andNewer(VersionEnum.a1_0_15)); // a1.0.8 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.LEATHER, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.MILK_BUCKET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.LEATHER, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.MILK_BUCKET, VersionRange.andNewer(VersionEnum.a1_0_15)); // a1.0.6 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.CACTUS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.OAK_BOAT, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.CACTUS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.OAK_BOAT, VersionRange.andNewer(VersionEnum.a1_0_15)); // a1.0.5 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.SNOW_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.SNOWBALL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.SNOW_BLOCK, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.SNOWBALL, VersionRange.andNewer(VersionEnum.a1_0_15)); // a1.0.4 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.ICE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.SNOW, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); + register(Items.ICE, VersionRange.andNewer(VersionEnum.a1_0_15), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.SNOW, VersionRange.andNewer(VersionEnum.a1_0_15), VersionRange.singleton(VersionEnum.c0_30cpe)); // a1.0.1 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.IRON_DOOR, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.LEVER, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.OAK_PRESSURE_PLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.REDSTONE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.REDSTONE_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.REDSTONE_TORCH, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STONE_BUTTON, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STONE_PRESSURE_PLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.IRON_DOOR, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.LEVER, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.OAK_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.REDSTONE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.REDSTONE_ORE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.REDSTONE_TORCH, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STONE_BUTTON, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STONE_PRESSURE_PLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100629 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.COBBLESTONE_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.OAK_STAIRS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.COBBLESTONE_STAIRS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.OAK_STAIRS, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100625-2 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.SADDLE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.SPAWNER, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.SADDLE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.SPAWNER, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100624 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.MINECART, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.OAK_DOOR, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.RAIL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.MINECART, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.OAK_DOOR, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.RAIL, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100615 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.BUCKET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.LAVA_BUCKET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WATER_BUCKET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.BUCKET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.LAVA_BUCKET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WATER_BUCKET, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100607 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.LADDER, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.OAK_SIGN, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.LADDER, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.OAK_SIGN, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100227-1 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.GOLDEN_APPLE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.GOLDEN_APPLE, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100219 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.COOKED_PORKCHOP, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.FLINT, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.FURNACE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.PORKCHOP, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.COOKED_PORKCHOP, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.FLINT, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.FURNACE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.PORKCHOP, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100212-1 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.CHAINMAIL_BOOTS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.CHAINMAIL_CHESTPLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.CHAINMAIL_HELMET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.CHAINMAIL_LEGGINGS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_BOOTS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_CHESTPLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_HELMET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_LEGGINGS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_BOOTS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_CHESTPLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_HELMET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_LEGGINGS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_BOOTS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_CHESTPLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_HELMET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_LEGGINGS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.CHAINMAIL_BOOTS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.CHAINMAIL_CHESTPLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.CHAINMAIL_HELMET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.CHAINMAIL_LEGGINGS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_BOOTS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_CHESTPLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_HELMET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_LEGGINGS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_BOOTS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_CHESTPLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_HELMET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_LEGGINGS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_BOOTS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_CHESTPLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_HELMET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_LEGGINGS, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 20100206 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.BREAD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_HOE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.FARMLAND, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_HOE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_HOE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STONE_HOE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WHEAT, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WHEAT_SEEDS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WOODEN_HOE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.BREAD, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_HOE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.FARMLAND, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_HOE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_HOE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STONE_HOE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WHEAT, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WHEAT_SEEDS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WOODEN_HOE, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 0.31 20100130 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.BOWL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.CRAFTING_TABLE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.FEATHER, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_AXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_PICKAXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_SHOVEL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLDEN_SWORD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GUNPOWDER, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.MUSHROOM_STEW, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STRING, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.BOWL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.CRAFTING_TABLE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.FEATHER, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_AXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_PICKAXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_SHOVEL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLDEN_SWORD, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GUNPOWDER, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.MUSHROOM_STEW, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STRING, VersionRange.andNewer(VersionEnum.a1_0_15)); // Infdev 0.31 20100129 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.STICK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.STICK, VersionRange.andNewer(VersionEnum.a1_0_15)); // Indev 0.31 20100128 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.COAL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_AXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_PICKAXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_SHOVEL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.DIAMOND_SWORD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GOLD_INGOT, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_INGOT, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STONE_AXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STONE_PICKAXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STONE_SHOVEL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.STONE_SWORD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WOODEN_AXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WOODEN_PICKAXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WOODEN_SHOVEL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.WOODEN_SWORD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.COAL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_AXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_BLOCK, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_ORE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_PICKAXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_SHOVEL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.DIAMOND_SWORD, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GOLD_INGOT, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_INGOT, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STONE_AXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STONE_PICKAXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STONE_SHOVEL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.STONE_SWORD, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WOODEN_AXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WOODEN_PICKAXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WOODEN_SHOVEL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.WOODEN_SWORD, VersionRange.andNewer(VersionEnum.a1_0_15)); // Indev 0.31 20091231-2 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.APPLE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_AXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_BOOTS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_CHESTPLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_HELMET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_LEGGINGS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_PICKAXE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_SHOVEL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.IRON_SWORD, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.LEATHER_BOOTS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.LEATHER_CHESTPLATE, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.LEATHER_HELMET, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.LEATHER_LEGGINGS, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.APPLE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_AXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_BOOTS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_CHESTPLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_HELMET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_LEGGINGS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_PICKAXE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_SHOVEL, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.IRON_SWORD, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.LEATHER_BOOTS, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.LEATHER_CHESTPLATE, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.LEATHER_HELMET, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.LEATHER_LEGGINGS, VersionRange.andNewer(VersionEnum.a1_0_15)); // Indev 0.31 20100124-1 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.CHEST, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.CHEST, VersionRange.andNewer(VersionEnum.a1_0_15)); // Indev 0.31 20100122 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.ARROW, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.BOW, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.ARROW, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.BOW, VersionRange.andNewer(VersionEnum.a1_0_15)); // Indev 0.31 20100110 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.FLINT_AND_STEEL, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.FLINT_AND_STEEL, VersionRange.andNewer(VersionEnum.a1_0_15)); // Indev 0.31 20091223-2 (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.STONE_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.TORCH, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.STONE_SLAB, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.TORCH, VersionRange.andNewer(VersionEnum.a1_0_15)); // Cave game tech test? I literally have no idea - register(Items.BEDROCK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); - register(Items.GRASS_BLOCK, ProtocolRange.andNewer(LegacyProtocolVersion.a1_0_15)); + register(Items.BEDROCK, VersionRange.andNewer(VersionEnum.a1_0_15)); + register(Items.GRASS_BLOCK, VersionRange.andNewer(VersionEnum.a1_0_15)); - register(Items.OBSIDIAN, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); - register(Items.TNT, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); + register(Items.OBSIDIAN, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); + register(Items.TNT, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); // 0.26 SURVIVAL TEST (doesn't have multiplayer, so we assign it to the next multiplayer version) - register(Items.BOOKSHELF, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); - register(Items.BRICKS, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); - register(Items.COAL_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); - register(Items.GOLD_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); - register(Items.IRON_ORE, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); - register(Items.MOSSY_COBBLESTONE, ProtocolRange.andNewer(LegacyProtocolVersion.c0_28toc0_30)); + register(Items.BOOKSHELF, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); + register(Items.BRICKS, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); + register(Items.COAL_ORE, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); + register(Items.GOLD_ORE, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); + register(Items.IRON_ORE, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); + register(Items.MOSSY_COBBLESTONE, VersionRange.andNewer(VersionEnum.c0_28toc0_30)); - register(Items.BLACK_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.BLUE_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.BROWN_MUSHROOM, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.BROWN_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.CYAN_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.DANDELION, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.GRAY_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.GREEN_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.LIGHT_BLUE_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.LIGHT_GRAY_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.LIME_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.MAGENTA_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.ORANGE_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.PINK_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27), ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); - register(Items.POPPY, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.PURPLE_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.RED_MUSHROOM, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.RED_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.SMOOTH_STONE_SLAB, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.WHITE_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); - register(Items.YELLOW_WOOL, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_20ac0_27)); + register(Items.BLACK_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.BLUE_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.BROWN_MUSHROOM, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.BROWN_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.CYAN_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.DANDELION, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.GRAY_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.GREEN_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.LIGHT_BLUE_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.LIGHT_GRAY_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.LIME_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.MAGENTA_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.ORANGE_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.PINK_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27), VersionRange.singleton(VersionEnum.c0_30cpe)); + register(Items.POPPY, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.PURPLE_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.RED_MUSHROOM, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.RED_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.SMOOTH_STONE_SLAB, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.WHITE_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); + register(Items.YELLOW_WOOL, VersionRange.andNewer(VersionEnum.c0_0_20ac0_27)); - register(Items.SPONGE, ProtocolRange.andNewer(LegacyProtocolVersion.c0_0_19a_06)); + register(Items.SPONGE, VersionRange.andNewer(VersionEnum.c0_0_19a_06)); } - private void register(final Item item, final ProtocolRange range) { - itemMap.put(item, new ProtocolRange[]{range}); + private void register(final Item item, final VersionRange range) { + itemMap.put(item, new VersionRange[]{range}); } - private void register(final Item item, final ProtocolRange... ranges) { + private void register(final Item item, final VersionRange... ranges) { itemMap.put(item, ranges); } - public Map getItemMap() { + public Map getItemMap() { return itemMap; } diff --git a/src/main/java/de/florianmichael/viafabricplus/mappings/PackFormatsMappings.java b/src/main/java/de/florianmichael/viafabricplus/mappings/PackFormatsMappings.java index 5e898f6f..6d1988eb 100644 --- a/src/main/java/de/florianmichael/viafabricplus/mappings/PackFormatsMappings.java +++ b/src/main/java/de/florianmichael/viafabricplus/mappings/PackFormatsMappings.java @@ -17,6 +17,7 @@ */ package de.florianmichael.viafabricplus.mappings; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.GameVersion; @@ -32,44 +33,44 @@ public class PackFormatsMappings { private final static Map protocolMap = new HashMap<>(); public static void load() { - registerVersion(ProtocolVersion.v1_20, 15, "1.20 Pre-release 5", "1.20-pre5"); - registerVersion(ProtocolVersion.v1_19_4, 13, "1.19.4"); - registerVersion(ProtocolVersion.v1_19_3, 12, "1.19.3"); - registerVersion(ProtocolVersion.v1_19_1, 9, "1.19.2"); - registerVersion(ProtocolVersion.v1_19, 9, "1.19"); - registerVersion(ProtocolVersion.v1_18_2, 8, "1.18.2"); - registerVersion(ProtocolVersion.v1_18, 8, "1.18"); - registerVersion(ProtocolVersion.v1_17_1, 7, "1.17.1"); - registerVersion(ProtocolVersion.v1_17, 7, "1.17"); - registerVersion(ProtocolVersion.v1_16_4, 6, "1.16.5"); - registerVersion(ProtocolVersion.v1_16_3, 6, "1.16.3"); - registerVersion(ProtocolVersion.v1_16_2, 6, "1.16.2"); - registerVersion(ProtocolVersion.v1_16_1, 5, "1.16.1"); - registerVersion(ProtocolVersion.v1_16, 5, "1.16"); - registerVersion(ProtocolVersion.v1_15_2, 5, "1.15.2"); - registerVersion(ProtocolVersion.v1_15_1, 5, "1.15.1"); - registerVersion(ProtocolVersion.v1_15, 5, "1.15"); - registerVersion(ProtocolVersion.v1_14_4, 4, "1.14.4"); - registerVersion(ProtocolVersion.v1_14_3, 4, "1.14.3"); - registerVersion(ProtocolVersion.v1_14_2, 4, "1.14.2", "1.14.2 / f647ba8dc371474797bee24b2b312ff4"); - registerVersion(ProtocolVersion.v1_14_1, 4, "1.14.1", "1.14.1 / a8f78b0d43c74598a199d6d80cda413f"); - registerVersion(ProtocolVersion.v1_14, 4, "1.14", "1.14 / 5dac5567e13e46bdb0c1d90aa8d8b3f7"); - registerVersion(ProtocolVersion.v1_13_2, 4, "1.13.2"); // ids weren't sent over the http headers back then, why care... - registerVersion(ProtocolVersion.v1_13_1, 4, "1.13.1"); - registerVersion(ProtocolVersion.v1_13, 4, "1.13"); - registerVersion(ProtocolVersion.v1_12_2, 3, "1.12.2"); - registerVersion(ProtocolVersion.v1_12_1, 3, "1.12.1"); - registerVersion(ProtocolVersion.v1_12, 3, "1.12"); - registerVersion(ProtocolVersion.v1_11_1, 3, "1.11.2"); - registerVersion(ProtocolVersion.v1_11, 3, "1.11"); - registerVersion(ProtocolVersion.v1_10, 2, "1.10.2"); - registerVersion(ProtocolVersion.v1_9_3, 2, "1.9.4"); - registerVersion(ProtocolVersion.v1_9_2, 2, "1.9.2"); - registerVersion(ProtocolVersion.v1_9_1, 2, "1.9.1"); - registerVersion(ProtocolVersion.v1_9, 2, "1.9"); - registerVersion(ProtocolVersion.v1_8, 1, "1.8.9"); - registerVersion(ProtocolVersion.v1_7_6, 1, "1.7.10"); - registerVersion(ProtocolVersion.v1_7_1, 1, "1.7.5"); + registerVersion(VersionEnum.r1_20, 15, "1.20 Pre-release 5", "1.20-pre5"); + registerVersion(VersionEnum.r1_19_4, 13, "1.19.4"); + registerVersion(VersionEnum.r1_19_3, 12, "1.19.3"); + registerVersion(VersionEnum.r1_19_1tor1_19_2, 9, "1.19.2"); + registerVersion(VersionEnum.r1_19, 9, "1.19"); + registerVersion(VersionEnum.r1_18_2, 8, "1.18.2"); + registerVersion(VersionEnum.r1_18tor1_18_1, 8, "1.18"); + registerVersion(VersionEnum.r1_17_1, 7, "1.17.1"); + registerVersion(VersionEnum.r1_17, 7, "1.17"); + registerVersion(VersionEnum.r1_16_4tor1_16_5, 6, "1.16.5"); + registerVersion(VersionEnum.r1_16_3, 6, "1.16.3"); + registerVersion(VersionEnum.r1_16_2, 6, "1.16.2"); + registerVersion(VersionEnum.r1_16_1, 5, "1.16.1"); + registerVersion(VersionEnum.r1_16, 5, "1.16"); + registerVersion(VersionEnum.r1_15_2, 5, "1.15.2"); + registerVersion(VersionEnum.r1_15_1, 5, "1.15.1"); + registerVersion(VersionEnum.r1_15, 5, "1.15"); + registerVersion(VersionEnum.r1_14_4, 4, "1.14.4"); + registerVersion(VersionEnum.r1_14_3, 4, "1.14.3"); + registerVersion(VersionEnum.r1_14_2, 4, "1.14.2", "1.14.2 / f647ba8dc371474797bee24b2b312ff4"); + registerVersion(VersionEnum.r1_14_1, 4, "1.14.1", "1.14.1 / a8f78b0d43c74598a199d6d80cda413f"); + registerVersion(VersionEnum.r1_14, 4, "1.14", "1.14 / 5dac5567e13e46bdb0c1d90aa8d8b3f7"); + registerVersion(VersionEnum.r1_13_2, 4, "1.13.2"); // ids weren't sent over the http headers back then, why care... + registerVersion(VersionEnum.r1_13_1, 4, "1.13.1"); + registerVersion(VersionEnum.r1_13, 4, "1.13"); + registerVersion(VersionEnum.r1_12_2, 3, "1.12.2"); + registerVersion(VersionEnum.r1_12_1, 3, "1.12.1"); + registerVersion(VersionEnum.r1_12, 3, "1.12"); + registerVersion(VersionEnum.r1_11_1to1_11_2, 3, "1.11.2"); + registerVersion(VersionEnum.r1_11, 3, "1.11"); + registerVersion(VersionEnum.r1_10, 2, "1.10.2"); + registerVersion(VersionEnum.r1_9_3tor1_9_4, 2, "1.9.4"); + registerVersion(VersionEnum.r1_9_2, 2, "1.9.2"); + registerVersion(VersionEnum.r1_9_1, 2, "1.9.1"); + registerVersion(VersionEnum.r1_9, 2, "1.9"); + registerVersion(VersionEnum.r1_8, 1, "1.8.9"); + registerVersion(VersionEnum.r1_7_6tor1_7_10, 1, "1.7.10"); + registerVersion(VersionEnum.r1_7_2tor1_7_5, 1, "1.7.5"); checkOutdated(SharedConstants.getProtocolVersion()); } @@ -91,11 +92,11 @@ public class PackFormatsMappings { return protocolMap.get(targetVersion); } - private static void registerVersion(final ProtocolVersion version, final int packFormat, final String name) { + private static void registerVersion(final VersionEnum version, final int packFormat, final String name) { registerVersion(version, packFormat, name, name); } - private static void registerVersion(final ProtocolVersion version, final int packFormat, final String name, final String id) { + private static void registerVersion(final VersionEnum version, final int packFormat, final String name, final String id) { protocolMap.put(version.getVersion(), new GameVersion() { @Override public SaveVersion getSaveVersion() { diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java index c327995b..1902fd44 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java @@ -22,56 +22,26 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.RequiredArgumentBuilder; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import com.viaversion.viaversion.api.protocol.version.VersionProvider; import com.viaversion.viaversion.connection.UserConnectionImpl; -import com.viaversion.viaversion.libs.gson.JsonArray; -import com.viaversion.viaversion.libs.gson.JsonObject; import com.viaversion.viaversion.protocol.ProtocolPipelineImpl; -import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider; -import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider; -import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider; -import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider; -import de.florianmichael.viafabricplus.ViaFabricPlus; -import de.florianmichael.viafabricplus.definition.v1_19_0.provider.CommandArgumentsProvider; import de.florianmichael.viafabricplus.base.event.ChangeProtocolVersionCallback; -import de.florianmichael.viafabricplus.base.event.FinishViaLoadingBaseStartupCallback; -import de.florianmichael.viafabricplus.base.event.ViaLoadingBaseBuilderCallback; -import de.florianmichael.viafabricplus.protocolhack.command.ViaFabricPlusVLBViaCommandHandler; -import de.florianmichael.viafabricplus.protocolhack.netty.ViaFabricPlusVLBPipeline; -import de.florianmichael.viafabricplus.protocolhack.platform.ViaAprilFoolsPlatformImpl; -import de.florianmichael.viafabricplus.protocolhack.platform.ViaBedrockPlatformImpl; -import de.florianmichael.viafabricplus.protocolhack.platform.ViaLegacyPlatformImpl; -import de.florianmichael.viafabricplus.protocolhack.provider.*; -import de.florianmichael.viafabricplus.protocolhack.provider.viabedrock.ViaFabricPlusBlobCacheProvider; -import de.florianmichael.viafabricplus.protocolhack.provider.viabedrock.ViaFabricPlusNettyPipelineProvider; -import de.florianmichael.viafabricplus.protocolhack.provider.vialegacy.*; -import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusHandItemProvider; -import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusMovementTransmitterProvider; -import de.florianmichael.viafabricplus.protocolhack.provider.vialoadingbase.ViaFabricPlusVLBBaseVersionProvider; -import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusPlayerAbilitiesProvider; -import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusPlayerLookTargetProvider; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; -import de.florianmichael.vialoadingbase.model.Platform; +import de.florianmichael.viafabricplus.base.event.FinishViaVersionStartupCallback; +import de.florianmichael.viafabricplus.protocolhack.command.ViaFabricPlusVLCommandHandler; +import de.florianmichael.viafabricplus.protocolhack.impl.ViaFabricPlusVLInjector; +import de.florianmichael.viafabricplus.protocolhack.impl.ViaFabricPlusVLLoader; +import de.florianmichael.viafabricplus.protocolhack.netty.ViaFabricPlusVLLegacyPipeline; import io.netty.channel.*; import io.netty.util.AttributeKey; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; -import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.SharedConstants; import net.minecraft.client.MinecraftClient; import net.minecraft.network.ClientConnection; -import net.raphimc.viaaprilfools.api.AprilFoolsProtocolVersion; -import net.raphimc.viabedrock.api.BedrockProtocolVersion; -import net.raphimc.viabedrock.protocol.providers.BlobCacheProvider; -import net.raphimc.viabedrock.protocol.providers.NettyPipelineProvider; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; -import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicMPPassProvider; -import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicWorldHeightProvider; -import net.raphimc.vialegacy.protocols.release.protocol1_3_1_2to1_2_4_5.providers.OldAuthProvider; -import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.providers.EncryptionProvider; -import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.providers.GameProfileFetcher; +import net.raphimc.vialoader.ViaLoader; +import net.raphimc.vialoader.impl.platform.ViaAprilFoolsPlatformImpl; +import net.raphimc.vialoader.impl.platform.ViaBackwardsPlatformImpl; +import net.raphimc.vialoader.impl.platform.ViaBedrockPlatformImpl; +import net.raphimc.vialoader.impl.platform.ViaLegacyPlatformImpl; +import net.raphimc.vialoader.util.VersionEnum; import java.net.InetSocketAddress; import java.util.*; @@ -79,11 +49,12 @@ import java.util.*; public class ProtocolHack { public final static AttributeKey LOCAL_VIA_CONNECTION = AttributeKey.newInstance("viafabricplus-via-connection"); public final static AttributeKey LOCAL_MINECRAFT_CONNECTION = AttributeKey.newInstance("viafabricplus-minecraft-connection"); - public final static AttributeKey FORCED_VERSION = AttributeKey.newInstance("viafabricplus-forced-version"); + public final static AttributeKey FORCED_VERSION = AttributeKey.newInstance("viafabricplus-forced-version"); - private final static Map forcedVersions = new HashMap<>(); + private final static Map forcedVersions = new HashMap<>(); + public static VersionEnum targetVersion = VersionEnum.r1_19_4; - public static ComparableProtocolVersion getTargetVersion() { + public static VersionEnum getTargetVersion() { if (MinecraftClient.getInstance() == null || MinecraftClient.getInstance().getNetworkHandler() == null) { return getTargetVersion((Channel) null); } @@ -91,22 +62,22 @@ public class ProtocolHack { return getTargetVersion(MinecraftClient.getInstance().getNetworkHandler().getConnection().channel); } - public static ComparableProtocolVersion getTargetVersion(final Channel channel) { - if (channel != null && channel.hasAttr(FORCED_VERSION)) { - return channel.attr(FORCED_VERSION).get(); - } - - return ViaLoadingBase.getInstance().getTargetVersion(); - } - - public static ComparableProtocolVersion getTargetVersion(final InetSocketAddress socketAddress) { + public static VersionEnum getTargetVersion(final InetSocketAddress socketAddress) { if (forcedVersions.containsKey(socketAddress)) { return forcedVersions.get(socketAddress); } return getTargetVersion(); } - public static Map getForcedVersions() { + public static VersionEnum getTargetVersion(final Channel channel) { + if (channel != null && channel.hasAttr(FORCED_VERSION)) { + return channel.attr(FORCED_VERSION).get(); + } + + return targetVersion; + } + + public static Map getForcedVersions() { return forcedVersions; } @@ -121,13 +92,13 @@ public class ProtocolHack { new ProtocolPipelineImpl(user); - channel.pipeline().addLast(new ViaFabricPlusVLBPipeline(user, address, ProtocolHack.getTargetVersion(channel))); + channel.pipeline().addLast(new ViaFabricPlusVLLegacyPipeline(user, ProtocolHack.getTargetVersion(channel), address)); } private static void initCommands() { // Adding ViaVersion commands ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> { - final ViaFabricPlusVLBViaCommandHandler commandHandler = (ViaFabricPlusVLBViaCommandHandler) Via.getManager().getCommandHandler(); + final ViaFabricPlusVLCommandHandler commandHandler = (ViaFabricPlusVLCommandHandler) Via.getManager().getCommandHandler(); final RequiredArgumentBuilder executor = RequiredArgumentBuilder. argument("args", StringArgumentType.greedyString()).executes(commandHandler::execute).suggests(commandHandler::suggestion); @@ -137,86 +108,15 @@ public class ProtocolHack { }); } + public static void setTargetVersion(VersionEnum targetVersion) { + ProtocolHack.targetVersion = targetVersion; + ChangeProtocolVersionCallback.EVENT.invoker().onChangeProtocolVersion(targetVersion); + } + public static void init() { - ViaLoadingBase.ViaLoadingBaseBuilder builder = ViaLoadingBase.ViaLoadingBaseBuilder.create(); - - builder = builder.platform(new Platform("ViaBedrock", () -> true, ViaBedrockPlatformImpl::new, protocolVersions -> protocolVersions.add(BedrockProtocolVersion.bedrockLatest)), 0); - builder = builder.platform(new Platform("ViaLegacy", () -> true, ViaLegacyPlatformImpl::new, protocolVersions -> { - final List legacyProtocols = new ArrayList<>(LegacyProtocolVersion.PROTOCOLS); - Collections.reverse(legacyProtocols); - - legacyProtocols.remove(LegacyProtocolVersion.c0_30cpe); - legacyProtocols.add(legacyProtocols.indexOf(LegacyProtocolVersion.c0_28toc0_30) + 1, LegacyProtocolVersion.c0_30cpe); - - protocolVersions.addAll(legacyProtocols); - })); - builder = builder.platform(new Platform("ViaAprilFools", () -> true, ViaAprilFoolsPlatformImpl::new, protocolVersions -> { - protocolVersions.add(protocolVersions.indexOf(ProtocolVersion.v1_14) + 1, AprilFoolsProtocolVersion.s3d_shareware); - protocolVersions.add(protocolVersions.indexOf(ProtocolVersion.v1_16) + 1, AprilFoolsProtocolVersion.s20w14infinite); - protocolVersions.add(protocolVersions.indexOf(ProtocolVersion.v1_16_2) + 1, AprilFoolsProtocolVersion.sCombatTest8c); - })); - - builder = builder.runDirectory(ViaFabricPlus.RUN_DIRECTORY); - builder = builder.nativeVersion(SharedConstants.getProtocolVersion()); - builder = builder.forceNativeVersionCondition(() -> { - if (MinecraftClient.getInstance() == null) return true; - - return MinecraftClient.getInstance().isInSingleplayer(); - }); - builder = builder.providers(providers -> { - providers.use(VersionProvider.class, new ViaFabricPlusVLBBaseVersionProvider()); - - providers.use(MovementTransmitterProvider.class, new ViaFabricPlusMovementTransmitterProvider()); - providers.use(HandItemProvider.class, new ViaFabricPlusHandItemProvider()); - providers.use(PlayerLookTargetProvider.class, new ViaFabricPlusPlayerLookTargetProvider()); - providers.use(PlayerAbilitiesProvider.class, new ViaFabricPlusPlayerAbilitiesProvider()); - - providers.use(CommandArgumentsProvider.class, new ViaFabricPlusCommandArgumentsProvider()); - - providers.use(OldAuthProvider.class, new ViaFabricPlusOldAuthProvider()); - providers.use(ClassicWorldHeightProvider.class, new ViaFabricPlusClassicWorldHeightProvider()); - providers.use(EncryptionProvider.class, new ViaFabricPlusEncryptionProvider()); - providers.use(GameProfileFetcher.class, new ViaFabricPlusGameProfileFetcher()); - providers.use(ClassicMPPassProvider.class, new ViaFabricPlusClassicMPPassProvider()); - - providers.use(NettyPipelineProvider.class, new ViaFabricPlusNettyPipelineProvider()); - providers.use(BlobCacheProvider.class, new ViaFabricPlusBlobCacheProvider()); - }); - builder = builder.onProtocolReload(protocolVersion -> ChangeProtocolVersionCallback.EVENT.invoker().onChangeProtocolVersion(protocolVersion)); - builder = builder.dumpSupplier(() -> { - JsonObject platformSpecific = new JsonObject(); - JsonArray mods = new JsonArray(); - FabricLoader.getInstance().getAllMods().stream().map((mod) -> { - JsonObject jsonMod = new JsonObject(); - jsonMod.addProperty("id", mod.getMetadata().getId()); - jsonMod.addProperty("name", mod.getMetadata().getName()); - jsonMod.addProperty("version", mod.getMetadata().getVersion().getFriendlyString()); - JsonArray authors = new JsonArray(); - mod.getMetadata().getAuthors().stream().map(it -> { - JsonObject info = new JsonObject(); - JsonObject contact = new JsonObject(); - it.getContact().asMap().forEach(contact::addProperty); - - if (contact.size() != 0) info.add("contact", contact); - info.addProperty("name", it.getName()); - - return info; - }).forEach(authors::add); - jsonMod.add("authors", authors); - - return jsonMod; - }).forEach(mods::add); - - platformSpecific.add("mods", mods); - platformSpecific.addProperty("native version", SharedConstants.getProtocolVersion()); - return platformSpecific; - }); - builder = builder.managerBuilderConsumer(viaManagerBuilder -> viaManagerBuilder.commandHandler(new ViaFabricPlusVLBViaCommandHandler())); - - ViaLoadingBaseBuilderCallback.EVENT.invoker().onBuildViaLoadingBase(builder); - builder.build(); + ViaLoader.init(null, new ViaFabricPlusVLLoader(), new ViaFabricPlusVLInjector(), new ViaFabricPlusVLCommandHandler(), ViaBackwardsPlatformImpl::new, ViaLegacyPlatformImpl::new, ViaAprilFoolsPlatformImpl::new, ViaBedrockPlatformImpl::new); initCommands(); - FinishViaLoadingBaseStartupCallback.EVENT.invoker().onFinishViaLoadingBaseStartup(); + FinishViaVersionStartupCallback.EVENT.invoker().onFinishViaVersionStartup(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusVLBViaCommandHandler.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusVLCommandHandler.java similarity index 93% rename from src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusVLBViaCommandHandler.java rename to src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusVLCommandHandler.java index 0c4e746f..044cd6d4 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusVLBViaCommandHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusVLCommandHandler.java @@ -23,14 +23,14 @@ import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; import de.florianmichael.viafabricplus.definition.c0_30.command.impl.ListExtensionsCommand; import de.florianmichael.viafabricplus.definition.c0_30.command.impl.SetTimeCommand; -import de.florianmichael.vialoadingbase.platform.viaversion.VLBViaCommandHandler; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import net.raphimc.vialoader.impl.viaversion.VLCommandHandler; import java.util.concurrent.CompletableFuture; -public class ViaFabricPlusVLBViaCommandHandler extends VLBViaCommandHandler { +public class ViaFabricPlusVLCommandHandler extends VLCommandHandler { - public ViaFabricPlusVLBViaCommandHandler() { + public ViaFabricPlusVLCommandHandler() { super(); this.registerSubCommand(new ListExtensionsCommand()); diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLInjector.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLInjector.java new file mode 100644 index 00000000..916eb63f --- /dev/null +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLInjector.java @@ -0,0 +1,69 @@ +/* + * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus + * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package de.florianmichael.viafabricplus.protocolhack.impl; + +import com.viaversion.viaversion.libs.gson.JsonArray; +import com.viaversion.viaversion.libs.gson.JsonObject; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.SharedConstants; +import net.raphimc.vialoader.impl.viaversion.VLInjector; +import net.raphimc.vialoader.netty.VLLegacyPipeline; + +public class ViaFabricPlusVLInjector extends VLInjector { + + @Override + public String getEncoderName() { + return VLLegacyPipeline.VIA_ENCODER_NAME; + } + + @Override + public String getDecoderName() { + return VLLegacyPipeline.VIA_DECODER_NAME; + } + + @Override + public JsonObject getDump() { + JsonObject platformSpecific = new JsonObject(); + JsonArray mods = new JsonArray(); + FabricLoader.getInstance().getAllMods().stream().map((mod) -> { + JsonObject jsonMod = new JsonObject(); + jsonMod.addProperty("id", mod.getMetadata().getId()); + jsonMod.addProperty("name", mod.getMetadata().getName()); + jsonMod.addProperty("version", mod.getMetadata().getVersion().getFriendlyString()); + JsonArray authors = new JsonArray(); + mod.getMetadata().getAuthors().stream().map(it -> { + JsonObject info = new JsonObject(); + JsonObject contact = new JsonObject(); + it.getContact().asMap().forEach(contact::addProperty); + + if (contact.size() != 0) info.add("contact", contact); + info.addProperty("name", it.getName()); + + return info; + }).forEach(authors::add); + jsonMod.add("authors", authors); + + return jsonMod; + }).forEach(mods::add); + + platformSpecific.add("mods", mods); + platformSpecific.addProperty("native version", SharedConstants.getProtocolVersion()); + + return platformSpecific; + } +} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLLoader.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLLoader.java new file mode 100644 index 00000000..f4a37558 --- /dev/null +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/impl/ViaFabricPlusVLLoader.java @@ -0,0 +1,72 @@ +/* + * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus + * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package de.florianmichael.viafabricplus.protocolhack.impl; + +import com.viaversion.viaversion.api.Via; +import com.viaversion.viaversion.api.platform.providers.ViaProviders; +import com.viaversion.viaversion.api.protocol.version.VersionProvider; +import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider; +import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider; +import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider; +import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider; +import de.florianmichael.viafabricplus.definition.v1_19_0.provider.CommandArgumentsProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.ViaFabricPlusCommandArgumentsProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.viabedrock.ViaFabricPlusBlobCacheProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.viabedrock.ViaFabricPlusNettyPipelineProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.vialegacy.*; +import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusBaseVersionProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusHandItemProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusMovementTransmitterProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusPlayerAbilitiesProvider; +import de.florianmichael.viafabricplus.protocolhack.provider.viaversion.ViaFabricPlusPlayerLookTargetProvider; +import net.raphimc.viabedrock.protocol.providers.BlobCacheProvider; +import net.raphimc.viabedrock.protocol.providers.NettyPipelineProvider; +import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicMPPassProvider; +import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicWorldHeightProvider; +import net.raphimc.vialegacy.protocols.release.protocol1_3_1_2to1_2_4_5.providers.OldAuthProvider; +import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.providers.EncryptionProvider; +import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.providers.GameProfileFetcher; +import net.raphimc.vialoader.impl.viaversion.VLLoader; + +public class ViaFabricPlusVLLoader extends VLLoader { + + @Override + public void load() { + super.load(); + + final ViaProviders providers = Via.getManager().getProviders(); + + providers.use(VersionProvider.class, new ViaFabricPlusBaseVersionProvider()); + + providers.use(MovementTransmitterProvider.class, new ViaFabricPlusMovementTransmitterProvider()); + providers.use(HandItemProvider.class, new ViaFabricPlusHandItemProvider()); + providers.use(PlayerLookTargetProvider.class, new ViaFabricPlusPlayerLookTargetProvider()); + providers.use(PlayerAbilitiesProvider.class, new ViaFabricPlusPlayerAbilitiesProvider()); + + providers.use(CommandArgumentsProvider.class, new ViaFabricPlusCommandArgumentsProvider()); + + providers.use(OldAuthProvider.class, new ViaFabricPlusOldAuthProvider()); + providers.use(ClassicWorldHeightProvider.class, new ViaFabricPlusClassicWorldHeightProvider()); + providers.use(EncryptionProvider.class, new ViaFabricPlusEncryptionProvider()); + providers.use(GameProfileFetcher.class, new ViaFabricPlusGameProfileFetcher()); + providers.use(ClassicMPPassProvider.class, new ViaFabricPlusClassicMPPassProvider()); + + providers.use(NettyPipelineProvider.class, new ViaFabricPlusNettyPipelineProvider()); + providers.use(BlobCacheProvider.class, new ViaFabricPlusBlobCacheProvider()); + } +} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java deleted file mode 100644 index eb4b6ecc..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.protocolhack.netty; - -import com.viaversion.viaversion.api.connection.UserConnection; -import de.florianmichael.viafabricplus.ViaFabricPlus; -import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.DisconnectAdapter; -import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.RakNetClientConnection; -import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.PingEncapsulationCodec; -import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.RakMessageEncapsulationCodec; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; -import de.florianmichael.vialoadingbase.netty.VLBPipeline; -import de.florianmichael.vialoadingbase.netty.event.CompressionReorderEvent; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPipeline; -import net.raphimc.viabedrock.api.BedrockProtocolVersion; -import net.raphimc.viabedrock.netty.BatchLengthCodec; -import net.raphimc.viabedrock.netty.PacketEncapsulationCodec; -import net.raphimc.viabedrock.protocol.BedrockBaseProtocol; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; -import net.raphimc.vialegacy.netty.PreNettyLengthPrepender; -import net.raphimc.vialegacy.netty.PreNettyLengthRemover; -import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.baseprotocols.PreNettyBaseProtocol; - -import java.net.InetSocketAddress; - -public class ViaFabricPlusVLBPipeline extends VLBPipeline { - // ViaBedrock (RakNet and Codec based) - public final static String VIA_BEDROCK_DISCONNECT_ADAPTER_NAME = "via-bedrock-disconnect-adapter"; - public final static String VIA_BEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME = "via-bedrock-frame-encapsulation"; - public final static String VIA_BEDROCK_PING_ENCAPSULATION_HANDLER_NAME = "via-bedrock-ping-encapsulation"; - public final static String VIA_BEDROCK_PACKET_ENCAPSULATION_HANDLER_NAME = "via-bedrock-packet-encapsulation"; - public final static String VIA_BEDROCK_BATCH_LENGTH_HANDLER_NAME = "via-bedrock-batch_length"; - public final static String VIA_BEDROCK_COMPRESSION_HANDLER_NAME = "via-bedrock-compression"; - public final static String VIA_BEDROCK_ENCRYPTION_HANDLER_NAME = "via-bedrock-encryption"; - - // ViaLegacy (pre Netty) - public final static String VIA_LEGACY_PRE_NETTY_LENGTH_PREPENDER_HANDLER_NAME = "via-legacy-pre-netty-length-prepender"; - public final static String VIA_LEGACY_PRE_NETTY_LENGTH_REMOVER_HANDLER_NAME = "via-legacy-pre-netty-length-remover"; - - private final InetSocketAddress address; - private final ComparableProtocolVersion version; - - public ViaFabricPlusVLBPipeline(UserConnection info, final InetSocketAddress address, final ComparableProtocolVersion version) { - super(info); - - this.address = address; - this.version = version; - } - - @Override - public void handlerAdded(ChannelHandlerContext ctx) throws Exception { - // ViaLoadingBase - super.handlerAdded(ctx); - - final ChannelPipeline pipeline = ctx.channel().pipeline(); - - // ViaLegacy - if (this.version.isOlderThanOrEqualTo(LegacyProtocolVersion.r1_6_4)) { - getUser().getProtocolInfo().getPipeline().add(PreNettyBaseProtocol.INSTANCE); - - pipeline.addBefore("splitter", VIA_LEGACY_PRE_NETTY_LENGTH_PREPENDER_HANDLER_NAME, new PreNettyLengthPrepender(getUser())); - pipeline.addBefore("prepender", VIA_LEGACY_PRE_NETTY_LENGTH_REMOVER_HANDLER_NAME, new PreNettyLengthRemover(getUser())); - } - - // ViaBedrock - if (this.version.isEqualTo(BedrockProtocolVersion.bedrockLatest)) { - getUser().getProtocolInfo().getPipeline().add(BedrockBaseProtocol.INSTANCE); - - pipeline.replace("splitter", VIA_BEDROCK_BATCH_LENGTH_HANDLER_NAME, new BatchLengthCodec()); - - pipeline.addBefore(VIA_BEDROCK_BATCH_LENGTH_HANDLER_NAME, VIA_BEDROCK_DISCONNECT_ADAPTER_NAME, new DisconnectAdapter()); - pipeline.addAfter(VIA_BEDROCK_DISCONNECT_ADAPTER_NAME, VIA_BEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, new RakMessageEncapsulationCodec()); - pipeline.addAfter(VIA_BEDROCK_BATCH_LENGTH_HANDLER_NAME, VIA_BEDROCK_PACKET_ENCAPSULATION_HANDLER_NAME, new PacketEncapsulationCodec()); - - // Replaced by the codecs - pipeline.remove("prepender"); - pipeline.remove("timeout"); - - // Pinging in RakNet is something different - if (RakNetClientConnection.getRakNetPingSessions().contains(address)) { - pipeline.replace(VIA_BEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, VIA_BEDROCK_PING_ENCAPSULATION_HANDLER_NAME, new PingEncapsulationCodec(address)); - - pipeline.remove(VIA_BEDROCK_PACKET_ENCAPSULATION_HANDLER_NAME); - pipeline.remove(VIA_BEDROCK_BATCH_LENGTH_HANDLER_NAME); - } - } - } - - @Override - public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { - // Bypass, because Krypton overwrites the entire compression instead of modifying the handlers. - if (evt.getClass().getName().equals("me.steinborn.krypton.mod.shared.misc.KryptonPipelineEvent")) { - if (evt.toString().equals("COMPRESSION_ENABLED")) { - super.userEventTriggered(ctx, new CompressionReorderEvent()); - ViaFabricPlus.LOGGER.info("Compression has been re-ordered after \"Krypton\""); - return; - } - } - super.userEventTriggered(ctx, evt); - } - - @Override - public String getDecoderHandlerName() { - return "decoder"; - } - - @Override - public String getEncoderHandlerName() { - return "encoder"; - } - - @Override - public String getDecompressionHandlerName() { - return "decompress"; - } - - @Override - public String getCompressionHandlerName() { - return "compress"; - } -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLLegacyPipeline.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLLegacyPipeline.java new file mode 100644 index 00000000..a667cbde --- /dev/null +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLLegacyPipeline.java @@ -0,0 +1,99 @@ +/* + * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus + * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package de.florianmichael.viafabricplus.protocolhack.netty; + +import com.viaversion.viaversion.api.connection.UserConnection; +import de.florianmichael.viafabricplus.ViaFabricPlus; +import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.RakNetClientConnection; +import io.netty.channel.ChannelHandlerContext; +import net.raphimc.vialoader.netty.CompressionReorderEvent; +import net.raphimc.vialoader.netty.VLLegacyPipeline; +import net.raphimc.vialoader.netty.viabedrock.PingEncapsulationCodec; +import net.raphimc.vialoader.util.VersionEnum; + +import java.net.InetSocketAddress; + +public class ViaFabricPlusVLLegacyPipeline extends VLLegacyPipeline { + public final static String VIABEDROCK_COMPRESSION_HANDLER_NAME = "viabedrock-compression"; + public final static String VIABEDROCK_ENCRYPTION_HANDLER_NAME = "viabedrock-encryption"; + + private final InetSocketAddress address; + + public ViaFabricPlusVLLegacyPipeline(UserConnection user, VersionEnum version, final InetSocketAddress address) { + super(user, version); + + this.address = address; + } + + @Override + public void handlerAdded(ChannelHandlerContext ctx) { + super.handlerAdded(ctx); + + if (this.version == VersionEnum.bedrockLatest && RakNetClientConnection.getRakNetPingSessions().contains(address)) { + ctx.pipeline().replace(VIABEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, VIABEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, new PingEncapsulationCodec(address)); + + ctx.pipeline().remove(VIABEDROCK_PACKET_ENCAPSULATION_HANDLER_NAME); + ctx.pipeline().remove(this.lengthSplitterName()); + } + + System.out.println(ctx.pipeline().names()); + } + + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { + // Bypass, because Krypton overwrites the entire compression instead of modifying the handlers. + if (evt.getClass().getName().equals("me.steinborn.krypton.mod.shared.misc.KryptonPipelineEvent")) { + if (evt.toString().equals("COMPRESSION_ENABLED")) { + super.userEventTriggered(ctx, CompressionReorderEvent.INSTANCE); + ViaFabricPlus.LOGGER.info("Compression has been re-ordered after \"Krypton\""); + return; + } + } + super.userEventTriggered(ctx, evt); + } + + @Override + protected String decompressName() { + return "decompress"; + } + + @Override + protected String compressName() { + return "compress"; + } + + @Override + protected String packetDecoderName() { + return "decoder"; + } + + @Override + protected String packetEncoderName() { + return "encoder"; + } + + @Override + protected String lengthSplitterName() { + return "splitter"; + } + + @Override + protected String lengthPrependerName() { + return "prepender"; + } +} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/DisconnectAdapter.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/DisconnectAdapter.java deleted file mode 100644 index 0e9bd8b1..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/DisconnectAdapter.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of ViaBedrock - https://github.com/RaphiMC/ViaBedrock - * Copyright (C) 2023 RK_01/RaphiMC and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.protocolhack.netty.viabedrock; - -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; - -public class DisconnectAdapter extends ChannelOutboundHandlerAdapter { - private boolean calledDisconnect = false; - - @Override - public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception { - if (ctx.channel().isActive() && !this.calledDisconnect) { - this.calledDisconnect = true; - ctx.disconnect(promise); // Send disconnect notification to the server and close the channel - } else { - super.close(ctx, promise); - } - } -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/PingEncapsulationCodec.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/PingEncapsulationCodec.java deleted file mode 100644 index b9a630b8..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/PingEncapsulationCodec.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; -import org.cloudburstmc.netty.channel.raknet.RakConstants; -import org.cloudburstmc.netty.channel.raknet.RakPing; -import org.cloudburstmc.netty.channel.raknet.RakPong; - -import java.net.InetSocketAddress; -import java.util.List; - -public class PingEncapsulationCodec extends MessageToMessageCodec { - - private final InetSocketAddress remoteAddress; - - public PingEncapsulationCodec(final InetSocketAddress remoteAddress) { - this.remoteAddress = remoteAddress; - } - - @Override - protected void encode(ChannelHandlerContext ctx, ByteBuf in, List out) { - final int packetId = in.readUnsignedByte(); - - if (packetId == RakConstants.ID_UNCONNECTED_PING) { - out.add(new RakPing(in.readLong(), this.remoteAddress)); - } else { - ctx.close(); - throw new IllegalStateException("Unexpected packet ID: " + packetId); - } - } - - @Override - protected void decode(ChannelHandlerContext ctx, RakPong in, List out) { - if (!this.remoteAddress.equals(in.getSender())) { - ctx.close(); - throw new IllegalStateException("Received pong from unexpected address: " + in.getSender()); - } - - final ByteBuf buf = ctx.alloc().buffer(); - buf.writeByte(RakConstants.ID_UNCONNECTED_PONG); - buf.writeLong(in.getPingTime()); - buf.writeBytes(in.getPongData()); - out.add(buf); - } - -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/RakMessageEncapsulationCodec.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/RakMessageEncapsulationCodec.java deleted file mode 100644 index 1a237ed4..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/RakMessageEncapsulationCodec.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.CompositeByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; -import org.cloudburstmc.netty.channel.raknet.RakReliability; -import org.cloudburstmc.netty.channel.raknet.packet.RakMessage; - -import java.util.List; - -public class RakMessageEncapsulationCodec extends MessageToMessageCodec { - - private final static int FRAME_ID = 0xFE; - - @Override - protected void encode(ChannelHandlerContext ctx, ByteBuf msg, List out) { - final CompositeByteBuf buf = ctx.alloc().compositeBuffer(2); - try { - buf.addComponent(true, ctx.alloc().ioBuffer(1).writeByte(FRAME_ID)); - buf.addComponent(true, msg.retainedSlice()); - out.add(buf.retain()); - } finally { - buf.release(); - } - } - - @Override - protected void decode(ChannelHandlerContext ctx, RakMessage msg, List out) { - if (msg.channel() != 0 && msg.reliability() != RakReliability.RELIABLE_ORDERED) { - return; - } - final ByteBuf in = msg.content(); - if (!in.isReadable()) { - return; - } - final int id = in.readUnsignedByte(); - if (id != FRAME_ID) { - throw new IllegalStateException("Invalid frame ID: " + id); - } - out.add(in.readRetainedSlice(in.readableBytes())); - } - -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaAprilFoolsPlatformImpl.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaAprilFoolsPlatformImpl.java deleted file mode 100644 index 08e8c24f..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaAprilFoolsPlatformImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.protocolhack.platform; - -import com.viaversion.viaversion.api.Via; -import de.florianmichael.vialoadingbase.util.JLoggerToLog4j; -import net.raphimc.viaaprilfools.platform.ViaAprilFoolsPlatform; -import org.apache.logging.log4j.LogManager; - -import java.io.File; -import java.util.logging.Logger; - -public class ViaAprilFoolsPlatformImpl implements ViaAprilFoolsPlatform { - private final static Logger LOGGER = new JLoggerToLog4j(LogManager.getLogger("ViaAprilFools")); - - public ViaAprilFoolsPlatformImpl() { - this.init(this.getDataFolder()); - } - - @Override - public Logger getLogger() { - return LOGGER; - } - - @Override - public File getDataFolder() { - return Via.getPlatform().getDataFolder(); - } -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaBedrockPlatformImpl.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaBedrockPlatformImpl.java deleted file mode 100644 index 551c8704..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaBedrockPlatformImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.protocolhack.platform; - -import com.viaversion.viaversion.api.Via; -import de.florianmichael.vialoadingbase.util.JLoggerToLog4j; -import net.raphimc.viabedrock.platform.ViaBedrockPlatform; -import org.apache.logging.log4j.LogManager; - -import java.io.File; -import java.util.logging.Logger; - -public class ViaBedrockPlatformImpl implements ViaBedrockPlatform { - private final static Logger LOGGER = new JLoggerToLog4j(LogManager.getLogger("ViaBedrock")); - - public ViaBedrockPlatformImpl() { - this.init(this.getDataFolder()); - } - - @Override - public Logger getLogger() { - return LOGGER; - } - - @Override - public File getDataFolder() { - return Via.getPlatform().getDataFolder(); - } -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaLegacyPlatformImpl.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaLegacyPlatformImpl.java deleted file mode 100644 index 3f145464..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/platform/ViaLegacyPlatformImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus - * Copyright (C) 2021-2023 FlorianMichael/EnZaXD and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package de.florianmichael.viafabricplus.protocolhack.platform; - -import com.viaversion.viaversion.api.Via; -import de.florianmichael.vialoadingbase.util.JLoggerToLog4j; -import net.raphimc.vialegacy.platform.ViaLegacyPlatform; -import org.apache.logging.log4j.LogManager; - -import java.io.File; -import java.util.logging.Logger; - -public class ViaLegacyPlatformImpl implements ViaLegacyPlatform { - private final static Logger LOGGER = new JLoggerToLog4j(LogManager.getLogger("ViaLegacy")); - - public ViaLegacyPlatformImpl() { - this.init(this.getDataFolder()); - } - - @Override - public Logger getLogger() { - return LOGGER; - } - - @Override - public File getDataFolder() { - return Via.getPlatform().getDataFolder(); - } - - @Override - public String getCpeAppName() { - return "ClassiCube 1.3.5"; - } -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/vialoadingbase/ViaFabricPlusVLBBaseVersionProvider.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/viaversion/ViaFabricPlusBaseVersionProvider.java similarity index 89% rename from src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/vialoadingbase/ViaFabricPlusVLBBaseVersionProvider.java rename to src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/viaversion/ViaFabricPlusBaseVersionProvider.java index 5a55c220..519e8a55 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/vialoadingbase/ViaFabricPlusVLBBaseVersionProvider.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/viaversion/ViaFabricPlusBaseVersionProvider.java @@ -15,19 +15,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package de.florianmichael.viafabricplus.protocolhack.provider.vialoadingbase; +package de.florianmichael.viafabricplus.protocolhack.provider.viaversion; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import com.viaversion.viaversion.protocols.base.BaseVersionProvider; import de.florianmichael.viafabricplus.ViaFabricPlus; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.base.settings.groups.GeneralSettings; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; -import de.florianmichael.vialoadingbase.provider.VLBBaseVersionProvider; import io.netty.bootstrap.Bootstrap; import io.netty.channel.*; import io.netty.channel.epoll.Epoll; @@ -44,6 +41,7 @@ import net.minecraft.network.packet.c2s.query.QueryRequestC2SPacket; import net.minecraft.network.packet.s2c.query.QueryPongS2CPacket; import net.minecraft.network.packet.s2c.query.QueryResponseS2CPacket; import net.minecraft.text.Text; +import net.raphimc.vialoader.util.VersionEnum; import org.jetbrains.annotations.NotNull; import java.net.InetSocketAddress; @@ -51,13 +49,13 @@ import java.net.SocketAddress; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; -public class ViaFabricPlusVLBBaseVersionProvider extends VLBBaseVersionProvider { +public class ViaFabricPlusBaseVersionProvider extends BaseVersionProvider { // Based on https://github.com/ViaVersion/ViaFabric/blob/main/viafabric-mc119/src/main/java/com/viaversion/fabric/mc119/service/ProtocolAutoDetector.java - private final static LoadingCache> AUTO_DETECTION_CACHE = CacheBuilder.newBuilder(). + private final static LoadingCache> AUTO_DETECTION_CACHE = CacheBuilder.newBuilder(). expireAfterWrite(30, TimeUnit.SECONDS). build(CacheLoader.from(address -> { - CompletableFuture future = new CompletableFuture<>(); + CompletableFuture future = new CompletableFuture<>(); try { final ClientConnection clientConnection = new ClientConnection(NetworkSide.CLIENTBOUND); @@ -86,7 +84,7 @@ public class ViaFabricPlusVLBBaseVersionProvider extends VLBBaseVersionProvider @Override public void onResponse(QueryResponseS2CPacket packet) { if (packet.metadata() != null && packet.metadata().version().isPresent()) { - final ProtocolVersion version = ViaLoadingBase.fromProtocolId(packet.metadata().version().get().protocolVersion()); + final VersionEnum version = VersionEnum.fromProtocolId(packet.metadata().version().get().protocolVersion()); future.complete(version); ViaFabricPlus.LOGGER.info("Auto-detected " + version + " for " + address); @@ -126,7 +124,7 @@ public class ViaFabricPlusVLBBaseVersionProvider extends VLBBaseVersionProvider @Override public int getClosestServerProtocol(UserConnection connection) throws Exception { - if (connection.isClientSide()) { + if (connection.isClientSide() && !MinecraftClient.getInstance().isInSingleplayer()) { if (GeneralSettings.INSTANCE.autoDetectVersion.getValue()) { final SocketAddress target = connection.getChannel().remoteAddress(); if (target instanceof final InetSocketAddress socketAddress) { @@ -136,7 +134,7 @@ public class ViaFabricPlusVLBBaseVersionProvider extends VLBBaseVersionProvider return; } if (version != null) { - final ComparableProtocolVersion remapped = ViaLoadingBase.fromProtocolId(version.getVersion()); + final VersionEnum remapped = VersionEnum.fromProtocolId(version.getVersion()); if (remapped != null) { ProtocolHack.getForcedVersions().put(socketAddress, remapped); } @@ -144,6 +142,7 @@ public class ViaFabricPlusVLBBaseVersionProvider extends VLBBaseVersionProvider }); } } + System.out.println(ProtocolHack.getTargetVersion(connection.getChannel()).getName()); return ProtocolHack.getTargetVersion(connection.getChannel()).getVersion(); } return super.getClosestServerProtocol(connection); diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/viaversion/ViaFabricPlusHandItemProvider.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/viaversion/ViaFabricPlusHandItemProvider.java index 06752088..773ebc58 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/viaversion/ViaFabricPlusHandItemProvider.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/viaversion/ViaFabricPlusHandItemProvider.java @@ -19,6 +19,7 @@ package de.florianmichael.viafabricplus.protocolhack.provider.viaversion; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.item.Item; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider; import de.florianmichael.viafabricplus.protocolhack.usage.ItemTranslator; @@ -32,6 +33,6 @@ public class ViaFabricPlusHandItemProvider extends HandItemProvider { if (lastUsedItem == null) { return null; } - return ItemTranslator.minecraftToViaVersion(info, lastUsedItem, ProtocolVersion.v1_8.getVersion()); + return ItemTranslator.minecraftToViaVersion(info, lastUsedItem, VersionEnum.r1_8.getVersion()); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/usage/ItemTranslator.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/usage/ItemTranslator.java index 0db54399..d21db634 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/usage/ItemTranslator.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/usage/ItemTranslator.java @@ -26,9 +26,8 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.protocol.packet.PacketWrapperImpl; -import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.vialoadingbase.ViaLoadingBase; import io.netty.buffer.Unpooled; +import net.minecraft.SharedConstants; import net.minecraft.item.ItemStack; import net.minecraft.network.NetworkSide; import net.minecraft.network.NetworkState; @@ -41,7 +40,7 @@ import java.util.stream.Collectors; public class ItemTranslator { public static Item minecraftToViaVersion(final UserConnection user, final ItemStack stack, final int targetVersion) { - final List protocolPath = Via.getManager().getProtocolManager().getProtocolPath(ViaLoadingBase.getInstance().getNativeVersion(), targetVersion); + final List protocolPath = Via.getManager().getProtocolManager().getProtocolPath(SharedConstants.getProtocolVersion(), targetVersion); if (protocolPath == null) return null; final CreativeInventoryActionC2SPacket dummyPacket = new CreativeInventoryActionC2SPacket(36, stack); diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/AbstractInformationGroup.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/AbstractInformationGroup.java index 1169208b..35561f56 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/AbstractInformationGroup.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/AbstractInformationGroup.java @@ -18,15 +18,15 @@ package de.florianmichael.viafabricplus.ui.information; import com.viaversion.viaversion.api.connection.UserConnection; -import de.florianmichael.vialoadingbase.model.ProtocolRange; +import net.raphimc.vialoader.util.VersionRange; import java.util.List; public abstract class AbstractInformationGroup { - private final ProtocolRange protocolRange; + private final VersionRange versionRange; - public AbstractInformationGroup(final ProtocolRange protocolRange) { - this.protocolRange = protocolRange; + public AbstractInformationGroup(final VersionRange versionRange) { + this.versionRange = versionRange; } public abstract void applyInformation(final UserConnection userConnection, final List output); @@ -48,7 +48,7 @@ public abstract class AbstractInformationGroup { return format(((double) value / 1024.0 / 1024.0 / 1024.0 / 1024.0)) + " Tb"; } - public ProtocolRange getProtocolRange() { - return protocolRange; + public VersionRange getVersionRange() { + return versionRange; } } diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/BedrockInformation.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/BedrockInformation.java index 5ee9ad03..ffab42e7 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/BedrockInformation.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/BedrockInformation.java @@ -23,16 +23,16 @@ import de.florianmichael.viafabricplus.definition.bedrock.storage.JoinGameStorag import de.florianmichael.viafabricplus.definition.bedrock.ModelFormats; import de.florianmichael.viafabricplus.ui.information.AbstractInformationGroup; import de.florianmichael.viafabricplus.protocolhack.provider.viabedrock.ViaFabricPlusBlobCacheProvider; -import de.florianmichael.vialoadingbase.model.ProtocolRange; import net.lenni0451.reflect.stream.RStream; import net.lenni0451.reflect.stream.field.FieldStream; -import net.raphimc.viabedrock.api.BedrockProtocolVersion; import net.raphimc.viabedrock.api.chunk.BedrockChunk; import net.raphimc.viabedrock.api.model.entity.Entity; import net.raphimc.viabedrock.protocol.providers.BlobCacheProvider; import net.raphimc.viabedrock.protocol.storage.BlobCache; import net.raphimc.viabedrock.protocol.storage.ChunkTracker; import net.raphimc.viabedrock.protocol.storage.GameSessionStorage; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; import java.util.List; import java.util.Map; @@ -42,7 +42,7 @@ import java.util.concurrent.CompletableFuture; public class BedrockInformation extends AbstractInformationGroup { public BedrockInformation() { - super(ProtocolRange.singleton(BedrockProtocolVersion.bedrockLatest)); + super(VersionRange.singleton(VersionEnum.bedrockLatest)); } @Override diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/C0_30CPEInformation.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/C0_30CPEInformation.java index 1584c330..b8fa5a05 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/C0_30CPEInformation.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/C0_30CPEInformation.java @@ -19,16 +19,16 @@ package de.florianmichael.viafabricplus.ui.information.impl; import com.viaversion.viaversion.api.connection.UserConnection; import de.florianmichael.viafabricplus.ui.information.AbstractInformationGroup; -import de.florianmichael.vialoadingbase.model.ProtocolRange; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.classic.protocolc0_28_30toc0_28_30cpe.storage.ExtensionProtocolMetadataStorage; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; import java.util.List; public class C0_30CPEInformation extends AbstractInformationGroup { public C0_30CPEInformation() { - super(ProtocolRange.singleton(LegacyProtocolVersion.c0_30cpe)); + super(VersionRange.singleton(VersionEnum.c0_30cpe)); } @Override diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/GeneralInformation.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/GeneralInformation.java index e416f984..a755c510 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/GeneralInformation.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/GeneralInformation.java @@ -20,7 +20,6 @@ package de.florianmichael.viafabricplus.ui.information.impl; import com.viaversion.viaversion.api.connection.UserConnection; import de.florianmichael.viafabricplus.ui.information.AbstractInformationGroup; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.vialoadingbase.ViaLoadingBase; import java.util.List; @@ -33,7 +32,7 @@ public class GeneralInformation extends AbstractInformationGroup { @Override public void applyInformation(UserConnection userConnection, List output) { output.add("Pipeline count: " + userConnection.getProtocolInfo().getPipeline().pipes().size()); - output.add("Selected version (in the GUI): " + ViaLoadingBase.getInstance().getTargetVersion().getName() + " (" + ViaLoadingBase.getInstance().getTargetVersion().getVersion() + ")"); + output.add("Selected version (in the GUI): " + ProtocolHack.targetVersion.getName() + " (" + ProtocolHack.targetVersion.getVersion() + ")"); output.add("Connected version: " + ProtocolHack.getTargetVersion().getName() + " (" + ProtocolHack.getTargetVersion().getVersion() + ")"); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_1Information.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_1Information.java index 2a1032b5..7d1fbcc1 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_1Information.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_1Information.java @@ -19,16 +19,16 @@ package de.florianmichael.viafabricplus.ui.information.impl; import com.viaversion.viaversion.api.connection.UserConnection; import de.florianmichael.viafabricplus.ui.information.AbstractInformationGroup; -import de.florianmichael.vialoadingbase.model.ProtocolRange; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.release.protocol1_2_1_3to1_1.storage.SeedStorage; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; import java.util.List; public class V1_1Information extends AbstractInformationGroup { public V1_1Information() { - super(ProtocolRange.andOlder(LegacyProtocolVersion.r1_1)); + super(VersionRange.andOlder(VersionEnum.r1_1)); } @Override diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_2_4_5Information.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_2_4_5Information.java index c1f5d4a6..17cb8424 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_2_4_5Information.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_2_4_5Information.java @@ -19,16 +19,16 @@ package de.florianmichael.viafabricplus.ui.information.impl; import com.viaversion.viaversion.api.connection.UserConnection; import de.florianmichael.viafabricplus.ui.information.AbstractInformationGroup; -import de.florianmichael.vialoadingbase.model.ProtocolRange; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.release.protocol1_3_1_2to1_2_4_5.storage.EntityTracker; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; import java.util.List; public class V1_2_4_5Information extends AbstractInformationGroup { public V1_2_4_5Information() { - super(ProtocolRange.andOlder(LegacyProtocolVersion.r1_2_4tor1_2_5)); + super(VersionRange.andOlder(VersionEnum.r1_2_4tor1_2_5)); } @Override diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_5_2Information.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_5_2Information.java index 02147f19..b8b22991 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_5_2Information.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_5_2Information.java @@ -19,16 +19,16 @@ package de.florianmichael.viafabricplus.ui.information.impl; import com.viaversion.viaversion.api.connection.UserConnection; import de.florianmichael.viafabricplus.ui.information.AbstractInformationGroup; -import de.florianmichael.vialoadingbase.model.ProtocolRange; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.protocols.release.protocol1_6_1to1_5_2.storage.EntityTracker; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; import java.util.List; public class V1_5_2Information extends AbstractInformationGroup { public V1_5_2Information() { - super(ProtocolRange.andOlder(LegacyProtocolVersion.r1_5_2)); + super(VersionRange.andOlder(VersionEnum.r1_5_2)); } @Override diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_7_10Information.java b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_7_10Information.java index 47a19920..35ad786c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_7_10Information.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/information/impl/V1_7_10Information.java @@ -18,17 +18,17 @@ package de.florianmichael.viafabricplus.ui.information.impl; import com.viaversion.viaversion.api.connection.UserConnection; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.ui.information.AbstractInformationGroup; -import de.florianmichael.vialoadingbase.model.ProtocolRange; import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.storage.EntityTracker; +import net.raphimc.vialoader.util.VersionEnum; +import net.raphimc.vialoader.util.VersionRange; import java.util.List; public class V1_7_10Information extends AbstractInformationGroup { public V1_7_10Information() { - super(ProtocolRange.andOlder(ProtocolVersion.v1_7_6)); + super(VersionRange.andOlder(VersionEnum.r1_7_6tor1_7_10)); } @Override diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/ClassicItemSelectionScreen.java b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/ClassicItemSelectionScreen.java index 56e5ec8c..493d22db 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/ClassicItemSelectionScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/ClassicItemSelectionScreen.java @@ -19,13 +19,12 @@ package de.florianmichael.viafabricplus.ui.screen.impl; import de.florianmichael.viafabricplus.base.event.ChangeProtocolVersionCallback; import de.florianmichael.viafabricplus.ui.screen.VFPScreen; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.math.MathHelper; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; import java.util.ArrayList; import java.util.List; @@ -39,7 +38,7 @@ public class ClassicItemSelectionScreen extends VFPScreen { INSTANCE = new ClassicItemSelectionScreen(); ChangeProtocolVersionCallback.EVENT.register(protocolVersion -> { - if (protocolVersion.isOlderThanOrEqualTo(LegacyProtocolVersion.c0_28toc0_30)) { + if (protocolVersion.isOlderThanOrEqualTo(VersionEnum.c0_28toc0_30)) { INSTANCE.reload(protocolVersion, false); } }); @@ -57,7 +56,7 @@ public class ClassicItemSelectionScreen extends VFPScreen { super("Classic item selection", false); } - public void reload(final ComparableProtocolVersion version, final boolean hasCustomBlocksV1) { + public void reload(final VersionEnum version, final boolean hasCustomBlocksV1) { final List allowedItems = new ArrayList<>(); allowedItems.add(Items.OAK_LOG); allowedItems.add(Items.OAK_PLANKS); @@ -79,9 +78,9 @@ public class ClassicItemSelectionScreen extends VFPScreen { allowedItems.add(Items.OAK_SAPLING); allowedItems.add(Items.BOOKSHELF); allowedItems.add(Items.TNT); - if (version.isNewerThan(LegacyProtocolVersion.c0_0_19a_06)) { + if (version.isNewerThan(VersionEnum.c0_0_19a_06)) { allowedItems.add(Items.SPONGE); - if (version.isNewerThan(LegacyProtocolVersion.c0_0_20ac0_27)) { + if (version.isNewerThan(VersionEnum.c0_0_20ac0_27)) { allowedItems.add(Items.WHITE_WOOL); allowedItems.add(Items.ORANGE_WOOL); allowedItems.add(Items.MAGENTA_WOOL); diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ForceVersionScreen.java b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ForceVersionScreen.java index a2d28c6d..32512da0 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ForceVersionScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ForceVersionScreen.java @@ -17,10 +17,9 @@ */ package de.florianmichael.viafabricplus.ui.screen.impl.base; +import net.raphimc.vialoader.util.VersionEnum; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.viafabricplus.ui.screen.VFPScreen; -import de.florianmichael.vialoadingbase.ViaLoadingBase; -import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.screen.Screen; @@ -29,13 +28,15 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import net.raphimc.vialoader.util.VersionEnum; +import java.util.Arrays; import java.util.function.Consumer; public class ForceVersionScreen extends VFPScreen { - private final Consumer selectionConsumer; + private final Consumer selectionConsumer; - public ForceVersionScreen(final Screen prevScreen, final Consumer selectionConsumer) { + public ForceVersionScreen(final Screen prevScreen, final Consumer selectionConsumer) { super("Force version", false); this.prevScreen = prevScreen; @@ -63,7 +64,7 @@ public class ForceVersionScreen extends VFPScreen { super(minecraftClient, width, height, top, bottom, entryHeight); this.addEntry(new ResetProtocolSlot()); - ViaLoadingBase.getProtocols().stream().map(ViaProtocolSlot::new).forEach(this::addEntry); + VersionEnum.SORTED_VERSIONS.stream().map(ViaProtocolSlot::new).forEach(this::addEntry); } } @@ -96,20 +97,20 @@ public class ForceVersionScreen extends VFPScreen { } public class ViaProtocolSlot extends DummyProtocolSlot { - private final ProtocolVersion protocolVersion; + private final VersionEnum versionEnum; - public ViaProtocolSlot(final ProtocolVersion protocolVersion) { - this.protocolVersion = protocolVersion; + public ViaProtocolSlot(final VersionEnum versionEnum) { + this.versionEnum = versionEnum; } @Override public Text getNarration() { - return Text.literal(this.protocolVersion.getName()); + return Text.literal(this.versionEnum.getName()); } @Override public boolean mouseClicked(double mouseX, double mouseY, int button) { - selectionConsumer.accept(ViaLoadingBase.fromProtocolVersion(protocolVersion)); + selectionConsumer.accept(versionEnum); playClickSound(); close(); @@ -119,7 +120,7 @@ public class ForceVersionScreen extends VFPScreen { @Override public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) { final TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; - drawCenteredTextWithShadow(matrices, textRenderer, this.protocolVersion.getName(), x + entryWidth / 2, y - 1 + entryHeight / 2 - textRenderer.fontHeight / 2, -1); + drawCenteredTextWithShadow(matrices, textRenderer, this.versionEnum.getName(), x + entryWidth / 2, y - 1 + entryHeight / 2 - textRenderer.fontHeight / 2, -1); } } } diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ProtocolSelectionScreen.java b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ProtocolSelectionScreen.java index ba0c33db..20c32322 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ProtocolSelectionScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/base/ProtocolSelectionScreen.java @@ -17,7 +17,6 @@ */ package de.florianmichael.viafabricplus.ui.screen.impl.base; -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import de.florianmichael.classic4j.BetaCraftHandler; import de.florianmichael.viafabricplus.definition.c0_30.ClassiCubeAccountHandler; import de.florianmichael.viafabricplus.ui.screen.VFPScreen; @@ -26,7 +25,6 @@ import de.florianmichael.viafabricplus.ui.screen.impl.thirdparty.classicube.Clas import de.florianmichael.viafabricplus.ui.screen.impl.thirdparty.BetaCraftScreen; import de.florianmichael.viafabricplus.ui.screen.impl.settings.SettingsScreen; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; -import de.florianmichael.vialoadingbase.ViaLoadingBase; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.tooltip.Tooltip; @@ -34,8 +32,10 @@ import net.minecraft.client.gui.widget.AlwaysSelectedEntryListWidget; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; +import net.raphimc.vialoader.util.VersionEnum; import java.awt.*; +import java.util.Arrays; public class ProtocolSelectionScreen extends VFPScreen { public final static ProtocolSelectionScreen INSTANCE = new ProtocolSelectionScreen(); @@ -109,38 +109,38 @@ public class ProtocolSelectionScreen extends VFPScreen { public SlotList(MinecraftClient minecraftClient, int width, int height, int top, int bottom, int entryHeight) { super(minecraftClient, width, height, top, bottom, entryHeight); - ViaLoadingBase.getProtocols().stream().map(ProtocolSlot::new).forEach(this::addEntry); + VersionEnum.SORTED_VERSIONS.stream().map(ProtocolSlot::new).forEach(this::addEntry); } } public static class ProtocolSlot extends AlwaysSelectedEntryListWidget.Entry { - private final ProtocolVersion protocolVersion; + private final VersionEnum versionEnum; - public ProtocolSlot(final ProtocolVersion protocolVersion) { - this.protocolVersion = protocolVersion; + public ProtocolSlot(final VersionEnum versionEnum) { + this.versionEnum = versionEnum; } @Override public Text getNarration() { - return Text.literal(this.protocolVersion.getName()); + return Text.literal(this.versionEnum.getName()); } @Override public boolean mouseClicked(double mouseX, double mouseY, int button) { - ViaLoadingBase.getInstance().reload(this.protocolVersion); + ProtocolHack.setTargetVersion(this.versionEnum); playClickSound(); return super.mouseClicked(mouseX, mouseY, button); } @Override public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) { - final boolean isSelected = ProtocolHack.getTargetVersion().getVersion() == protocolVersion.getVersion(); + final boolean isSelected = ProtocolHack.getTargetVersion().getVersion() == versionEnum.getVersion(); matrices.push(); matrices.translate(x, y - 1, 0); final TextRenderer textRenderer = MinecraftClient.getInstance().textRenderer; - drawCenteredTextWithShadow(matrices, textRenderer, this.protocolVersion.getName(), entryWidth / 2, entryHeight / 2 - textRenderer.fontHeight / 2, isSelected ? Color.GREEN.getRGB() : Color.RED.getRGB()); + drawCenteredTextWithShadow(matrices, textRenderer, this.versionEnum.getName(), entryWidth / 2, entryHeight / 2 - textRenderer.fontHeight / 2, isSelected ? Color.GREEN.getRGB() : Color.RED.getRGB()); matrices.pop(); } } diff --git a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/thirdparty/classicube/ClassiCubeServerListScreen.java b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/thirdparty/classicube/ClassiCubeServerListScreen.java index e7496d85..07044c34 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/thirdparty/classicube/ClassiCubeServerListScreen.java +++ b/src/main/java/de/florianmichael/viafabricplus/ui/screen/impl/thirdparty/classicube/ClassiCubeServerListScreen.java @@ -29,7 +29,6 @@ import de.florianmichael.viafabricplus.ui.screen.VFPScreen; import de.florianmichael.viafabricplus.ui.screen.impl.base.ProtocolSelectionScreen; import de.florianmichael.viafabricplus.ui.screen.MappedSlotEntry; import de.florianmichael.viafabricplus.base.settings.groups.AuthenticationSettings; -import de.florianmichael.vialoadingbase.ViaLoadingBase; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.screen.ConnectScreen; @@ -41,7 +40,7 @@ import net.minecraft.client.network.ServerInfo; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import net.raphimc.vialegacy.api.LegacyProtocolVersion; +import net.raphimc.vialoader.util.VersionEnum; import java.util.ArrayList; import java.util.List; @@ -129,7 +128,7 @@ public class ClassiCubeServerListScreen extends VFPScreen { ViaFabricPlusClassicMPPassProvider.classiCubeMPPass = classiCubeServerInfo.mpPass(); if (AuthenticationSettings.INSTANCE.forceCPEIfUsingClassiCube.getValue()) { - ((IServerInfo) entry).viafabricplus_forceVersion(ViaLoadingBase.fromProtocolVersion(LegacyProtocolVersion.c0_30cpe)); + ((IServerInfo) entry).viafabricplus_forceVersion(VersionEnum.c0_30cpe); } ConnectScreen.connect(MinecraftClient.getInstance().currentScreen, MinecraftClient.getInstance(), serverAddress, entry); diff --git a/src/main/resources/viafabricplus.mixins.json b/src/main/resources/viafabricplus.mixins.json index f2998e18..2e51594d 100644 --- a/src/main/resources/viafabricplus.mixins.json +++ b/src/main/resources/viafabricplus.mixins.json @@ -127,7 +127,6 @@ "fixes.vialegacy.MixinProtocol1_8to1_7_6_10", "fixes.vialegacy.MixinProtocolc0_30toc0_30cpe", "fixes.vialegacy.MixinViaLegacyConfig", - "fixes.vialoadingbase.MixinVLBViaConfig", "fixes.viaversion.MixinCommonBoss", "fixes.viaversion.MixinNBTType", "fixes.viaversion.MixinProtocolVersion",