├── .gitattributes
├── .github
├── FUNDING.yml
├── dependabot.yml
└── workflows
│ └── build.yml
├── .gitignore
├── .idea
└── copyright
│ ├── GPL_3_0.xml
│ └── profiles_settings.xml
├── LICENSE
├── README.md
├── build.gradle
├── buildSrc
├── build.gradle
└── src
│ └── main
│ └── groovy
│ ├── base.base-conventions.gradle
│ ├── base.exclude-run-folder.gradle
│ ├── base.fill-build-constants.gradle
│ ├── base.publishing-conventions.gradle
│ ├── via.run-with-viaproxy-task.gradle
│ ├── via.viaversion-maven-publishing.gradle
│ └── vialegacy.publishing-conventions.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
└── main
├── java
└── net
│ └── raphimc
│ └── vialegacy
│ ├── ViaLegacy.java
│ ├── ViaLegacyConfig.java
│ ├── api
│ ├── LegacyProtocolVersion.java
│ ├── data
│ │ ├── BlockList1_6.java
│ │ └── ItemList1_6.java
│ ├── model
│ │ ├── ChunkCoord.java
│ │ └── Location.java
│ ├── protocol
│ │ ├── StatelessProtocol.java
│ │ └── StatelessTransitionProtocol.java
│ ├── remapper
│ │ ├── AbstractBlockRemapper.java
│ │ ├── AbstractChunkTracker.java
│ │ └── LegacyItemRewriter.java
│ ├── splitter
│ │ ├── PreNettyPacketType.java
│ │ ├── PreNettySplitter.java
│ │ └── PreNettyTypes.java
│ └── util
│ │ ├── BlockFaceUtil.java
│ │ ├── ChunkCoordSpiral.java
│ │ ├── GameProfileUtil.java
│ │ └── PacketUtil.java
│ ├── netty
│ ├── PreNettyLengthCodec.java
│ ├── PreNettyLengthPrepender.java
│ └── PreNettyLengthRemover.java
│ ├── platform
│ ├── ViaLegacyConfig.java
│ └── ViaLegacyPlatform.java
│ └── protocol
│ ├── alpha
│ ├── a1_0_15toa1_0_16_2
│ │ ├── Protocola1_0_15Toa1_0_16_2.java
│ │ └── packet
│ │ │ ├── ClientboundPacketsa1_0_15.java
│ │ │ └── ServerboundPacketsa1_0_15.java
│ ├── a1_0_16_2toa1_0_17_1_0_17_4
│ │ ├── Protocola1_0_16_2Toa1_0_17_1_0_17_4.java
│ │ ├── packet
│ │ │ └── ClientboundPacketsa1_0_16.java
│ │ ├── storage
│ │ │ └── TimeLockStorage.java
│ │ └── task
│ │ │ └── TimeLockTask.java
│ ├── a1_0_17_1_0_17_4toa1_1_0_1_1_2_1
│ │ ├── Protocola1_0_17_1_0_17_4Toa1_1_0_1_1_2_1.java
│ │ └── packet
│ │ │ ├── ClientboundPacketsa1_0_17.java
│ │ │ └── ServerboundPacketsa1_0_17.java
│ ├── a1_1_0_1_1_2_1toa1_2_0_1_2_1_1
│ │ ├── Protocola1_1_0_1_1_2_1Toa1_2_0_1_2_1_1.java
│ │ └── packet
│ │ │ ├── ClientboundPacketsa1_1_0.java
│ │ │ └── ServerboundPacketsa1_1_0.java
│ ├── a1_2_0_1_2_1_1toa1_2_2
│ │ ├── Protocola1_2_0_1_2_1_1Toa1_2_2.java
│ │ └── packet
│ │ │ ├── ClientboundPacketsa1_2_0.java
│ │ │ └── ServerboundPacketsa1_2_0.java
│ ├── a1_2_2toa1_2_3_1_2_3_4
│ │ ├── Protocola1_2_2Toa1_2_3_1_2_3_4.java
│ │ └── packet
│ │ │ ├── ClientboundPacketsa1_2_2.java
│ │ │ └── ServerboundPacketsa1_2_2.java
│ ├── a1_2_3_1_2_3_4toa1_2_3_5_1_2_6
│ │ ├── Protocola1_2_3_1_2_3_4Toa1_2_3_5_1_2_6.java
│ │ └── packet
│ │ │ └── ClientboundPacketsa1_2_3.java
│ └── a1_2_3_5_1_2_6tob1_0_1_1_1
│ │ ├── Protocola1_2_3_5_1_2_6Tob1_0_1_1_1.java
│ │ ├── data
│ │ ├── AlphaItems.java
│ │ └── CraftingManager.java
│ │ ├── model
│ │ └── CraftingRecipe.java
│ │ ├── packet
│ │ ├── ClientboundPacketsa1_2_6.java
│ │ └── ServerboundPacketsa1_2_6.java
│ │ ├── provider
│ │ ├── AlphaInventoryProvider.java
│ │ ├── NoOpAlphaInventoryProvider.java
│ │ └── TrackingAlphaInventoryProvider.java
│ │ ├── storage
│ │ ├── AlphaInventoryTracker.java
│ │ └── InventoryStorage.java
│ │ └── task
│ │ └── AlphaInventoryUpdateTask.java
│ ├── beta
│ ├── b1_0_1_1tob1_1_2
│ │ └── Protocolb1_0_1_1Tob1_1_2.java
│ ├── b1_1_2tob1_2_0_2
│ │ ├── Protocolb1_1_2Tob1_2_0_2.java
│ │ ├── packet
│ │ │ ├── ClientboundPacketsb1_1.java
│ │ │ └── ServerboundPacketsb1_1.java
│ │ ├── rewriter
│ │ │ └── BlockDataRewriter.java
│ │ ├── storage
│ │ │ └── EntityFlagStorage.java
│ │ └── types
│ │ │ ├── NbtLessItemType.java
│ │ │ └── Typesb1_1.java
│ ├── b1_2_0_2tob1_3_0_1
│ │ ├── Protocolb1_2_0_2Tob1_3_0_1.java
│ │ ├── data
│ │ │ └── BlockHardnessList.java
│ │ ├── packet
│ │ │ ├── ClientboundPacketsb1_2.java
│ │ │ └── ServerboundPacketsb1_2.java
│ │ ├── storage
│ │ │ └── BlockDigStorage.java
│ │ ├── task
│ │ │ └── BlockDigTickTask.java
│ │ └── types
│ │ │ ├── EntityDataType.java
│ │ │ ├── EntityDataTypesb1_2.java
│ │ │ └── Typesb1_2.java
│ ├── b1_3_0_1tob1_4_0_1
│ │ ├── Protocolb1_3_0_1Tob1_4_0_1.java
│ │ └── packet
│ │ │ └── ClientboundPacketsb1_3.java
│ ├── b1_4_0_1tob1_5_0_2
│ │ ├── Protocolb1_4_0_1Tob1_5_0_2.java
│ │ ├── packet
│ │ │ ├── ClientboundPacketsb1_4.java
│ │ │ └── ServerboundPacketsb1_4.java
│ │ └── types
│ │ │ ├── EntityDataType.java
│ │ │ ├── EntityDataTypesb1_4.java
│ │ │ └── Typesb1_4.java
│ ├── b1_5_0_2tob1_6_0_6
│ │ ├── Protocolb1_5_0_2Tob1_6_0_6.java
│ │ ├── packet
│ │ │ ├── ClientboundPacketsb1_5.java
│ │ │ └── ServerboundPacketsb1_5.java
│ │ ├── storage
│ │ │ └── WorldTimeStorage.java
│ │ └── task
│ │ │ └── TimeTrackTask.java
│ ├── b1_6_0_6tob1_7_0_3
│ │ └── Protocolb1_6_0_6Tob1_7_0_3.java
│ ├── b1_7_0_3tob1_8_0_1
│ │ ├── Protocolb1_7_0_3Tob1_8_0_1.java
│ │ ├── packet
│ │ │ ├── ClientboundPacketsb1_7.java
│ │ │ └── ServerboundPacketsb1_7.java
│ │ ├── storage
│ │ │ ├── PlayerHealthTracker.java
│ │ │ └── PlayerNameTracker.java
│ │ └── types
│ │ │ ├── StringType.java
│ │ │ └── Typesb1_7_0_3.java
│ └── b1_8_0_1tor1_0_0_1
│ │ ├── Protocolb1_8_0_1tor1_0_0_1.java
│ │ ├── packet
│ │ ├── ClientboundPacketsb1_8.java
│ │ └── ServerboundPacketsb1_8.java
│ │ ├── rewriter
│ │ └── ItemRewriter.java
│ │ ├── storage
│ │ └── PlayerAirTimeStorage.java
│ │ ├── task
│ │ └── PlayerAirTimeUpdateTask.java
│ │ └── types
│ │ ├── NbtLessItemType.java
│ │ └── Typesb1_8_0_1.java
│ ├── classic
│ ├── c0_0_15a_1toc0_0_16a_02
│ │ ├── Protocolc0_0_15a_1Toc0_0_16a_02.java
│ │ └── packet
│ │ │ ├── ClientboundPacketsc0_15a.java
│ │ │ └── ServerboundPacketsc0_15a.java
│ ├── c0_0_16a_02toc0_0_18a_02
│ │ └── Protocolc0_0_16a_02Toc0_0_18a_02.java
│ ├── c0_0_18a_02toc0_0_19a_06
│ │ └── Protocolc0_0_18a_02Toc0_0_19a_06.java
│ ├── c0_0_19a_06toc0_0_20a_27
│ │ ├── Protocolc0_0_19a_06Toc0_0_20a_27.java
│ │ └── packet
│ │ │ ├── ClientboundPacketsc0_19a.java
│ │ │ └── ServerboundPacketsc0_19a.java
│ ├── c0_0_20a_27toc0_28_30
│ │ ├── Protocolc0_0_20a_27Toc0_28_30.java
│ │ └── packet
│ │ │ └── ClientboundPacketsc0_20a.java
│ ├── c0_28_30toa1_0_15
│ │ ├── Protocolc0_28_30Toa1_0_15.java
│ │ ├── data
│ │ │ ├── ClassicBlocks.java
│ │ │ └── Cp437String.java
│ │ ├── model
│ │ │ └── ClassicLevel.java
│ │ ├── packet
│ │ │ ├── ClientboundPacketsc0_28.java
│ │ │ └── ServerboundPacketsc0_28.java
│ │ ├── provider
│ │ │ ├── ClassicCustomCommandProvider.java
│ │ │ ├── ClassicMPPassProvider.java
│ │ │ └── ClassicWorldHeightProvider.java
│ │ ├── storage
│ │ │ ├── ClassicBlockRemapper.java
│ │ │ ├── ClassicLevelStorage.java
│ │ │ ├── ClassicOpLevelStorage.java
│ │ │ ├── ClassicPositionTracker.java
│ │ │ ├── ClassicProgressStorage.java
│ │ │ └── ClassicServerTitleStorage.java
│ │ ├── task
│ │ │ └── ClassicLevelStorageTickTask.java
│ │ └── types
│ │ │ ├── BlockPositionType.java
│ │ │ ├── ByteArrayType.java
│ │ │ ├── StringType.java
│ │ │ └── Typesc0_30.java
│ └── c0_30cpetoc0_28_30
│ │ ├── Protocolc0_30cpeToc0_28_30.java
│ │ ├── data
│ │ ├── ClassicProtocolExtension.java
│ │ └── ExtendedClassicBlocks.java
│ │ ├── packet
│ │ ├── ClientboundPacketsc0_30cpe.java
│ │ └── ServerboundPacketsc0_30cpe.java
│ │ ├── storage
│ │ ├── ExtBlockPermissionsStorage.java
│ │ └── ExtensionProtocolMetadataStorage.java
│ │ └── task
│ │ └── ClassicPingTask.java
│ └── release
│ ├── r1_0_0_1tor1_1
│ ├── Protocolr1_0_0_1Tor1_1.java
│ ├── packet
│ │ ├── ClientboundPackets1_0_0.java
│ │ └── ServerboundPackets1_0_0.java
│ └── rewriter
│ │ ├── ChatFilter.java
│ │ └── ItemRewriter.java
│ ├── r1_1tor1_2_1_3
│ ├── Protocolr1_1Tor1_2_1_3.java
│ ├── biome
│ │ ├── EndBiomeGenerator.java
│ │ ├── IWorldChunkManager.java
│ │ ├── NetherBiomeGenerator.java
│ │ ├── PlainsBiomeGenerator.java
│ │ ├── beta
│ │ │ ├── NoiseGenerator2.java
│ │ │ ├── NoiseGeneratorOctaves2.java
│ │ │ ├── OldBiomeGenBase.java
│ │ │ └── WorldChunkManager_b1_7.java
│ │ └── release
│ │ │ ├── BiomeCache.java
│ │ │ ├── BiomeCacheBlock.java
│ │ │ ├── IntCache.java
│ │ │ ├── IntCacheInstance.java
│ │ │ ├── NewBiomeGenBase.java
│ │ │ ├── WorldChunkManager_r1_1.java
│ │ │ └── genlayer
│ │ │ ├── GenLayer.java
│ │ │ ├── GenLayerDownfall.java
│ │ │ ├── GenLayerDownfallMix.java
│ │ │ ├── GenLayerHills.java
│ │ │ ├── GenLayerIsland_b1_8.java
│ │ │ ├── GenLayerIsland_r1_0.java
│ │ │ ├── GenLayerMushroomIsland.java
│ │ │ ├── GenLayerRiver.java
│ │ │ ├── GenLayerRiverInit.java
│ │ │ ├── GenLayerRiverMix.java
│ │ │ ├── GenLayerShore_r1_0.java
│ │ │ ├── GenLayerShore_r1_1.java
│ │ │ ├── GenLayerSmooth.java
│ │ │ ├── GenLayerSmoothZoom.java
│ │ │ ├── GenLayerSnow.java
│ │ │ ├── GenLayerSwampRivers.java
│ │ │ ├── GenLayerTemperature.java
│ │ │ ├── GenLayerTemperatureMix.java
│ │ │ ├── GenLayerVillageLandscape_b1_8.java
│ │ │ ├── GenLayerVillageLandscape_r1_0.java
│ │ │ ├── GenLayerZoom.java
│ │ │ ├── GenLayerZoomFuzzy.java
│ │ │ ├── GenLayerZoomVoronoi.java
│ │ │ └── LayerIsland.java
│ ├── model
│ │ ├── LegacyNibbleArray.java
│ │ ├── NonFullChunk.java
│ │ └── PendingBlockEntry.java
│ ├── packet
│ │ ├── ClientboundPackets1_1.java
│ │ └── ServerboundPackets1_1.java
│ ├── rewriter
│ │ └── ItemRewriter.java
│ ├── storage
│ │ ├── PendingBlocksTracker.java
│ │ └── SeedStorage.java
│ ├── task
│ │ └── BlockReceiveInvalidatorTask.java
│ └── types
│ │ ├── BlockChangeRecordArrayType.java
│ │ ├── ChunkType.java
│ │ └── Types1_1.java
│ ├── r1_2_1_3tor1_2_4_5
│ ├── Protocolr1_2_1_3Tor1_2_4_5.java
│ ├── packet
│ │ ├── ClientboundPackets1_2_1.java
│ │ └── ServerboundPackets1_2_1.java
│ └── rewriter
│ │ └── ItemRewriter.java
│ ├── r1_2_4_5tor1_3_1_2
│ ├── Protocolr1_2_4_5Tor1_3_1_2.java
│ ├── data
│ │ ├── EntityList1_2_4.java
│ │ ├── NbtItemList1_2_4.java
│ │ └── sound
│ │ │ ├── Sound.java
│ │ │ ├── SoundRegistry1_2_4.java
│ │ │ └── SoundType.java
│ ├── model
│ │ ├── AbstractTrackedEntity.java
│ │ ├── ConfiguredSound.java
│ │ ├── TrackedEntity.java
│ │ └── TrackedLivingEntity.java
│ ├── packet
│ │ ├── ClientboundPackets1_2_4.java
│ │ └── ServerboundPackets1_2_4.java
│ ├── provider
│ │ └── OldAuthProvider.java
│ ├── rewriter
│ │ └── ItemRewriter.java
│ ├── storage
│ │ ├── ChestStateTracker.java
│ │ └── EntityTracker.java
│ ├── task
│ │ └── EntityTrackerTickTask.java
│ └── types
│ │ ├── ChunkType.java
│ │ ├── ItemType.java
│ │ └── Types1_2_4.java
│ ├── r1_3_1_2tor1_4_2
│ ├── Protocolr1_3_1_2Tor1_4_2.java
│ ├── packet
│ │ ├── ClientboundPackets1_3_1.java
│ │ └── ServerboundPackets1_3_1.java
│ ├── rewriter
│ │ ├── ItemRewriter.java
│ │ └── SoundRewriter.java
│ └── types
│ │ ├── EntityDataType.java
│ │ ├── EntityDataTypes1_3_1.java
│ │ ├── NbtLessItemType.java
│ │ └── Types1_3_1.java
│ ├── r1_4_2tor1_4_4_5
│ ├── Protocolr1_4_2Tor1_4_4_5.java
│ ├── packet
│ │ └── ClientboundPackets1_4_2.java
│ ├── rewriter
│ │ └── ItemRewriter.java
│ └── types
│ │ ├── EntityDataType.java
│ │ ├── EntityDataTypes1_4_2.java
│ │ ├── NbtLessItemType.java
│ │ ├── Types1_4_2.java
│ │ └── UnsignedByteByteArrayType.java
│ ├── r1_4_4_5tor1_4_6_7
│ ├── Protocolr1_4_4_5Tor1_4_6_7.java
│ ├── packet
│ │ └── ClientboundPackets1_4_4.java
│ ├── rewriter
│ │ └── ItemRewriter.java
│ └── types
│ │ ├── BulkChunkType.java
│ │ └── Types1_4_4.java
│ ├── r1_4_6_7tor1_5_0_1
│ ├── Protocolr1_4_6_7Tor1_5_0_1.java
│ ├── packet
│ │ └── ClientboundPackets1_4_6.java
│ └── rewriter
│ │ └── ItemRewriter.java
│ ├── r1_5_0_1tor1_5_2
│ └── Protocolr1_5_0_1Tor1_5_2.java
│ ├── r1_5_2tor1_6_1
│ ├── Protocolr1_5_2Tor1_6_1.java
│ ├── data
│ │ └── EntityDataIndex1_5_2.java
│ ├── packet
│ │ ├── ClientboundPackets1_5_2.java
│ │ └── ServerboundPackets1_5_2.java
│ ├── rewriter
│ │ ├── EntityDataRewriter.java
│ │ ├── ItemRewriter.java
│ │ └── SoundRewriter.java
│ └── storage
│ │ ├── AttachTracker.java
│ │ └── EntityTracker.java
│ ├── r1_6_1tor1_6_2
│ ├── Protocolr1_6_1Tor1_6_2.java
│ └── packet
│ │ └── ClientboundPackets1_6_1.java
│ ├── r1_6_2tor1_6_4
│ └── Protocolr1_6_2Tor1_6_4.java
│ ├── r1_6_4tor1_7_2_5
│ ├── Protocolr1_6_4Tor1_7_2_5.java
│ ├── packet
│ │ ├── ClientboundPackets1_6_4.java
│ │ └── ServerboundPackets1_6_4.java
│ ├── provider
│ │ └── EncryptionProvider.java
│ ├── rewriter
│ │ ├── ItemRewriter.java
│ │ ├── SoundRewriter.java
│ │ ├── StatisticRewriter.java
│ │ └── TextRewriter.java
│ ├── storage
│ │ ├── ChunkTracker.java
│ │ ├── HandshakeStorage.java
│ │ ├── PlayerInfoStorage.java
│ │ ├── ProtocolMetadataStorage.java
│ │ └── StatisticsStorage.java
│ └── types
│ │ ├── EntityDataType.java
│ │ ├── EntityDataTypes1_6_4.java
│ │ ├── StringType.java
│ │ └── Types1_6_4.java
│ ├── r1_7_2_5tor1_7_6_10
│ ├── Protocolr1_7_2_5Tor1_7_6_10.java
│ ├── packet
│ │ ├── ClientboundPackets1_7_2.java
│ │ └── ServerboundPackets1_7_2.java
│ └── rewriter
│ │ └── TextRewriter.java
│ └── r1_7_6_10tor1_8
│ ├── Protocolr1_7_6_10Tor1_8.java
│ ├── data
│ ├── EntityDataIndex1_7_6.java
│ └── Particle1_7_6.java
│ ├── model
│ ├── ExtendedBlockStorage.java
│ ├── HologramPartEntity.java
│ ├── MapData.java
│ ├── MapIcon.java
│ └── TabListEntry.java
│ ├── provider
│ └── GameProfileFetcher.java
│ ├── rewriter
│ ├── EntityDataRewriter.java
│ ├── ItemRewriter.java
│ └── TextRewriter.java
│ ├── storage
│ ├── ChunkTracker.java
│ ├── EntityTracker.java
│ ├── MapStorage.java
│ ├── TablistStorage.java
│ └── WindowTracker.java
│ └── types
│ ├── BlockChangeRecordArrayType.java
│ ├── BlockPositionVarYType.java
│ ├── BulkChunkType.java
│ ├── ChunkType.java
│ ├── EntityDataType.java
│ ├── EntityDataTypes1_7_6.java
│ ├── IntArrayType.java
│ ├── ItemArrayType.java
│ ├── ItemType.java
│ ├── NBTType.java
│ └── Types1_7_6.java
└── resources
└── assets
└── vialegacy
└── vialegacy.yml
/.gitattributes:
--------------------------------------------------------------------------------
1 | #
2 | # https://help.github.com/articles/dealing-with-line-endings/
3 | #
4 | # Linux start script should use lf
5 | /gradlew text eol=lf
6 |
7 | # These are Windows script files and should use crlf
8 | *.bat text eol=crlf
9 |
10 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ko_fi: rk_01
2 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | registries:
3 | maven-central:
4 | type: maven-repository
5 | url: "https://repo.maven.apache.org/maven2/"
6 | updates:
7 | - package-ecosystem: "gradle"
8 | directory: "/"
9 | schedule:
10 | interval: "daily"
11 | registries:
12 | - maven-central
13 | - package-ecosystem: "github-actions"
14 | directory: "/"
15 | schedule:
16 | interval: "weekly"
17 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: build
2 | on: [push, pull_request, workflow_dispatch]
3 |
4 | jobs:
5 | build:
6 | runs-on: ubuntu-24.04
7 | if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
8 | steps:
9 | - name: Checkout Repository
10 | uses: actions/checkout@v5
11 | with:
12 | persist-credentials: false
13 | - name: Validate Gradle Wrapper
14 | uses: gradle/actions/wrapper-validation@v5
15 | - name: Set up JDK 21
16 | uses: actions/setup-java@v5
17 | with:
18 | distribution: temurin
19 | java-version: 21
20 | check-latest: true
21 | - name: Build with Gradle
22 | run: ./gradlew build
23 | - name: Upload Artifacts to GitHub
24 | uses: actions/upload-artifact@v4
25 | with:
26 | name: Artifacts
27 | path: build/libs/
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 | *.log.gz
7 |
8 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
9 | hs_err_pid*
10 |
11 | # Project files
12 | /.idea/*
13 | !/.idea/copyright/
14 | /.gradle/
15 | /buildSrc/.gradle/
16 | build/
17 | out/
18 | /run/
19 |
--------------------------------------------------------------------------------
/.idea/copyright/GPL_3_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "java-library"
3 | id "base.base-conventions"
4 | id "base.fill-build-constants"
5 | id "vialegacy.publishing-conventions"
6 | id "via.run-with-viaproxy-task"
7 | id "net.raphimc.class-token-replacer" version "1.1.7"
8 | }
9 |
10 | repositories {
11 | maven {
12 | name = "ViaVersion"
13 | url = "https://repo.viaversion.com"
14 |
15 | content {
16 | includeGroupByRegex "com\\.viaversion(\\..+)?"
17 | includeGroupByRegex "net\\.raphimc(\\..+)?"
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compileOnly "com.viaversion:viaversion-common:5.5.1-SNAPSHOT"
24 | compileOnly "com.google.guava:guava:33.5.0-jre"
25 | compileOnly "io.netty:netty-handler:4.2.7.Final"
26 | }
27 |
--------------------------------------------------------------------------------
/buildSrc/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "groovy-gradle-plugin"
3 | }
4 |
5 | repositories {
6 | gradlePluginPortal()
7 | }
8 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/base.base-conventions.gradle:
--------------------------------------------------------------------------------
1 | base {
2 | java.toolchain.languageVersion = JavaLanguageVersion.of(project.java_version)
3 |
4 | group = project.maven_group
5 | archivesName = project.name
6 | version = project.maven_version
7 | }
8 |
9 | repositories {
10 | mavenCentral()
11 | }
12 |
13 | jar {
14 | if (layout.projectDirectory.file("LICENSE").asFile.exists()) {
15 | def projectName = project.name
16 | from(layout.projectDirectory.file("LICENSE")) {
17 | rename { "${it}_${projectName}" }
18 | }
19 | } else if (rootProject.layout.projectDirectory.file("LICENSE").asFile.exists()) {
20 | def projectName = rootProject.name
21 | from(rootProject.layout.projectDirectory.file("LICENSE")) {
22 | rename { "${it}_${projectName}" }
23 | }
24 | }
25 | }
26 |
27 | tasks.withType(JavaCompile).configureEach {
28 | it.options.encoding = "UTF-8"
29 | }
30 |
31 | tasks.withType(Javadoc).configureEach {
32 | it.options.encoding = "UTF-8"
33 | it.options.addStringOption("Xdoclint:none", "-quiet")
34 | }
35 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/base.exclude-run-folder.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "idea"
3 | }
4 |
5 | idea {
6 | module {
7 | ["run"].each {
8 | excludeDirs << layout.projectDirectory.file("$it").asFile
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/base.fill-build-constants.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "net.raphimc.class-token-replacer"
3 | }
4 |
5 | sourceSets.configureEach {
6 | it.classTokenReplacer {
7 | property("\${version}", project.version)
8 | property("\${commit_hash}", latestCommitHash().get())
9 | }
10 | }
11 |
12 | Provider latestCommitHash() {
13 | return providers.exec {
14 | commandLine = ["git", "rev-parse", "--short", "HEAD"]
15 | }.standardOutput.getAsText().map(String::trim)
16 | }
17 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/base.publishing-conventions.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "maven-publish"
3 | id "signing"
4 | }
5 |
6 | java {
7 | withSourcesJar()
8 | withJavadocJar()
9 | }
10 |
11 | publishing {
12 | publications {
13 | mavenJava(MavenPublication) {
14 | from(components.java)
15 |
16 | groupId = project.maven_group
17 | artifactId = project.maven_name
18 | version = project.maven_version
19 | }
20 | }
21 | }
22 |
23 | signing {
24 | setRequired(false)
25 | sign(publishing.publications.mavenJava)
26 | }
27 |
28 | tasks.withType(PublishToMavenRepository).configureEach {
29 | it.dependsOn(tasks.withType(Sign))
30 | }
31 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/via.run-with-viaproxy-task.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "base.exclude-run-folder"
3 | }
4 |
5 | def prepareTask = tasks.register("prepareViaProxyFiles", Copy) {
6 | dependsOn(tasks.jar)
7 |
8 | def projectName = project.name
9 | from(tasks.jar.archiveFile)
10 | into(file("run/jars"))
11 | rename { "${projectName}.jar" }
12 | }
13 |
14 | def cleanupTask = tasks.register("cleanupViaProxyFiles", Delete) {
15 | delete(file("run/jars/${project.name}.jar"))
16 | delete(file("run/logs"))
17 | }
18 |
19 | tasks.register("runViaProxy", JavaExec) {
20 | dependsOn(prepareTask)
21 | finalizedBy(cleanupTask)
22 |
23 | def viaProxyConfiguration = configurations.create("viaProxy")
24 | viaProxyConfiguration.dependencies.add(dependencies.create("net.raphimc:ViaProxy:3.4.6-SNAPSHOT") {
25 | transitive = false
26 | })
27 |
28 | mainClass = "net.raphimc.viaproxy.ViaProxy"
29 | classpath = viaProxyConfiguration
30 | workingDir = file("run")
31 | jvmArgs = ["-DskipUpdateCheck"]
32 | }
33 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/via.viaversion-maven-publishing.gradle:
--------------------------------------------------------------------------------
1 | publishing {
2 | repositories {
3 | maven {
4 | name = "Via"
5 | url = "https://repo.viaversion.com/"
6 |
7 | credentials(PasswordCredentials)
8 | authentication {
9 | basic(BasicAuthentication)
10 | }
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/buildSrc/src/main/groovy/vialegacy.publishing-conventions.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "base.publishing-conventions"
3 | id "via.viaversion-maven-publishing"
4 | }
5 |
6 | publishing {
7 | publications {
8 | mavenJava {
9 | pom {
10 | name = "ViaLegacy"
11 | description = "ViaVersion addon to add support for EVERY Minecraft server version (Classic, Alpha, Beta, Release)"
12 | url = "https://github.com/ViaVersion/ViaLegacy"
13 | licenses {
14 | license {
15 | name = "GPL-3.0 License"
16 | url = "https://github.com/ViaVersion/ViaLegacy/blob/main/LICENSE"
17 | }
18 | }
19 | developers {
20 | developer {
21 | id = "RK_01"
22 | }
23 | }
24 | scm {
25 | connection = "scm:git:git://github.com/ViaVersion/ViaLegacy.git"
26 | developerConnection = "scm:git:ssh://github.com/ViaVersion/ViaLegacy.git"
27 | url = "https://github.com/ViaVersion/ViaLegacy.git"
28 | }
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.parallel=true
3 | org.gradle.configuration-cache=true
4 |
5 | java_version=17
6 | maven_group=net.raphimc
7 | maven_name=ViaLegacy
8 | maven_version=3.0.12-SNAPSHOT
9 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ViaVersion/ViaLegacy/d22a243e49baaeedae33d021ee0b4e56aec8a9be/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionSha256Sum=8fad3d78296ca518113f3d29016617c7f9367dc005f932bd9d93bf45ba46072b
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
5 | networkTimeout=10000
6 | validateDistributionUrl=true
7 | zipStoreBase=GRADLE_USER_HOME
8 | zipStorePath=wrapper/dists
9 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | mavenCentral()
4 | gradlePluginPortal()
5 | }
6 | }
7 |
8 | plugins {
9 | id "org.gradle.toolchains.foojay-resolver-convention" version "1.0.0"
10 | }
11 |
12 | rootProject.name = "ViaLegacy"
13 |
--------------------------------------------------------------------------------
/src/main/java/net/raphimc/vialegacy/ViaLegacy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
3 | * Copyright (C) 2020-2025 RK_01/RaphiMC and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package net.raphimc.vialegacy;
19 |
20 | import net.raphimc.vialegacy.platform.ViaLegacyConfig;
21 | import net.raphimc.vialegacy.platform.ViaLegacyPlatform;
22 |
23 | public class ViaLegacy {
24 |
25 | public static final String VERSION = "${version}";
26 | public static final String IMPL_VERSION = "git-ViaLegacy-${version}:${commit_hash}";
27 |
28 | private static ViaLegacyPlatform platform;
29 | private static ViaLegacyConfig config;
30 |
31 | private ViaLegacy() {
32 | }
33 |
34 | public static void init(final ViaLegacyPlatform platform, final ViaLegacyConfig config) {
35 | if (ViaLegacy.platform != null) throw new IllegalStateException("ViaLegacy is already initialized");
36 |
37 | ViaLegacy.platform = platform;
38 | ViaLegacy.config = config;
39 | }
40 |
41 | public static ViaLegacyPlatform getPlatform() {
42 | return ViaLegacy.platform;
43 | }
44 |
45 | public static ViaLegacyConfig getConfig() {
46 | return ViaLegacy.config;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/net/raphimc/vialegacy/api/splitter/PreNettyPacketType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
3 | * Copyright (C) 2020-2025 RK_01/RaphiMC and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package net.raphimc.vialegacy.api.splitter;
19 |
20 | import com.viaversion.viaversion.api.connection.UserConnection;
21 | import io.netty.buffer.ByteBuf;
22 |
23 | import java.util.function.BiConsumer;
24 |
25 | public interface PreNettyPacketType {
26 |
27 | BiConsumer getPacketReader();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/net/raphimc/vialegacy/api/splitter/PreNettySplitter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
3 | * Copyright (C) 2020-2025 RK_01/RaphiMC and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package net.raphimc.vialegacy.api.splitter;
19 |
20 | import com.viaversion.viaversion.api.connection.StorableObject;
21 | import com.viaversion.viaversion.api.protocol.Protocol;
22 |
23 | import java.util.function.IntFunction;
24 |
25 | public class PreNettySplitter implements StorableObject {
26 |
27 | private final IntFunction packetTypeSupplier;
28 | private final Class extends Protocol, ?, ?, ?>> protocolClass;
29 |
30 | public PreNettySplitter(Class extends Protocol, ?, ?, ?>> protocolClass, IntFunction packetTypeSupplier) {
31 | this.protocolClass = protocolClass;
32 | this.packetTypeSupplier = packetTypeSupplier;
33 | }
34 |
35 | public PreNettyPacketType getPacketType(final int packetId) {
36 | return this.packetTypeSupplier.apply(packetId);
37 | }
38 |
39 | public String getProtocolName() {
40 | return this.protocolClass.getSimpleName();
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/net/raphimc/vialegacy/api/util/BlockFaceUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
3 | * Copyright (C) 2020-2025 RK_01/RaphiMC and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package net.raphimc.vialegacy.api.util;
19 |
20 | import com.viaversion.viaversion.api.minecraft.BlockFace;
21 |
22 | public class BlockFaceUtil {
23 |
24 | public static BlockFace getFace(final int direction) {
25 | return switch (direction) {
26 | case 0 -> BlockFace.BOTTOM;
27 | default -> BlockFace.TOP;
28 | case 2 -> BlockFace.NORTH;
29 | case 3 -> BlockFace.SOUTH;
30 | case 4 -> BlockFace.WEST;
31 | case 5 -> BlockFace.EAST;
32 | };
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/net/raphimc/vialegacy/api/util/GameProfileUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
3 | * Copyright (C) 2020-2025 RK_01/RaphiMC and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package net.raphimc.vialegacy.api.util;
19 |
20 | import com.viaversion.viaversion.api.minecraft.GameProfile;
21 |
22 | import java.nio.charset.StandardCharsets;
23 | import java.util.UUID;
24 |
25 | public class GameProfileUtil {
26 |
27 | public static UUID getOfflinePlayerUuid(final String name) {
28 | return UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(StandardCharsets.UTF_8));
29 | }
30 |
31 | public static boolean isOfflineGameProfile(final GameProfile gameProfile) {
32 | return gameProfile.id() != null && gameProfile.name() != null && gameProfile.id().equals(getOfflinePlayerUuid(gameProfile.name()));
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/net/raphimc/vialegacy/api/util/PacketUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
3 | * Copyright (C) 2020-2025 RK_01/RaphiMC and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package net.raphimc.vialegacy.api.util;
19 |
20 | import com.viaversion.viaversion.api.protocol.packet.PacketType;
21 | import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
22 | import com.viaversion.viaversion.protocol.packet.PacketWrapperImpl;
23 | import io.netty.buffer.ByteBuf;
24 | import io.netty.buffer.Unpooled;
25 |
26 | public class PacketUtil {
27 |
28 | public static int calculateLength(final PacketWrapper wrapper) {
29 | final PacketType packetType = wrapper.getPacketType();
30 | wrapper.setPacketType(null);
31 |
32 | final ByteBuf lengthBuffer = Unpooled.buffer();
33 | if (wrapper instanceof PacketWrapperImpl impl && impl.getInputBuffer() != null) {
34 | impl.getInputBuffer().markReaderIndex();
35 | }
36 | wrapper.writeToBuffer(lengthBuffer);
37 | if (wrapper instanceof PacketWrapperImpl impl && impl.getInputBuffer() != null) {
38 | impl.getInputBuffer().resetReaderIndex();
39 | }
40 | final int length = lengthBuffer.readableBytes();
41 | lengthBuffer.release();
42 |
43 | wrapper.setPacketType(packetType);
44 | return length;
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/net/raphimc/vialegacy/netty/PreNettyLengthCodec.java:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of ViaLegacy - https://github.com/RaphiMC/ViaLegacy
3 | * Copyright (C) 2020-2025 RK_01/RaphiMC and contributors
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, either version 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * This program is distributed in the hope that it will be useful,
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | * GNU General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU General Public License
16 | * along with this program. If not, see .
17 | */
18 | package net.raphimc.vialegacy.netty;
19 |
20 | import com.viaversion.viaversion.api.connection.UserConnection;
21 | import io.netty.buffer.ByteBuf;
22 | import io.netty.channel.ChannelHandlerContext;
23 | import io.netty.handler.codec.ByteToMessageCodec;
24 |
25 | import java.util.List;
26 |
27 | public class PreNettyLengthCodec extends ByteToMessageCodec {
28 |
29 | protected final PreNettyLengthRemover encoder;
30 | protected final PreNettyLengthPrepender decoder;
31 |
32 | public PreNettyLengthCodec(final UserConnection user) {
33 | this.encoder = new PreNettyLengthRemover(user);
34 | this.decoder = new PreNettyLengthPrepender(user);
35 | }
36 |
37 | @Override
38 | protected void encode(ChannelHandlerContext ctx, ByteBuf in, ByteBuf out) {
39 | this.encoder.encode(ctx, in, out);
40 | }
41 |
42 | @Override
43 | protected void decode(ChannelHandlerContext ctx, ByteBuf in, List