Compare commits

...
2505 Commits
Author SHA1 Message Date
Nassim Jahnke 3dfb96dec9 4.2.0 Release 2022-02-24 09:22:47 +01:00
Nassim Jahnke 82ada0bcd8 Add new default command parser 2022-02-23 18:15:39 +01:00
Nassim Jahnke 28bd50a105 Fix legacy component text wrapping
Fixes #2821
2022-02-22 10:10:51 +01:00
Nassim Jahnke 46bd5814e3 Fix mutated dimension registry on old servers 2022-02-19 10:14:15 +01:00
Nassim Jahnke 4e9cddac8f 1.18.2 pre1 2022-02-18 17:49:45 +01:00
Nassim Jahnke a85c5578c1 22w07a 2022-02-16 18:40:50 +01:00
Nassim Jahnke 130ab70550 Fix registry on respawn 2022-02-09 19:57:54 +01:00
Nassim Jahnke ee27cbdd22 22w06a 2022-02-09 19:15:35 +01:00
Nassim Jahnke bd0d238f23 22w05a 2022-02-02 11:42:18 +01:00
Nassim Jahnke 3a5ac6f037 Merge branch 'master' into dev 2022-01-30 18:24:05 +01:00
Nassim Jahnke 8db0f3ac6e Fix uninjection from empty pipeline
Closes #2788
2022-01-30 18:21:28 +01:00
Nassim Jahnke 60eda447b4 22w03a 2022-01-19 18:05:36 +01:00
Nassim Jahnke d5f2388723 Add Item#copy 2022-01-11 17:10:31 +01:00
Nassim Jahnke d5a568b3fc Update copyright header 2022-01-09 22:36:07 +01:00
Nassim Jahnke 2704d70c1f Update Sponge module to API v8 2022-01-09 18:30:51 +01:00
Konicai 2a1e82ac6d Initial update to api-8 2022-01-09 16:17:41 +01:00
Nassim Jahnke 755a69e912 Update shadow 2022-01-05 10:03:07 +01:00
RK_01 101a4f63de Fixed 1.9.2 -> 1.9.3 block entity translation (#2784) 2022-01-03 11:05:15 +01:00
Nassim Jahnke 84bdaa79e2 Map walls to low variant in 1.15->1.16 2021-12-22 17:32:25 +01:00
Nassim Jahnke c3b6f5ce64 Update Gradle wrapper to 7.3.2 2021-12-22 17:31:30 +01:00
Nassim Jahnke 06a7260173 Fill dirt block tag to fix flower place animation 2021-12-20 10:53:11 +01:00
Nassim Jahnke 54236f718f Update shadow 2021-12-15 08:59:34 +01:00
Nassim Jahnke 2143e38d27 Don't make the client resize palettes on >8 bits 2021-12-08 21:31:53 +01:00
Nassim Jahnke 7d7651bc39 Update ProtocolVersion name for 1.18.1 2021-12-08 16:37:10 +01:00
RK_01 64c11b1f8f Fixed 1.9 -> 1.8 potion metadata packet order (#2765) 2021-12-08 12:49:13 +01:00
Myles a1a0926c4b Back to snapshot 2021-12-03 18:11:51 +00:00
Myles aade94a48f 4.1.1 release 2021-12-03 18:02:58 +00:00
Nassim Jahnke edebe64cf8 Fix handling of invalid biomes in 1.17->1.18 2021-12-03 13:33:52 +01:00
Nassim Jahnke ae4f837091 Fix double effect register 2021-12-02 20:17:24 +01:00
Lucas 5e6d87c8fd Map smoke directions from 1.13 to 1.13.1 (#2745) 2021-12-02 17:04:48 +01:00
Nassim Jahnke 20e9723d21 Update Gradle, particles finally work everywhere™️
Fixes #2746
2021-12-02 10:54:32 +01:00
Nassim Jahnke 54724ac540 Fix 1.18 block entity warnings on <1.12 servers 2021-12-01 19:54:43 +01:00
Nassim Jahnke a9c848e32e Cleanup palette type 2021-12-01 17:50:23 +01:00
Nassim Jahnke 02f9e87233 Fix invisible chests for 1.18 clients on very old servers
Fixes #2744
2021-12-01 17:50:09 +01:00
Nassim Jahnke 22d546edc0 Bump version to 4.1.1-SNAPSHOT 2021-12-01 15:37:39 +01:00
Nassim Jahnke f464e8e287 4.1.0 Release 2021-11-29 21:17:20 +01:00
Nassim Jahnke bd5217acb4 Merge remote-tracking branch 'origin/master' into dev 2021-11-28 16:09:21 +01:00
RK_01 e0cf62825b Fixed 1.9.3 -> 1.9.1 chunk translation (#2740) 2021-11-28 16:08:02 +01:00
Nassim Jahnke 9ce356aff4 another one 2021-11-26 17:15:10 +01:00
Nassim Jahnke 60fa54dddc 1.18-rc2 2021-11-26 10:53:58 +01:00
Nassim Jahnke 99b457965b 1.18-rc1 2021-11-25 16:09:34 +01:00
Nassim Jahnke 1d1a330ef1 1.18 pre8 2021-11-24 16:41:42 +01:00
Nassim Jahnke 4e9910c20e 1.18-pre7 2021-11-23 18:09:09 +01:00
Nassim Jahnke 82f2958ac6 1.18-pre6 2021-11-22 18:41:49 +01:00
Nassim Jahnke 1afa441571 Fix possible NPE in 1.13 component rewriting 2021-11-21 21:02:06 +01:00
Nassim Jahnke d159047dc0 Add more debugging options 2021-11-21 11:43:55 +01:00
Nassim Jahnke 3a529d00ce Fix update light passthrough 2021-11-19 21:35:21 +01:00
Nassim Jahnke b14b2b86e8 1.18-pre5 2021-11-19 17:27:43 +01:00
Nassim Jahnke 9ab4319771 *this is wrong intensifies* 2021-11-19 10:20:30 +01:00
Nassim Jahnke 8de7a4c828 Improve ceillog2 method 2021-11-19 10:06:45 +01:00
Nassim Jahnke 782d7a2172 this is wrong 2021-11-18 11:38:31 +01:00
Nassim Jahnke 2e5f3e4d66 this is wrong 2021-11-18 11:32:53 +01:00
Nassim Jahnke 6a00bf099e Cache 1.17.1 light by default, add config option 2021-11-18 11:23:46 +01:00
Nassim Jahnke bc11bd4caf Set mappings default values to -1 2021-11-17 19:52:06 +01:00
Nassim Jahnke c133552d04 1.18-pre4 2021-11-17 19:28:44 +01:00
Nassim Jahnke 2065a83fa1 Update biomes highest bits 2021-11-17 18:02:54 +01:00
Nassim Jahnke 30ce0eaa45 1.18-pre3 2021-11-17 17:43:17 +01:00
Nassim Jahnke 8be1fc9340 Move MetaTypes methods up into abstract class 2021-11-17 11:13:14 +01:00
Nassim Jahnke 6a8aa497b0 1.18-pre2 2021-11-16 13:28:53 +01:00
Nassim Jahnke 390155e03b Make Mappings extendable 2021-11-16 13:15:27 +01:00
Nassim Jahnke 3051ddb6c0 Better Mappings builders
Allows for mappings between json arrays and objects without a billion different constructors, also now uses the proper size for 1.18 chunks
2021-11-15 21:49:02 +01:00
Nassim Jahnke 25d74632c2 Update Bungee version warning 2021-11-15 11:00:18 +01:00
Nassim Jahnke 2b77427d0b Remove unused 1.18 code 2021-11-14 09:45:25 +01:00
_tomcraft dfc77b6f84 Update BungeeCord support (#2731)
fixes #2730
2021-11-14 09:44:33 +01:00
_tomcraft 6bc7f911c3 Fix bed rewriting and fix inconsistencies in item rewrite (#2729) 2021-11-14 09:37:03 +01:00
Nassim Jahnke 718614f81f 1.18 Pre-1 2021-11-11 10:06:59 +01:00
Nassim Jahnke 8e1f3bb086 Update Gradle to 7.3, adventure to 4.9.3 2021-11-11 10:05:58 +01:00
Nassim Jahnke 3a87eb463a Fix 1.18 spawner entity 2021-11-10 17:31:52 +01:00
Nassim Jahnke a49c395486 Make changes in particles easier to handle 2021-11-10 11:35:44 +01:00
Nassim Jahnke ad7f782a1a Fix InformativeException NPE 2021-11-08 12:09:08 +01:00
Nassim Jahnke 3aa84b5a5a Fix particle 1.18 meta type 2021-11-06 15:19:24 +01:00
Nassim Jahnke 52457ea749 Fix unquoted string being parsed as double 2021-11-05 18:19:14 +01:00
Nassim Jahnke 8104b96b8c Fix premature snbt numeric parsing 2021-11-04 19:43:48 +01:00
Nassim Jahnke a7835650bf Make model customization type with previous handlers 2021-11-03 19:16:03 +01:00
Nassim Jahnke d326dadb5d 21w44a 2021-11-03 19:14:33 +01:00
Nassim Jahnke d9307dad0c Merge remote-tracking branch 'origin/master' into dev 2021-11-03 10:53:16 +01:00
RK_01 752735159c Fixed credits screen not showing on 1.8 servers (#2724) 2021-11-02 19:01:29 +01:00
Nassim Jahnke 7cc6eb2b66 Fix accidental float/double NaN parsing in snbt 2021-11-02 15:09:40 +01:00
Nassim Jahnke 0a19057606 Merge remote-tracking branch 'origin/master' into dev 2021-10-30 15:56:39 +02:00
RK_01 a49d73c4c6 Abstract 1.8 metadata type (#2720) 2021-10-30 15:56:24 +02:00
Nassim Jahnke 82ded0299c Merge remote-tracking branch 'origin/master' into dev 2021-10-29 17:57:47 +02:00
Nassim Jahnke ab7cd4955b Metadata type should be written as var int 2021-10-29 17:57:23 +02:00
Nassim Jahnke 95493f3bbe Minor optimization 2021-10-29 17:47:38 +02:00
Nassim Jahnke a8c6f6b783 21w43a 2021-10-27 18:43:09 +02:00
Nassim Jahnke 516f746061 Handle barrier/light particles in entity meta 2021-10-25 09:52:54 +02:00
Nassim Jahnke d8d65ea989 Merge remote-tracking branch 'origin/master' into dev 2021-10-23 09:58:22 +02:00
Nassim Jahnke d80735e248 Read player digging action as var int
Does not matter for small numbers, but properly reflects Vanilla's reading/writing type
2021-10-23 09:58:11 +02:00
Redned ff5ad2385c Fix recipe book glitch on <1.16.2 servers (#2715) 2021-10-23 09:30:03 +02:00
Nassim Jahnke 2f28b25af3 Add block marker id to ParticleMappings 2021-10-20 18:51:53 +02:00
Nassim Jahnke 02bf9501a9 Handle item and particle meta 2021-10-20 18:48:07 +02:00
Nassim Jahnke a6292988d5 21w42a
Screw entity meta particles
2021-10-20 17:58:50 +02:00
Nassim Jahnke 431f773b77 Merge remote-tracking branch 'origin/master' into dev 2021-10-20 13:52:34 +02:00
Nassim Jahnke bd2bd1cf32 Cancel global entity packet if not lightning 2021-10-20 13:51:49 +02:00
Nassim Jahnke f5d92bf74f Merge remote-tracking branch 'origin/master' into dev 2021-10-19 09:16:06 +02:00
Nassim Jahnke dbe8b6551a Readd flare
Issues were addressed in 2.0.0
2021-10-19 09:10:17 +02:00
Nassim Jahnke 027e132749 Merge remote-tracking branch 'origin/master' into dev 2021-10-16 13:26:06 +02:00
Nassim Jahnke 7e3a157fcf Revert flare usage for now
Caused some issues I have no time to investigate at the moment, but worrying enough to warrant a temporary removal
Closes ViaVersion/ViaBackwards#402
2021-10-16 13:25:56 +02:00
Nassim Jahnke 9cd1ebf576 21w41a 2021-10-13 18:05:52 +02:00
Nassim Jahnke 03f929163c Merge remote-tracking branch 'origin/master' into dev 2021-10-11 21:04:29 +02:00
Nassim Jahnke e7e1ee7a2b Update shadow 2021-10-11 21:03:18 +02:00
_tomcraft 3f229c4cb9 Minor improvements (#2709) 2021-10-11 21:00:32 +02:00
Gero b2e0fdeaf8 Don't cancel chunks with missing light data (#2711) 2021-10-09 14:08:07 +02:00
Nassim Jahnke 0b541befbc Merge remote-tracking branch 'origin/master' into dev 2021-10-08 17:29:16 +02:00
Nassim Jahnke fd9346d4da Use validated channel in getNewPluginChannelId
Fixes #2707
2021-10-08 17:29:05 +02:00
Nassim JahnkeandGerrygames e744214ad6 Fix biome palette writing
Co-authored-by: Gerrygames <gecam59@gmail.com>
2021-10-08 13:17:07 +02:00
Nassim Jahnke 3feff8e751 Fix remove in ChunkLightStorage 2021-10-08 10:05:50 +02:00
Nassim Jahnke a2acd261d8 Merge remote-tracking branch 'origin/master' into dev 2021-10-08 09:37:32 +02:00
Nassim Jahnke 36b8884d92 Fix leftover FU load factors 2021-10-08 09:37:04 +02:00
Nassim Jahnke c15d7b8882 Don't forget id comments 2021-10-07 16:46:10 +02:00
Nassim Jahnke 9f33a09e87 21w40a 2021-10-07 16:44:43 +02:00
Nassim Jahnke cc78180a6c Merge remote-tracking branch 'origin/master' into dev 2021-10-07 12:27:21 +02:00
Connor Hartley e5338688bb Replace use of concurrenthashmap in entity tracker and block storage (#2705) 2021-10-07 12:26:14 +02:00
Nassim Jahnke b19ec959b3 Merge remote-tracking branch 'origin/master' into dev 2021-10-05 14:21:31 +02:00
MrMicky 8b4a57985b Remove usage of sun.misc.Unsafe in BungeeViaInjector (#2698) 2021-10-05 14:20:18 +02:00
Nassim Jahnke 7fb4e4a095 Change GH actions dist to adoptium 2021-10-05 14:10:04 +02:00
Nassim Jahnke 1bc4fc211d Merge remote-tracking branch 'origin/master' into dev 2021-10-03 20:15:19 +02:00
Nassim Jahnke 0a4d08886d Update adventure 2021-10-03 20:14:12 +02:00
creeper123123321 0f5fa620d1 Translatable ender dragon/wither text (#2702) 2021-10-03 16:23:41 +02:00
Gero a0f26f1ca3 Fix channel name validation in 1.13 to 1.12.2 protocol (#2701)
Closes #2187
2021-10-03 12:12:49 +02:00
MrMicky e64a0fb62e Prevent kick when signing empty book (#2700) 2021-10-03 10:11:34 +02:00
Nassim Jahnke 69409d71d1 Run handitem cache every tick 2021-10-02 16:38:20 +02:00
Nassim Jahnke 68c63d20ed Fix reading of explicit int array entries
See https://github.com/KyoriPowered/adventure/pull/460
2021-10-02 11:27:18 +02:00
Nassim Jahnke 2afa3fd9de Merge remote-tracking branch 'origin/master' into dev 2021-10-01 22:46:37 +02:00
Myles 0bcaf3e422 Merge pull request #2695 from ViaVersion/legacy-injector-cleanup
Cleanup Bukkit/Sponge injectors
2021-10-01 15:38:03 +01:00
Nassim Jahnke 6e5992c168 Add docs to abstract LegacyViaInjector methods 2021-10-01 16:33:18 +02:00
Gero 02122f8ce6 Fix #2532 2021-10-01 15:35:04 +02:00
_tomcraft 39f7f70a32 Cancel arm animation if in an open inventory for 1.16+ (#2687) 2021-10-01 12:38:49 +02:00
Nassim Jahnke 427b0a68d0 Cleanup Bukkit/Sponge injectors 2021-10-01 12:17:55 +02:00
Nassim Jahnke 50f3a05fa5 21w39a (probably) 2021-09-29 20:16:31 +02:00
Nassim JahnkeandRK_01 a306c222d4 More NBTTagTest test cases
Co-authored-by: RK_01 <50594595+raphimc@users.noreply.github.com>
2021-09-25 15:43:55 +02:00
Nassim Jahnke 5bfee3339a Merge remote-tracking branch 'origin/master' into dev 2021-09-25 14:57:41 +02:00
Nassim Jahnke 2b9df69627 Fix trailing comma again, fix 'possiblyNumeric' DoubleTag parsing 2021-09-25 14:57:14 +02:00
Nassim Jahnke 4f1e92f309 Merge remote-tracking branch 'origin/master' into dev 2021-09-25 13:18:59 +02:00
Nassim Jahnke 88165088a9 Update adventure nbt i/o 2021-09-25 13:15:26 +02:00
Nassim Jahnke e38f76b8bc Definitely did not forget to update mappings 2021-09-24 14:39:38 +02:00
Nassim Jahnke 1f63fc7de1 21w38a 2021-09-23 17:23:14 +02:00
Nassim Jahnke 763a88fe97 Merge remote-tracking branch 'origin/master' into dev 2021-09-22 11:16:35 +02:00
Nassim Jahnke 12e2be40e8 Remove some old todos, don't send empty 1.14->1.15 meta packet 2021-09-22 11:15:36 +02:00
Nassim Jahnke 22379eda6f Add todo 2021-09-22 10:16:42 +02:00
Nassim Jahnke 4485af577d Merge remote-tracking branch 'origin/master' into dev 2021-09-21 11:02:40 +02:00
Nassim Jahnke 0fcfd78b62 Add more user friendly 'block-versions' option 2021-09-20 15:15:25 +02:00
Nassim Jahnke 4940ed66c1 Don't warn on superfluous bytes
Should be looked into, but not now™️
2021-09-16 18:17:44 +02:00
Nassim Jahnke 73093c0ff2 Read/write palette based on block/biome size variables 2021-09-16 18:12:33 +02:00
Nassim Jahnke c5e27b89af Don't read remaining bytes in 1.18 chunk type 2021-09-16 17:01:58 +02:00
Nassim Jahnke 111cd2fd46 Biome palettes entries can have 1 bit 2021-09-16 15:47:28 +02:00
Nassim Jahnke 5a90c8374c Fix named sound packets and old block entities 2021-09-16 15:41:14 +02:00
Nassim Jahnke 9ffa737a4d Implement BlockEntity sectionX/Z methods 2021-09-16 14:19:45 +02:00
Nassim Jahnke c565f2c9c7 Cleanup Palette interface and read/write 2021-09-16 13:03:31 +02:00
Nassim Jahnke eaa18f569a Write linear palette as map palette for now 2021-09-16 12:17:21 +02:00
Nassim Jahnke bfe6389377 Write biomes to palette 2021-09-16 11:35:05 +02:00
Nassim Jahnke f72412484a Map block entity ids, only biomes and something else left 2021-09-16 00:26:23 +02:00
Nassim Jahnke b4301adb3b WIP 21w37a 2021-09-15 23:00:14 +02:00
Levertion d67269c9fe Add support for setting a custom world name (#2672) 2021-09-15 10:52:11 +02:00
Nassim Jahnke c264e639d6 Clear entity data on world change in world tracker 2021-09-14 17:35:27 +02:00
Nassim Jahnke 32a84f24ef Nicer getters in Pair and Triple 2021-09-14 11:13:39 +02:00
Nassim Jahnke 68e4146f3b Deprecate cancelClientbound/Serverbound with new id parameter 2021-09-05 14:02:33 +02:00
Nassim Jahnke f4f7215a6a Fix disabled packet limiter check 2021-09-02 17:33:09 +02:00
Nassim Jahnke a0b19872f8 Disable VV packet limiter on 1.17.1+ Paper 2021-09-01 15:25:24 +02:00
Nassim Jahnke f2147179c2 Small fixes, add majorVersion method, nicer getter names in some classes
None of the deprecated methods will be removed anytime soon.
2021-08-28 22:15:28 +02:00
RK_01 e7a0b4cf04 Improve 1.8 -> 1.9 chunk translation and fix #2065 (#2669) 2021-08-28 10:02:27 +02:00
Nassim Jahnke 533572e8cd Add CREATE_FOG BossFlag 2021-08-27 19:29:07 +02:00
creeper123123321 257eea5b04 try to fix GoLilyPad servers (#2667)
Closes ViaVersion/ViaFabric#21
2021-08-25 14:55:43 +02:00
Jo0001 47af0d634f Fix typo in comment/javadocs (#2609) 2021-08-25 12:49:57 +02:00
kennytv 5e11d9d51f Update Gradle to 7.2 2021-08-17 13:37:51 +02:00
kennytv 7ffcff7a7b Fix 1.15->1.16 wolf anger 2021-08-14 10:37:21 +02:00
kennytv 9ee548b967 Fix 1.17 clients writing empty books
Fixes #2658
2021-08-11 15:11:56 +02:00
kennytv c9142223fd Gitignores don't have to be .gitignore'd 2021-08-02 17:59:12 +02:00
kennytv 2094397bca Allow bypassing of packet type restriction in Protocol, amend packet creator 2021-08-01 12:05:04 +02:00
kennytv b81109f512 Semi force packet types in PacketWrapper at creation and transformation 2021-07-31 15:08:45 +02:00
kennytv 874dbafe26 More packet sending API
Allows for easy packet sending from a specific version to or from any client version supported by Via.
For example, you can send packets in the 1.17.1 format to both client and server, and it will be transformed accordingly if executed on another server version or sent to a different client version.
2021-07-30 12:26:15 +02:00
kennytv 46ca469a4a Add author tag to constructed book nbt
Fixes #2640
2021-07-27 11:58:24 +02:00
Pierre Maurice Schwang 8fb51bf3b7 Update bug_report.yml (#2636) 2021-07-25 09:51:04 +02:00
creeper123123321 9874a9053a it's 2021 and we should use UTF 8 (#2633) 2021-07-23 21:31:25 +02:00
kennytv db87774426 Fix ProtocolSupport compat on 1.17
Fixes #2632

Thank you md_5, very cool
2021-07-23 10:15:59 +02:00
creeper123123321 d14db9396b Fix idle ticking in proxies (#2631) 2021-07-20 18:57:53 +02:00
kennytv d7966567e7 Lowercase gang 2021-07-07 20:43:27 +02:00
KennyTV b4f8024eef Fix 1.15->1.16 and 1.16.1->1.16.2 dropped items
Fixes #2610
2021-07-07 10:06:15 +02:00
KennyTV e70f230f39 Bump version to 4.0.2-SNAPSHOT 2021-07-07 09:59:49 +02:00
KennyTV b28f743306 4.0.1 Release 2021-07-06 10:31:03 +02:00
KennyTV 9f97a09942 1.17.1-rc2 2021-07-05 14:52:13 +02:00
KennyTV 4f7e655613 1.17.1-rc1 2021-07-01 19:58:34 +02:00
KennyTV a7d94c2f8f 1.17.1-pre3 2021-06-30 18:19:19 +02:00
KennyTV c2172821fd Merge remote-tracking branch 'origin/master' into dev 2021-06-29 18:12:36 +02:00
KennyTV 24393d4ef4 1.17.1-pre2 2021-06-29 18:11:51 +02:00
KennyTV 622ea91648 Ignore bad 1.8 wither meta
Fixes #2570
2021-06-22 11:28:09 +02:00
KennyTV aed1a63a77 Merge remote-tracking branch 'origin/master' into dev 2021-06-21 14:58:38 +02:00
LemonCaramel 14cd568e46 Add Resource pack prompt message option (1.17+) (#2544) 2021-06-21 14:55:49 +02:00
KennyTV 44d836e2e7 Clear entity trackers on server switch
Fixes #5930
2021-06-21 14:33:23 +02:00
_tomcraft f9af6947f7 Improve arm-swing cancel by resetting cursor item (#2528) 2021-06-20 22:50:37 +02:00
_tomcraft 8e1da82793 Use a more fork-proof approach to enable Paper block place patch (#2561) 2021-06-20 22:49:59 +02:00
KennyTV 860aca974b Read unsigned byte in set slot 2021-06-20 16:16:08 +02:00
KennyTV 6a66d7653f Fix writable book id 2021-06-20 16:16:07 +02:00
KennyTV d32a4541a9 1.17.1-pre1 2021-06-20 16:16:07 +02:00
KennyTV 26719169ee Fix 1.8 special inventory tracking 2021-06-20 16:15:48 +02:00
KennyTV eae145543e Fix 1.8 set slot write type
Fixes #2558
2021-06-19 15:35:43 +02:00
KennyTV 48f1300908 Read set slot inv id as unsigned byte for consistency 2021-06-18 16:59:34 +02:00
KennyTV 5cdaabeaec Handle particle id change in 1.16 metadata
Fixes #2551
2021-06-17 11:55:22 +02:00
KennyTV 40f87e9472 Update Gradle wrapper to 7.1 2021-06-16 09:12:23 +02:00
KennyTV 7f385d4762 Create concurrent hashmap with weak values with Guava
This could use Guava's Cache, but that's just the MapMaker but more
2021-06-15 09:59:23 +02:00
KennyTV 389c5adaa3 Half revert back to storing uuids in CommonBoss
Fixes #2547
2021-06-14 22:47:13 +02:00
KennyTV 7a82ded94b Fix Velocity compatibility (requires Velocity 3.0.0)
This finally removes the hacky reorder fix on Velocity; it added a few more events that could benefit us, but this is the most important right now.
2021-06-14 21:09:47 +02:00
Myles 86278e837a Fix 1.17 BungeeCord support 2021-06-14 19:46:25 +01:00
KennyTV 34a0499152 Update bug_report.yml 2021-06-14 10:59:01 +02:00
Myles 68ccc6634d Spigot 1.17 compatibility 2021-06-11 20:19:06 +01:00
Jo0001 317af7ebc5 Use the correct content-type header (#2527) 2021-06-10 22:15:14 +02:00
KennyTV 206368b777 Fix 1.12->1.13 entity tracking
Fixes #2526
2021-06-10 22:10:22 +02:00
KennyTV 204a81b0ea Add 1.17 to legacy api package ProtocolVersion 2021-06-10 10:50:07 +02:00
KennyTV b940ecab9c Fix meta warning 2021-06-10 08:42:52 +02:00
KennyTV 15cbc96697 Shorten metadata error message 2021-06-09 18:59:48 +02:00
KennyTV b5e5b46f77 Update adventure to 4.8.0 release 2021-06-08 19:07:09 +02:00
KennyTV 42b6a1378c Bump to 4.0.1-SNAPSHOT 2021-06-08 19:06:08 +02:00
KennyTV 4074352a53 4.0.0 Release 🚀 2021-06-07 16:32:07 +02:00
KennyTV f909b55a84 1.17-rc2 2021-06-07 14:28:41 +02:00
KennyTV 593aa7564a Put the other filled 1.17 tags into the diff file 2021-06-07 09:58:52 +02:00
KennyTV 24efb48004 Add method to load extra tags from diff files 2021-06-06 17:17:51 +02:00
KennyTV 38b3f40f7d Add Java version warning
We will update the required Java version at some point, the only question is when.
2021-06-06 11:55:40 +02:00
KennyTV d89f916546 Cleanup 1.17 entity rewriter, fix DataItem amount check 2021-06-06 10:08:15 +02:00
KennyTV 62278f287c Update gson, junit, and checker-qual 2021-06-05 17:17:29 +02:00
KennyTV 72be978f8e Update issue template 2021-06-05 17:16:51 +02:00
creeper123123321 666f3d6c92 Explain "left-handed-handling" option (#2512) 2021-06-05 17:12:55 +02:00
KennyTV 8e7606ea1b 1.17-rc1 2021-06-04 16:00:38 +02:00
KennyTV 2b8c5082ed Make Item an interface, more OOP for the ItemRewriter 2021-06-04 12:15:14 +02:00
KennyTV 05f9fc1ddc 1.17-pre5 2021-06-03 20:22:48 +02:00
KennyTV fc1450fe38 Slightly more OOP, move registerPackets out of Protocol constructor
registerPackets being called within the constructor made it impossible to create instance objects then used in registerPackets (vs. having to then create the objects in registerPackets).
2021-06-03 17:28:02 +02:00
KennyTV e1072a8dc7 Fix docs 2021-06-03 10:45:58 +02:00
KennyTV 3290d4ae24 Expose lateBind field in ViaVersionPlugin 2021-06-03 10:40:25 +02:00
KennyTV b2855c2cd4 F 2021-06-02 23:22:09 +02:00
KennyTV fec777b349 Don't wrap direct type mappers 2021-06-02 23:22:00 +02:00
KennyTV 7b1f9c199a Produce less overhead in packet handler registering
Instead of creating a void type reader for every single PacketHandler registered, this just directly uses the consumer-like PacketHandler.

The distinction between ValueCreator and the normal PacketHandler was unnecessary given you could also just read something in a ValueCreator instance, effectively just being a consumer of a PacketWrapper instance.
2021-06-02 22:00:20 +02:00
KennyTV a8b3444ff5 1.17-pre4 2021-06-02 18:44:47 +02:00
KennyTV 6839334c1a Fix confirmation id encoding, remove old send methods 2021-06-02 12:44:49 +02:00
KennyTV d7e3aa7143 Whoops 2021-06-01 23:28:32 +02:00
KennyTV 48436e7caf Go through the rest of the send usages 2021-06-01 23:27:33 +02:00
KennyTV eaa58affd1 Minor changes 2021-06-01 22:52:05 +02:00
KennyTV 57cf1803f3 Fix 1.9 block entity data send 2021-06-01 19:36:25 +02:00
KennyTV 104fa4e29f Optimize protocol path finding
Not perfect, but better. This prevents the path checks from exponentially increasing (if it weren't for the maxProtocolPathSize fail safe).

By default, a path will never go to a protocol version that puts it farther from the desired server protocol version, even if a path existed.
Otherwise as well as previously, *all* possible paths will be checked until a fitting one is found.

Negative examples if the new boolean is set to true:
    A possible path from 3 to 5 in order of 3->10->5 will be dismissed.
    A possible path from 5 to 3 in order of 5->0->3 will be dismissed.

Negative examples if set to false:
    While searching for a path from 3 to 5, 3->2->1 could be checked first before 3->4->5 is found.
    While searching for a path from 5 to 3, 5->6->7 could be checked first before 5->4->3 is found.

Assuming custom platforms like Bedrock protocol use the normal registering methods, they will have to change the boolean to false to revert to previous behavior (tho still somewhat better optimized).
2021-06-01 18:54:36 +02:00
KennyTV 4011aee280 1.17-pre3 2021-06-01 18:10:53 +02:00
KennyTV 37fd69fa86 Make packet send methods use the current thread by default
Defaulting to submitting to the netty event loop caused issues more often than not - this also removes the `currentThread` flag and instead provides new scheduleSend methods so it is always obvious whether the packet is sent immediately.
2021-06-01 10:13:49 +02:00
KennyTV 3fb125592b Send entity destroy on current thread 2021-05-31 20:45:56 +02:00
KennyTV 7925fd2d8f Fix shulker meta handling 2021-05-31 20:17:43 +02:00
KennyTV 199324ee9d 1.17-pre2 2021-05-31 18:21:31 +02:00
KennyTV d5cac99b5f Reorder Type instances 2021-05-31 11:51:21 +02:00
KennyTV 3618914ce9 Add method to get Protocol by supported versions, some cleanup 2021-05-29 22:21:29 +02:00
KennyTV ff140c421a Add/change comments 2021-05-29 11:50:07 +02:00
RK_01 016b8f1dbc Correct ClientboundPackets1_9_3 packetid comments (#2503) 2021-05-29 09:34:24 +02:00
KennyTV 0d31054903 Fix view distance update packet in 1.13->1.14
The client world is initialized during the join packet, but the view distance packet was created during/before the join handling.
Fixes #2502
2021-05-28 10:02:26 +02:00
KennyTV 8beedffea2 Fix project root build/libs dir not being cleaned
The base plugin is usually applied by the java plugin, but since that has been moved into the platforms, cleaning was no longer applied to the root dir (created and filled by the universal submodule).
2021-05-27 23:56:31 +02:00
RK_01 4ef862e06d Correct packet id comment (#2501) 2021-05-27 15:42:51 +02:00
KennyTV 53642e9a3c 1.17-pre1 2021-05-27 15:36:53 +02:00
KennyTV fd9dab8aa1 Replace inventory ack by using 1.17 ping packets 2021-05-26 21:36:20 +02:00
KennyTV 703978e227 Don't require UserConnection holding class in stored objects 2021-05-26 21:35:28 +02:00
KennyTV 7195319eb5 Update adventure 2021-05-26 16:37:29 +02:00
KennyTV 2d0a597f74 Make Metadata fully type safe, remove "Discontinued" meta types
The Discontinued entry was a special edge case that could lead to a Metadata type returning null. Instead, just directly use null in the 1.8->1.9 code where it is checked against. Also renamed the Meta1_17Types entries to be in uppercase and properly represent their value type.
2021-05-26 16:36:47 +02:00
KennyTV bc89f57088 Slightly improve metadata iteration, remove redundant MetaHandlerEvent index
Lazily create the event if needed and share it with other filters when handling a metadata entry. Lastly, only add the additionally created meta once after the filter list, not once per filter.
2021-05-26 09:00:49 +02:00
KennyTV 57769c5671 Make metadata (almost) fail-safe
This could mean life and death, see
`new Metadata(17, MetaType1_14.Float, event.meta()).value()`
vs.
`new Metadata(17, MetaType1_14.Float, event.meta().value())`
2021-05-25 16:27:55 +02:00
LemonCaramel a6b4b16fd3 Add Missing Translation Mapping (#2484) 2021-05-25 16:27:19 +02:00
KennyTV 3a1e364d4a Refactor entity tracking and meta handling
This essentially merges the two approaches to the metadata handling from ViaVersion and ViaBackwards and improves on both designs.

ViaVersion did not track every single entity, but only those needed (at least in theory) and can work with untracked entities' metadata. It had a very simple method overridden by metadata rewriter implementations, directly operating on the full metadata list and manually handling meta index changes as well as item/block/particle id changes.

ViaBackwards on the other hand had to track *every single* entity and threw warnings otherwise - while less prone to errors due to giving obvious warnings in the console, it unnecessarily tracks a lot of entities, and those warnings also annoys users when encountering virtual entity plugins (operating asynchronously and sending update packets while already untracked or not yet tracked). Dedicated MetaHandlers made id changes and filtering a lot easier to read and write. However, the actual metadata list handling and its distribution to handlers was not very well implemented and required a lot of list copying and creation as well as exception throws to cancel individual metadata entries.

This version has MetaFilters built with a Builder containing multiple helper functions, and the entity tracking is properly given its own map, hashed by a Protocol's class, to be easily and generically accessible from anywhere with only a Protocol class from the UserConnection, along with more optimized metadata list iteration. The entity tracking is largely unchanged, keeping ViaVersion's approach to not having to track *all* entities (and being able to handle null types in meta handlers).

All of this is by no means absolutely perfect, but is much less prone to errors than both previous systems and takes a lot less effort to actually write. A last possible change would be to use a primitive int to object map that is built to be concurrency save for the EntityTracker, tho that would have to be chosen carefully.
2021-05-25 15:37:07 +02:00
Jason 03638028cd Make proper sources jar (#2495) 2021-05-25 09:44:57 +02:00
jmp d5f56784e2 Silence doclint 2021-05-25 09:07:06 +02:00
jmp cbf71e2289 Only add javadoc jar to common and api 2021-05-25 09:07:06 +02:00
jmp e2d9e44be3 Build script improvements 2021-05-25 09:07:06 +02:00
KennyTV 2d2a5fa79c Fill "needs tool" tags
Fixes #2493
2021-05-24 09:21:32 +02:00
RK_01 605331963d Fix typo in DumpSubCmd (#2492) 2021-05-23 19:42:01 +02:00
KennyTV 15a5d51248 Don't cast ChannelInitializer type to SocketChannel 2021-05-22 19:41:07 +02:00
KennyTV 8bcd8fd995 Add apiVersion to ViaAPI, some jd 2021-05-22 19:39:26 +02:00
Kamillaova 9484526d39 Fix README build command (gradlew) (#2489) 2021-05-22 13:37:53 +02:00
KennyTV ab1cc791b7 Fix enchantment parsing or lvl integers 2021-05-21 09:17:40 +02:00
KennyTV 1fe76dbb77 Add more jd to Chunk, ChunkSection, and ChunkSectionLight 2021-05-20 19:23:29 +02:00
KennyTV cf2adab728 Make ChunkSection an interface, don't allocate light arrays if not needed 2021-05-20 18:32:28 +02:00
KennyTV 04fedd2892 Add comments 2021-05-20 16:56:39 +02:00
KennyTV c172091944 21w20a 2021-05-19 18:54:38 +02:00
creeper123123321 16ba5aa4f9 Run some optipng (#2482) 2021-05-18 20:46:35 +02:00
KennyTV 5fa2c788e0 Add missing mineable tag entries
Fixes #2481
2021-05-18 17:07:57 +02:00
creeper123123321 c5a338137e Update fabric.mod.json (#2480) 2021-05-18 13:49:58 +02:00
KennyTV 01d79e2681 Fix non-full chunk sending to 1.17 clients 2021-05-17 17:31:42 +02:00
KennyTV 576682ef9f Handle invalid uuid int array
Closes #2475
2021-05-15 16:42:38 +02:00
KennyTV 54b0345017 Fix PS compatibility on Java 8 💩 2021-05-15 10:11:19 +02:00
KennyTV 4f9f3254be Fix PS compatibility on Java 16 2021-05-15 09:28:18 +02:00
KennyTV 1538ff5201 Expand unsupported software checks 2021-05-14 16:59:12 +02:00
creeper123123321 f17fb833a0 add internal getInputBuffer() (#2472) 2021-05-14 11:19:02 +02:00
KennyTV 84c064fc11 Fix legacy hover deserialization, add snapshot suffix to version 2021-05-14 10:59:43 +02:00
KennyTV 7b5b79f510 Update Gradle to 7.0.1 2021-05-12 16:00:42 +02:00
KennyTV 2588c6ecc8 21w19a (probably) 2021-05-12 15:19:33 +02:00
KennyTV 2df57bc37c Fix 1.14->1.15 meta ordering issue
Closes #2467
2021-05-10 13:27:12 +02:00
KennyTV efeaef3e4e Update shadow plugin 2021-05-09 10:25:57 +02:00
KennyTV cb7a7254a6 Make UnsupportedSoftware hold a list of class names 2021-05-08 10:05:43 +02:00
KennyTV fe3f247eb1 21w18a 2021-05-05 18:28:39 +02:00
Juan Cruz Linsalata 096415cf8e Don't inject if inactive (#2461) 2021-05-02 15:52:07 +02:00
KennyTV af0cf1d3f2 Rename PacketType methods
Just in case a packet with some magic id is going to be added, since the enum ordinal and name methods cannot be overridden
2021-05-02 11:14:38 +02:00
KennyTV d183d76c47 Remove platform bulk chunk transformers 2021-05-02 10:12:37 +02:00
KennyTV 44e928d53c Update copyright scopes 2021-04-30 19:05:07 +02:00
KennyTV 89127cad8a If possible, user Paper internal injection method 2021-04-29 23:32:13 +02:00
KennyTV ab93e0877c Rename platform task implementations 2021-04-29 17:46:29 +02:00
KennyTV 96b5051c75 Use primitive long in task methods 2021-04-29 17:31:16 +02:00
KennyTV 9e59ef4c4a Hold the rest of the primitive Type instances under their actual class
This brings no improvement now, but if primitive read/write methods for manual calls were implemented later, a signature break will have been prevented by this (aka breaking it now)
2021-04-28 21:12:19 +02:00
KennyTV 00746833ac ProtocolInfo is not a StoredObject
You can't actually call UserConnection#get with ProtocolInfo.class since the ProtocolInfo interface is not a StoredObject
2021-04-28 18:57:08 +02:00
KennyTV 8e15b6d42b 21w17a 2021-04-28 17:40:57 +02:00
KennyTV cad358322d Rename outgoing->clientbound, incoming->serverbound
Via can both be used on servers and clients, making a direction like "incoming" ambiguous
2021-04-28 16:30:34 +02:00
KennyTV a2b3906c9e Move bossbar to new legacy package, since it only works on <1.9
The newly created LegacyViaAPI is safe to use, but should hold methods that cannot be universally used on every version
2021-04-28 11:10:16 +02:00
KennyTV cadb5ec64c Rename abstract Protocol to AbstractProtocol
This prevents confusion around the previously equally named interface and abstract class
2021-04-27 18:21:51 +02:00
KennyTV 95e20677fd Clean up ProtocolPipeline
The filter functionality isn't something that's likely to be used again, so move out its usage and only check on <1.9 servers
2021-04-27 15:59:06 +02:00
KennyTV f1c8d271b1 Reformat imports
The package rename wasn't done through refactoring but through simple replaces to not make git choke on diffs
2021-04-27 13:42:36 +02:00
KennyTV 318c49cf30 More interfaces, keep ProtocolRegistry.SERVER_PROTOCOL legacy api 2021-04-27 13:25:18 +02:00
KennyTV d4bc31d11e Always create ProtocolInfo, store mappings as int[] 2021-04-27 10:29:30 +02:00
KennyTV 30d122e7fa Create some fancy interfaces 2021-04-26 23:01:55 +02:00
KennyTV 49d386063d Add ProtocolVersion to legacy api 2021-04-26 21:45:27 +02:00
KennyTV deec4b521e Move some packages and classes around 2021-04-26 21:27:59 +02:00
KennyTV dbf6a110f2 Keep wrapping Via, ViaAPI, and Bossbar API in api-legacy module 2021-04-26 20:55:24 +02:00
KennyTV a25a5634de Change package/imports in classes and build configs 2021-04-26 20:52:34 +02:00
KennyTV a3b1ce817e Repackage to com.viaversion
This process will be split into multiple commits for git not to choke on.
2021-04-26 20:46:30 +02:00
KennyTV c02047aaf8 Change group id to com.viaversion 2021-04-24 20:54:46 +02:00
Juan Cruz Linsalata f18e2b3875 Cancel Bungee packet encoding when closed (#2448) 2021-04-24 18:30:08 +02:00
KennyTV ad0842c107 Bump version to 4.0.0, remove ProtocolRegistry
The bump was overdue given the breakages that have happened
2021-04-23 22:48:08 +02:00
KennyTV 2b19a98809 21w16a 2021-04-21 19:40:51 +02:00
KennyTV d40ce9fc4a Minor optimizations in pipeline filling 2021-04-21 11:58:19 +02:00
KennyTV 144c24c276 Move packet tracking methods out of UserConnectionn 2021-04-20 13:24:10 +02:00
Mariell Hoversholm 2c884dc241 Feat (Bungee): Use only unsafe field modifications (#2440) 2021-04-17 09:59:24 +02:00
KennyTV d0882cf02c Update GsonUtil, more javadoc 2021-04-16 23:05:31 +02:00
RK_01 cfec0cc25f Improve 1.9->1.8 block place translation (and fix some bugs) (#2437) 2021-04-16 08:45:33 +02:00
KennyTVandjmp d3a3e366b1 Fix publishing
Co-authored-by: jmp <jasonpenilla2@me.com>
2021-04-15 11:07:40 +02:00
MrMicky f1eef0294f Fix Java 16 compatibility on Bukkit/Sponge 1.8 (#2438) 2021-04-15 08:43:05 +02:00
KennyTV 4df70de312 Add note on required jdk version for compilation 2021-04-14 20:43:30 +02:00
KennyTV 898521de9a 21w15a 2021-04-14 17:38:06 +02:00
Jason 87d54f1103 Clean up build scripts using new Gradle features (#2436)
* Make use of `TYPESAFE_PROJECT_ACCESSORS` and `VERSION_CATALOGS` Gradle feature previews to clean up build scripts

* Bump setup-java action to v2, specify AdoptOpenJDK distribution
2021-04-14 14:16:48 +02:00
KennyTV c7e5b4a297 Update to Gradle 7.0 2021-04-13 12:37:29 +02:00
Mariell Hoversholm 458279d111 Fix (Bungee): Java 16 compatibility (#2433)
This has been tested on the following:
 - AdoptOpenJDK Java 1.8.0_282
 - GraalVM CE 21.0.0 OpenJDK 11.0.10
 - AdoptOpenJDK Java 15.0.2
 - AdoptOpenJDK Java 16 (also tested with BungeeCord b1556)
 - Amazon Corretto OpenJDK 16.0.0.36.1

... with Waterfall b406 on Linux 5.10.28.
2021-04-13 11:42:32 +02:00
KennyTV 7300a69817 Use Paper method to get server protocol version if possible 2021-04-12 20:11:13 +02:00
LabyStudio 76e739e4f0 fix ghost shield issue and delayed interaction when switching to another item (#2432) 2021-04-12 16:56:53 +02:00
KennyTV 0ee80dc41f Don't throw an exception on hover parse failure 2021-04-11 13:35:53 +02:00
KennyTV 4473f863c6 Update ComponentRewriter 2021-04-10 17:03:43 +02:00
creeper123123321 9f380a7598 Handle minecart block data (#2424) 2021-04-09 17:09:30 +02:00
KennyTV 3c7d481a39 Fix namespaced 1.12->1.13 sound conversion 2021-04-09 14:56:44 +02:00
KennyTV b23c01c44b Javadoc additions 2021-04-08 21:44:45 +02:00
KennyTV 00b8289c61 Handle new entity pose from 21w13a 2021-04-07 17:27:51 +02:00
KennyTV e9fa5b49ca 21w14a 2021-04-07 16:55:22 +02:00
KennyTV ef8cb05703 Update build badge in readme 2021-04-06 19:02:05 +02:00
LabyStudio e83686d6fc Implement showShieldWhenSwordInHand option (#2417) 2021-04-05 18:53:57 +02:00
KennyTV 26bbc92f94 Warn about potentially unstable plugins/server software 2021-04-03 17:01:57 +02:00
MrMicky 9ccd8bff33 Fix error with shit-click on offhand slot on 1.8 servers (#2419) 2021-04-03 09:09:00 +02:00
KennyTV 29d6b55592 Fix ChunkSection nullability annotations 2021-04-02 18:29:51 +02:00
KennyTV 1251d43709 Fix invalid enchantment parsing
Fixes #2418
2021-04-02 18:22:18 +02:00
KennyTV 070c7f5808 Move to checker qual nullability annotations 2021-04-02 14:15:30 +02:00
KennyTV d79bd00f58 Minor log changes 2021-04-02 10:21:31 +02:00
creeper123123321 df7a644479 Add ShortByteArrayType, minor PacketWrapper changes (#2413) 2021-04-01 20:17:17 +02:00
R0bbyYT 956492bca6 Add option to fix delayed shield blocking (#2415) 2021-04-01 20:03:13 +02:00
creeper123123321 1d311284fd GitHub workflow (#2163) 2021-03-31 21:53:10 +02:00
KennyTV b251170c22 Add goat entity type 2021-03-31 20:40:02 +02:00
KennyTV ab376dc562 21w13a 2021-03-31 19:18:16 +02:00
KennyTV fd9442b077 Minor jd changes in ViaAPI, fix typo 2021-03-30 22:10:57 +02:00
KennyTV a63f2ab6fe Improve server version API 2021-03-26 12:51:38 +01:00
KennyTV d918fd27b6 Reduce boxing in protocol path getting
More of its implementation should probably be cleaned up later
2021-03-25 22:34:30 +01:00
KennyTV 63356207a3 ProtocolRegistry -> ProtocolManager interface 2021-03-24 15:30:03 +01:00
KennyTV 210cae70fd Add MIT copyright headers to the api module 2021-03-24 14:02:38 +01:00
KennyTV 0ab2c626aa Split parts of common into api; We are now GPL, api is MIT
This does not affect any previous states of this project; only future modifications as well as the project as a whole will be under the GNU General Public License from now on. The newly introduced api directory, partly split from common, is an exception to this, still being licensed under the MIT license.

See the README for details.
2021-03-24 14:02:37 +01:00
KennyTV b8072aad86 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	.github/ISSUE_TEMPLATE/config.yml
2021-03-22 15:39:34 +01:00
KennyTV 00b4c9b1f8 Add feature request template 2021-03-22 15:30:33 +01:00
KennyTV 2f45de2f6a Small changes to the issue form 2021-03-22 14:42:05 +01:00
KennyTV f60c0165e3 Issue forms, anyone? 2021-03-22 14:36:47 +01:00
KennyTV bfcfb4340e Add missing doc 2021-03-22 13:47:40 +01:00
KennyTV 9b4d50b214 Tidy up concurrent mapping loading 2021-03-21 20:25:52 +01:00
KennyTV bdeb5acae9 Fix license bundling 2021-03-21 20:07:32 +01:00
KennyTV 81b9f1b4cd 21w11a 2021-03-17 17:01:58 +01:00
KennyTV 0552863f28 Update adventure 2021-03-15 20:59:46 +01:00
KennyTV 0986e174a2 Fix drag desync 2021-03-15 14:50:58 +01:00
KennyTV b589561932 More primitive tag calls 2021-03-15 10:43:09 +01:00
KennyTV 388eb73782 Update nbt usage 2021-03-15 10:43:09 +01:00
KennyTV 2f7de53e9b Merge remote-tracking branch 'origin/master' into dev 2021-03-13 15:34:10 +01:00
KennyTV f7afe84982 21w10a (kind of) 2021-03-10 23:18:13 +01:00
LemonCaramel ea014656bc Add "forced-use-1_17-resource-pack" option (#2390) 2021-03-08 12:30:23 +01:00
LemonCaramel 72de597544 Fix Explosion Mapping (#2389) 2021-03-08 08:28:03 +01:00
KennyTV d7c8f3a594 Update Sponge repository url 2021-03-07 12:26:17 +01:00
LemonCaramel 6cc761e3b2 Title Packet fix (#2387) 2021-03-07 10:03:05 +01:00
Joseph Burton 2723302f56 Update bug_report.md 2021-03-06 18:34:34 +01:00
KennyTV 6497cca8bd Update adventure 2021-03-04 17:02:43 +01:00
KennyTV ec188db247 Shade relocated adventure without breaking native platform usage 2021-03-04 16:11:09 +01:00
KennyTV b84bc7668a Fixes 2021-03-04 16:11:09 +01:00
KennyTV cf8d11d530 Let's go on an <insert title card> 2021-03-04 16:11:09 +01:00
RK_01 7f8052c3cd Fix handling of unknown container ids (#2384) 2021-03-04 15:05:27 +01:00
KennyTV 08763a92ab Add 1.17 to table 2021-03-02 14:14:28 +01:00
LemonCaramel 6e9e757294 Fix ExceptionInInitializerError (#2372) 2021-02-28 00:42:37 +01:00
KennyTV 5e227cb4a5 Fix Bungee Chat relocation
Fixes #2371
2021-02-27 10:21:39 +01:00
RK_01 3c73d70f63 Fix handling of animation 3 in 1.8->1.9 (#2358) 2021-02-26 14:45:55 +01:00
KennyTV 9fbadc0ad5 Keep white background of version chart 2021-02-26 10:51:49 +01:00
KennyTV 6b7818e6f1 21w08b 2021-02-25 15:59:48 +01:00
KennyTV 16208b2a7f Update README 2021-02-25 10:21:11 +01:00
KennyTV a0351b8168 Update version 2021-02-25 09:20:31 +01:00
KennyTV 35ac41e1fa Fix subproject version/name 2021-02-25 09:19:18 +01:00
Jason 46a01cb0f0 Fix publishing (#2364) 2021-02-25 09:19:18 +01:00
Myles e437c656c5 Revert "Try /everything"
This reverts commit 902081b22b3b6c7a4ac56c7ec68fa76f917267bb.
2021-02-25 09:19:18 +01:00
KennyTV f5b8937a70 Try /everything 2021-02-25 09:19:17 +01:00
Myles 8e069812e0 Set maven authentication to basic 2021-02-25 09:19:17 +01:00
jmp b6bee8f4cc Configure artifacts for publication 2021-02-25 09:19:17 +01:00
KennyTV aaaa97f781 Fix local publishing 2021-02-25 09:19:17 +01:00
KennyTV 5b0d98f639 Remove test publishing 2021-02-25 09:19:16 +01:00
KennyTV 68985141f1 Try local publishing 2021-02-25 09:19:16 +01:00
KennyTV a48f717396 Add publish url 2021-02-25 09:19:16 +01:00
KennyTV a7a00e9f67 Update version 2021-02-25 09:19:16 +01:00
KennyTV c719b98ab3 Don't spam compiler warnings 2021-02-25 09:19:15 +01:00
KennyTV c059e57771 Move javassist to Bukkit moduke 2021-02-25 09:19:15 +01:00
KennyTV 5fde8c25a3 Change universal jar name 2021-02-25 09:19:15 +01:00
jmp 02f1ab1752 Uppercase jar names 2021-02-25 09:19:14 +01:00
jmp 024c36c584 Switch to indra, attempt to fix shading and universal jar 2021-02-25 09:19:14 +01:00
KennyTV ef6c347194 *cries in elephant* 2021-02-25 09:19:14 +01:00
KennyTV c0dabfe097 *cries in elephant* 2021-02-25 09:18:51 +01:00
KennyTV 0a41d36220 21w08a (aka the great splittening) 2021-02-24 23:38:28 +01:00
KennyTV 37004d8c4f 21w07a 2021-02-17 18:55:43 +01:00
KennyTV 01277d147e Deduplicate more entitytype code 2021-02-16 12:24:35 +01:00
KennyTV 1da0b38849 Merge remote-tracking branch 'origin/master' into dev 2021-02-16 12:21:32 +01:00
KennyTV 84f8e019c8 Fix 1.9to1.9.1 protocol registration 2021-02-15 20:02:31 +01:00
KennyTV 64b7e74d80 Cleanup modern entity types 2021-02-14 17:24:20 +01:00
creeper123123321 a141f871a9 ProtocolVersion.toString() space (#2343) 2021-02-13 13:21:02 +01:00
KennyTV 69609d536b Use chunk section length for fallback biome array 2021-02-11 21:45:36 +01:00
KennyTV b21de03710 Read byte in player position 2021-02-11 19:54:00 +01:00
KennyTV e7b489f66e This is actually 21w06a 2021-02-11 09:30:30 +01:00
KennyTV 7493c8d7b7 Add setSections to Chunk 2021-02-11 00:00:02 +01:00
KennyTV 4ff98256f6 21w06a 2021-02-10 19:09:33 +01:00
Myles d1a0d629df Merge branch 'master' into dev 2021-02-09 16:32:44 +00:00
Myles 50bfc86706 Revert "The bytebuf doesn't need to be rewritten"
This reverts commit ac877d0b1a.
2021-02-09 16:32:31 +00:00
Myles 76c83da382 Merge branch 'master' into dev 2021-02-09 10:54:34 +00:00
Myles f04a748e54 Ignore NBT with hanging comma, fixes #2319 2021-02-09 10:54:04 +00:00
Myles d39193400f Ignore NBT with hanging comma, fixes #2319 2021-02-09 10:50:11 +00:00
Myles 628979f923 Merge branch 'master' into dev 2021-02-09 10:36:54 +00:00
Myles 24b4cd8dbd Merge branch 'reduce-decode-rewriting' 2021-02-09 10:36:13 +00:00
Myles 727c575a1c Run QuickMove on next tick to improve likeliness of success (fixes #2044)
Since it is 5 ticks later, the inventory may be closed
2021-02-09 10:35:13 +00:00
Myles ac877d0b1a The bytebuf doesn't need to be rewritten 2021-02-06 15:29:36 +00:00
Myles 37d57af6ec Change ResourceLeakDetector to PARANOID for displayleaks 2021-02-06 15:26:21 +00:00
KennyTV e09c3b0159 Merge remote-tracking branch 'origin/master' into dev 2021-02-06 15:38:06 +01:00
Myles 22793dbac4 Re-add a semicolon
🥇
2021-02-06 14:30:18 +00:00
Myles 1998eca6c8 Merge pull request #2322 from creeper123123321/passbytebuf
Allow bytebuf passthrough on encode
2021-02-06 14:25:42 +00:00
creeper123123321 100ae1c680 Update SpongeEncodeHandler.java 2021-02-06 11:18:51 -03:00
creeper123123321 6941b48038 fixed pending #2291 changes 2021-02-06 10:21:34 -03:00
KennyTV 59c9018250 Call command argument handler with unmapped name 2021-02-05 13:04:57 +01:00
RK_01 bdfaf9a621 Remap declare command parser types in 1.14 -> 1.13.2 (#2316) 2021-02-05 12:18:28 +01:00
KennyTV 54488341bf Add abstract declare commands handler 2021-02-05 11:41:21 +01:00
KennyTV 59e05e3096 21w05b 2021-02-04 19:11:24 +01:00
KennyTV 554fbb49c5 21w05a 2021-02-03 19:30:28 +01:00
Jo0001 7faf4cf81a Change error message (#2286) 2021-02-01 14:51:03 +01:00
KennyTV ee2959ac5d Handle shulker meta change 2021-01-21 11:37:31 +01:00
KennyTV e679a0c2b0 Fix dust particle writing
The double/float inconsistency was fixed in 21w03a, yay
2021-01-21 09:26:56 +01:00
KennyTV 14bfb8d147 Fix glow squid entity id 2021-01-20 18:51:07 +01:00
KennyTV 3a9dd5c86d Add setBitmask to Chunk 2021-01-20 18:24:43 +01:00
KennyTV c8c54786fc 21w03a 2021-01-20 17:59:34 +01:00
KennyTV 4cc8a3f092 Return -1 in getPlayerVersion if the player is not connected 2021-01-17 13:59:26 +01:00
KennyTV 2beed20f1b Update 1.16.4/5 protocol name 2021-01-17 13:55:19 +01:00
Thibaut Gautier 91319402f3 Fixed encoding not properly working with other packet reading libraries
Injecting a message to byte encoder beforehand would break outbound packets in ViaVersion. This solution is a good fix which won't impact anything.
2021-01-17 13:12:18 +01:00
RK_01 ee147a4b37 Replace some hardcoded chunk section values (#2274) 2021-01-05 09:42:32 +01:00
KennyTV 127cae80bd Fix 1.17 entity tracking
Fixes #2250
2020-12-17 12:38:51 +01:00
KennyTV 55a2a0a779 Fix disconnect on respawn packet send
Closes #2251
2020-12-17 11:52:15 +01:00
KennyTV ed4d0bc134 Add methods to handle new tags format 2020-12-17 11:51:51 +01:00
KennyTV 6298eb42c5 Make TagRewriter.TagData public 2020-12-16 19:54:02 +01:00
KennyTV 823ac0e173 Add RegistryType#getByKey 2020-12-16 19:50:49 +01:00
KennyTV 6622b7dcff 20w51a 2020-12-16 18:57:16 +01:00
KennyTV 4858d75439 Change the outdated server message 2020-12-15 11:38:41 +01:00
KennyTV 4355f8987f Merge branch 'master' into dev
# Conflicts:
#	bukkit-legacy/pom.xml
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	fabric/pom.xml
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2020-12-15 11:16:57 +01:00
Myles c0fb81946e Snapshot 2020-12-12 13:16:13 +00:00
Myles 6c440513ba 3.2.1 2020-12-12 13:07:59 +00:00
Myles 2da0e1cad7 Merge pull request #2198 from terrarier2111/patch-3
Created a local variable for ProxiedPlayers
2020-12-11 09:17:16 +00:00
Myles 3d777bdcda Merge pull request #2237 from mathiascode/statscheck
Add missing length check in 1.13 -> 1.12.2 stats code
2020-12-11 09:15:30 +00:00
Mat e22975cec4 Add missing length check in 1.13 -> 1.12.2 stats code 2020-12-11 03:08:34 +02:00
KennyTV f35c48bed2 Merge branch 'master' into dev 2020-12-09 21:39:13 +01:00
KennyTV 965814d833 Fix ProtocolLib check (again)
#BlameGerry (again)
2020-12-09 21:31:00 +01:00
KennyTV 459e3e68b8 Dust particle rgb values are now written as doubles 2020-12-09 12:41:26 +01:00
KennyTV 72205a5414 Whoops 2020-12-09 11:47:59 +01:00
KennyTV e7ad3970cc Complete vibration particle reading 2020-12-09 11:47:40 +01:00
KennyTV 4714a3f03a Merge branch 'master' into dev 2020-12-09 11:31:51 +01:00
KennyTV f08db2d234 Fix startup
#BlameGerry
2020-12-09 11:31:37 +01:00
KennyTV 5954c16f62 New particle meta type 2020-12-09 11:29:07 +01:00
KennyTV a4d1ac3b95 Add getSpawnParticleHandler method to ItemRewriter 2020-12-09 11:03:40 +01:00
KennyTV 52b95eab28 Merge remote-tracking branch 'origin/master' into dev 2020-12-09 09:17:37 +01:00
Gerrygames 24c56a239e Fix PacketWrapper#sendToServer bypassing ProtocolLib (#2229) 2020-12-08 19:15:55 +01:00
KennyTV 7858b998ca Reduce chance of quick move task while disabling
Closes #2226
2020-12-08 12:42:13 +01:00
creeper123123321 d75420a35b Use ArrayDeque, less ram for PacketWrapper.readableObjects (#2218) 2020-12-07 11:50:52 +01:00
KennyTV 137680ed9f Use generic y section count in 1.17 chunk reading 2020-12-03 11:53:05 +01:00
KennyTV e56ff898eb Use integer for y coordinate in Position 2020-12-03 11:14:46 +01:00
KennyTV 3aa35395f4 Fix tag processing in older versions, small refactor 2020-12-03 11:14:35 +01:00
KennyTV ff91dd7082 Finish 20w49a 2020-12-02 22:31:02 +01:00
KennyTV 8a11b577eb Current WIP 20w49a 2020-12-02 21:57:32 +01:00
_tomcraft 6882678bc4 Reduce useless List operations (#2214) 2020-11-29 21:31:18 +01:00
KennyTV 4555c5dbf3 Use FU map in FakeTileEntity 2020-11-29 16:40:40 +01:00
KennyTV 4cc0d2c1a2 Merge remote-tracking branch 'origin/master' into dev 2020-11-29 16:39:06 +01:00
KennyTV c671a6deed 20w48a (probably) 2020-11-25 17:15:43 +01:00
KennyTV 8de26a0ad3 Work around relocation of fastutil reflection call 2020-11-23 20:49:28 +01:00
KennyTV e128f6a7ed Merge branch 'master' into dev 2020-11-23 15:22:44 +01:00
KennyTV 9c0b187f31 Catch errors in Bungee chat parsing 2020-11-22 09:55:39 +01:00
terrarier2111 6a12f8139c Added missing import 2020-11-21 19:26:10 +01:00
KennyTV e85f9e7510 Fix npe
Fixes #2196
2020-11-20 13:23:23 +01:00
terrarier2111 0b256d15b2 Created a local variable for ProxiedPlayers 2020-11-15 21:15:42 +01:00
KennyTV 7abff77c51 Add method to get handler in sound rewriter 2020-11-15 12:01:01 +01:00
KennyTV 78972a5345 Add 1.9-1.11 sound mappings 2020-11-15 11:36:26 +01:00
KennyTV 7a6e45008b Fix entity item meta 2020-11-14 22:21:36 +01:00
_tomcraft a041610fe2 Prevent 1.12- clients to creative-pick server-side unknown block/item (#2180) 2020-11-13 14:27:29 +01:00
KennyTV ba776e5f88 Handle metadata and map data changes
Mapdata might be bork tho™️
2020-11-12 21:34:12 +01:00
KennyTV 67fda72bdd 20w46a 2020-11-11 19:13:31 +01:00
KennyTV 721c52e3f5 Fix multi block change reading 2020-11-11 16:54:19 +01:00
KennyTV 424e855d72 Uncache biome data on world change, process multi block change 2020-11-11 16:54:19 +01:00
KennyTV 88a1a42625 Finish update
Still unsure whether we also have to store block entity data and if/which respawn conditions have to be checked for biome uncaching
2020-11-11 16:54:18 +01:00
KennyTV 0d3f729679 20w45a
Missing: Diff mappings
2020-11-11 16:54:18 +01:00
KennyTV 692e53427b Change log message when executor is shut down 2020-11-11 16:53:47 +01:00
KennyTV 3b5aaa1ff5 Fix legacy nbt array weirdness
Closes #2176
2020-11-08 10:35:15 +01:00
KennyTV 95e0cff03c Fix italic item names in 1.12->1.13 protocol
Fixes #2165
2020-11-03 13:40:01 +01:00
KennyTV 91f3d0fdb7 Bump version to 3.2.1-SNAPSHOT 2020-11-03 09:49:46 +01:00
KennyTV b3e8ad9164 3.2.0 Release, 1.16.4 2020-11-02 19:40:04 +01:00
KennyTV c3501a831e Merge remote-tracking branch 'origin/master' into dev 2020-11-02 18:37:01 +01:00
Myles 9821cb1b16 Merge pull request #1723 from creeper123123321/backendinjection
Velocity Backend injection / Velocity 1.1.0
2020-11-02 17:29:31 +00:00
Myles bba1f2acf0 Merge pull request #2162 from lennardk/fix-1.11-sound-rewrite
Fix sound ID shift in 1.11
2020-11-02 16:19:27 +00:00
Lennard Klein 1afbff18ef Fix sound ID shift in 1.11
This possibly got broken in the rewrite in dc62394.
Fixes ender pearl throw and experience bottle throw/pickup sounds.
2020-11-01 14:51:34 +01:00
MrMicky 56ec689841 Update protocol versions (#2156) 2020-10-29 12:53:16 +01:00
Myles 3189501b78 Revert "Remove minecraft libraries"
This reverts commit 1c23103517.
2020-10-29 11:10:36 +00:00
Myles 1c23103517 Remove minecraft libraries
Not needed AFAIK
2020-10-29 11:01:07 +00:00
Five (Xer) 06e1b90f29 Finalize Velocity-1.1.0 2020-10-28 20:10:15 +01:00
creeper123123321 acd79fc661 readd snakeyaml as provided dependency 2020-10-28 19:51:02 +01:00
creeper123123321 18bde6ee37 don't shade snakeyaml, closes #1959 2020-10-28 19:51:02 +01:00
creeper123123321 72f8052e58 code cleanup 2020-10-28 19:51:02 +01:00
creeper123123321 0343be6915 remove unused code 2020-10-28 19:51:02 +01:00
creeper123123321 000a034836 draft -> buf 2020-10-28 19:51:02 +01:00
creeper123123321 2d33447fc1 fixed backend compression, remove debug 2020-10-28 19:51:02 +01:00
creeper123123321 bcb76350a1 fix decoder 2020-10-28 19:51:02 +01:00
creeper123123321 485f4fa070 remove velocityconnectionmanager 2020-10-28 19:51:02 +01:00
creeper123123321 b1e60f5f1b fix compiling 2020-10-28 19:51:02 +01:00
creeper123123321 6c3479e739 rebased on master 2020-10-28 19:51:02 +01:00
creeper123123321 4813cc3077 inject into velocity backend (currently broken)
Add client-side mode for UserConnection

remove unused code

fix duplicate method on rebase
2020-10-28 19:51:01 +01:00
KennyTV 69c8cf8ffb Smaller workaround for lore italics in 1.13->1.14 2020-10-28 15:19:00 +01:00
KennyTV 510ff4e6a1 Improve 1.13->1.14 lore conversion, remove noisy workaround for a non-issue in legacy to json conversion
If people want to have white, unformatted text in their lore, they should do exactly that; add a white color, not reset to default
Fixes #2158
2020-10-28 14:36:22 +01:00
DaPorkchop_ a6043c14cd Fix 1.16.2 multi block change packet order (#2138) 2020-10-28 08:43:22 +01:00
KennyTV 1a4c34afcf 1.16.4-rc1 2020-10-27 18:34:59 +01:00
KennyTV 2f9ec6f2aa Remove redundant/already implicit check in VersionRange 2020-10-24 22:39:17 +02:00
KennyTV bc2f6a423f Fix typo 2020-10-24 11:14:11 +02:00
KennyTV 0986b0982c Fix dontbugme command
Fixes #2152
2020-10-24 11:13:16 +02:00
KennyTV 9a24129e49 1.16.4-pre2 2020-10-22 17:43:38 +02:00
KennyTV c8029bdbdf Use getters instead of inlining 2020-10-21 14:17:51 +02:00
KennyTV 1129c17489 Improve ProtocolVersion subversion/range handling
Closes #2041
2020-10-21 14:02:31 +02:00
KennyTV f313b5b617 Merge branch 'master' into dev 2020-10-18 22:41:23 +02:00
RK_01 765f92bfe5 Correct 1.9.x -> 1.10 sound pitch adjustments (#2139) 2020-10-18 22:37:30 +02:00
KennyTV edd71bf8ab Fix version blocking on 1.8
Fixes #2142
2020-10-16 18:26:15 +02:00
KennyTV 7d96efc645 Minor ProtocolVersion refactor 2020-10-16 18:21:45 +02:00
KennyTV 6cb2837d77 Merge remote-tracking branch 'origin/master' into dev 2020-10-16 16:56:29 +02:00
KennyTV 08a8268852 Handle book edit change 2020-10-15 17:57:12 +02:00
DaPorkchop_ 54b6d1c21c Fix entity attributes length prefix (#2136) 2020-10-14 15:40:39 +02:00
RK_01 71341a9381 Fix 1.11.1 -> 1.12 show_achievement translation (#2120) 2020-10-12 13:32:06 +02:00
KennyTV 5eccc2e3cd Merge branch 'master' into dev 2020-10-12 10:18:50 +02:00
KennyTV 0015682fe4 Add warning on startup for 1.8 users 2020-10-12 09:51:33 +02:00
KennyTV 107892fb24 Hopefully finish preparation, minor optimizations 2020-10-07 12:50:23 +02:00
KennyTV 6371b77b94 Prepare hackery for 1.16.4 2020-10-07 12:32:52 +02:00
KennyTV 03ba058a9b Rewrite areaeffectcloud in 1.13->1.13.1 2020-09-25 14:49:01 +02:00
connorhartley 750c5ed9a7 Fix falling_dust ID in ParticleMappings 2020-09-25 10:00:09 +02:00
Seanoo1 14afb884ad Update README.md 2020-09-21 19:49:59 +02:00
Kim Hallberg ab788554bf Update LICENSE to 2020 2020-09-21 19:49:42 +02:00
KennyTV b8c204b306 Rewrite area effect cloud data
Fixes #2082
2020-09-21 11:12:32 +02:00
KennyTV 52f542774f Automated particle rewriting 2020-09-21 09:53:04 +02:00
KennyTV e502f2c96d Clarify error in BlockChangeRecord1_16_2 2020-09-13 15:26:37 +02:00
terrarier2111 8d904ca010 Update BungeeCord version to 1.16-R0.4-SNAPSHOT (#2083) 2020-09-12 20:04:52 +02:00
terrarier2111 9a6b0664e3 Update BungeePlugin.java (#2080) 2020-09-12 17:43:09 +02:00
KennyTV 5f1472a18d Merge branch 'dev' into master
# Conflicts:
#	bukkit-legacy/pom.xml
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	fabric/pom.xml
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2020-09-10 16:37:35 +02:00
KennyTV 9dff193c09 Minor cleanup in 1.13->1.13.1 protocol 2020-09-09 15:51:30 +02:00
KennyTV 9b2c3320ee 3.1.1 Release, 1.16.3 support 2020-09-09 15:50:13 +02:00
KennyTV df9508ff3c Make mapping loading considerably faster 2020-09-09 10:54:56 +02:00
KennyTV 414f561673 Use FU collections in ChunkSection, pre-size palette 2020-09-08 11:10:16 +02:00
KennyTV 074edf1b48 Fix falling block id rewrite 2020-09-08 11:01:00 +02:00
KennyTV a0a229fa29 Make pipeline fail-safe limit changeable
☠
2020-09-08 09:06:54 +02:00
KennyTV ebdadf0774 Fix version name 2020-09-07 15:44:14 +02:00
KennyTV 5b09536dcf 1.16.3-rc1 2020-09-07 15:11:11 +02:00
KennyTV 1ea548f05d Avoid List creation and collection reversal in transforming 2020-09-06 12:42:37 +02:00
KennyTV b7bf993795 Warn with unmapped id when missing 2020-09-04 11:04:44 +02:00
KennyTV a709382d25 Fix NPE 2020-09-04 11:04:44 +02:00
KennyTV d36def89e1 Abstract mapping loading 2020-09-04 11:04:44 +02:00
KennyTV 074af0e282 Fix typo in config 2020-09-02 15:45:39 +02:00
Nassim b6358cf83c Merge pull request #2052 from UnicraftNetwork/IOB-1.13-at-recipe-request-fix
Fix IOB in 1.13 recipe request
2020-09-02 10:13:06 +02:00
BGMP f53a6928f2 Fix IOB in 1.13 recipe request 2020-08-31 05:59:19 -04:00
KennyTV 78bb5f171f Fix IOB in 1.13 recipe request
Fixes #2039
2020-08-27 09:37:51 +02:00
Nassim 28219a3993 Merge pull request #2038 from RaphiMC/master
Fixed 1.9 -> 1.8 enderman held item metadata translation
2020-08-25 17:28:13 +02:00
RK_01andNassim cae5122d04 Applied suggestions for PR
Co-authored-by: Nassim <jahnke.nassim@gmail.com>
2020-08-25 15:53:58 +02:00
RaphiMC 0070485d2e fixed 1.9 -> 1.8 enderman held item metadata translation 2020-08-25 15:43:21 +02:00
Nassim 4b6b904361 Merge pull request #2031 from RednedEpic/fix/inventory-workaround
Rework inventory workaround to cancel animation if in an open inventory for 1.16
2020-08-24 14:54:47 +02:00
RednedEpic 7e03da66d4 Rework inventory workaround to cancel animation if in an open inventory
On 1.16, when sending a new inventory while another one is open (without explicitly calling `closeInventory` first), a hand swing is sent from the client, which the server handles like any normal arm swing. This in turn results in the `PlayerInteractEvent` and `PlayerAnimationEvent` both being called on Bukkit's end, which are used to detect for left clicks. If an item in the player's hand opens a menu when left clicked and the above is true, this results in that menu being reopened.
2020-08-22 13:25:00 -05:00
Nassim b209eb3c8b Merge pull request #2030 from Jo0001/patch-2
Use https for GitHub issue link
2020-08-22 11:51:52 +02:00
Jo0001 be31c705b5 Use https for GitHub issue link 2020-08-22 11:44:51 +02:00
Nassim 13ee674d96 Merge pull request #2028 from astei/optimize/improve-inlining-transform
Fix bad ProtocolPipeline changes
2020-08-21 22:25:41 +02:00
Andrew Steinborn d31310ace8 Fix bad ProtocolPipeline changes 2020-08-21 16:21:01 -04:00
Nassim 1afed864b1 Merge pull request #2011 from astei/optimize/improve-inlining-transform
Make several tweaks to Protocol to improve inlining and performance on hot paths
2020-08-21 21:43:07 +02:00
Nassim 95d56c970c Merge pull request #2026 from frengor/master
Fix Wrong AutoTeam Color
2020-08-21 21:35:13 +02:00
frengor 2dcd832a29 Fix Wrong AutoTeam Color 2020-08-21 01:58:34 +02:00
KennyTV f54bb7923b Revert "Fix 1.13 component rewriter npe"
This reverts commit 1b862d08
2020-08-18 10:07:52 +02:00
KennyTV 1b862d084b Fix 1.13 component rewriter npe 2020-08-18 10:06:52 +02:00
Andrew Steinborn fc7a7396ef Make several tweaks to Protocol to improve inlining and performance on hot paths 2020-08-17 19:37:55 -04:00
KennyTV be6e086aac Add note to 1.9 update sign packet creation 2020-08-17 21:37:17 +02:00
Nassim 5e70b54f08 Merge pull request #2007 from connorhartley/1.16-inventory-open-fix
Close the open inventory before opening a new one on 1.16
2020-08-17 08:57:16 +02:00
connorhartley f3d8b47add Use ClientboundPackets1_16#CLOSE_WINDOW instead of byte for packet ID 2020-08-17 11:09:12 +12:00
connorhartley d3cadaf90f Close the open inventory before opening a new one on 1.16 2020-08-17 10:08:56 +12:00
Nassim 83a49a686a Merge pull request #2003 from connorhartley/chatitemrewriter-fix
Ensure normal keys that end with numbers don't get matched and replaced when replacing indexes
2020-08-16 21:11:12 +02:00
connorhartley a4920a2c74 Ensure normal keys that end with numbers dont get matched and replaced 2020-08-17 00:20:39 +12:00
KennyTV 37170a2180 Fix parsing of custom recipes
Fixes #1995
2020-08-16 10:18:08 +02:00
Nassim c6c5b9430e Merge pull request #2002 from astei/optimize/113-1122-chatrewriter
Remove useless URL detection and event addition from 1.13->1.12.2 ChatRewriter
2020-08-16 10:00:49 +02:00
Andrew Steinborn 338b8792a9 Remove useless URL detection and event addition from 1.13->1.12.2 ChatRewriter 2020-08-16 01:47:14 -04:00
KennyTV 7163d38ddf Rewrite statistics category ids
Thanks to RaphiMC for providing the statistic mappings
2020-08-13 13:31:14 +02:00
KennyTV b0fc931ecd Fix empty compound reading 2020-08-13 08:31:06 +02:00
KennyTV 0ec1116a9e Rewrite block/item/entity ids in statistics
Still todo: Rewrite change in category ids in various versions
2020-08-12 22:15:48 +02:00
KennyTV e45c82ee87 Merge remote-tracking branch 'origin/dev' into master 2020-08-12 22:15:16 +02:00
Myles cb4c4b2141 Merge pull request #1988 from RaphiMC/dev
Add 1.12->1.11.1 achievement messages and fix 1.13->1.12.2 statistics remapping
2020-08-12 21:11:25 +01:00
RaphiMC acfdbc5494 slight code changes for PR 2020-08-12 17:16:50 +02:00
RK_01 70d08dfc6f fixed 1.13 -> 1.12.2 statistics remapping 2020-08-12 16:39:01 +02:00
RK_01 dfc4652da7 added 1.12 -> 1.11.1 achievement message translation 2020-08-12 16:38:21 +02:00
Myles a2ac867269 Merge pull request #1986 from Jo0001/patch-1
Link to ViaSetup
2020-08-12 14:42:37 +01:00
Jo0001 9c61135a73 Link to ViaSetup 2020-08-12 15:33:20 +02:00
KennyTV f7951e7ef9 Fix falling block 1.16.1->1.16.2 remapping
Fixes #1985
2020-08-12 14:04:12 +02:00
Nassim d37509224d Merge pull request #1980 from creeper123123321/backtosnapshot
back to snapshot
2020-08-11 22:05:31 +02:00
creeper123123321 7d0b7288dc version badge 2020-08-11 14:06:38 -03:00
creeper123123321 53d22dcff7 back to snapshot 2020-08-11 13:48:26 -03:00
KennyTV 6060954f87 3.1.0 Release - 1.16.2 support 2020-08-11 12:44:41 +02:00
KennyTV ff8a27d92a Fix multi block change not being sent
Tfw when the ugly logic works but you just didn't send the packet
2020-08-11 12:38:45 +02:00
Nassim 617abe2d8c Merge pull request #1977 from RaphiMC/dev
fixed 1.11 -> 1.10.2 potion data remapping
2020-08-10 22:34:50 +02:00
Koppe 93c84b1912 minor code improvements 2020-08-10 22:28:40 +02:00
Koppe 0b17b81b63 fixed 1.11 -> 1.10.2 potion data remapping 2020-08-10 22:17:31 +02:00
KennyTV 6a7a92a97b Remove ClientChunk from 1.14+ chunk types
Apparently multiple people (including me) blindly copied that from older versions.
Also removed join/respawn from the abstract MetadataRewriter, since they were only used twice each.
2020-08-10 21:22:01 +02:00
KennyTV 31f7bde35f Some MetadataRewriter cleanup 2020-08-10 18:32:23 +02:00
KennyTV da77c32a0d 1.16.2-rc2 2020-08-10 14:53:32 +02:00
KennyTV 421453d25e Fix 1.8->1.9 ender dragon sound
Fixes #1943
2020-08-10 09:22:08 +02:00
KennyTV fa4d44b929 Update rc1 mappings 2020-08-07 17:48:58 +02:00
KennyTV 7c8b56b3cb 1.16.2-rc1 2020-08-07 17:35:48 +02:00
KennyTV f6fec5b93b 1.16.2-pre3 (almost)
The Nether does not have its custom fog, no idea why yet
2020-08-06 20:21:54 +02:00
KennyTV ea0f91136e Accept plain strings for components
Addresses #1968
2020-08-06 10:15:38 +02:00
KennyTV cf7d49aec5 1.16.2-pre2 2020-08-05 18:19:00 +02:00
KennyTV 03733d274a Merge remote-tracking branch 'origin/master' into dev 2020-08-05 17:44:38 +02:00
Myles 2dd688fa0e Merge pull request #1963 from KennyTV/master
Update Issue Template
2020-08-05 08:38:50 +01:00
KennyTV 8165e55514 Update Issue Template 2020-08-05 09:23:30 +02:00
Nassim e5464c8e4b Merge pull request #1960 from creeper123123321/patch-6
Update javassist and gson
2020-08-05 09:23:06 +02:00
creeper123123321 f70b9a8322 Update javassist and gson 2020-08-04 08:22:03 -03:00
Myles c31f728a37 Merge pull request #1955 from Jo0001/patch-1
Disable blank issues ;)
2020-08-03 19:10:52 +01:00
Jo0001 0a519379a1 Disable blank issues ;) 2020-08-03 17:03:12 +02:00
KennyTV 2b50f6c713 Merge branch 'master' into dev
# Conflicts:
#	pom.xml
2020-08-03 08:40:53 +02:00
KennyTV be2ba2b1b9 Fix Chat meta type
Fixes #1949
2020-08-03 08:39:58 +02:00
Myles 5051e7ea48 Merge pull request #1947 from creeper123123321/patch-5
Explain chatrewriter changes
2020-08-02 20:17:42 +01:00
creeper123123321 a42aa4b202 use velocity snapshots repo 2020-08-02 13:55:48 -03:00
creeper123123321 3d22258321 update velocity repo 2020-08-02 12:47:45 -03:00
creeper123123321 8fe1648d6b Explain chatrewriter changes 2020-08-02 12:37:36 -03:00
KennyTV 49211240a3 1.16.2-Pre1 2020-07-29 17:22:04 +02:00
KennyTV 89c503dd92 Print erroneous json if parsing fails 2020-07-28 09:59:35 +02:00
KennyTV c326bb7b51 Merge remote-tracking branch 'origin/master' into dev 2020-07-26 10:36:22 +02:00
Gerrygames 50024b0602 fix global palette value 2020-07-25 17:56:42 +02:00
KennyTV 5503a338fa Check for register/unregister channels with long names 2020-07-23 19:31:37 +02:00
Nassim 076c5e5265 Merge pull request #1927 from creeper123123321/patch-4
Remove "API" from name in fabric.mod.json
2020-07-23 16:12:42 +02:00
creeper123123321 01d534391d Remove "API" from name in fabric.mod.json 2020-07-23 10:56:54 -03:00
KennyTV 48f8412440 20w30a 2020-07-22 21:47:18 +02:00
KennyTV 2c9ce50312 Bump version to 3.1.0- 2020-07-22 09:17:28 +02:00
KennyTV 601a6eb808 Set mapping load thread name, config comment change
Closes #1922
2020-07-21 09:10:16 +02:00
KennyTV 647230a996 Move long plugin channel name check to a config option 2020-07-19 17:30:03 +02:00
KennyTV 5047aaff0c Fix 1.12->1.13 recipe type switcheroo
Fixes #1918
2020-07-19 13:37:41 +02:00
KennyTV a981adf7a3 Fix VB check on Velocity/Sponge 2020-07-16 19:43:54 +02:00
KennyTV a16a085f75 Print exceptions during mapping loading 2020-07-16 19:27:56 +02:00
KennyTV 37f5948b0a 20w29a 2020-07-15 17:44:24 +02:00
KennyTV 7fa80e1759 Use buffered stream for compressed nbt reading
(See tux' open pr at adventure)
2020-07-15 12:10:24 +02:00
KennyTV e1464044a7 Use Map in RecipeRewriter, use correct names for 1.13/1.14 rewriters 2020-07-15 11:42:59 +02:00
KennyTV 42167394e0 Make 1.16 default registry public 2020-07-11 22:26:54 +02:00
KennyTV 3ef1912267 Map biomes, fix registry sending 2020-07-09 14:31:19 +02:00
KennyTV 3c20b79573 Implement multi block change packet changes 2020-07-08 21:51:56 +02:00
KennyTV 7171802b78 20w28a 2020-07-08 21:01:18 +02:00
KennyTV 58e7455cd9 Fix NPE on proxies in ViaIdleThread
Fixes #1878
2020-07-04 13:22:51 +02:00
KennyTV a613edcb42 Fix legacy nbt io
Fixes #1874
2020-07-02 16:35:33 +02:00
KennyTV 5ce1e850c8 Rewrite item nbt attributes 2020-07-02 15:57:52 +02:00
KennyTV 4f392ba361 Suffix snapshot version again
(Now accepted by ViaFabric)
2020-07-02 15:57:52 +02:00
KennyTV 61fb1c249c Wrap exceptions in remappers to InformativeEx 2020-07-02 15:57:52 +02:00
KennyTV dae83d0e36 Wrap exceptions in remappers to InformativeEx 2020-07-02 11:08:59 +02:00
KennyTV 67c5e78e7b Cleanup declare recipe, trade list, and advancement packets 2020-07-02 00:18:33 +02:00
KennyTV 1ec2551fcc Change version back to 3.0.2-SNAPSHOT
Spam is over, I promise
2020-07-01 20:42:07 +02:00
KennyTV d4a299501a Add piglin brute to entity types 2020-07-01 20:21:38 +02:00
KennyTV 3fbeb3e902 Actually fix hardcore flag 2020-07-01 20:07:20 +02:00
KennyTV 7f2023176f Fix hardcore flag 2020-07-01 20:02:44 +02:00
KennyTV 3ddd289b49 20w27a
TODO: Yoink recipe rewriter from ViaBackwards
2020-07-01 19:44:11 +02:00
KennyTV f16ff65933 Move handshake exceptions filter to exceptionCaught handling 2020-07-01 13:22:00 +02:00
KennyTV 96485c444e Filter new blocks/items in tag rewriting
Fixes ViaVersion/ViaBackwards#219
2020-07-01 09:40:18 +02:00
KennyTV b99b79f44a Only print handshake errors when debug is enabled
The exceptions only now showed up with the new print handling, but 100% of the printed cases have just been invalid packets, which we can (and should) just ignore.
Fixes #1854
2020-07-01 09:11:46 +02:00
KennyTV 3ba2191829 Fix late Bungee connection cancelling 2020-06-30 13:51:06 +02:00
KennyTV 26de3fe573 Cancel lengthy plugin channels on Spigot
Fixes #1859
2020-06-30 09:35:37 +02:00
KennyTV d59749fb03 Fix legacy nbt parsing 2020-06-29 18:06:23 +02:00
KennyTV a0195c59cc Handle lore in show_item in 1.13->1.14
Also print out nbt if reading/writing fails
2020-06-28 22:19:59 +02:00
KennyTV 26b90b6d71 Fix accidental casting
Might have forgotten to actually commit this, whoopsie
2020-06-28 20:44:45 +02:00
Myles ed0db721dd Merge pull request #1853 from KennyTV/master
Fix 1.12->1.13 show_item handling
2020-06-28 11:52:59 +01:00
KennyTV b203db3ce5 Minor formatting change 2020-06-28 12:35:42 +02:00
KennyTV e386f7cf45 Fix 1.12->1.13 show_item handling
Fixes #1603
2020-06-28 12:28:35 +02:00
KennyTV c1c542cc5a Fix advancement reading 2020-06-28 11:59:19 +02:00
KennyTV 642d427783 Convert component score values
Fixes #1817
2020-06-27 23:41:46 +02:00
KennyTV b2514a9e50 Map a few removed translation keys
Fixes #1818
2020-06-27 19:51:42 +02:00
Nassim a942d3aad5 Merge pull request #1840 from KennyTV/component-reading
Directly read components as json, to only de-/serialize once
2020-06-27 17:42:25 +02:00
KennyTV 7a25645ed5 Rename some A's 2020-06-27 16:56:57 +02:00
Myles 3c23bd41dd Merge pull request #1843 from creeper123123321/patch-3
Fix bossbar
2020-06-26 10:04:18 +01:00
Myles e5ba76e006 Merge pull request #1833 from KennyTV/master
Only print InformativeException cases in codec handlers
2020-06-26 10:03:49 +01:00
creeper123123321 7a03feeccc Fix bossbar 2020-06-26 05:57:02 -03:00
Nassim 67ef4700c7 Merge pull request #1842 from creeper123123321/fixdisablebaseprotocol
inactivate userconnection correctly when there's no translation
2020-06-25 20:50:17 +02:00
creeper123123321 790a9d0058 inactivate userconnection correctly when there's no translation 2020-06-25 13:49:19 -03:00
Myles 002ad95cad Merge pull request #1839 from creeper123123321/nonuuidbossbar
Allow use of UserConnections for BossBars
2020-06-25 17:25:44 +01:00
creeper123123321 7ff42400c0 javadc 2020-06-25 12:07:30 -03:00
creeper123123321 3df7f760a6 warn about duplicate uuids 2020-06-25 11:50:12 -03:00
KennyTV 3a48e54e52 Directly read components as json, to only de-/serialize once 2020-06-25 16:41:39 +02:00
creeper123123321 73eef1727a make isFrontEnd public 2020-06-25 11:41:38 -03:00
creeper123123321 1ab0cd07af Use return value from add/remove and add abstract isFrontEnd 2020-06-25 11:40:15 -03:00
creeper123123321 9df545483c Fix when client doesn't have id 2020-06-25 11:28:30 -03:00
creeper123123321 3f93bb051d Redirect UUID to UserConnection bossbars 2020-06-25 11:25:59 -03:00
creeper123123321 8bd982a412 fix number comparing 2020-06-25 11:00:43 -03:00
creeper123123321 7b200ad264 dont use uuids for bossbars, use userconnection 2020-06-25 10:50:34 -03:00
KennyTV 5d2a4e2ef3 Add sanity check to conduit nbt handling 2020-06-25 12:52:59 +02:00
KennyTV d414106d5a Only print InformativeException cases in codec handlers 2020-06-25 12:51:51 +02:00
KennyTV d86ac64ac9 Fix PS support
Fixes #1825
2020-06-25 12:39:49 +02:00
KennyTV 6761489ebf Also handle the block entity data packet for nbt
Fixes #1816
2020-06-25 11:18:07 +02:00
KennyTV dd0ec0033a Bukkit is no more
... no longer deployed that is
2020-06-25 10:44:53 +02:00
KennyTV f91ddb2521 Hotfix RGB Bungee legacy insertions
Fixes #1838
We should at some point completely remove the Bungee chat lib and handle everything with plain json ourselves
2020-06-25 09:57:26 +02:00
Myles 3ee94415a9 Back to snapshot 2020-06-24 13:34:17 +01:00
Myles 1a7ce908b8 Release 2020-06-24 13:16:45 +01:00
KennyTV d3fb7cd91b 1.16.1 2020-06-24 14:10:33 +02:00
KennyTV 8b61d168f7 Send remaining (empty) tags
Fixes #1830
2020-06-24 14:05:52 +02:00
Myles 50cb30b4fc Version graph (updated by @kennytv) 2020-06-24 09:36:01 +01:00
KennyTV 5b807a9f17 Fix motd reading in some cases
Fixes #1826
2020-06-23 23:33:59 +02:00
KennyTV f671a4fa5c Work around player sample line breaks
Fixes #1819
2020-06-23 20:01:01 +02:00
KennyTV 0b1c210f77 Fix component read length
Fixes #1822, fixes #1696
2020-06-23 19:15:20 +02:00
KennyTV 9220c5ae40 Remap ocelots to cats in 1.13->1.14 again
Fixes #1815
2020-06-23 17:43:05 +02:00
KennyTV f391cc6185 Send impact_projectiles enttiy tag 2020-06-23 17:30:37 +02:00
KennyTV b0fe7d9c6d Also add wooden_trapdoors item tag 2020-06-23 17:13:11 +02:00
KennyTV 3d39f0d304 Fix wooden_trapdoors tag checking 2020-06-23 16:31:00 +02:00
Myles 42029770a2 Back to snapshot 2020-06-23 14:40:22 +01:00
Myles cf00b9ee7c 3.0.0 2020-06-23 14:07:27 +01:00
Myles b0816b1ce6 Merge pull request #1812 from KennyTV/abstraction
Revert removal of concurrency hacks
2020-06-22 17:15:11 +01:00
KennyTV 67cce53b72 Revert removal of concurrency hacks
Apparently still causes issues with PS, we'll investigate this properly at a later date
2020-06-22 17:45:10 +02:00
Myles 0c097d7467 Merge pull request #1810 from KennyTV/abstraction
Fix 1.16 Bungee compat
2020-06-22 16:33:25 +01:00
KennyTV 70e142e4c4 Fix 1.16 Bungee compat
Moved the version hack outside of the BaseProtocol class into separate impls with properly checking the sent version
2020-06-22 17:02:25 +02:00
KennyTV 9f104866b2 Prepare for 1.16 2020-06-22 16:10:34 +02:00
KennyTV 7ec9eb08d9 Fix banner item color in 1.12->1.13
Fixes #1809
2020-06-22 10:20:00 +02:00
Myles 2ea3d60307 Merge pull request #1807 from KennyTV/abstraction
Avoid a bit of overhead in manual primitive type reading
2020-06-18 19:02:05 +01:00
KennyTV 7595ca0c40 Avoid a bit of overhead in manual primitive type reading
Mostly interesting for proper object type reading (arrays, chunks, etc.) that manually call the type read/write methods + packet varint channel id
2020-06-18 19:38:47 +02:00
KennyTV 5a15d34d9e 1.16 rc1 2020-06-18 15:48:33 +02:00
KennyTV cc500e4681 1.16 pre8 2020-06-17 18:03:22 +02:00
KennyTV 4c7cf56655 Fix future entity equip reading 2020-06-16 21:04:29 +02:00
Myles f570e77325 Merge pull request #1805 from KennyTV/abstraction
1.16 pre7
2020-06-16 18:55:22 +01:00
KennyTV 9785878d87 1.16 pre7 2020-06-16 18:50:50 +02:00
KennyTV 6cd6c87127 1.16 pre6 2020-06-15 20:11:21 +02:00
KennyTV 8d7c7743b8 Only print codec netty exceptions 2020-06-14 18:15:09 +02:00
KennyTV b9889d2c45 1.16 pre5 2020-06-12 17:18:06 +02:00
Myles a58257bc38 Merge pull request #1802 from KennyTV/abstraction
1.16 pre4
2020-06-11 22:28:52 +01:00
KennyTV 7924dfeab2 Remove -1 tag workaround, fixed in pre4 2020-06-11 19:36:35 +02:00
KennyTV 989c0bf55f 1.16 pre4 2020-06-11 19:30:52 +02:00
Myles 064c7a3cd0 Merge pull request #1801 from KennyTV/abstraction
1.16 pre3
2020-06-11 13:26:14 +01:00
KennyTV e1b2702231 1.16 pre3 2020-06-10 19:36:05 +02:00
KennyTV 029f399a14 Rename ViaCodecException to CancelCodecException 2020-06-10 08:58:40 +02:00
KennyTV 7588609c56 Fix cancelexception printing 2020-06-09 21:29:19 +02:00
KennyTV 6513df10e7 Explicitly cast json loaded map in BlockIdData
Else json will start to cry sometimes
2020-06-09 20:38:50 +02:00
KennyTV d14a74f29e Change CancelException message 2020-06-09 20:05:35 +02:00
Myles 2f9c66eafb Merge pull request #1505 from creeper123123321/nettyhandlerabstraction
Netty handler tidy
2020-06-09 17:10:06 +01:00
KennyTV ad1707f0ee Fixup docs 2020-06-09 17:57:14 +02:00
KennyTV aa59ed112a Fixup docs, remove ConcurrentList 2020-06-09 17:53:31 +02:00
Myles 7be8c9d8aa Merge pull request #1799 from KennyTV/abstraction
Use FastUtil collections for frequently called code
2020-06-09 15:50:23 +01:00
KennyTV f408a5d4c6 Add last load factors 2020-06-09 08:38:22 +02:00
KennyTV 5d8084986f Put itemmappings into custom Int2IntBiMap 2020-06-08 23:54:24 +02:00
KennyTV 5bd1ef882e Set load factor to 1 for deterministically sized collections 2020-06-08 23:13:47 +02:00
KennyTV 6167c3b526 Set default return values 2020-06-08 23:01:55 +02:00
KennyTV 8188ae09f5 Use proper FU classes, shade dumbed down version 2020-06-08 22:23:24 +02:00
KennyTV 9c81ba368f Cancel block change packets for removed actions 2020-06-08 17:46:18 +02:00
KennyTV 39cb8fd554 Fix FU check 2020-06-08 15:58:10 +02:00
KennyTV 623cdaf881 Getter for original map in IntMap 2020-06-08 15:34:34 +02:00
KennyTV 1ad559212e Create soft wrapper for FU Int2ObjectMap 2020-06-08 13:49:26 +02:00
KennyTV 30e10bb645 Create soft wrapper for FU IntSet and Int2IntMap 2020-06-08 12:27:34 +02:00
KennyTV df495f8131 Remove accidental import 2020-06-07 16:29:15 +02:00
KennyTV 529da10615 Move ProtocolInfo into its own field 2020-06-07 12:19:36 +02:00
KennyTV f2d6691af7 Minor javadoc changes 2020-06-07 11:32:49 +02:00
creeper123123321 a8a1e9448e Netty handler tidy 2020-06-07 10:41:29 +02:00
Myles d58959fcca Merge pull request #1798 from KennyTV/abstraction
Add method to get protocol instance by class
2020-06-07 09:18:57 +01:00
KennyTV 5fca206b8d Add method to get protocol instance by class 2020-06-07 10:16:40 +02:00
Myles 67993364b4 Merge pull request #1797 from KennyTV/packetids
Print protocol and packet type when erroring
2020-06-06 15:32:47 +01:00
KennyTV 25652eab15 Print protocol and packet type when erroring 2020-06-06 16:16:38 +02:00
KennyTV f117239184 Further safety checks for correct packets types 2020-06-06 15:54:51 +02:00
KennyTV cc3dae127b Use correct packet type when warning for missing mapping 2020-06-06 15:33:20 +02:00
Myles 137050be16 Merge pull request #1795 from KennyTV/packetids
Packet type constants and auto channel mapping
2020-06-06 11:00:06 +01:00
KennyTV baf1b851c4 1.8 packet enum, add a small number of nullable annotations 2020-06-06 10:55:35 +02:00
KennyTV 545ab2de79 Enforce correct packet types with generics, 1.9 packet constant 2020-06-06 09:45:43 +02:00
KennyTV 38f845bb7e Consistency changes, 1.11->1.12 packet constants
Almost there! :>
2020-06-05 23:06:00 +02:00
KennyTV 9f80553749 Safety checks, packet type constants for 1.12->1.13 protocol 2020-06-05 22:33:48 +02:00
KennyTV d7d4e58106 Packet type constants and auto channel mapping 2020-06-05 20:48:35 +02:00
Myles 5293417900 Merge pull request #1793 from KennyTV/abstraction
1.16-pre1
2020-06-05 19:47:45 +01:00
KennyTV 9a59c40ce1 Fix dimension registry data 2020-06-05 14:02:09 +02:00
KennyTV 8a00e260f6 Pre 2 protocol bump 2020-06-05 13:22:58 +02:00
KennyTV 1285a0c6bf 1.16-pre1 2020-06-05 00:42:39 +02:00
KennyTV eb9d913cb6 Add toString, equals, and hashCode to Metadata 2020-06-03 11:19:54 +02:00
Myles a60340f330 Workaround for missing Protocol1_9to1_8 2020-05-30 21:31:28 +01:00
KennyTV 796a42c981 Send new 20w22a tags 2020-05-29 20:36:40 +02:00
Myles 63a81b939d Merge pull request #1788 from KennyTV/abstraction
20w22a
2020-05-29 14:20:07 +01:00
KennyTV a9e2544188 20w22a 2020-05-29 15:14:18 +02:00
KennyTV bea01bc794 Fix respawn reading 2020-05-23 12:46:15 +02:00
Myles 3db74c79ab Merge pull request #1784 from KennyTV/abstraction
Sound rewriter cleanup - don't send -1 sound ids
2020-05-23 10:20:17 +01:00
KennyTV 799c933d95 Make SoundRewriter fields protected 2020-05-23 11:14:50 +02:00
KennyTV 6b9e67f96b Sound rewriter cleanup - don't send -1 sound ids
Addresses #1783
2020-05-23 10:56:27 +02:00
Myles 062d846c37 Merge pull request #1782 from KennyTV/abstraction
20w21a
2020-05-20 16:18:26 +01:00
KennyTV af3023562d Fix dimension identifier 2020-05-20 17:02:22 +02:00
KennyTV 92f4e3dd81 20w21a 2020-05-20 16:44:12 +02:00
Myles f7eb445d61 Merge pull request #1775 from KennyTV/abstraction
20w20a
2020-05-16 16:22:35 +01:00
KennyTV 98b77278cd 20w20b 2020-05-14 11:53:27 +02:00
Myles 60461b9cff Merge pull request #1776 from Xernium/abstraction
I am sick of this-
2020-05-13 20:31:00 +01:00
FivePB (Xer) 1394c70981 Shouldn't try to write helpful messages when drunk 2020-05-13 20:56:15 +02:00
FivePB (Xer) 595b8c3b56 Yes much tree 2020-05-13 20:50:28 +02:00
FivePB (Xer) 27cbd844f0 Much fighting over this mess(age) 2020-05-13 20:48:51 +02:00
KennyTV 5c5c1ed402 20w20a 2020-05-13 18:08:33 +02:00
KennyTV 245c7e8219 Add wall_post_override blocktag 2020-05-12 22:51:02 +02:00
Myles 3079663ba9 Merge pull request #1769 from KennyTV/abstraction
Add runnable list to be executed before the full init
2020-05-09 09:28:11 +01:00
KennyTV 25d54ae229 Add runnable list to be executed before the full init 2020-05-09 09:46:15 +02:00
Myles 045c35243f Merge pull request #1768 from Gerrygames/abstraction
Handle new window type in 1.16
2020-05-08 08:32:33 +01:00
Gerrygames 5009ffbb5a handle new window type in 1.16 2020-05-08 01:36:24 +02:00
KennyTV 47b43402f5 20w19a 2020-05-06 19:11:05 +02:00
KennyTV a5dbec5303 Merge remote-tracking branch 'origin/master' into abstraction
# Conflicts:
#	pom.xml
2020-05-06 19:05:15 +02:00
Myles f3f82c4f1a Merge pull request #1765 from KennyTV/abstraction
Fix toggleglide listener swimming check
2020-05-06 09:03:41 +01:00
KennyTV 653ca4b322 Fix toggleglide listener swimming check 2020-05-06 09:30:16 +02:00
Myles b57800c2e2 Merge pull request #1760 from konwboj/master
Fix block connections causing issues with TNT
2020-05-05 19:43:49 +01:00
konwboy 222c03aa67 Fix block connections causing issues with TNT 2020-05-05 19:49:59 +02:00
Myles d5ff2b5b63 Merge pull request #1735 from KennyTV/abstraction
Add fire connection handler
2020-05-02 15:35:38 +01:00
Myles 0a95488146 Merge pull request #1750 from Gerrygames/abstraction
fix enchantments in enchanting table for 1.16
2020-04-29 20:14:03 +01:00
Gerrygames 93d21efd3d fix enchantments in enchanting table for 1.16 2020-04-29 21:10:05 +02:00
Myles d71cd20a39 Merge pull request #1749 from KennyTV/20w18a
20w18a
2020-04-29 18:50:11 +01:00
KennyTV 19201134a8 20w18a 2020-04-29 18:09:57 +02:00
KennyTV da2f153a43 Share JsonParser instance 2020-04-27 14:41:57 +02:00
Myles d96b88b967 Merge pull request #1743 from KennyTV/cache
Uncache UserConnection on channel close, say farewell to lombok
2020-04-25 12:24:44 +01:00
KennyTV d33482e200 Remove lombok at last 2020-04-25 11:56:20 +02:00
KennyTV 24ebb77860 Directly add dependent futures to the list instead of waiting for the extra boolean 2020-04-24 13:48:22 +02:00
KennyTV e4bac5f81a Improve shutdown of executor loader and mappings cache
Previously, the shutdown check would only happen once all futures were removed, as in a player joined that had to check the remaining protocols.
Now, the check will be done regularly once the plugin has fully been enabled and has the option to delay the shutdown until set on again (i.e. with ViaBackwards)
2020-04-24 13:27:29 +02:00
KennyTV 4b9a15b003 Some javadoc changes 2020-04-24 11:39:11 +02:00
KennyTV 32826467d3 Wrap reflectiveoperationexception in concurrentlist clone 2020-04-23 21:42:08 +02:00
KennyTV 886ac734f9 Add null check to channel close 2020-04-23 21:09:41 +02:00
KennyTV 762c66ff42 Farewell, lombok! 2020-04-23 21:07:12 +02:00
KennyTV 53b8c2328e Uncache UserConnection on channel close, fix memory leak 2020-04-23 20:24:16 +02:00
KennyTV 578c661730 Check if player is handled by Via on disconnect 2020-04-22 22:11:01 +02:00
KennyTV a82bbc4e66 Replace keyset map lookups with value iterator 2020-04-22 21:47:14 +02:00
KennyTV 867cd4ee39 Move heightmap code above block entity check 2020-04-22 21:46:14 +02:00
Myles f7b841faf3 Merge pull request #1742 from Gerrygames/abstraction
convert height maps, fix 1.16 chunk reading
2020-04-22 20:44:47 +01:00
Gerrygames b80902ec10 convert height maps, fix 1.16 chunk reading 2020-04-22 21:42:11 +02:00
Myles 90386cd0de Merge pull request #1741 from Gerrygames/abstraction
20w17a
2020-04-22 18:15:02 +01:00
Gerrygames e22bba0360 20w17a, update entity types renamed in 1.13 2020-04-22 19:04:53 +02:00
Myles f82b52b017 Fix disconnect / sendMessage on Bungee 2020-04-20 09:56:34 +01:00
Myles 2734b18d07 Block connections true by default
While we didn't have this enabled when it launched, most of the bugs are gone and the number of people using this option is pretty high.
2020-04-19 18:59:38 +01:00
KennyTV 3a5a47aaa2 Add fire connection handler 2020-04-19 15:57:59 +02:00
Myles c7bc9aa43c Merge pull request #1734 from KennyTV/abstraction
Add safety checks to skullowner conversion
2020-04-17 20:04:29 +01:00
KennyTV c956f23def Add safety checks to skullowner conversion 2020-04-17 21:02:51 +02:00
KennyTV 0f90efa05f Add subplatform versions to dumps 2020-04-17 20:52:55 +02:00
Myles e3821e1741 Merge pull request #1733 from KennyTV/abstraction
Add git commit hash to dumps
2020-04-16 23:21:30 +01:00
KennyTV 8bf9a910d5 Explicitly use parent version 2020-04-16 21:44:04 +02:00
KennyTV 83a6346a8d Add git commit hash to dumps 2020-04-16 21:39:28 +02:00
Myles d9291e6457 Merge pull request #1719 from creeper123123321/portedplayerschange
Remove portedPlayers field, let platform handle players
2020-04-15 23:11:09 +01:00
Myles 2bd2fa3228 Merge pull request #1728 from KennyTV/abstraction
20w16a
2020-04-15 22:18:05 +01:00
KennyTV b03dfa9951 20w16a 2020-04-15 17:53:02 +02:00
creeper123123321 dd5cbb0e4c Merge branch 'abstraction' of https://github.com/ViaVersion/ViaVersion into portedplayerschange 2020-04-15 11:39:13 -03:00
creeper123123321 18034a334c Merge branch 'portedplayerschange' of github.com:creeper123123321/ViaVersion into portedplayerschange 2020-04-15 11:36:01 -03:00
creeper123123321 17881b342a javadoc, remove ViaAPIs getPortedPlayers, fix ViaManager.getPortedPlayers name, rename to ViaAPI#isInjected 2020-04-15 11:35:09 -03:00
Myles 47e50d035f Merge pull request #1724 from KennyTV/abstraction
Fix 1.15 EntityToggleGlideEvent cancelling on Bukkit
2020-04-14 17:58:14 +01:00
Myles 5af9f025d8 Merge pull request #1379 from creeper123123321/1_8inconsistencyfix
Fix inconsistent types in block placement
2020-04-14 17:43:20 +01:00
creeper123123321 c12c43e79a SpongePlugin readd .getParentFile() 2020-04-14 12:47:44 -03:00
creeper123123321 9e4ed56384 Revert SpongePlugin sharedRoot change 2020-04-14 12:46:23 -03:00
KennyTV 8f08a32c5a Bai bai to more lombok usage once more 2020-04-13 20:58:24 +02:00
KennyTV fdb6137339 Create bukkit-legacy module for 1.8 magic method usage
No real changes to the classes other than them being moved
2020-04-13 20:19:55 +02:00
KennyTV f173cf73d4 Fix 1.15 EntityToggleGlideEvent cancelling on Bukkit
Since 1.15, cancelling can only be done by updating the player's metadata
2020-04-13 20:03:46 +02:00
creeper123123321 a91c72fb44 position fix 2020-04-13 14:42:48 -03:00
creeper123123321 99abe3994c use short 2020-04-13 14:33:00 -03:00
creeper123123321 a0e3d70a3f unsigned byte 2020-04-13 14:01:28 -03:00
creeper123123321 ee7eaecdb3 move field 2020-04-13 08:51:04 -03:00
creeper123123321 a105c5cb11 Make getPortedPlayers() private, update bungee-api, remove some lombok usage, create ViaConnectionManager 2020-04-12 16:47:32 -03:00
Myles 4d30cc2309 Merge pull request #1718 from creeper123123321/abstraction
#1717 Fix
2020-04-12 19:39:35 +01:00
creeper123123321 ca78bf9851 Remove portedPlayers field, let platform handle players 2020-04-12 15:37:08 -03:00
creeper123123321 d7027cc0e3 formatting 2020-04-12 15:18:44 -03:00
creeper123123321 f8def524aa Run Velocity server change logic on event loop 2020-04-12 14:50:54 -03:00
Myles 14532bfa9a Merge pull request #1709 from KennyTV/abstraction
20w15a
2020-04-09 00:11:10 +01:00
KennyTV 721808d71d 20w15a 2020-04-08 16:15:53 +02:00
Myles 3c9c61056d Merge pull request #1689 from KennyTV/abstraction
Asynchronously load mapping data
2020-04-05 21:54:04 +01:00
Myles 19f7800173 Merge pull request #1705 from KennyTV/1.16
Minor chunk type cleanup
2020-04-05 21:52:20 +01:00
KennyTV df702736bf Readd block entity wrapping 2020-04-04 00:37:06 +02:00
KennyTV 3737242226 Cleanup chunk types 2020-04-04 00:32:00 +02:00
KennyTV ebff5e2f4d Adapt tagdata loading 2020-04-03 19:57:07 +02:00
KennyTV 081781f223 Some cleanup 2020-04-03 19:32:31 +02:00
KennyTV c570f4a972 Minor change 2020-04-03 19:32:31 +02:00
KennyTV 563c5f830d Don't expose executor and future map 2020-04-03 19:32:30 +02:00
KennyTV 248fd92f6e Use CompletableFuture.runAsync 2020-04-03 19:32:30 +02:00
KennyTV 757654aa9d Minor changes 2020-04-03 19:32:30 +02:00
KennyTV e658304405 Asynchronously load mappings (until needed), create optional mappings cache for VB 2020-04-03 19:32:30 +02:00
KennyTV b5e5118450 Minor protocol cleanup
Removed unneeded integer boxing and empty method implementations of the user init
2020-04-03 19:32:30 +02:00
KennyTV 95db675de5 Add missing tags for client sending, cleanup 2020-04-03 17:29:40 +02:00
KennyTV cae6addf26 Fill beacon tag in case it's fully used by the client in the future 2020-04-03 16:47:38 +02:00
KennyTV ed26971724 Fix beacon item payment 2020-04-03 13:41:53 +02:00
KennyTV 7cdcdfa3c9 Minor cleanup to tagrewriter 2020-04-03 11:29:59 +02:00
KennyTV 8314f6c1db Send empty non_flammable_wood itemtag as well 2020-04-03 00:03:21 +02:00
KennyTV 297fe0a538 Send empty non_flammable_wood tag 2020-04-02 23:58:06 +02:00
KennyTV b6592b38ad Fix zombie id 2020-04-02 23:06:05 +02:00
Myles 8ef0221d43 Merge pull request #1703 from KennyTV/1.16
20w14a, entity name fixes, abstract tag rewriter
2020-04-02 21:40:42 +01:00
KennyTV b1d6a49a82 Fix entity remap 2020-04-02 21:42:21 +02:00
KennyTV 0fcba4f4ec Minor changes 2020-04-02 21:09:48 +02:00
KennyTV 0ee6369884 20w14a, entity name fixes, abstract tag rewriter 2020-04-02 21:03:05 +02:00
KennyTV b941a6a422 20w13b 2020-03-26 15:39:34 +01:00
Myles 2d05d601a0 Merge pull request #1692 from KennyTV/20w13a
20w13a
2020-03-25 21:56:41 +00:00
KennyTV 90f363a2be Use correct parent for hoglin and strider 2020-03-25 19:58:38 +01:00
KennyTV 875b85b0fc 20w13a 2020-03-25 19:42:06 +01:00
Myles 29c1623aab Merge pull request #1691 from KennyTV/chat
Update bungeecord-chat
2020-03-24 20:21:34 +00:00
KennyTV a914bc349a Update bungeecord-chat 2020-03-24 21:18:00 +01:00
Myles 88e20e2eb6 Bump version 2020-03-21 22:07:36 +00:00
Myles 9d343a3f29 Merge pull request #1683 from Gerrygames/abstraction
Fix skull items
2020-03-21 13:50:48 +00:00
Gerrygames 6b7f00ef76 fix skull items 2020-03-21 13:51:14 +01:00
Myles c2a1d289e1 Merge pull request #1680 from KennyTV/abstraction
Fix login packet reading on 1.16 servers, fix uuid nbt tags
2020-03-20 21:15:49 +00:00
KennyTV 20ce8cc288 Fix block entity uuid nbt, fix particles 2020-03-20 19:20:48 +01:00
KennyTV 6eaeb5a201 Fix login packet reading on 1.16 servers 2020-03-18 20:31:43 +01:00
Myles f245bb8263 Merge pull request #1679 from KennyTV/abstraction
20w12a
2020-03-18 18:26:34 +00:00
KennyTV f746fda5a8 Unroll uuid reading/writing 2020-03-18 19:21:48 +01:00
KennyTV a7ab4153ef 20w12a 2020-03-18 19:15:58 +01:00
KennyTV 5057ac3d3d Remove null check for channel in UserConnection again 2020-03-14 16:36:04 +01:00
Myles 4b9d3e34ea Merge pull request #1677 from KennyTV/abstraction
20w11a
2020-03-11 21:29:29 +00:00
KennyTV 7887e10bb6 20w11a 2020-03-11 22:14:08 +01:00
Myles ef88be547b Merge pull request #1674 from KennyTV/abstraction
Remove some lombok usage from the api package
2020-03-10 22:36:45 +00:00
KennyTV dd73ba4f72 Remove some lombok usage from the api package 2020-03-10 13:22:22 +01:00
Myles 467adbd3ed Merge pull request #1669 from KennyTV/abstraction
20w10a
2020-03-04 18:31:51 +00:00
KennyTV 2bf69c2df2 20w10a 2020-03-04 18:07:49 +01:00
Myles 7ccc0eb488 Merge pull request #1666 from KennyTV/abstraction
20w09a
2020-02-27 10:48:03 +00:00
KennyTV 97db997473 Fix typo 2020-02-26 18:51:27 +01:00
KennyTV efbc246a72 20w09a 2020-02-26 18:50:30 +01:00
Myles 9ce209ef42 Merge pull request #1664 from KennyTV/abstraction
20w08a
2020-02-19 19:51:03 +00:00
KennyTV df7ef32677 20w08a 2020-02-19 18:49:17 +01:00
KennyTV 1a4945eecd Merge branch 'master' into abstraction 2020-02-19 15:23:39 +01:00
Myles e3e88d449d Merge pull request #1646 from Jo0001/patch-1
Add link to krusics "Blocked Version Generator"
2020-02-17 10:01:42 +00:00
Myles 529f9a0e01 Fix double space and use a 2020-02-17 10:01:28 +00:00
Myles b5add583c9 Merge pull request #1662 from KennyTV/abstraction
20w07a
2020-02-14 20:54:54 +00:00
KennyTV c2d8b43eab Update hoglin, add piglin entity type 2020-02-14 15:56:55 +01:00
KennyTV 6d823263ac 20w07a 2020-02-14 15:48:12 +01:00
KennyTV a9b3640b69 Merge branch 'master' into abstraction 2020-02-14 15:47:42 +01:00
Myles 17323c715d Merge pull request #1656 from JLLeitschuh/fix/JLL/use_https_to_resolve_dependencies
[SECURITY] Use HTTPS to resolve dependencies in Maven Build
2020-02-11 16:31:27 +00:00
Jonathan Leitschuh 2420b8052e Use HTTPS instead of HTTP to resolve dependencies
This fixes a security vulnerability in this project where the `pom.xml`
files were configuring Maven to resolve dependencies over HTTP instead of
HTTPS.

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2020-02-11 10:46:21 -05:00
KennyTV 5c54e8a08d Merge branch 'master' into abstraction 2020-02-10 15:55:09 +01:00
Myles fa220a93eb Merge pull request #1654 from KennyTV/master
Add vines blockconnection to prevent unwanted climbing
2020-02-10 13:58:40 +00:00
KennyTV 7e164b40c7 Add vines blockconnection to prevent unwanted climbing
Fixes #1640
2020-02-10 14:50:22 +01:00
Myles 323ceb9ced Merge pull request #1653 from KennyTV/abstraction
Remove deprecated api, remove a bit of magic
2020-02-10 09:10:11 +00:00
KennyTV 681a0dc0e4 Remove deprecated api, remove a bit of magic 2020-02-10 10:05:56 +01:00
Myles 7cbd20a038 Merge pull request #1652 from KennyTV/abstraction
Remove a bit of magic, use finals
2020-02-09 12:08:39 +00:00
KennyTV 3f5500c637 Remove a bit of magic, use finals 2020-02-09 13:06:23 +01:00
Myles 7513b0499d Merge pull request #1650 from KennyTV/abstraction
Handle items in cooldown packet
2020-02-08 21:24:45 +00:00
KennyTV c4b447f7b6 Handle items in cooldown packet 2020-02-08 21:33:44 +01:00
KennyTV 177b0fbf33 Fix particle mapping 2020-02-06 12:37:57 +01:00
Myles 7f5e53782b Merge pull request #1648 from KennyTV/abstraction
20w06a, more cleanup
2020-02-05 19:28:04 +00:00
KennyTV 2184ef19ca 20w06a, more cleanup 2020-02-05 20:09:06 +01:00
Myles 712aa0dbf0 Merge pull request #1647 from KennyTV/abstraction
Improvements to 1.11 EntityIdRewriter
2020-02-05 16:07:33 +00:00
KennyTV c33611d2d3 Cleanup 1.11 entityidrewriter 2020-02-04 15:33:36 +01:00
Jo0001 bf15415185 Add link to krusics "Blocked Version Generator" 2020-02-01 20:26:03 +01:00
Myles 7a38e8ceb9 Merge pull request #1644 from KennyTV/abstraction
Minor blockconnection cleanup, reduce map lookups
2020-01-28 14:23:19 +00:00
KennyTV 7f6c429a55 Minor blockconnection cleanup, reduce map lookups 2020-01-28 13:31:36 +01:00
Myles 6eeecb271b Merge pull request #1638 from KennyTV/abstraction
Do not unnecessarily register tasks/listeners, set api-version
2020-01-28 11:38:32 +00:00
Myles 109d5afcf5 Merge pull request #1643 from KennyTV/master
Option to (not) remap infested blocks to their normal variants
2020-01-28 11:37:58 +00:00
KennyTV 116706c09f Option to (not) remap infested blocks to their normal variants
Fixes #1642
2020-01-28 12:36:27 +01:00
KennyTV 598b51a4bf Do not unnecessarily register tasks/listeners 2020-01-22 14:55:39 +01:00
KennyTV b06b9c69ca Do not unnecessarily register tasks/listeners 2020-01-22 14:14:43 +01:00
KennyTV 704f946cf7 Merge remote-tracking branch 'origin/master' into abstraction
# Conflicts:
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2020-01-21 16:07:42 +01:00
KennyTV 1ef9dc8de6 2.2.3 Release 2020-01-21 16:07:01 +01:00
KennyTV f9d10a9571 1.15.2 support 2020-01-21 16:05:26 +01:00
KennyTV 379c5791e6 Merge branch 'master' into dev 2020-01-20 22:15:41 +01:00
KennyTV 8569f47627 Merge branch 'dev' into abstraction 2020-01-19 19:09:57 +01:00
Myles 555bbb550f Merge pull request #1634 from Gerrygames/dev
1.15-pre2
2020-01-16 15:03:34 +00:00
Gerrygames 4cf09f2e34 1.15-pre2 2020-01-16 15:58:35 +01:00
Myles c9abd745c5 Merge pull request #1633 from KennyTV/abstraction
Put translation values into correct map
2020-01-16 09:50:45 +00:00
KennyTV 5d1b8dbb85 Put translation values into correct map 2020-01-16 10:39:31 +01:00
Myles ebeb1905b3 Merge pull request #1631 from KennyTV/abstraction
Convert (general) 1.12.2->1.13 statistics
2020-01-15 21:44:55 +00:00
KennyTV 605b217ba4 Convert (general) 1.12.2->1.13 statistics 2020-01-15 21:51:33 +01:00
KennyTV 814bd9d85e Merge remote-tracking branch 'origin/master' into abstraction 2020-01-15 19:13:33 +01:00
Myles 8d16ebf6ae Merge pull request #1630 from KennyTV/master
Fix 1.11 evocation id
2020-01-15 17:54:52 +00:00
KennyTV 7f0af23f96 Fix 1.11 evocation id
Fixes #1629
2020-01-15 18:53:26 +01:00
Myles 060370f356 Update fabric.mod.json 2020-01-14 20:11:09 +00:00
Myles ab384df279 Merge branch 'master' into abstraction 2020-01-14 19:14:42 +00:00
Myles 9a0cc02b86 Merge branch 'master' into dev 2020-01-14 19:14:38 +00:00
Myles 5fb86d8df3 *sobs* 2020-01-14 19:14:18 +00:00
Myles c64c27331a Merge branch 'master' into dev 2020-01-14 19:12:55 +00:00
Myles cd2ca76236 Merge branch 'master' into abstraction 2020-01-14 19:12:42 +00:00
Myles 9598e0e4f8 Update authors 2020-01-14 19:12:24 +00:00
Myles d29c2bdfb7 Merge pull request #1627 from KennyTV/master
Fix heightmaps
2020-01-14 18:24:51 +00:00
KennyTV 538b467fa6 Fix heightmaps 2020-01-14 19:18:02 +01:00
Myles 7deca33374 Merge pull request #1626 from Gerrygames/dev
1.15.2-pre1 + merge master
2020-01-14 17:07:19 +00:00
Gerrygames c704813a6c 1.15.2-pre1 2020-01-14 17:51:39 +01:00
Myles 86af7f054a Merge pull request #1601 from KennyTV/abstraction
Cleanup some block rewrite methods
2020-01-06 14:56:17 +00:00
Myles a6932bb71f Merge pull request #1617 from KennyTV/channelnames
Make plugin channel mappings modifiable
2020-01-06 14:55:38 +00:00
KennyTV 3384b6bc17 Only load mappings file from dir if manually copied 2020-01-06 10:52:42 +01:00
KennyTV 4bdb566fb5 Kept the wrong defaults 2020-01-05 21:23:40 +01:00
KennyTV 5ad62a03ed Make plugin channel mappings modifiable 2020-01-05 21:21:58 +01:00
KennyTV 280b6fae2a Merge master 2019-12-21 19:49:18 +01:00
Myles e07c994ddc Merge pull request #1599 from KennyTV/master
Fix Bungee injection on Java 12+
2019-12-21 07:18:23 +00:00
KennyTV 5d974858fe Some more cleanup 2019-12-20 17:53:14 +01:00
KennyTV 5cb5992d44 Fix Bungee injection on Java 12+
Fixes #1512
2019-12-20 16:35:10 +01:00
KennyTV fddbeda81e Back to snapshot 2019-12-20 16:29:10 +01:00
KennyTV 1c1ec10a0a Common methods for block rewriting 2019-12-17 18:29:38 +01:00
Myles cd9566fbc8 1.15.1 support 2019-12-17 15:28:43 +00:00
KennyTV 90b88f3cbf Update readme 2019-12-17 15:03:06 +01:00
Myles faf86b2439 Merge pull request #1590 from KennyTV/dev
1.15.1
2019-12-17 13:59:06 +00:00
KennyTV 5a1dadf476 1.15.1 2019-12-17 14:54:51 +01:00
Myles 6eabb17f67 Merge from master 2019-12-15 09:16:53 +00:00
Myles 4f72edeaee Merge branch 'master' into dev 2019-12-15 09:02:48 +00:00
Myles b0f3d04439 Merge branch 'master' of https://github.com/ViaVersion/ViaVersion 2019-12-15 09:02:03 +00:00
Myles 33a34fc149 Update README with new table 2019-12-15 09:01:49 +00:00
Myles 679f573444 Merge pull request #1587 from robinbraemer/patch-1
fix typo
2019-12-15 09:00:37 +00:00
Robin Brämer f35b931004 fix typo 2019-12-14 22:01:50 +01:00
Myles 7ca50291e3 Merge pull request #1585 from KennyTV/master
Fix book edit
2019-12-14 16:34:57 +00:00
KennyTV 9c8a8e2e9c Fix book edit 2019-12-14 16:22:24 +01:00
Myles d45a370a4d Merge pull request #1527 from creeper123123321/primitive_types
Use primitive types in Position and BlockFace, remove world block con…
2019-12-13 12:48:36 +00:00
Myles d5907711e1 Merge pull request #1576 from astei/remove-unneeded-indirection
Remove unneeded indirection
2019-12-13 08:30:22 +00:00
Andrew Steinborn 437463f1b4 Revert "Remove indirection in byte array writing"
This reverts commit ba08c3ad2f.

Breaks the API that ViaRewind and ViaBackwards depend on.
2019-12-12 20:45:03 -05:00
creeper123123321 d6b52bcc54 Merge remote-tracking branch 'upstream/abstraction' into primitive_types 2019-12-12 15:23:32 -03:00
Myles 3738459fa6 Merge pull request #1580 from KennyTV/dev
1.15.1-pre1
2019-12-12 15:35:36 +00:00
KennyTV be4d071250 1.15.1-pre1 2019-12-12 16:32:53 +01:00
Myles 91a2aa6781 Merge pull request #1575 from KennyTV/master
Fix biomedata on some custom Spigot versions
2019-12-12 09:33:20 +00:00
Andrew Steinborn ba08c3ad2f Remove indirection in byte array writing
This saves us from the cost of (un)boxing bytes on the fly.
2019-12-12 00:02:09 -05:00
Andrew Steinborn 220c45b800 Remove indirection in StringType decoding 2019-12-11 23:55:44 -05:00
Andrew Steinborn a42e724f50 Remove unneeded indirection in NBTType
ByteBufInputStream implements DataInput, ByteBufOutputStream implements DataOutput. Use them to exploit native Netty ByteBuf calls where possible.
2019-12-11 23:51:39 -05:00
KennyTV 1002ca4016 Fix biomedata on some custom Spigot versions 2019-12-11 20:36:49 +01:00
Myles c1b11a55d5 Back to SNAPSHOT 2019-12-11 11:16:05 +00:00
Myles a21a2079c6 2.2.1 2019-12-11 11:12:22 +00:00
Myles 07d219c77b Merge pull request #1569 from KennyTV/master
Ignore unneeded sound warnings
2019-12-11 11:10:01 +00:00
KennyTV b7b8bdc841 Ignore unneeded sound warnings 2019-12-11 12:07:22 +01:00
Myles dd5c1bb1a4 Merge pull request #1568 from KennyTV/abstraction
Merge master into abstraction
2019-12-11 09:11:56 +00:00
KennyTV 5f46dcbab0 Merge remote-tracking branch 'upstream/master' into abstraction
# Conflicts:
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/providers/blockentities/FlowerPotHandler.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/EntityPackets.java
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2019-12-11 09:53:09 +01:00
Myles 66b9bfbbd5 Merge pull request #1567 from KennyTV/master
Fix acknowledge digging
2019-12-11 08:36:18 +00:00
KennyTV dfbe2e9739 Fix acknowledge digging
Fixes #1564
2019-12-11 09:30:51 +01:00
Myles 3d10c56aac Merge pull request #1565 from Gerrygames/master
fix entity metadata in spawn packet being ignored
2019-12-11 08:18:23 +00:00
Gerrygames 84624a4884 fix entity metadata in spawn packet being ignored 2019-12-11 02:10:16 +01:00
Myles 68ac978d45 Back to SNAPSHOT 2019-12-10 15:34:42 +00:00
Myles 8136eb15e1 Merge 1.15 support 2019-12-10 15:31:07 +00:00
Myles 2c95a1e71c README 2019-12-10 15:29:52 +00:00
Myles c85d4224ad 1.15 protocol + 2.2.0 2019-12-10 15:29:26 +00:00
Myles a74bee5bed Merge pull request #1562 from KennyTV/dev
Fix trade list
2019-12-09 18:30:46 +00:00
KennyTV 9dae40f455 Fix trade list 2019-12-09 19:30:09 +01:00
Myles fe7a5a2ae5 Merge pull request #1561 from Gerrygames/dev
fix wrong import - #1560
2019-12-09 18:26:05 +00:00
Gerrygames 44a3108982 fix wrong import - #1560 2019-12-09 19:24:18 +01:00
Myles c0beee9189 Merge pull request #1559 from Gerrygames/dev
1.15-pre7
2019-12-09 12:49:47 +00:00
Gerrygames ea045e6c34 1.15-pre7 2019-12-09 13:48:06 +01:00
Myles 7c38a77f60 Merge pull request #1558 from Gerrygames/abstraction
Merge dev into abstraction
2019-12-09 11:11:15 +00:00
Gerrygames 9174ad854c Merge branch 'dev' into abstraction
# Conflicts:
#	bukkit/pom.xml
#	bungee/pom.xml
#	common/pom.xml
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/Protocol1_15To1_14_4.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/EntityPackets.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/types/Chunk1_15Type.java
#	jar/pom.xml
#	pom.xml
#	sponge-legacy/pom.xml
#	sponge/pom.xml
#	velocity/pom.xml
2019-12-09 11:52:23 +01:00
Myles 2960f2a3bb Merge pull request #1557 from Gerrygames/dev
Fix 1.15 entity type ids
2019-12-09 10:46:13 +00:00
Gerrygames cfe073cd20 fix 1.15 entity type ids 2019-12-09 11:34:00 +01:00
Myles 459871257e Merge pull request #1528 from KennyTV/abstraction
Hold config values in fields, add extra mappings constructor, other fixes
2019-12-08 23:08:52 +00:00
Myles 4bb4b96a10 Merge pull request #1548 from KennyTV/dev
Convert biome data to 1.15 format
2019-12-07 10:35:44 +00:00
KennyTV 68a18df969 Take biome data from same indexes as Mojang ("middle" of 4x4x4 areas) 2019-12-07 11:31:00 +01:00
Myles 8c921f427c Merge pull request #1554 from KennyTV/pre6
1.15-pre6
2019-12-07 09:07:40 +00:00
KennyTV 90e1d7236e 1.15-pre6 2019-12-07 10:05:29 +01:00
KennyTV decb20d2d1 Convert biome data to 1.15 format 2019-12-07 10:02:11 +01:00
Myles ff7cb4bbbe Merge pull request #1552 from Gerrygames/dev
1.15-pre5
2019-12-05 14:08:47 +00:00
Gerrygames a68fca9dda 1.15-pre5 2019-12-05 15:03:45 +01:00
Myles 944bfe2b06 Merge pull request #1549 from Gerrygames/dev
1.15-pre4
2019-12-03 13:25:26 +00:00
Gerrygames 762151f067 1.15-rep4 2019-12-03 14:22:54 +01:00
Myles 0327b66a1d Merge pull request #1543 from KennyTV/dev
Fix blaze remap and entity destroy in 1.15
2019-11-30 18:32:05 +00:00
KennyTV 2c95229cfc Fix blaze remap and entity destroy in 1.15
Fixes #1542
2019-11-30 19:22:36 +01:00
Myles 18fa4062e6 Merge pull request #1537 from KennyTV/dev
1.15-pre3
2019-11-28 20:58:56 +00:00
KennyTV 5c7520f552 1.15-pre3 2019-11-28 20:10:19 +01:00
creeper123123321 875d2392b5 Fix position shifting, fix two layers of item copy 2019-11-27 16:39:06 -03:00
KennyTV a68eac7cd2 Add set cooldown register in ItemRewriter 2019-11-27 12:56:20 +01:00
KennyTV 42efec6e2b Add version to entity type warning 2019-11-27 00:55:33 +01:00
KennyTV bcb953a45a Fix 1.15 chunk read 2019-11-27 00:08:28 +01:00
KennyTV bca5b43a2a Fix entity type 2019-11-26 23:59:23 +01:00
KennyTV da704539f0 Rename suppress-warning config option 2019-11-26 20:14:56 +01:00
KennyTV bd9a1dda88 Fix last config issues 2019-11-26 18:22:33 +01:00
KennyTV 915258169e Fix inverted array read check 2019-11-26 13:51:37 +01:00
KennyTV 1b207251e8 Add extra mappings constructor for VB 2019-11-25 22:41:59 +01:00
Myles b7a0829e76 Merge pull request #1534 from KennyTV/dev
1.15-pre2
2019-11-25 20:52:28 +00:00
KennyTV 48feee2bfc Destroy 1.15 entities 2019-11-25 20:40:03 +01:00
KennyTV 08e145f831 1.15-pre2 2019-11-25 19:37:02 +01:00
Myles a44e28bbab Merge pull request #1532 from creeper123123321/sendtrap
Add exception for wrong protocol
2019-11-25 18:19:58 +00:00
KennyTV 21cad97f3f Some fixes, move blockconnection method to bukkit config 2019-11-25 18:34:55 +01:00
creeper123123321 de97b5b15f fix typo 2019-11-24 18:43:10 -03:00
creeper123123321 1e8d04a07d remove deprecated methods and constructor on item and position, inline some uses of position 2019-11-24 17:55:46 -03:00
creeper123123321 a8a33a3a2b add exception for wrong protocol 2019-11-24 09:04:37 -03:00
Myles adafcda13d Merge pull request #1531 from Gerrygames/dev
Fix missing boss bar packet remap
2019-11-24 10:57:59 +00:00
Gerrygames c478492227 fix missing boss bar packet remap 2019-11-24 11:52:04 +01:00
Myles 07b11b4f4a Merge pull request #1529 from creeper123123321/abstraction-update
Merge dev
2019-11-23 11:23:41 +00:00
creeper123123321 beed8437a4 merge dev 2019-11-23 07:23:20 -03:00
KennyTV 501adc503c Fix typo in simulatePlayerTick getter 2019-11-22 22:39:34 +01:00
KennyTV 907516eb71 Hold config values in fields 2019-11-22 22:00:41 +01:00
creeper123123321 9308fc7712 Fix wrong casting 2019-11-22 15:19:25 -03:00
creeper123123321 062d3759be Use primitive types in Position and BlockFace, remove world block connections on Sponge, clean code in 1.8 entity tracker, add constructor for cloning Item and Position 2019-11-22 15:13:41 -03:00
Myles c699baaa41 Merge pull request #1526 from Gerrygames/dev
1.15 pre1
2019-11-22 11:49:28 +00:00
Gerrygames 582e4a11d4 1.15 pre1 2019-11-21 18:34:29 +01:00
Myles 285744a274 Merge pull request #1520 from creeper123123321/dev
19w46b
2019-11-20 12:59:16 +00:00
Myles faaa252fa8 Merge pull request #1521 from creeper123123321/abstraction
Merge dev into abstraction
2019-11-20 12:58:53 +00:00
Myles b01fd89373 Merge pull request #1510 from creeper123123321/flowerpotrewrite
Pot handler rewrite
2019-11-20 12:58:21 +00:00
Myles ed5702188c Merge pull request #1515 from ForceUpdate1/dev_particle_type
Fix area effect cloud
2019-11-20 12:12:43 +00:00
creeper123123321 f9165a1b64 fixed mappings 2019-11-15 12:30:47 -03:00
creeper123123321 bd0ce3dd71 merge dev 2019-11-15 11:35:35 -03:00
creeper123123321 385a483a29 19w46b 2019-11-15 11:19:31 -03:00
Marco Neuhaus 3b97f843cd relocate classes 2019-11-13 22:28:23 +01:00
Myles 3766da5a3a Merge pull request #1518 from Gerrygames/dev
19w46a
2019-11-13 21:04:29 +00:00
Gerrygames c3fa950a9f 19w46a 2019-11-13 17:27:51 +01:00
Myles a114e56e06 Merge pull request #1499 from creeper123123321/abstraction
Add fabric metadata
2019-11-11 22:18:59 +00:00
Myles 04e60d95e4 Merge pull request #1514 from KennyTV/dev
19w45b
2019-11-11 22:14:40 +00:00
Marco Neuhaus 000313ee9a move particle type 2019-11-11 12:29:51 +01:00
Marco dc54551d0c fix area effect cloud
add 1.14 particle type
2019-11-10 16:38:12 +01:00
KennyTV b3dc05e5ce 19w45b 2019-11-08 14:26:20 +01:00
Myles 3c57127a6c Merge pull request #1513 from Gerrygames/dev
19w45a
2019-11-07 19:06:15 +00:00
Gerrygames d16a760466 19w45a 2019-11-07 18:42:05 +01:00
creeper123123321 3761ebf8c7 Pot handler rewrite 2019-11-04 17:36:16 -03:00
Myles a7d78f7f69 Merge pull request #1503 from creeper123123321/abstraction-update
Abstraction update
2019-11-02 14:28:58 +00:00
Myles f59c0722e0 Merge pull request #1507 from creeper123123321/primitivebytearray
primitive array types
2019-11-02 13:32:42 +00:00
creeper123123321 1735f48f23 primitive array types 2019-11-02 10:00:27 -03:00
creeper123123321 a280c1ad39 Add "install: true" in .travis.yml 2019-10-30 14:53:38 -03:00
creeper123123321 ce4ae73f55 forgotten merge conflict 2019-10-30 14:30:36 -03:00
creeper123123321 fd065fb7c5 merge dev 2019-10-30 14:24:22 -03:00
Myles 5ad2511e17 Merge pull request #1502 from ViaVersion/master
Merge master into dev
2019-10-30 16:59:47 +00:00
Myles 8fe47391bf Merge pull request #1501 from Gerrygames/dev
19w44a
2019-10-30 16:20:43 +00:00
Gerrygames 12279731ad 19w44a 2019-10-30 17:14:00 +01:00
creeper123123321 a13c417352 add fabric metadata 2019-10-27 09:15:45 -03:00
Myles a8d0a4dd14 Merge pull request #1491 from creeper123123321/abstraction
deduplicate minecraft compact array code/decode
2019-10-24 21:49:31 +01:00
Myles f8b4a6e28a Merge pull request #1496 from MrMicky-FR/master
Fix item hover event on 1.12
2019-10-24 21:48:09 +01:00
Myles 85e048f22a Merge pull request #1497 from KennyTV/abstraction
Bump version to 3.0.0-SNAPSHOT
2019-10-24 21:03:09 +01:00
KennyTV 3257c79e69 Major version bump to 3.0.0-SNAPSHOT 2019-10-24 21:58:22 +02:00
MrMicky ee54e153bf Fix item hover event for 1.12 players 2019-10-23 16:11:14 +02:00
creeper123123321 9ea6c34543 use setflatblock 2019-10-19 15:35:34 -03:00
creeper123123321 005c91eb4d deduplicate minecraft compact array code/decode 2019-10-19 15:31:50 -03:00
Myles 806312e248 Merge pull request #1487 from Gerrygames/dev
19w42a
2019-10-17 16:33:52 +01:00
Gerrygames bd805bfdc4 19w42a 2019-10-16 18:07:58 +02:00
Myles 98a8f7f072 Merge pull request #1480 from MrMicky-FR/master
Fix scoreboard colors on 1.13
2019-10-13 15:54:51 +01:00
Myles 28b7f6febc Merge pull request #1484 from KennyTV/abstraction
Item rewriter cleanup
2019-10-12 10:06:55 +01:00
Myles d2ad3aea44 Merge pull request #1481 from Gerrygames/dev
19w41a
2019-10-10 11:13:10 +01:00
Gerrygames 3ffc55b539 19w41a 2019-10-09 18:06:37 +02:00
MrMicky 96c58e7b1c Fix scoreboard colors on 1.13 2019-10-08 13:25:37 +02:00
KennyTV c8171b3f43 Item rewriter cleanup 2019-10-05 09:17:10 +02:00
Myles 857ae523cf Merge pull request #1477 from KennyTV/abstraction
Cleanup more entity tracking and rewriting
2019-10-04 13:40:48 +01:00
Myles 232f2494e3 Merge pull request #1479 from KennyTV/dev
Fix an error in the player spawn packet
2019-10-04 13:40:24 +01:00
KennyTV 626eb14960 Fix an error in the player spawn packet 2019-10-04 13:26:51 +02:00
KennyTV c131672870 Fix 2019-10-03 11:00:55 +02:00
Myles 10a2e6b959 Merge pull request #1478 from KennyTV/dev
19w40a, merge master
2019-10-02 15:23:37 +01:00
KennyTV a9c49d948a Merge remote-tracking branch 'upstream/master' into dev
# Conflicts:
#	bukkit/src/main/java/us/myles/ViaVersion/bukkit/platform/BukkitViaConfig.java
#	bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaConfig.java
#	common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java
#	common/src/main/resources/assets/viaversion/config.yml
#	sponge/src/main/java/us/myles/ViaVersion/sponge/platform/SpongeViaConfig.java
#	velocity/src/main/java/us/myles/ViaVersion/velocity/platform/VelocityViaConfig.java
2019-10-02 16:21:37 +02:00
KennyTV 79a2304728 19w40a 2019-10-02 16:19:56 +02:00
KennyTV 48edd01461 Readd second cancelOutgoing method for VB 2019-10-02 15:55:59 +02:00
KennyTV 3adffdc438 Minor fix 2019-10-02 15:14:03 +02:00
KennyTV 655ef137c1 Cleanup more entity tracking and rewriting 2019-10-02 15:09:50 +02:00
KennyTV b11456d86b Helper methods for cancelling packets 2019-10-02 11:17:55 +02:00
Myles abb5e27358 Merge pull request #1476 from KennyTV/abstraction
Merge master & restore merged branches' history
2019-10-02 08:59:18 +01:00
KennyTV 42a7b5a1b2 Merge upstream/dev into abstraction 2019-10-02 09:50:51 +02:00
KennyTV 7ba2630dd2 Finish merge 2019-10-02 09:37:18 +02:00
KennyTV bbeabd20b8 Merge remote-tracking branch 'upstream/master' into abstraction
# Conflicts:
#	bukkit/src/main/java/us/myles/ViaVersion/bukkit/platform/BukkitViaConfig.java
#	bungee/src/main/java/us/myles/ViaVersion/bungee/platform/BungeeViaConfig.java
#	common/src/main/java/us/myles/ViaVersion/api/ViaVersionConfig.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/Protocol1_14_1To1_14.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14_1to1_14/packets/EntityPackets.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/MetadataRewriter.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/data/MappingData.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/EntityPackets.java
#	common/src/main/resources/assets/viaversion/config.yml
#	velocity/src/main/java/us/myles/ViaVersion/velocity/platform/VelocityViaConfig.java
2019-10-02 09:31:42 +02:00
Nassim 7e323bc497 Untrack entities in 1.14.1 protocol (#1474) 2019-10-01 21:07:42 +01:00
Lukas 7e008226ec Fix 1.14+ walk animation (#1469)
* Do not send NaN health metadata to 1.14+ clients
* Added config option 'fix-1_14-health-nan'
2019-10-01 09:04:58 +01:00
Nassim 4e7c520abe Entity tracker and rewriter cleanup (#1464) 2019-09-27 19:25:18 +01:00
Gerrygames dce64a0b34 19w39a (#1465) 2019-09-27 16:17:40 +01:00
Nassim aa9a1df1ab Actually fix zombie sound rewrites (#1463) 2019-09-26 20:14:54 +01:00
Nassim 4537aaf339 Fix some sound rewrites (#1462)
Resolves #1434
2019-09-26 19:46:48 +01:00
Nassim 44a4ffb26a Migrate to Java optionals (#1458)
* Add fromEntityType method to 1.13 objecttypes

* Migrate guava optionals to java optionals
2019-09-21 10:57:28 +01:00
Nassim 9408946b36 Merge master into abstraction (#1457) 2019-09-19 10:22:06 +01:00
Nassim cad6e7604d Merge dev, update 1.15 to abstraction, reduce helper mapping (#1456) 2019-09-19 09:27:48 +01:00
Gerrygames e452289603 19w38b, fix bell remap (#1455)
* 19w38a, fix bell remap

* 19w38b
2019-09-18 17:32:13 +01:00
MrMaurice211 0c95eaa1c3 Added forge mappings. (#1452) 2019-09-12 08:08:28 +01:00
Gerrygames c1cce6be9a 19w37a (#1451)
* 19w36a

* 19w37a
2019-09-11 16:09:44 +01:00
Nassim 0afcb893e3 Fix plugin message pattern (#1448) 2019-09-11 13:51:17 +01:00
bundabrg c7050565b8 If Bungeecord ServerConnectEvent is cancelled then ignore the event (#1450) 2019-09-11 13:51:00 +01:00
Nassim 3c436c0259 Fix entity equipment packet for 1.9+ clients (#1449) 2019-09-10 17:09:11 +01:00
Nassim 8b6b3c77e4 Relieve the lightconversion of a little work (#1433) 2019-09-09 13:02:42 +01:00
Nassim 5eb3771704 Fix no light for non full blocks (#1414) 2019-09-09 13:02:30 +01:00
BlackBeltPanda 9fd4795cb3 Update mapping-lang-1.12-1.13.json (#1439)
Fixes Tool Smith and Weapon Smith Villager names
2019-09-08 16:01:35 +01:00
Gerrygames 23eadaeaee 19w36a (#1435) 2019-09-04 16:49:27 +01:00
Myles 8ccba70788 Merge pull request #1432 from KennyTV/master
Fix hitbox listener on 1.8.0 servers
2019-08-31 08:54:52 +01:00
KennyTV 91c2987cfe Minor change
Fixes #1431
(also trying the awesome GitHub auto-closing)
2019-08-31 09:28:56 +02:00
KennyTV 5b403da966 Fix hitbox listener for for 1.8.0 servers 2019-08-31 09:17:30 +02:00
Myles e6e7da89cc Merge pull request #1426 from KennyTV/abstraction
MappingData and minor ProtocolRegistry cleanup
2019-08-29 21:24:28 +01:00
KennyTV 64e0b6c711 Minor change 2019-08-29 22:24:01 +02:00
Myles 238c0e8d40 Merge pull request #1430 from KennyTV/dev
19w35a
2019-08-29 19:06:08 +01:00
KennyTV f35eb3054c Finish 19w35a 2019-08-29 19:56:30 +02:00
KennyTV ea25b559ed 19w35a (mappings for 34a still missing) 2019-08-28 19:28:23 +02:00
KennyTV ad8e723005 Mapping and protocolregistry cleanup 2019-08-23 22:14:32 +02:00
KennyTV 4542e9511b Set some object fields to finals, use lambdas 2019-08-23 22:13:37 +02:00
KennyTV c4b23b8c87 Merge remote-tracking branch 'upstream/master' into abstraction 2019-08-23 21:20:13 +02:00
KennyTV 6f19d2d6d1 Start working on 19w34a 2019-08-23 21:15:38 +02:00
Gerrygames 7cb4e1d00e Fix explosion block desync, fixes #1365 (#1419)
* fix explosion block desync, fixes #1365

* Remove unused import
2019-08-14 09:37:54 +01:00
creeper123123321 28e8339a32 Warn about outdated BungeeCord versions (#1405) 2019-07-29 11:21:31 +01:00
Thom 99ac42c168 Issue with the CanDestroy taglist (#1411)
* Fix for an issue with the CanDestroy tag

The CanDestroy taglist didn't go to lowercase when a 1.13+ user plays on a server equal to 1.12.2 or lower causing the taglist to not work any longer for items written in caps, this while a 1.12.2 client can use the item with the in caps written CanDestroy taglist on the server

* Added Locale.ROOT to the toLowerCase()

* Added the same functionality to CanPlaceOn
2019-07-29 11:19:30 +01:00
Myles 8d97391bf3 Merge pull request #1403 from creeper123123321/master2
change version to 2.1.4-SNAPSHOT
2019-07-20 13:24:44 +01:00
Myles 2836184de3 Merge pull request #1404 from creeper123123321/patch-2
oraclejdk8 doesn't work anymore
2019-07-20 13:24:19 +01:00
creeper123123321 196ff53927 oraclejdk8 doesn't work anymore 2019-07-20 09:14:05 -03:00
creeper123123321 aaba566b1e change version to 2.1.4-SNAPSHOT 2019-07-20 09:08:13 -03:00
Myles 7191dcaa15 Update README.md 2019-07-19 11:21:19 +01:00
Myles 437b16ccd5 Merge branch 'dev' 2019-07-19 11:20:24 +01:00
Myles e4b0a99141 Merge pull request #1402 from KennyTV/1.14.4
1.14.4
2019-07-19 11:19:26 +01:00
Myles 3e5300f03c Merge pull request #1401 from KennyTV/master
Fix 1.14 client lag on join
2019-07-19 11:14:23 +01:00
KennyTV abb09153f0 1.14.4 2019-07-18 16:40:34 +02:00
KennyTV 05437a3e70 Fix 1.14 client lag on join 2019-07-16 20:44:56 +02:00
Myles c697704d04 Merge pull request #1400 from KennyTV/dev
1.14.4-pre6 support
2019-07-15 14:36:31 +01:00
KennyTV bc09187dc1 1.14.4-pre6 support 2019-07-15 14:58:55 +02:00
Myles fd53881221 Merge pull request #1390 from KennyTV/dev
1.14.4-pre1 support
2019-07-03 20:46:35 +01:00
KennyTV 2024614b68 1.14.4-pre1 support 2019-07-03 19:36:30 +02:00
Myles 3521f9ac36 Merge branch 'master' into abstraction 2019-06-28 22:02:48 +01:00
Myles d6973a301b Fix #1382 2019-06-28 22:01:46 +01:00
creeper123123321 ae7fcbc8ad trying to fix inconsistent types in block placement 2019-06-24 17:14:01 -03:00
Myles b675018acf Merge pull request #1375 from KennyTV/master
Fix 1.13 clients unable to break infested blocks (#1370)
2019-06-24 20:37:08 +01:00
Myles 10984cbeb7 Merge branch 'master' into abstraction 2019-06-24 16:24:42 +01:00
Myles bae0cd5e3e Back to snapshot 2019-06-24 16:23:35 +01:00
Myles e4750249e9 1.14.3 support 2019-06-24 16:14:31 +01:00
KennyTV 662bae45b7 Fix 1.13 clients unable to break infested blocks (#1370) 2019-06-22 16:07:38 +02:00
Myles c0e56c7c19 1.14.3 Pre-4 support 2019-06-19 23:11:54 +01:00
Myles 390653a9a6 Merge branch 'master' into abstraction 2019-06-19 09:42:01 +01:00
Myles 0cd04381a4 Merge branch 'master' into dev 2019-06-19 09:41:06 +01:00
Myles dcefaa6b19 Merge pull request #1367 from Gerrygames/master
Fix 1.13 chunk reading, fix 1.9 chunk type not using global palette
2019-06-19 09:40:26 +01:00
Gerrygames 3063538ad0 fix 1.13 chunk reading, fix 1.9 chunk type not using global palette 2019-06-14 17:50:14 +02:00
Myles 604b694709 Merge pull request #1366 from KennyTV/dev
1.14.3 pre-3
2019-06-14 10:33:16 +01:00
KennyTV 1c9309ac98 1.14.3 pre-3 2019-06-14 11:17:38 +02:00
Myles e7c89f28ba Merge pull request #1363 from KennyTV/dev
1.14.3 pre-2
2019-06-07 13:41:30 +01:00
KennyTV 97a8f41e12 1.14.3 pre-2 2019-06-07 12:36:37 +02:00
Myles be5bf7961e Merge branch 'master' into dev 2019-06-05 15:56:29 +01:00
Myles 318db58be1 Servers older than 1.13.2 have a length limit on plugin message name 2019-06-05 15:55:55 +01:00
Myles 0deed6e00d Merge pull request #1359 from KennyTV/dev
1.14.3 pre-1
2019-06-03 21:01:57 +01:00
KennyTV 5ad9d51fb0 Set version to 2.1.2 2019-06-03 21:59:19 +02:00
KennyTV 907b5e020c Change new trade list boolean 2019-06-03 21:20:32 +02:00
KennyTV a8d13fadb3 1.14.3 pre-1 2019-06-03 20:21:33 +02:00
Myles 0137105a6d Fix #1358 by checking for null before processing 2019-05-31 20:43:02 +01:00
Myles 5364d89ca8 Implement hashCode for version 2019-05-27 18:10:57 +01:00
Myles 744fa25349 Fix several NPE cases, apply final to relevant fields, remove unused code
The suggested changes were found with FindBugs, some of these bugs may be rare cases.
2019-05-27 17:50:08 +01:00
Myles 3027490256 Merge branch 'master' into abstraction 2019-05-27 17:29:04 +01:00
Myles 89dfcaf626 Back to SNAPSHOT 2019-05-27 13:37:16 +01:00
Myles 4fb0738c1a Merge pull request #1356 from Gerrygames/1.14.2
1.14.2
2019-05-27 13:24:38 +01:00
Gerrygames e8f4f7049b 1.14.2 2019-05-27 14:23:00 +02:00
Myles 0087e382ed Merge pull request #1354 from Gerrygames/1.14.2
1.14.2-pre4
2019-05-24 17:37:27 +01:00
Gerrygames eb9e48ecdc 1.14.2-pre4 2019-05-24 18:25:55 +02:00
Myles 34f8451ac5 Merge pull request #1352 from KennyTV/master
Fix minecart mapping
2019-05-22 17:41:57 +01:00
KennyTV 894503d56b Fix minecart mapping 2019-05-22 18:35:50 +02:00
Myles ee8c3d609f Merge pull request #1351 from KennyTV/dev
1.14.2-pre3
2019-05-22 16:24:13 +01:00
KennyTV b2c1c24902 1.14.2-pre3 2019-05-22 16:54:25 +02:00
Myles 6e8ea8689b Merge pull request #1349 from KennyTV/master
Add dolphin to Entity1_13Types
2019-05-22 14:44:20 +01:00
KennyTV 7fcb489f38 Add dolphin to Entity1_13Types 2019-05-22 15:25:42 +02:00
Myles 10b0a6fbb6 Merge branch 'master' into dev 2019-05-21 18:07:00 +01:00
Myles ecc1cce033 Merge pull request #1348 from KennyTV/master
Fix suffocation damage for 1.14+ players in hitbox patch
2019-05-21 18:06:20 +01:00
KennyTV 10d8ce86b3 Use weakhashmap 2019-05-21 19:02:03 +02:00
Myles b0fc69c308 Merge pull request #1339 from KennyTV/abstraction
Remove duplicated code in configs and EntityType
2019-05-21 17:49:53 +01:00
KennyTV 5cc421cff9 Don't cancel normal suffocation 2019-05-20 10:30:42 +02:00
KennyTV ca1ba4f422 Fix suffocation damage for 1.14+ players in hitbox patch 2019-05-19 23:28:05 +02:00
Myles a2d9489ad5 Merge pull request #1344 from astei/dont-send-empty-register
Don't try to send register messages without channels
2019-05-17 23:08:43 +01:00
Andrew Steinborn 232ee9b63b Don't try to send register messages without channels
Bukkit interprets this as attempting to register the channel "" (the
empty string), which fails on Minecraft 1.13 and above.
2019-05-17 18:01:58 -04:00
Myles 7861c76730 Merge pull request #1342 from KennyTV/dev
1.14.2-pre2
2019-05-17 14:24:15 +01:00
KennyTV d7aa23681b 1.14.2-pre2 2019-05-17 15:15:21 +02:00
Myles b75016a186 Merge branch 'master' into dev 2019-05-17 11:59:59 +01:00
Myles 6882b7074c Fix #1333 pandas missing 2019-05-17 11:59:46 +01:00
Myles 83bca3c23f Merge pull request #1341 from Gerrygames/1.14.2
1.14.2-pre1
2019-05-16 18:26:55 +01:00
Gerrygames a075e31a4e 1.14.2-pre1 2019-05-16 19:21:26 +02:00
Myles bdd32688fa Merge pull request #1330 from kashike/cleanup
Reduce duplication in various classes
2019-05-15 22:24:27 +01:00
Myles cb857d828f Merge pull request #1340 from KennyTV/master
Support latest Velocity changes
2019-05-15 22:23:37 +01:00
KennyTV 440d469fa2 Update to latest Velocity build 2019-05-15 23:16:01 +02:00
KennyTV 82da5e5a60 Fix MappingData reference 2019-05-15 13:37:23 +02:00
KennyTV a191d0de16 Reduce code duplication MappingData in (also regarding future versions) 2019-05-15 13:32:29 +02:00
KennyTV ae6cff5325 Remove deprecated config methods 2019-05-15 12:48:40 +02:00
KennyTV eb9520cdc3 Reduce duplicated code in config classes 2019-05-15 12:22:56 +02:00
KennyTV f8f20097a9 Move some default methods to EntityType 2019-05-15 12:04:56 +02:00
KennyTV cbb0f87676 Remove overriding properties 2019-05-15 11:59:40 +02:00
Myles a6e1488545 Merge pull request #1331 from Gerrygames/abstraction
Java 8, FunctionalInterface remapper
2019-05-15 09:21:33 +01:00
kashike 34c009e4e5 Reduce duplication in various classes 2019-05-14 13:56:50 -07:00
Myles b67242c609 Merge pull request #1337 from Gerrygames/abstraction_1.14.1
fix missing final declaration
2019-05-14 11:25:12 +01:00
Gerrygames 6e4516272b fix missing final declaration 2019-05-14 10:27:55 +02:00
Myles 08383c9141 Merge pull request #1336 from Gerrygames/abstraction_1.14.1
Abstraction 1.14.1
2019-05-14 09:26:20 +01:00
Gerrygames 2e37175dc2 1.14.1 abstraction 2019-05-14 10:21:50 +02:00
Gerrygames f25442337d Merge remote-tracking branch 'Myles/master' into abstraction_1.14.1 2019-05-14 10:15:58 +02:00
Myles 56a34ec2f8 Update to 2.1.0 2019-05-13 13:15:14 +01:00
Myles 362962dfb3 Merge pull request #1332 from Gerrygames/1.14.1
1.14.1
2019-05-13 13:10:48 +01:00
Gerrygames 77d572190e 1.14.1 2019-05-13 14:00:37 +02:00
Gerrygames 18f7459070 Java 8, FunctionalInterface remapper 2019-05-13 12:43:38 +02:00
Myles e71b08de3f Merge pull request #1323 from Gerrygames/abstraction
Abstract EntityTracker and MetadataRewriter
2019-05-13 11:26:59 +01:00
Gerrygames e8f8473e1c IEntityType -> EntityType 2019-05-13 12:04:03 +02:00
Myles 1d0d032431 Merge branch 'master' into dev 2019-05-12 13:01:08 +01:00
Myles fac7dafca5 Use fixed locale for toUpperCase/toLower #1126 2019-05-12 13:00:14 +01:00
Myles fbebf2d75e Merge pull request #1321 from creeper123123321/master
Not tested workaround for #1312
2019-05-10 22:57:22 +01:00
creeper123123321 a51f347371 Use readableBytes 2019-05-10 16:02:17 -03:00
Myles 6cee137780 Merge pull request #1325 from Gerrygames/1.14.1
1.14.1-pre2
2019-05-09 17:33:24 +01:00
Gerrygames 56b48a803a 1.14.1-pre2 2019-05-09 18:32:53 +02:00
Myles 3318d682fd Merge pull request #1324 from Gerrygames/1.14.1
1.14-pre2
2019-05-09 16:28:23 +01:00
Gerrygames 1fe3c337e1 1.14-pre2 2019-05-09 17:26:56 +02:00
Gerrygames 2442520ef3 use spaces 2019-05-09 15:07:20 +02:00
Gerrygames 44183f19cd @Override and protected 2019-05-09 14:46:24 +02:00
Gerrygames 23b68a867c abstract MetadataRewriter 2019-05-09 14:43:48 +02:00
creeper123123321 4d16dbf76f Not tested workaround for #1312 2019-05-08 20:38:55 -03:00
Gerrygames 6911d061a7 abstract EntityTracker 2019-05-08 12:14:41 +02:00
Myles ab9c0434e1 Merge pull request #1320 from Gerrygames/1.14.1
1.14.1
2019-05-07 17:23:20 +01:00
Gerrygames 3b932bd6b3 1.14.1 pre1 2019-05-07 18:19:34 +02:00
Myles 256839765a Merge pull request #1319 from KennyTV/master
Update text usage for latest Velocity build
2019-05-07 11:03:35 +01:00
KennyTV 46f9967dba Update text usage for latest Velocity build 2019-05-07 11:48:57 +02:00
Myles d91d47a755 Merge pull request #1317 from creeper123123321/master
Register tabcompletethread once - fixes #1316
2019-05-05 19:25:29 +01:00
creeper123123321 5a2c047e7a Register tabcompletethread once - fixes #1316 2019-05-05 14:16:24 -03:00
Myles 5ca8b0aef8 Merge pull request #1315 from creeper123123321/master
Add some needed tags
2019-05-01 22:11:13 +01:00
creeper123123321 e249ea1f0a fix tag ids - not tested 2019-05-01 16:54:09 -03:00
creeper123123321 e1b06d3872 Add some needed tags 2019-05-01 16:37:17 -03:00
Myles a4ed1644f3 Merge pull request #1314 from creeper123123321/master
Send set view distance on server change - not tested
2019-05-01 17:01:39 +01:00
creeper123123321 ad12866bf4 Send set view distance on server change - not tested 2019-05-01 12:52:53 -03:00
Myles b04acf98c7 Merge pull request #1313 from creeper123123321/master
Send light update before chunk packet, maybe better ByteBuf releasing…
2019-05-01 15:34:38 +01:00
creeper123123321 6b58d86248 Make PipelineUtil.containsCause check if the instance is of the class type 2019-05-01 11:31:36 -03:00
creeper123123321 7f6069e76b Send light update before chunk packet, maybe better ByteBuf releasing, ignore cancel exception on UserConnection#send 2019-05-01 11:15:48 -03:00
Myles 04d5ae074a Merge pull request #1305 from creeper123123321/master
Pose handling for 1.14
2019-04-30 22:00:29 +01:00
Myles 85067b2574 Merge pull request #1310 from Gerrygames/master
Faster light writing
2019-04-29 18:07:45 +01:00
Gerrygames 06340e593d faster light writing 2019-04-29 19:02:14 +02:00
Myles a896961fc4 Merge pull request #1309 from KennyTV/master
Fix paperpatch
2019-04-29 10:07:32 +01:00
KennyTV 73a62b8123 Fix paperpatch 2019-04-29 11:03:54 +02:00
creeper123123321 6d8a763f4c Don't send pose to the client entity 2019-04-27 17:39:45 -03:00
creeper123123321 61b5c90aa7 Recalculate pose when using or leaving bed 2019-04-27 17:21:01 -03:00
creeper123123321 d7eff51805 Not tested pose handling 2019-04-27 16:23:24 -03:00
Myles da7a57026d Merge pull request #1303 from KennyTV/master
Some minor optimization
2019-04-27 18:47:46 +01:00
Myles 643e3dc2da Merge pull request #1302 from creeper123123321/master
Workaround for packet order issue in neighbour chunk updates
2019-04-27 18:43:56 +01:00
creeper123123321 13086c7cac Fixed connecting after sending the packet 2019-04-27 14:03:48 -03:00
KennyTV 41b22e8951 Forgot return 2019-04-27 19:01:45 +02:00
KennyTV d76e70b1f7 Don't cache Item 2019-04-27 18:59:18 +02:00
KennyTV c7c5c79365 Some minor optimization 2019-04-27 18:36:01 +02:00
creeper123123321 87eceb5264 Use cached cancel exception when not in debug mode 2019-04-27 13:34:35 -03:00
creeper123123321 7b29972af0 Fix wrong protocol class 2019-04-27 13:12:19 -03:00
creeper123123321 4258f52f86 Workaround for packet order issue in neighbour chunk updates 2019-04-27 13:03:53 -03:00
Myles c3a7abd5f2 Merge pull request #1296 from KennyTV/master
Fix sign and banner placement in paperpatch
2019-04-26 20:57:37 +01:00
KennyTV a5f5472853 Fix sign and banner placement in paperpatch 2019-04-26 11:16:53 +02:00
Myles 63fc733c88 Merge pull request #1292 from Gerrygames/palette_fix
fix setPaletteEntry
2019-04-25 22:53:07 +01:00
Myles b5944f66a7 Merge pull request #1291 from KennyTV/master
Fix oversight in last pr
2019-04-25 22:52:47 +01:00
Gerrygames c8a19a1d83 fix setPaletteEntry 2019-04-25 22:16:19 +02:00
KennyTV 6ab525be7b Fix blockconnection 2019-04-25 22:05:32 +02:00
Myles fd1932cfd8 Merge pull request #1288 from creeper123123321/master
Fix husks
2019-04-25 11:44:41 +01:00
Myles 2eb9fe7e62 Merge pull request #1289 from KennyTV/master
Minor optimizations
2019-04-25 11:21:13 +01:00
KennyTV ac1943758d Remove unnecessary heightmap entries 2019-04-25 12:11:14 +02:00
KennyTV 1f86c6ab21 Slightly reduce map lookups 2019-04-25 11:50:55 +02:00
creeper123123321 44f8f5e66d Fix husks 2019-04-24 18:37:29 -03:00
Myles 0be8a56ba3 Back to snapshot 2019-04-24 19:57:19 +01:00
Myles 0b4d49d760 2.0.1 2019-04-24 19:52:39 +01:00
Myles 2bd266cd69 Merge pull request #1284 from creeper123123321/master
Force resend center chunk on respawn
2019-04-24 19:49:18 +01:00
creeper123123321 0380d80138 Force resend center chunk on respawn 2019-04-24 15:45:28 -03:00
Myles e297d825e3 Merge pull request #1283 from Gerrygames/master
1.14 heightmap
2019-04-24 17:43:07 +01:00
Gerrygames 53a639e7ae 1.14 heightmap 2019-04-24 18:40:03 +02:00
Myles a23b6feb46 Merge pull request #1275 from creeper123123321/patch-2
Add Velocity to readme
2019-04-24 10:51:48 +01:00
creeper123123321 603fe9cbd8 Add Velocity to readme 2019-04-24 05:39:51 -03:00
Myles 17d61b51e9 Merge pull request #1272 from creeper123123321/master
Set center chunk to 0,0 on respawn
2019-04-23 22:55:21 +01:00
creeper123123321 8d85106ee8 Set center chunk to 0,0 on respawn 2019-04-23 18:52:46 -03:00
Myles 0834610f8e Fix sneaking NPE 2019-04-23 22:23:37 +01:00
Myles 2e289a1d18 Fix encoding of position
Huge thanks to those involved on this goose hunt.
2019-04-23 22:15:05 +01:00
Myles b4418c02ca Fix Entity Tracker on Bungee being incorrect after server switch #1215 2019-04-23 21:29:51 +01:00
Myles 52b46a17cd Update chart 2019-04-23 18:20:03 +01:00
Myles 05e056a28b Cancel packets correctly so they don't mess bungee up 2019-04-23 17:28:26 +01:00
Myles 7b1eefb115 Avoid relocation issues on BungeeCord 2019-04-23 17:22:57 +01:00
Myles d50ceaa172 Back to snapshot 2019-04-23 16:33:07 +01:00
Myles 34b0db57ae Get ready.... 2019-04-23 16:16:49 +01:00
Myles 0c9de82e99 Merging went wrong 2019-04-23 16:02:18 +01:00
Myles 11ce8524ac Merge with master 2019-04-23 15:40:47 +01:00
Myles 4a8534c164 Refactor class names for protocols
The inconsistency was too much for me.
2019-04-23 15:34:17 +01:00
Myles 593b6fc3ac Merge branch 'master' into dev 2019-04-23 13:03:37 +01:00
Myles 33315bc271 Relocate Bungee chat api 2019-04-23 13:03:20 +01:00
Myles c3e406e95b Workaround villager packet causing issues 2019-04-23 13:02:18 +01:00
Myles dad71f1179 Rewrite inventory names which use .name syntax 2019-04-23 10:30:21 +01:00
Myles 03382ea987 Bump chat api version 2019-04-23 09:48:25 +01:00
Myles 54eed43f94 Merge branch 'master' into dev 2019-04-23 08:57:42 +01:00
Myles 404bc6725b Merge pull request #1267 from creeper123123321/master
Bossbar fix for delay-switch-until-joingame Velocity branch
2019-04-23 07:34:26 +01:00
creeper123123321 1b7b3d1d28 Bossbar fix for delay-switch-until-joingame Velocity branch 2019-04-22 20:11:54 -03:00
Myles d3662d226b Merge branch 'master' into dev 2019-04-22 18:56:29 +01:00
Myles d699000dc3 Default to 'packet' blockconnection method 2019-04-22 18:56:05 +01:00
Myles a18a1875d3 Merge pull request #1266 from KennyTV/hitbox-fix
Add option to fix hitboxes
2019-04-22 15:33:54 +01:00
KennyTV bf523c93d1 Use constants for heights 2019-04-22 16:17:34 +02:00
KennyTV b58cbf85e5 Hitbox fix options 2019-04-22 15:55:38 +02:00
KennyTV e38bdffc84 Hitbox fix options 2019-04-22 14:38:22 +02:00
Myles 89a01b3997 Merge pull request #1265 from Gerrygames/1.14
only update center chunk when needed
2019-04-22 10:44:10 +01:00
Gerrygames a4085c1a5a only update center chunk when needed 2019-04-22 11:42:42 +02:00
Myles 4fa57fd642 Merge pull request #1262 from creeper123123321/dev2
attack metadata handling
2019-04-21 23:36:25 +01:00
Myles 5f670a88a4 Merge pull request #1263 from creeper123123321/master
Check SessionHandler type before getting knownChannels
2019-04-21 23:35:59 +01:00
creeper123123321 2cadde1187 Remove debug 2019-04-21 18:57:11 -03:00
creeper123123321 bd7e36e38c Check SessionHandler type before getting knownChannels 2019-04-21 18:56:01 -03:00
creeper123123321 4eb69eac66 Run zombie rewrite before zombie villager rewrite 2019-04-21 16:50:41 -03:00
creeper123123321 8b5f6d1e67 fixed some metadata 2019-04-21 16:32:59 -03:00
creeper123123321 3a4db0a675 fixed 2019-04-21 15:57:40 -03:00
creeper123123321 b2352105e6 Handle new attack mode flag in insentient 2019-04-21 15:34:23 -03:00
Myles 70cb461c32 Merge pull request #1261 from KennyTV/dev
Remap areaeffectcloud particles
2019-04-21 19:23:22 +01:00
KennyTV f2628097ce Remap areaeffectcloud particles 2019-04-21 20:03:07 +02:00
Myles 49e85e2b8a Merge pull request #1260 from KennyTV/dev
Fix tridents (and building)
2019-04-21 17:53:43 +01:00
KennyTV d7353e01b0 Remove ')' 2019-04-21 18:52:53 +02:00
KennyTV 6674423ea4 Merge branch 'dev' of https://github.com/ViaVersion/ViaVersion into dev 2019-04-21 18:51:07 +02:00
Myles 918ee46ecc Merge pull request #1259 from creeper123123321/dev2
Fix velocity in item and arrow
2019-04-21 17:49:57 +01:00
creeper123123321 e34c291bd6 fix velocity in item and arrow 2019-04-21 13:46:17 -03:00
KennyTV 6c39966fef Fix tridents 2019-04-21 18:36:21 +02:00
Myles 32d6fd5386 Merge pull request #1257 from Gerrygames/1.14
1.14 Pre-Release 5
2019-04-18 13:47:22 +01:00
Gerrygames f64d5446a4 1.14 Pre-Release 5 2019-04-18 14:18:48 +02:00
Myles ed17f1bb50 Merge pull request #1254 from Gerrygames/1.14
1.14 Pre-Release 3
2019-04-16 17:01:30 +01:00
Gerrygames 8c27ead19e 1.14 Pre-Release 3 2019-04-16 16:22:58 +02:00
Myles 247cc1ebe8 Merge pull request #1253 from Gerrygames/1.14
1.14 Pre-Release 2
2019-04-13 10:59:41 +01:00
Gerrygames ea5ab1c2f5 1.14 Pre-Release 2 2019-04-13 11:45:22 +02:00
Myles 1e53803353 Merge pull request #1252 from creeper123123321/dev2
Resync the inventory when selecting trade
2019-04-11 16:15:29 +01:00
creeper123123321 6d1464d3f4 fix leave bed 2019-04-10 16:48:21 -03:00
creeper123123321 2d6defba11 Resync the inventory when selecting trade
Closes #1237
2019-04-10 15:05:27 -03:00
Myles 658822166a Merge pull request #1250 from Gerrygames/1.14
fix horse equipment packet id
2019-04-10 16:45:16 +01:00
Gerrygames 4c6ee807a7 fix horse equipment packet id 2019-04-10 17:43:42 +02:00
Myles 32b7d37861 Merge pull request #1249 from Gerrygames/1.14
1.14 Pre-Release 1
2019-04-10 16:29:16 +01:00
Gerrygames afe767c6db 1.14 Pre-Release 1 2019-04-10 17:28:12 +02:00
Myles b37430994d Merge pull request #1248 from Gerrygames/1.14
fix open sign editor
2019-04-07 14:47:36 +01:00
Gerrygames c51373dc9a fix open sign editor 2019-04-07 15:39:10 +02:00
Myles 421a5e8141 Merge branch 'master' into dev 2019-04-06 13:31:44 +01:00
Myles 9fe19e763a Update GitHub + chat links 2019-04-06 13:31:33 +01:00
Myles 6731ade5d9 Merge pull request #1247 from creeper123123321/master
More plugin messages
2019-04-06 13:09:48 +01:00
creeper123123321 cf3eb8b993 More plugin messages 2019-04-06 09:05:23 -03:00
Myles 5333c38972 Merge pull request #1245 from creeper123123321/dev2
Use set center chunk packet
2019-04-05 21:33:27 +01:00
creeper123123321 d9e057eb4f Use set center chunk packet 2019-04-05 17:13:26 -03:00
Myles 33cd80da7e Merge pull request #1244 from Gerrygames/1.14
19w14b
2019-04-05 17:50:37 +01:00
Gerrygames 8231b3aebe 19w14b 2019-04-05 18:48:38 +02:00
Myles 7fbbc5f4b8 Merge pull request #1242 from KennyTV/dev
Actually fix book opening
2019-04-04 19:32:40 +01:00
KennyTV 91687339bf Actually fix book opening 2019-04-04 20:28:02 +02:00
Myles b3181d1429 Merge pull request #1241 from Gerrygames/1.14
19w14a
2019-04-03 18:41:57 +01:00
Gerrygames 3ef8aa9e7f 19w14a 2019-04-03 19:39:39 +02:00
Myles 1a7195386c Merge pull request #1239 from creeper123123321/master
Fix invisible renamed banners
2019-04-02 19:49:43 +01:00
creeper123123321 77acdc1a17 Fix invisible renamed banners 2019-04-02 15:40:19 -03:00
Myles aecf9fb9b1 Merge pull request #1236 from ViaVersion/master
merge master into dev
2019-03-30 18:23:09 +00:00
Myles c8d1304e7f Merge pull request #1230 from creeper123123321/dev2
read nbt in 1.14 chunk, pose metatype, don't change ping protocol if …
2019-03-30 14:07:22 +00:00
Myles 796a508af0 Merge pull request #1235 from creeper123123321/gerry1.14
19w13b + chunk loading on join fixes
2019-03-30 14:07:06 +00:00
creeper123123321 6751acb6c4 Generated mappings for 13b 2019-03-30 10:00:54 -03:00
creeper123123321 475fb97730 19w13b and workaround for chunks not loading near to world border on 1.13.2 on join 2019-03-30 09:26:31 -03:00
Gerrygames acee33aae6 fix chunk loading in 19w13a 2019-03-27 20:16:26 +01:00
Gerrygames 65f60098c8 19w13a 2019-03-27 19:08:53 +01:00
creeper123123321 19a75abaf3 read nbt in 1.14 chunk, pose metatype, don't change ping protocol if different from provider 2019-03-24 13:07:03 -03:00
Myles fa36de2c78 Merge pull request #1229 from creeper123123321/master
Update OpenNBT
2019-03-24 14:05:09 +00:00
creeper123123321 0f49ce2f9d Update OpenNBT 2019-03-24 10:59:51 -03:00
Myles 73b24657f5 Merge pull request #1225 from creeper123123321/master
Don't connect fences to stairs
2019-03-23 19:24:38 +00:00
creeper123123321 e03db26530 Fix numeric ids that doesn't need string remap 2019-03-23 16:23:15 -03:00
creeper123123321 3fd3777e8c Don't connect fences to stairs 2019-03-22 15:18:41 -03:00
Myles 7ad73cd476 Merge pull request #1223 from creeper123123321/master
convert numerical ids to string ids on canplaceon/candestroy
2019-03-21 21:07:34 +00:00
creeper123123321 c5e0fcae9a convert numerical ids to string ids on canplaceon/candestroy 2019-03-21 17:48:14 -03:00
Myles 4ca25df410 Merge pull request #1222 from Gerrygames/1.14
19w12b
2019-03-21 16:19:31 +00:00
Gerrygames 56b5986fc5 19w12b 2019-03-21 17:04:33 +01:00
Myles 05c1a31f00 Merge pull request #1221 from Gerrygames/1.14
19w12a
2019-03-20 18:09:06 +00:00
Gerrygames e0b88b750d 19w12a 2019-03-20 14:27:28 +01:00
Myles b0c2d6f71c Merge pull request #1219 from creeper123123321/master
ignore non-identifier format on plugin messages
2019-03-18 21:37:21 +00:00
creeper123123321 4e28a10aaa ignore non-identifier format on plugin messages 2019-03-18 15:11:35 -03:00
Myles 49205f0361 Merge branch 'master' into dev 2019-03-18 11:30:19 +00:00
Myles 47819180c4 Rework previous commit + Introduce injection information to dump 2019-03-18 11:30:02 +00:00
Myles be3fa19c0a Consistency: itruncate1_14Books -> isTruncate1_14Books 2019-03-17 16:11:36 +00:00
Myles 32a2734082 Merge branch 'master' into dev 2019-03-17 16:10:38 +00:00
Myles b28b0c3018 Fix last commit 2019-03-17 16:05:24 +00:00
Myles ee5eb59e42 Revert unnecessary synchronizes in ListWrapper
Usually the list we're wrapping is synchronized, so instead we'll ensure our code can be run concurrently.

There might be issues with other plugins and this change (but it's unlikely), open a issue if you see any of these after this change.
2019-03-17 16:04:13 +00:00
Myles d3f4d8dd41 Merge pull request #1217 from Gerrygames/1.14
19w11a
2019-03-15 20:27:18 +00:00
Gerrygames d44ecaabf7 send difficulty instead of ignoring it 2019-03-13 19:03:22 +01:00
Myles d133ca4a0f Merge pull request #1211 from creeper123123321/master
Trying to fix main hand on bungee, handle left handed on 1.8 using 0x80
2019-03-13 17:50:03 +00:00
Gerrygames f8df3239d5 "fix" trade list 2019-03-13 18:07:09 +01:00
Gerrygames f9d957a827 19w11a 2019-03-13 17:53:17 +01:00
creeper123123321 bef3e3d18f process translate on command block entity 2019-03-10 16:36:30 -03:00
creeper123123321 aca764c288 fix command block #1212 2019-03-10 16:18:41 -03:00
creeper123123321 3c0282b04f Fix missing villager sound remap 2019-03-10 07:30:09 -03:00
Myles d8c081b8d3 Merge pull request #1213 from KennyTV/dev
Try to fix particles
2019-03-08 14:46:30 +00:00
KennyTV 53ca96f158 Fix particles 2019-03-07 23:59:31 +01:00
KennyTV f8895c7c78 Try to fix particles 2019-03-07 23:11:09 +01:00
creeper123123321 12b45d95e0 Trying to fix main hand on bungee, handle left handed on 1.8 using 0x80 2019-03-05 19:47:58 -03:00
Myles 1cdfeadd86 Merge pull request #1210 from KennyTV/dev
Fix minecart data
2019-03-04 15:46:27 +00:00
KennyTV 15fec93bf1 Fix minecart data 2019-03-04 16:42:22 +01:00
Myles 64d2de010d Fix Minecart typo (thanks KennyTV) 2019-03-04 11:37:38 +00:00
Myles ad1cd2c993 Merge pull request #1208 from KennyTV/dev
Add option to truncate edited books with more than 50 pages on 1.14
2019-03-04 09:34:41 +00:00
KennyTV 687de97fcd Use read instead of passthrough 2019-03-04 10:30:06 +01:00
KennyTV 9d0331e190 Add option to truncate edited books with more than 50 pages 2019-03-04 10:14:52 +01:00
Myles ca863ba8c6 Merge pull request #1207 from KennyTV/dev
Fix book opening
2019-03-03 13:29:29 +00:00
Myles b9a2279966 Merge pull request #1206 from ViaVersion/master
merge master into dev
2019-03-03 13:29:00 +00:00
KennyTV 9a91250af7 Fix books 2019-03-03 13:40:17 +01:00
Myles 05d01e70b7 Merge pull request #1205 from creeper123123321/master
Fix 1.9 chunk missing blocks, update travis badge url
2019-03-02 20:08:50 +00:00
creeper123123321 6b313cb65e Fix 1.9 chunk missing blocks, update travis badge url 2019-03-02 17:07:23 -03:00
Myles a4de84b6da Merge pull request #1204 from Gerrygames/1.14
19w09a
2019-02-27 16:40:07 +00:00
Gerrygames 31550bd010 19w09a 2019-02-27 17:03:38 +01:00
Myles 5d63c359b3 Merge pull request #1202 from creeper123123321/master
Workaround packet order for team packets
2019-02-25 17:37:29 +00:00
creeper123123321 8283816418 Fix team remove 2019-02-24 15:53:43 -03:00
creeper123123321 44be8b3791 unnecessary cancel when auto-team is disabled 2019-02-24 15:07:34 -03:00
creeper123123321 f46a2bb618 Bungee auto-team, bump BungeeCord version, workaround for block connections 2019-02-24 15:02:09 -03:00
creeper123123321 96366aae42 Fix NPE when block connection is disabled 2019-02-23 20:12:49 -03:00
Myles fd8879b46d Merge branch 'master' into dev 2019-02-23 22:34:16 +00:00
creeper123123321 d962ef09ff workaround packet order for team packets 2019-02-23 13:44:41 -03:00
Myles b26d2ef906 Merge pull request #1201 from creeper123123321/master
Some block connection changes, fix memory leak on Velocity, Sponge and Bungee
2019-02-23 14:32:16 +00:00
creeper123123321 0613886659 Fix memory leak 2019-02-23 10:12:25 -03:00
creeper123123321 75d7ffb447 Should be 15 2019-02-23 09:30:07 -03:00
creeper123123321 0b5c173945 Send multi block change on chunk updates, use separate for loops 2019-02-23 09:01:40 -03:00
Myles f170aed1b9 Merge pull request #1199 from Gerrygames/1.14
19w08b
2019-02-22 15:51:18 +00:00
Gerrygames 1921b46a66 19w08b 2019-02-21 17:21:57 +01:00
Gerrygames bccf90b093 fix horse armor 2019-02-20 21:02:09 +01:00
Gerrygames deebc83f1e still send animation 2019-02-20 20:36:45 +01:00
Gerrygames a319df630d fix use/leave bed 2019-02-20 20:28:14 +01:00
Gerrygames ab5eb2c7ef 19w08a metadata changes 2019-02-20 20:12:20 +01:00
Gerrygames 3de06c269d 19w08a 2019-02-20 18:01:21 +01:00
Myles 876839348c Merge pull request #1193 from creeper123123321/master
Cleanup ConnectionData#update and fix doors
2019-02-17 10:30:49 +00:00
Myles 755e8a007a Merge pull request #1194 from creeper123123321/dev
firework boost, set metatype to the newer class
2019-02-16 16:52:08 +00:00
creeper123123321 6a2e1a8114 Support ViaBackwards 1.13 with Velocity modern forwarding 2019-02-15 13:51:54 -02:00
creeper123123321 11b25151f7 Remove uuid tracking 2019-02-13 17:00:01 -02:00
creeper123123321 35bb80d67a firework boost, set metatype to the newer class 2019-02-13 16:42:59 -02:00
creeper123123321 7859f5ebd6 Cleanup ConnectionData#update and fix doors 2019-02-13 16:03:22 -02:00
Myles f38d753341 Merge pull request #1192 from Gerrygames/1.14
19w07a
2019-02-13 17:22:52 +00:00
Gerrygames d1007bbb38 19w07a 2019-02-13 17:50:07 +01:00
Myles 0886fdabd3 Merge pull request #1190 from creeper123123321/master
NPE fixes, warn instead of exception
2019-02-11 19:22:33 +00:00
creeper123123321 891f8b143f Shift 4 bits to left in chunk unloading 2019-02-11 17:01:27 -02:00
creeper123123321 7856716a3a Warn instead of blowing up everything 2019-02-11 16:48:26 -02:00
creeper123123321 4eb4b2c37f Use ByteBuf#order, more sanity check on block entity handler 2019-02-10 16:05:32 -02:00
Myles 1be617c110 Merge branch 'master' into dev 2019-02-10 16:45:34 +00:00
Myles f1743e5912 Merge pull request #1186 from creeper123123321/tabdelay
Tab delaying
2019-02-10 16:42:05 +00:00
Myles 102c1f99a7 Merge pull request #1189 from creeper123123321/master
Fix duplicate packet registering
2019-02-10 16:41:39 +00:00
creeper123123321 ae3434cb89 Fix duplicate packet registering 2019-02-10 14:05:58 -02:00
creeper123123321 63b743f85b Use only one task for tab completing 2019-02-07 14:07:30 -02:00
Myles 73f6418db3 Merge pull request #1167 from KennyTV/master
Reduce memory use for blockconnections
2019-02-06 23:00:51 +00:00
KennyTV d9c25b1acc Merge master 2019-02-06 22:14:00 +01:00
Myles 6c18fdb175 Merge pull request #1156 from creeper123123321/master
trying to optimize block connection storage
2019-02-06 21:08:26 +00:00
Myles cd009388a4 Merge pull request #1187 from creeper123123321/snowygrass
Connect grass block to snow
2019-02-06 21:08:07 +00:00
creeper123123321 d66c2f2f5d Connect grass block to snow
(cherry picked from commit 69b0d43c9825d896374fc26246410530c5b7495f)
2019-02-06 18:55:17 -02:00
Myles 7534904737 Merge pull request #1185 from creeper123123321/fixparticleandtranslations
Fix particles and translations with %d
2019-02-06 20:54:26 +00:00
creeper123123321 bce3593110 Tab delaying
(cherry picked from commit 386de52b9db1454e0fcec56ef9bfcd2c3a0f8d4a)
2019-02-06 18:53:24 -02:00
creeper123123321 9a92d180d0 Fix typo 2019-02-06 18:51:04 -02:00
creeper123123321 a203c17e06 Fix reddust, particle metadata rewriting, translations 2019-02-06 18:50:31 -02:00
Myles 69b5134b5f Merge pull request #1184 from Gerrygames/1.14
19w06a
2019-02-06 17:00:06 +00:00
Gerrygames 8c543ee97f 19w06a 2019-02-06 17:56:19 +01:00
KennyTV bafa6edd28 Fix some stair and lever connections 2019-02-03 00:22:49 +01:00
Myles 799567579b Update License to 2019 2019-01-31 10:48:52 +00:00
Myles c10e61a165 Merge pull request #1178 from Gerrygames/1.14
remove 1.14 object type (Mojang removed objcet trype in 19w05a)
2019-01-30 16:53:13 +00:00
Gerrygames a27e439c99 remove 1.14 object type (Mojang removed objcet trype in 19w05a)
fix entity type remaps
2019-01-30 17:48:11 +01:00
Myles e224d9daa2 Merge pull request #1177 from Gerrygames/1.14
19w05a
2019-01-30 16:17:47 +00:00
Gerrygames 91d9f99c70 19w05a 2019-01-30 17:16:06 +01:00
Myles c57f0d90bb Merge pull request #1173 from creeper123123321/dev
Fix item deserializing
2019-01-27 14:19:40 +00:00
creeper123123321 e9198e7946 Arrow and firework metadata rewriting, remap ocelot to cat for now 2019-01-25 15:37:44 -02:00
creeper123123321 25d1b08a6f 19w04b 2019-01-25 14:28:24 -02:00
creeper123123321 50395da626 Fix item deserializing 2019-01-25 10:01:24 -02:00
Myles 2d0209b221 Merge pull request #1172 from Gerrygames/1.14
19w04a
2019-01-24 15:59:09 +00:00
Gerrygames 44330c98b7 19w04a 2019-01-24 16:58:37 +01:00
Gerrygames b7f72bf55d 19w04a 2019-01-24 16:56:59 +01:00
creeper123123321 f6d7976eff Use old ids and byte[] + NibbleArray for block connections 2019-01-21 12:58:05 -02:00
creeper123123321 f45a727396 remove short array used for checking if array is empty 2019-01-21 12:58:05 -02:00
creeper123123321 d5f65eceb0 don't create chunksection on remove 2019-01-21 12:58:05 -02:00
creeper123123321 2285c453da fixed encodeblockpos, use map<long, short[]> 2019-01-21 12:58:04 -02:00
creeper123123321 193084927b store constructor 2019-01-21 12:58:04 -02:00
creeper123123321 1325d53950 Don't use netty collections 2019-01-21 12:58:04 -02:00
creeper123123321 fa1b56a7cf use short 2019-01-21 12:58:04 -02:00
creeper123123321 de11f1f90b trying to optimize blockconnectionstorage 2019-01-21 12:57:56 -02:00
Myles 9ba70424e8 Fix armour update on item break #1157 2019-01-20 17:01:14 +00:00
Myles c5ba5b4647 Ensure pipeline parts exist before injecting #1168 2019-01-20 16:47:50 +00:00
KennyTV 8e47497edb Use keyset instead of entryset 2019-01-20 15:03:47 +01:00
KennyTV 7f7dcffdf0 Forgot to assign a value 2019-01-19 19:59:17 +01:00
KennyTV 9d8a2a9680 Don't cycle through mappings in every connection handler 2019-01-19 19:19:24 +01:00
KennyTV 880df7a482 Remove unmapped blockconnection data 2019-01-19 19:17:55 +01:00
Myles a016eade01 Merge pull request #1162 from creeper123123321/proxybossbarfix
Fix bungee and velocity boss bar, implement Velocity channel workaround
2019-01-19 15:58:12 +00:00
Myles b3167c450e Merge pull request #1166 from Gerrygames/master
fix powered levers
2019-01-19 15:57:42 +00:00
Gerrygames 6ea37c1f17 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion 2019-01-18 18:45:34 +01:00
Gerrygames 17c5849f33 fix powered levers 2019-01-18 18:45:05 +01:00
creeper123123321 7e8bd606fe remove commented code 2019-01-18 14:34:51 -02:00
Myles 51e4076084 Merge pull request #1165 from Gerrygames/1.14
fix the fix for stone slab mapping
2019-01-18 16:31:20 +00:00
Gerrygames ff0ec98a27 fix the fix for stone slab mapping 2019-01-18 17:29:48 +01:00
Myles bbe4e5e7f5 Merge pull request #1163 from Gerrygames/master
fix lever mapping
2019-01-18 16:20:43 +00:00
Myles 47c25a0e5e Merge pull request #1164 from Gerrygames/1.14
19w03c + stone slab mapping fix
2019-01-18 16:20:25 +00:00
Gerrygames 553e56fe4c fix stone slab mapping 2019-01-18 17:18:17 +01:00
Gerrygames bea5d39ed5 19w03c 2019-01-18 17:17:54 +01:00
Gerrygames f6932e09f7 fix lever mapping 2019-01-18 14:07:27 +01:00
creeper123123321 44ca95bf85 Fix bungee and velocity boss bar, implement Velocity channel workaround 2019-01-18 08:05:23 -02:00
Myles 5ba7c4ba2c Merge pull request #1160 from Gerrygames/master
fix fence connections to stairs
2019-01-17 11:48:17 +00:00
Gerrygames 605e63e1df fix fence connections to stairs, remove waterlogged blocks from stair data 2019-01-17 12:22:36 +01:00
Myles bf34ea11bd Merge pull request #1158 from Gerrygames/1.14
19w03a
2019-01-16 17:46:52 +00:00
Gerrygames 7102214c9e 19w03a 2019-01-16 18:44:37 +01:00
Myles e60447ecd2 Merge pull request #1154 from creeper123123321/dev
not tested villager metadata rewriting
2019-01-15 17:32:11 +00:00
Myles 77a57d2243 Merge branch 'master' into dev 2019-01-12 17:42:47 +00:00
Myles b129ef04f3 Merge pull request #1148 from KennyTV/master
Add fixes for custom flowerstems and snowcollision for 1.13 clients
2019-01-12 17:42:17 +00:00
Myles 1f41893aab Merge pull request #1150 from creeper123123321/master
Fix new velocity version
2019-01-12 15:08:31 +00:00
creeper123123321 c8e8f39f9d Fix new velocity version 2019-01-12 12:45:13 -02:00
Myles 4a79e23485 Merge pull request #1147 from Gerrygames/1.14
19w02a
2019-01-10 21:28:29 +00:00
KennyTV 20654b0a77 Add convenience config options
Add option to send all flowerparts for 1.13+ as stems if a block is above
Add option to send 1-layer snow as 2-layers for 1.13+ to fix collision
2019-01-09 21:48:04 +01:00
creeper123123321 8d77891f76 not tested villager metadata rewriting 2019-01-09 17:26:06 -02:00
Gerrygames bea74661d1 19w02a 2019-01-09 18:26:08 +01:00
Myles 6b7bf843a1 Merge branch 'master' into dev 2019-01-09 16:30:29 +00:00
Myles 200ccfd092 Use HTTPS for update checking 2019-01-09 16:29:10 +00:00
Myles 67a0a47778 Merge pull request #1143 from creeper123123321/master
Auto-team fix
2019-01-08 22:59:29 +00:00
creeper123123321 933e8cbaed set auto-team to false on join packet 2019-01-08 20:49:17 -02:00
creeper123123321 daac2baf8e Resend viaversion team when removed from the current team 2019-01-08 20:47:08 -02:00
Myles 4a2bcf6fde Merge pull request #1142 from creeper123123321/master
Use ProtocolInfo#getServerProtocolVersion for block connection, use b…
2019-01-08 16:04:15 +00:00
creeper123123321 cd7774f056 Use ProtocolInfo#getServerProtocolVersion for block connection, use bungee and velocity version if not ported 2019-01-08 13:58:24 -02:00
Myles 452fb4f990 Merge pull request #1139 from creeper123123321/dev
Fix lore
2019-01-07 19:30:54 +00:00
creeper123123321 1f72ddb8a1 Fix lore 2019-01-06 17:27:41 -02:00
Myles 9af078bb8c Merge pull request #1135 from creeper123123321/dev
fix sign crash
2019-01-06 11:27:04 +00:00
creeper123123321 c88655a2a0 fix player digging 2019-01-06 09:08:29 -02:00
creeper123123321 a27efd94c8 oops 2019-01-06 08:43:25 -02:00
creeper123123321 9a26ac380a send signs tags 2019-01-06 08:28:08 -02:00
Myles 240653c429 Merge pull request #1133 from creeper123123321/patch-1
Add "blockconnection-method" to VelocityViaConfig#UNSUPPORTED
2019-01-04 15:03:14 +00:00
creeper123123321 bac3a76d9a Add "blockconnection-method" to VelocityViaConfig#UNSUPPORTED 2019-01-04 12:26:30 -02:00
Myles 3a4aed0b34 Merge pull request #1122 from Gerrygames/1.14
fix book signing and opening in 18w50a
2018-12-15 20:16:30 +00:00
Gerrygames 7f5073476c fix book signing and opening in 18w50a 2018-12-15 20:57:17 +01:00
Myles 1abc3ebea6 Merge pull request #1121 from creeper123123321/master
CanPlaceOn, CanDestroy
2018-12-15 11:43:51 +00:00
creeper123123321 c21003e1b7 CanPlaceOn, CanDestroy 2018-12-15 09:13:19 -02:00
Myles 1fd0211725 Merge pull request #1120 from creeper123123321/master
ProtocolVersion#SUPPORTED_VERSIONS, relocate javassist
2018-12-13 11:57:05 +00:00
creeper123123321 1932c7af4f ProtocolVersion#SUPPORTED_VERSIONS, relocate javassist 2018-12-13 09:47:58 -02:00
Myles 94422dab77 Merge pull request #1119 from creeper123123321/master
Fix breaking change caused by VelocityPowered/Velocity@853fd22
2018-12-13 10:03:45 +00:00
creeper123123321 b10ca3ebcf Fix breaking change caused by VelocityPowered/Velocity@853fd22 2018-12-13 07:41:05 -02:00
Myles aa2ff4b741 Merge pull request #1118 from Gerrygames/1.14
18w50a
2018-12-12 19:57:23 +00:00
Gerrygames 284a462936 18w50a 2018-12-12 20:48:52 +01:00
Myles 858e0a5b21 Merge pull request #1117 from creeper123123321/master
Fix mappings, fixing shift click on furnaces
2018-12-10 19:46:09 +00:00
creeper123123321 eaa8e05373 Fix mappings, fixing shift click on furnaces 2018-12-10 17:23:29 -02:00
Myles 3e3d338ed0 Merge pull request #1116 from creeper123123321/master
Recipe book
2018-12-10 15:09:20 +00:00
creeper123123321 0c5f5c6e3f remove debug 2018-12-10 12:56:45 -02:00
creeper123123321 7c6118bd6f facepalm 2018-12-10 12:54:06 -02:00
creeper123123321 7fe99c98f0 clicking in recipe doesn't work 2018-12-10 12:54:06 -02:00
creeper123123321 d6c4c18d35 still not working 2018-12-10 12:54:06 -02:00
creeper123123321 649676e811 trying recipes, currently not working 2018-12-10 12:54:05 -02:00
Myles 98c0985657 Merge branch 'master' into dev 2018-12-07 21:15:49 +00:00
Myles 43e93e74b1 Merge pull request #1113 from creeper123123321/master
Fix chunk writing
2018-12-07 21:14:18 +00:00
creeper123123321 ba7817170b Fix chunk writing 2018-12-07 19:10:40 -02:00
Myles 88279906b5 Merge pull request #1108 from Gerrygames/1.14
18w49a
2018-12-06 08:45:13 +00:00
Gerrygames 134987cb20 18w49a 2018-12-06 09:32:53 +01:00
Myles 7b880ae967 Fix type being byte instead of int 2018-12-05 19:13:26 +00:00
Myles 7e8e3fef61 Merge branch 'master' into dev 2018-12-05 19:10:52 +00:00
Myles c1147cb9f7 Formatting 2018-12-05 19:08:55 +00:00
Myles 54b35ef075 Merge branch 'master' into dev 2018-12-05 19:02:50 +00:00
Myles fba0a59324 Merge pull request #1107 from creeper123123321/master
Change Chunk#getBiomeData() to int[]
2018-12-05 19:01:25 +00:00
creeper123123321 c5c7d36bd1 Change Chunk#getBiomeData() to int[] 2018-12-05 16:52:53 -02:00
Myles 83ba55dda5 Merge pull request #1104 from Gerrygames/block-connections-master
fix BlockConnectionStorage not being initialized
2018-12-03 08:26:46 +00:00
Gerrygames 000fff210a fix BlockConnectionStorage not being initialized 2018-12-03 09:21:07 +01:00
Myles 8965b22f6d Merge branch 'master' into dev 2018-12-02 12:38:10 +00:00
Myles 4023f2412d Merge pull request #1093 from Gerrygames/block-connections-master
Implement 'serverside-blockconnection' for block-connections.
2018-12-02 12:28:58 +00:00
Myles 27d56caa48 Merge pull request #1100 from creeper123123321/master
Make Travis test compiling with Java 11
2018-11-29 15:36:14 +00:00
Myles 0cc1146f0e Merge pull request #1103 from Gerrygames/1.14
18w48a
2018-11-29 15:34:53 +00:00
Gerrygames 8aa7b749ca 18w48a 2018-11-29 16:31:39 +01:00
creeper123123321 55fad45a6c Update Lombok to make compile on Java 11 2018-11-26 16:30:18 -02:00
creeper123123321 22cc12e7a9 Try to compile with Java 11 2018-11-26 16:30:12 -02:00
Myles 2812b121ab Merge pull request #1099 from creeper123123321/master
Fix Velocity platform breaking changes
2018-11-26 18:02:41 +00:00
creeper123123321 ad3465f0d3 Fix Velocity platform breaking changes 2018-11-26 15:58:17 -02:00
Marco Neuhaus fc8b55dce7 fix spelling mistake 2018-11-24 18:42:00 +01:00
Myles 62d67e9a38 Merge pull request #1095 from Gerrygames/1.14
18w47a
2018-11-21 16:23:30 +00:00
Gerrygames 079cd7210b 18w47a 2018-11-21 17:20:26 +01:00
Gerrygames b60c56f464 Tripwire connections 2018-11-19 09:28:37 +01:00
Gerrygames eb1571d3e4 init ConnectionData 2018-11-17 16:10:13 +01:00
Gerrygames 9a13eb36b3 Serverside block-connections! 2018-11-17 15:45:37 +01:00
Myles 9ba5cc1f98 Merge branch 'master' into dev 2018-11-17 14:11:04 +00:00
Myles 2778ec0d9d Merge pull request #1060 from creeper123123321/dev
Change item id to int, fix valid string being considered as invalid + tests
2018-11-17 13:48:31 +00:00
Myles 20b0954f8c Missed one - oops 2018-11-17 13:47:58 +00:00
Myles 69aa7be6c5 Refactor tests to be one general test per method and include plugin 2018-11-17 13:46:32 +00:00
Myles 73dccbaf24 Merge branch 'pr/1045' 2018-11-17 13:15:20 +00:00
Myles 66d836739c Merge pull request #1092 from Gerrygames/chunk-refactor
Chunk refactor
2018-11-17 13:14:27 +00:00
Myles ab1c44c4fb Propose 2.0.0 snapshot as this version contains several API breaking changes 2018-11-17 13:13:55 +00:00
Myles 8549c22567 Change the name of the config class to be more consistent 2018-11-17 13:12:19 +00:00
Myles d0300de136 Prevent initialization error 2018-11-17 13:08:51 +00:00
Marco Neuhaus 34c701e039 fix chunk unload packet 2018-11-17 13:46:53 +01:00
Gerrygames cf0bd6f021 Use List and Map, fixes duplicate block ids in palette causing issues 2018-11-17 13:38:48 +01:00
Gerrygames 3b14dd3b04 Use methods for palette rewriting, fix "value already present" 2018-11-17 13:38:42 +01:00
Gerrygames 9a87adf51b Use BiHashMap as palette 2018-11-17 13:38:29 +01:00
Gerrygames ce65c7f583 fix merge issues 2018-11-17 13:36:35 +01:00
Gerrygames 82013d5737 Keep Chunk as an interface 2018-11-17 13:35:44 +01:00
Gerrygames 14377ca354 Use types for ChunkSections 2018-11-17 13:35:34 +01:00
Myles 75664961b8 Merge pull request #1090 from Gerrygames/1.14
18w46a
2018-11-16 09:55:02 +00:00
Gerrygames c5969c303e 18w46a 2018-11-15 15:44:50 +01:00
Myles f4b6b1795e Merge pull request #1085 from Gerrygames/myles_master
fix #1076
2018-11-13 10:05:09 +00:00
Gerrygames b86950d0e7 fix #1076 2018-11-13 10:59:11 +01:00
creeper123123321 3ef1ac06df fix version, detect velocity implementation, fix npe, fix detectorservice 2018-11-12 15:05:52 -02:00
creeper123123321 4c07b6d28d Squash Velocity platform commits
incomplete velocity code

untested velocity version detector

update velocity module version

Injecting, but not working

facepalm

Fix handler type

Should work now

will it work now?

it works!!!

fix npe in command tab completion

Do not forward command to server

implement server changing with different versions
thanks @Leymooo

Fix memory leaks

maybe cleaner code?

trying to port mainhandpatch, added todo

fix version

Use separated protocol version, add todo

Trying to mitigate UserConnection#toServer concurrent issue

port elytrapatch

it works but horribly and needs a modification in velocity

replace with a semaphore and EventLoop#submit

Lock for incoming packets

fix version

remove some TODOs

Listen to DisconnectEvent

Relocate snakeyaml
2018-11-12 15:05:48 -02:00
Myles 7f77cbfd74 Merge pull request #1081 from creeper123123321/master
Use less ram on translation mappings
2018-11-12 16:45:19 +00:00
Myles ca716a65d2 Merge pull request #1084 from Gerrygames/faster_palette
Faster palette
2018-11-12 16:44:47 +00:00
Gerrygames 4be46cd51d Use List and Map, fixes duplicate block ids in palette causing issues 2018-11-12 17:10:19 +01:00
Gerrygames bb2b8bc538 Use methods for palette rewriting, fix "value already present" 2018-11-12 16:08:01 +01:00
Gerrygames 41ef4f6284 Use BiHashMap as palette 2018-11-12 14:36:01 +01:00
creeper123123321 cfd3179cb8 try to eat less ram 2018-11-11 11:57:33 -02:00
Myles 1a3170c7db Merge pull request #1077 from creeper123123321/translations
Translation rewriting
2018-11-10 10:45:21 +00:00
Myles 25463a929a Merge pull request #1078 from creeper123123321/master
fix set cooldown
2018-11-10 10:44:34 +00:00
creeper123123321 408bd49120 fix set cooldown 2018-11-10 08:41:22 -02:00
creeper123123321 3fc2d28b95 fix npe 2018-11-08 16:18:20 -02:00
creeper123123321 d9eff7bb5c Translation rewriting 2018-11-08 16:11:01 -02:00
Myles 4b1c291fca Merge pull request #1075 from Gerrygames/1.14
18w45a
2018-11-08 16:51:30 +00:00
Gerrygames 0b34b65f76 add sound and block id mappings 2018-11-08 14:40:02 +01:00
Gerrygames ccb5ceb9b3 use blockmapping for air ids 2018-11-08 13:46:02 +01:00
Gerrygames 9fac4f9de4 18w45a 2018-11-08 13:43:38 +01:00
Myles d84c4365c9 Merge pull request #1069 from creeper123123321/master
color rewriting changes
2018-11-04 13:08:10 +00:00
creeper123123321 bec27e0fa6 Use ChatColor.COLOR_CHAR 2018-11-04 10:51:29 -02:00
creeper123123321 437b02c961 color rewriting changes 2018-11-04 08:56:22 -02:00
Myles e6922eae46 Don't use -1 if provided by ProtocolDetectorService on Bungee #1064 2018-11-01 22:41:56 +00:00
Gerrygames b92f4070d4 calculate non-air blocks correctly 2018-11-01 19:07:10 +01:00
Myles b9750be745 Merge pull request #1066 from creeper123123321/master
Tolerate some identifiers. Should fix #1063
2018-11-01 15:58:31 +00:00
Gerrygames 973b473100 don't use NotImplementedException 2018-10-31 20:28:14 +01:00
creeper123123321 b7606aece0 Tolerate some identifiers. Should fix #1063 2018-10-31 16:26:55 -03:00
Gerrygames 3f62730404 forgot some entity ids 2018-10-31 18:57:18 +01:00
Gerrygames c58b28fd00 18w44a 2018-10-31 18:51:54 +01:00
creeper123123321 149b3c2e29 fix player digging 2018-10-31 14:48:28 -03:00
Myles a412df00c4 Merge pull request #1065 from Gerrygames/1.14
remap items in advancements for 18w43c
2018-10-29 19:40:50 +00:00
Gerrygames aa067d4073 Merge branch 'myles_dev' into 1.14
# Conflicts:
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/Protocol1_14To1_13_2.java
2018-10-29 20:16:06 +01:00
Gerrygames 4c8917c6a0 remap items in advancements 2018-10-29 20:08:37 +01:00
Myles 78aefa936f Minor bug report typo 2018-10-28 16:38:53 +00:00
Myles 2c18adf202 Delete ISSUE_TEMPLATE.md 2018-10-28 16:38:08 +00:00
Myles 083f401ee5 Update issue templates 2018-10-28 16:30:26 +00:00
creeper123123321 6652a7fd83 Change item id to int, fix valid string being considered as invalid, tests 2018-10-27 11:55:17 -03:00
Myles d1b22b0f82 Update version 2018-10-27 12:30:39 +01:00
Myles 0fb08be6e9 Tidy up code to make it consistent 2018-10-27 12:25:42 +01:00
Gerrygames 2da9b99789 1.14 position changes 2018-10-26 18:36:35 +02:00
Gerrygames 28bb60244f fix merge issues 2018-10-26 17:09:26 +02:00
Gerrygames 928cd9de94 Merge branch 'chunk_section_rewrite' into 1.14
# Conflicts:
#	common/src/main/java/us/myles/ViaVersion/api/minecraft/chunks/ChunkSection.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/chunks/ChunkSection1_13.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/types/Chunk1_14Type.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_1_2to1_9_3_4/chunks/ChunkSection1_9_3_4.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9_3to1_9_1_2/chunks/ChunkSection1_9_1_2.java
#	common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/chunks/ChunkSection1_9to1_8.java
2018-10-26 17:02:01 +02:00
Gerrygames 0046fea684 Merge pull request #4 from creeper123123321/1.14
Sounds, calculate non-air blocks, getNewBlockId
2018-10-26 16:54:13 +02:00
Gerrygames 864715af40 Merge pull request #5 from Gerrygames/1.14_18w43c
Add support for 18w43c
2018-10-26 14:41:15 +02:00
Marco Neuhaus 3684d3f9a2 add support for 18w43c 2018-10-26 14:34:09 +02:00
creeper123123321 69c52c48ab Sounds, calculate non-air blocks, getNewBlockId 2018-10-25 18:25:57 -03:00
Gerrygames 9cf5a66e2f Keep Chunk as an interface 2018-10-25 20:26:24 +02:00
Gerrygames ae73ef1a33 Use types for ChunkSections 2018-10-25 13:56:40 +02:00
Gerrygames 4e2ba4f810 Merge pull request #3 from creeper123123321/1.14
fix light
2018-10-25 12:10:05 +02:00
creeper123123321 aef88cd82f send 4096 in chunk data short 2018-10-25 04:44:03 -03:00
creeper123123321 9cd40f3ec2 fix wrong order 2018-10-24 19:25:33 -03:00
creeper123123321 a368f0babc trying to implement lightning based on Pokechu22 documentation 2018-10-24 19:07:16 -03:00
Gerrygames 9565a47c22 fix chunk packets 2018-10-24 21:14:07 +02:00
Gerrygames 0df089b3cb 1.14 development 2018-10-24 19:05:14 +02:00
Myles 58efd6158f Back to SNAPSHOT 2018-10-22 17:45:17 +01:00
Myles 99bd1a52fb 1.13.2 update 2018-10-22 17:42:53 +01:00
Myles 8ba1725eae Merge pull request #1055 from Gerrygames/1.13.2
1.13.2
2018-10-22 17:35:25 +01:00
Myles 0a2524fec8 Merge pull request #1054 from Gerrygames/myles_master
fix #1052
2018-10-22 17:35:07 +01:00
Gerrygames 162d6aa33a 1.13.2 support 2018-10-22 15:18:23 +02:00
Gerrygames fdcdd0fe40 Merge remote-tracking branch 'Myles/master' into 1.13.2 2018-10-22 15:18:06 +02:00
Gerrygames 8532d388f8 fix #1052 2018-10-22 14:33:38 +02:00
Myles ccc144556b Merge pull request #1053 from Gerrygames/book_fix
fix #1044
2018-10-22 12:10:34 +01:00
Gerrygames 0b7e438128 fix #1044 2018-10-22 11:29:22 +02:00
Myles 2f11268dcc Merge pull request #1050 from Plancke/master
Fix scoreboard colors
2018-10-21 23:11:09 +01:00
Plancke 81514e4192 convert every color in the name 2018-10-21 23:19:54 +02:00
Plancke 7d5c59aa34 Don't read the array size 2018-10-21 23:06:24 +02:00
Plancke dc6d9367b0 Rewrite scoreboard team member names to fix the color changing 2018-10-21 22:56:11 +02:00
Myles 6c609a6b23 Merge pull request #1049 from Gerrygames/1.13.2
1.13.2-pre2 support
2018-10-20 10:32:02 +01:00
Gerrygames b7a3c8568f 1.13.2-pre2 support 2018-10-20 11:25:20 +02:00
Myles 80f84d4001 Merge pull request #1048 from Gerrygames/1.13.2
1.13.2
2018-10-17 16:21:53 +01:00
Gerrygames 5cecfd14d9 1.13.2-pre1 support 2018-10-17 15:38:59 +02:00
Myles 8bfcc550f7 Merge pull request #1036 from KennyTV/master
Remove some more unncessary/doubled map check
2018-10-03 17:12:47 +01:00
KennyTV e40be243de Return correct default protocol, whoops! 2018-10-03 10:12:13 +02:00
KennyTV 033d3bcd4d Remove some more unncessary/doubled map check 2018-09-30 21:19:18 +02:00
KennyTV 449ec15309 Remove unncessary/doubled map check 2018-09-30 20:48:23 +02:00
Myles 8b0ccd81e2 Merge pull request #1035 from KennyTV/master
Remove unncessary doubled map check
2018-09-30 16:16:51 +01:00
KennyTV a206fd7541 Remove unncessary doubled map check 2018-09-30 16:07:08 +02:00
Myles 77472cb9f4 Back to snapshot 2018-09-24 11:39:14 +01:00
Myles 5372d4b8e7 1.5.2 release 2018-09-24 11:33:20 +01:00
Myles 0255f3c42f Merge pull request #1030 from creeper123123321/master
Fix PacketWrapper#constructPacket
2018-09-24 08:44:14 +01:00
creeper123123321 eb5c10d375 Fix PacketWrapper#constructPacket 2018-09-24 03:42:08 -03:00
Myles 9f6766fb82 Back to 1.5.2-SNAPSHOT 2018-09-23 19:28:07 +01:00
Myles ab77eb98c0 Prepare for 1.5.1 release 2018-09-23 18:54:24 +01:00
Myles 85ab5d7741 Use Channel instead of SocketChannel
For better compatibility with third party software.
2018-09-23 18:52:26 +01:00
Myles 6457ff315f Merge branch 'pr/987' 2018-09-23 18:43:29 +01:00
Myles c09a9c88b4 Merge pull request #1005 from creeper123123321/sendpackettoserver
PacketWrapper#sendToServer changes
2018-09-23 18:18:00 +01:00
Myles e8dc4c893f Merge pull request #1013 from creeper123123321/master
Fix item particle
2018-09-23 18:17:29 +01:00
creeper123123321 b61edb0d8e javadoc, fix possible NPE 2018-09-21 14:46:22 -03:00
Myles 94b3b51602 Merge pull request #1021 from 7kasper/master
ViaVersion <3 ProtocolSupport
2018-09-12 19:51:19 +01:00
7kasper 5415a24f4e ViaVersion <3 ProtocolSupport 2018-09-12 19:59:42 +02:00
7kasper 048ae2fcd0 Merge pull request #1 from MylesIsCool/master
Update fork.
2018-09-12 17:00:25 +02:00
Myles 3a4d425a1c Merge pull request #1018 from 7kasper/patch-1
ProtocolSupport  <3 ViaVersion
2018-09-10 20:49:45 +01:00
7kasper 0a8fc31be1 3/2 Hopefully fix all the space thingies. 2018-09-10 21:45:26 +02:00
7kasper f6ae076731 Part 2/2 Import & register listener. 2018-09-10 21:29:27 +02:00
7kasper 76296d8d41 Part 1/2 generate PS Packet Listener 2018-09-10 21:27:34 +02:00
creeper123123321 5024375466 Fix item particle 2018-09-02 15:13:38 -03:00
Myles 527b5e6f99 Allow disabling of auto-complete in 1.13 via disable-1_13-auto-complete in config #891 2018-09-01 07:53:36 +01:00
creeper123123321 17115460b7 PacketWrapper#sendToServer changes 2018-08-28 14:02:48 -03:00
Myles 84aaec6bff Fix bossbars (credit to @JollyajaX) 2018-08-23 21:40:39 +01:00
Myles 0a8f740a14 Merge pull request #995 from creeper123123321/master
Rewrite arrow metadata and remove 0x10 metadata flag in 1.12.2 -> 1.13
2018-08-23 21:33:38 +01:00
creeper123123321 8bf230e057 Rewrite arrow metadata and remove 0x10 metadata flag in 1.12.2 -> 1.13 2018-08-23 17:18:59 -03:00
Myles 1f51ee7233 Merge pull request #991 from creeper123123321/master
Fix Villager GUI and declare recipes
2018-08-22 21:55:36 +01:00
creeper123123321 4cd70ee711 Fix rewriting 2018-08-22 17:27:21 -03:00
creeper123123321 3d1d73a81a Rewrite declare recipes and villager gui 2018-08-22 17:05:46 -03:00
Myles ad4d142e94 Update README 2018-08-22 17:33:50 +01:00
Myles 0f77da15ff Back to snapshot for dev 2018-08-22 17:32:47 +01:00
Myles a05ea7c1ce Prepare for 1.13.1 update 2018-08-22 17:05:24 +01:00
Myles 8945fc27d7 Merge branch 'master' into dev 2018-08-21 18:25:56 +01:00
Myles ac91ecc5f6 Ensure client disconnected on Bungee before removing 2018-08-21 18:25:41 +01:00
Myles 925aaf345c Merge branch 'master' into dev 2018-08-21 17:18:27 +01:00
Myles 2510751fdf Introduce 'suppress-1_13-conversion-errors' option 2018-08-21 16:26:04 +01:00
Myles 83e94dbf4a Fix tab complete support for 1.13.1-pre2 2018-08-21 16:07:24 +01:00
Myles 41ab131a4d Merge pull request #985 from ForceUpdate1/dev
Add support for 1.13.1-pre2
2018-08-21 15:13:19 +01:00
Marco Neuhaus 252c996abf update to 1.13.1-pre2 2018-08-20 20:08:02 +02:00
Myles acf5fc1ee4 Merge pull request #979 from ForceUpdate1/dev
update to 1.13.1-pre1
2018-08-16 22:18:25 +01:00
Marco Neuhaus c141d6efc7 fix tags packet 2018-08-16 23:14:08 +02:00
Marco Neuhaus 3b48f11f7b add support for 1.13.1-pre1 2018-08-16 22:38:22 +02:00
Myles 9ec8e2daf7 Update version to correspond to snapshot version 2018-08-12 20:33:24 +01:00
Myles 4f84200a47 Merge upstream 2018-08-12 20:29:30 +01:00
Myles e4a99c4a3d Merge pull request #942 from creeper123123321/buffer-changes
Replace Unpooled.buffer()
2018-08-12 20:27:44 +01:00
Myles 75adf7c9d4 Merge pull request #969 from creeper123123321/master
Metadata rewriting, noteblocks and enchanting
2018-08-12 20:26:44 +01:00
Myles 5fc693da22 Merge pull request #964 from creeper123123321/dev
Some untested code
2018-08-12 20:26:17 +01:00
creeper123123321 12e2f8b35a Make enchanting table show the enchantment correctly 2018-08-12 09:56:39 -03:00
creeper123123321 1e7dbac34e Reduce cooldown 2018-08-11 12:31:45 -03:00
creeper123123321 e39876ae67 Use unpowered note block 2018-08-11 06:54:38 -03:00
creeper123123321 ff3bc9a0cd Rewrite block action, effect, tags and advancements; palette rewriting 2018-08-10 19:21:35 -03:00
creeper123123321 dfe1850b93 Merge remote-tracking branch 'upstream/master' into dev 2018-08-10 18:34:32 -03:00
Myles 6f50fdc026 Merge pull request #962 from ForceUpdate1/master
add support for 18w32a
2018-08-09 21:00:47 +01:00
Marco Neuhaus 5c490be861 remove file header 2018-08-09 09:25:00 +02:00
Marco Neuhaus 849c7b4fcf fix wrong import 2018-08-08 23:35:14 +02:00
Marco Neuhaus fd5bb94cb5 code cleanup 2018-08-08 22:32:29 +02:00
Marco Neuhaus 647bbbedb0 add items remapping 2018-08-08 21:45:54 +02:00
Marco Neuhaus 6cfb21f660 add support for 18w32a 2018-08-08 18:58:25 +02:00
creeper123123321 c709b019e1 Use ChatRewriter.legacyTextToJson in metadata rewriting 2018-08-06 15:31:05 -03:00
Myles faabe5afb2 Merge pull request #958 from creeper123123321/master
Biomes / Bungee relay msgs
2018-08-05 22:04:52 +01:00
creeper123123321 798bf15155 Remove unused code 2018-08-05 17:54:17 -03:00
creeper123123321 543daa2628 Rewrite invalid biomes 2018-08-05 17:45:22 -03:00
creeper123123321 3bdf81158a Rewrite BungeeCord's plugin channel format 2018-08-05 17:26:14 -03:00
creeper123123321 9b42094273 Rewrite bungeecord relay messages 2018-08-04 07:37:33 -03:00
Myles 94f3fcba12 Merge pull request #953 from ForceUpdate1/master
Add support Snapshot 18w31a
2018-08-03 22:17:46 +01:00
Marco Neuhaus 58b30341ee remove comment headers 2018-08-03 23:15:59 +02:00
Marco Neuhaus 741e0f8fda add support for 18w31a 2018-08-01 20:20:52 +02:00
creeper123123321 d8885f9156 Put prefix last color into the start of suffix 2018-07-30 08:49:32 -03:00
creeper123123321 e9aa18fd6b Fix memory leak 2018-07-29 09:34:27 -03:00
creeper123123321 7518f8b98b Replace Unpooled.buffer()
(cherry picked from commit e9159cb2de)
2018-07-29 09:11:55 -03:00
Myles c9dab5402e Merge pull request #923 from creeper123123321/master
Named sound effect rewriting + Effect rewriting
2018-07-29 12:59:01 +01:00
creeper123123321 e5169378fc Revert "Replace Unpooled.buffer()"
This reverts commit e9159cb
2018-07-29 08:56:26 -03:00
creeper123123321 ca23750c28 merge upstream^2 + lowercase sound ids 2018-07-29 08:31:48 -03:00
creeper123123321 446fd84035 merge upstream 2018-07-29 08:30:58 -03:00
Myles fc264d0b0f Cleanup various debug code 2018-07-29 12:14:17 +01:00
Myles e9ad372039 Remap negative ids to air (workaround for #933) 2018-07-29 11:48:38 +01:00
creeper123123321 b1e8efb00b Fix memory leak 2018-07-28 17:53:17 -03:00
creeper123123321 73ee2498e8 More optimization 2018-07-25 18:12:38 -03:00
creeper123123321 6608877ef0 Rewrite palette instead of rewriting each block 2018-07-25 18:03:25 -03:00
creeper123123321 e9159cb2de Replace Unpooled.buffer() 2018-07-25 09:04:06 -03:00
creeper123123321 a403c7424c *facepalm* 2018-07-24 10:55:08 -03:00
creeper123123321 de2abdcab0 *facepalm* 2018-07-23 10:20:41 -03:00
creeper123123321 088ce93701 Use short[] for sound remapping 2018-07-23 10:15:55 -03:00
creeper123123321 b5a7c92c8d Add missing .toClient 2018-07-22 19:11:29 -03:00
creeper123123321 d4144264d5 Use short[] for block mappings 2018-07-22 19:03:22 -03:00
creeper123123321 b221530276 Update Protocol1_13To1_12_2.java 2018-07-22 18:02:17 -03:00
creeper123123321 8476c83d62 Merge branch 'master' into master 2018-07-22 18:01:04 -03:00
Matsv 9d624bc822 Reimplement advancements by rewriting the items to flat items 2018-07-22 22:58:18 +02:00
creeper123123321 f15c841b99 Hacky fix to noteblock 2018-07-22 17:51:18 -03:00
creeper123123321 019bccd24a Rewrite advancements 2018-07-22 17:06:43 -03:00
creeper123123321 584c0709e8 Block data 2018-07-22 16:24:38 -03:00
creeper123123321 d577088b8c Named sound effect rewriting + Effect rewriting (thanks @Pokechu22) 2018-07-22 15:15:40 -03:00
Mats 72f5d8addc Merge pull request #910 from creeper123123321/master
Fix bungee-chat italic, bold, obfuscated, underline, strikethrough
2018-07-22 03:24:51 +02:00
Mats 6d959169fa Merge pull request #914 from Pokechu22/wdl-channels
Remap WDL plugin channels
2018-07-22 03:23:33 +02:00
Mats 076d05c103 Merge pull request #911 from McPiraci/master
Fix rewriting of MC|StopSound plugin channel.
2018-07-22 03:22:55 +02:00
Pokechu22 1e91b21537 Remap WDL plugin channels 2018-07-21 14:18:49 -07:00
Michał Kasprzyk b64a0b065c Fix MC|StopSound plugin channel rewriting.
(ID of stop sound packet is 0x4C, not 0x4B)
2018-07-21 17:32:30 +02:00
creeper123123321 faf7e5d25f Fix bungee-chat italic, bold, obfuscated, underline, strikethrough 2018-07-21 11:48:31 -03:00
Mats fd37c6b040 Merge pull request #902 from Gerrygames/master
Fix reddust particle color for 1.13 clients
2018-07-21 12:45:02 +02:00
Gerrygames bb4b5d3080 Fix reddust particle color for 1.13 clients 2018-07-21 11:18:14 +02:00
Mats d27f17f74b Merge pull request #900 from Dinnerwolph/master
fix server icon
2018-07-21 02:58:46 +02:00
dinnerwolph 3646fad197 fix server icon 2018-07-21 02:51:07 +02:00
Myles 34491967e2 Back to snapshot 2018-07-20 23:29:25 +01:00
Myles 3df70055b0 1.4.1 release 2018-07-20 23:25:57 +01:00
Myles 7c0c4ee74d Implement prefix based team colours (based on code by @JollyAjax) 2018-07-20 21:21:24 +01:00
Myles ca415cc719 Merge pull request #896 from creeper123123321/master
Support custom enchantments
2018-07-20 20:02:38 +01:00
creeper123123321 6c17615ecb Accept int tag in level 2018-07-20 15:58:04 -03:00
creeper123123321 9a1376dcb3 Accept int tag 2018-07-20 15:54:52 -03:00
creeper123123321 32161333dd Fix custom enchantments 2018-07-20 15:47:05 -03:00
Myles a2f5120069 Merge pull request #894 from creeper123123321/memory-efficiency
Memory efficiency
2018-07-20 18:47:39 +01:00
creeper123123321 e067492cca Catch exception 2018-07-20 13:23:40 -03:00
creeper123123321 1cdf2ed1ef Make compatible with older netty 2018-07-20 13:16:34 -03:00
creeper123123321 dc90652853 Memory efficiency 2018-07-20 13:16:33 -03:00
Myles 459de30e9a Merge pull request #892 from Logics4/master
Don't use Paper block placement patch in 1.12.
2018-07-20 16:23:11 +01:00
Logics4 4fe68c2c93 Don't use Paper block placement patch in 1.12.
Apparently the bug that caused the block placement issues with Paper was fixed in 1.12 (according to Aikar from its development team). So, with this commit the patch to fix it won't run if the server is running Paper 1.12 or higher (which means it will only be used in 1.11.2 and lower server versions).
2018-07-20 16:12:00 +01:00
Myles 8b0eb9c9d0 Merge pull request #890 from creeper123123321/master
Remove redundant tags
2018-07-20 15:13:44 +01:00
creeper123123321 a2fce6f4a5 Update WorldPackets.java 2018-07-20 10:29:51 -03:00
creeper123123321 78b9e5d833 Fix biomes 2018-07-20 10:26:56 -03:00
creeper123123321 4e2156bd2b Remove redundant tags 2018-07-20 07:14:51 -03:00
Matsv fdc4d2c5d2 Merge remote-tracking branch 'upstream/master' into upmaster 2018-07-20 11:16:00 +02:00
Matsv 7a331bdb09 Rewrite entity names for spawners, fixes #884 2018-07-20 11:15:37 +02:00
Myles 5f50b4522c README.md - Fix typo in table 2018-07-19 20:42:01 +01:00
Myles 2a630bbc7d Update README.md 2018-07-19 20:29:46 +01:00
Matsv df32569af6 Flowerpot check for empty strings / return air 2018-07-19 13:18:34 +02:00
Mats 361c36349b Merge pull request #877 from creeper123123321/master
Rewrite StoredEnchantments
2018-07-19 13:13:00 +02:00
Matsv ddbbb14c72 Correct changed directions for item frames Fixes #874 2018-07-19 11:54:09 +02:00
Matsv a0899d4776 Fix falling / block dust particles 2018-07-19 09:52:53 +02:00
creeper123123321 4c8761b17b Rewrite StoredEnchantments 2018-07-19 04:51:38 -03:00
Matsv 7eb446d528 Bump to 1.4.1-SNAPSHOT 2018-07-19 09:18:31 +02:00
Myles d0230af5c9 ViaVersion 1.13 support
Thanks to Matsv, creeper123123321, Pokechu22, PureGero
2018-07-18 23:26:14 +01:00
Myles 17564506b5 Temporary force biomes to be ocean 2018-07-18 23:19:13 +01:00
Matsv dfd18d64c2 Correct directPallette check (Thanks @Pokechu22) 2018-07-18 23:39:23 +02:00
Myles c3eaf5a1b0 Remove some channel debug 2018-07-18 19:27:39 +01:00
Myles 152ef7fe38 Merge pull request #861 from creeper123123321/dev
Fix banners - not tested
2018-07-18 19:25:07 +01:00
creeper123123321 7ad59b7cb0 Fix banner items 2018-07-18 15:23:46 -03:00
creeper123123321 5d19697004 Fix patterns 2018-07-18 14:43:57 -03:00
Myles 8f7c090a23 Fix javadocs :P 2018-07-18 18:25:43 +01:00
Myles d39c59663a Merge pull request #858 from creeper123123321/dev
Update to 1.13 (not for production)
2018-07-18 18:16:53 +01:00
creeper123123321 9232ea4fd6 *facepalm* 2018-07-18 14:15:37 -03:00
creeper123123321 cd9ff95226 1.13!!!!! 2018-07-18 14:12:35 -03:00
creeper123123321 54ad8606dc Chunk1_13 - not tested 2018-07-18 14:12:35 -03:00
Myles 4e1ab821e1 Merge pull request #857 from PureGero/dev
Skulls don't have 'Rot'; Painting names
2018-07-18 18:03:09 +01:00
PureGero 3016e774ff Skulls don't have 'Rot'; Painting names
Skulls on walls don't always have a 'Rot' tag if it's rotation is 0.
'DonkeyKong', 'SkullAndRoses' and 'BurningSkull' weren't displaying.
2018-07-18 18:38:11 +10:00
Myles 666779b012 Merge pull request #855 from creeper123123321/dev
1.13-pre10 + some things
2018-07-17 22:08:45 +01:00
creeper123123321 ba9198bd45 *facepalm*³ 2018-07-17 17:51:31 -03:00
creeper123123321 29460a310b *facepalm*² 2018-07-17 17:49:35 -03:00
creeper123123321 3507c2016a *facepalm* 2018-07-17 17:44:46 -03:00
creeper123123321 6d996a93c8 Do not create unnecessary tag 2018-07-17 17:40:39 -03:00
creeper123123321 7cd1563805 1.13-pre10, fix flower pots, comment debug message 2018-07-17 17:15:43 -03:00
Myles 4ad51649cc Merge pull request #854 from creeper123123321/dev
1.13-pre9
2018-07-17 14:49:51 +01:00
creeper123123321 17023d6afd Correct comment 2018-07-17 10:41:05 -03:00
creeper123123321 ca85c9739a 1.13-pre9, RIP BaseProtocol1_13, use Type.VAR_INT_ARRAY 2018-07-16 15:45:41 -03:00
Mats b83b7ee2bc Merge pull request #853 from creeper123123321/dev
Changes on plugin channel rewriting
2018-07-15 14:48:39 +02:00
creeper123123321 c47d5dcba6 Changes on plugin channel rewriting 2018-07-15 09:26:26 -03:00
Matsv 7335c8ea98 Fix commandblock minecart 2018-07-15 13:56:42 +02:00
Myles 8d7ef29d3e Merge pull request #852 from creeper123123321/dev
Fix click window packet
2018-07-14 19:45:45 +01:00
creeper123123321 31a1bf35d9 More changes involving BaseProtocol - not tested yet 2018-07-14 09:11:17 -03:00
creeper123123321 051df7401e Fix click window packet 2018-07-14 07:53:31 -03:00
Myles e8cb0f561e Merge pull request #851 from creeper123123321/dev
1.13-pre8
2018-07-13 19:35:30 +01:00
creeper123123321 24f0eb1a2e Merge branch 'dev' of https://github.com/MylesIsCool/ViaVersion into dev 2018-07-13 15:24:38 -03:00
creeper123123321 5f1fba0276 1.13-pre8 2018-07-13 15:23:07 -03:00
Myles c88face33e Merge pull request #850 from creeper123123321/dev
1.13-pre7 + Sponge tab-completion fix
2018-07-13 10:16:26 +01:00
creeper123123321 c4eedca28b Fix Sponge tab-complete again 2018-07-12 15:00:06 -03:00
creeper123123321 9ac3110d3e it should work 2018-07-12 14:29:15 -03:00
creeper123123321 251f8bccaa /tableflip 2018-07-11 11:31:56 -03:00
creeper123123321 84d3c0d3e8 update tags packet id 2018-07-11 10:46:42 -03:00
creeper123123321 074aa302bc missing id changes 2018-07-11 10:13:36 -03:00
creeper123123321 638165aad5 1.13-pre7 2018-07-11 09:47:13 -03:00
Myles 65798d17ac Merge pull request #849 from creeper123123321/dev
1.13-pre6
2018-07-05 12:04:22 +01:00
creeper123123321 aacce4f77b Sound rewriting with JSON 2018-07-05 07:34:09 -03:00
creeper123123321 2153377c0e client to server plugin message rewriting 2018-07-04 17:10:30 -03:00
creeper123123321 006fb177e6 1.13-pre6 2018-07-04 10:50:01 -03:00
creeper123123321 cabc010582 Update mappings 2018-07-04 10:33:37 -03:00
Myles ae693ed438 Merge pull request #848 from creeper123123321/feature/logo
Add logo
2018-07-03 19:06:02 +01:00
Myles 4c7b2bbb4e Merge pull request #847 from creeper123123321/1-13-base-protocol
1.13 BaseProtocol changes
2018-07-03 16:01:21 +01:00
creeper123123321 314af6d000 Brackets. 2018-07-03 11:26:00 -03:00
creeper123123321 697e883649 More BaseProtocol changes 2018-07-03 11:19:32 -03:00
creeper123123321 f81892ea74 BaseProtocol changes 2018-07-03 09:58:00 -03:00
creeper123123321 4e9a253cfa Add logo 2018-07-02 19:41:27 -03:00
Myles 2c62cc37e7 Merge pull request #844 from creeper123123321/platform-and-sponge-changes
Platform and Sponge changes
2018-07-02 22:50:12 +01:00
creeper123123321 2fe0ed2ca1 restoring providers is not simple, removing todo 2018-07-02 18:48:52 -03:00
Myles b5e7434c9a Merge pull request #845 from creeper123123321/dev
1.13-pre5
2018-07-02 21:47:15 +01:00
creeper123123321 e3f71c26e7 1.13-pre5 + revert some changes 2018-07-02 11:36:03 -03:00
creeper123123321 7fda025c0d maybe cleaner code? 2018-06-28 07:34:56 -03:00
creeper123123321 383cbe15a6 reduce code 2018-06-27 15:08:09 -03:00
creeper123123321 7cace1ee32 fixed flowerpots 2018-06-27 14:27:12 -03:00
creeper123123321 1be25079d4 *facepalm* 2018-06-27 14:16:01 -03:00
creeper123123321 16cc07c020 some modifications 2018-06-27 14:10:37 -03:00
creeper123123321 7d671c2908 Fix BaseProtocol 2018-06-27 09:51:41 -03:00
creeper123123321 df2d9ba3d8 1.13-pre4 + ProtocolPipeline changes 2018-06-27 09:39:38 -03:00
creeper123123321 ffa696b963 LoggerWrapper changes, @Getter 2018-06-22 14:37:29 -03:00
creeper123123321 6f98e35dec Update BlockStorage 2018-06-22 09:30:11 -03:00
creeper123123321 39419f4ca3 1.13-pre3 2018-06-22 09:19:57 -03:00
creeper123123321 e26b6d08e1 1.13-pre2 + merge master 2018-06-17 10:17:33 -03:00
creeper123123321 cb4fcde6f4 1.13-pre2 + merge master 2018-06-17 10:16:53 -03:00
creeper123123321 f12a210665 Platform and Sponge changes 2018-06-14 15:21:49 -03:00
Myles 684c25dc2c Merge pull request #842 from creeper123123321/bug-fix/tab-complete
Fix tab completion on Sponge
2018-06-14 18:05:09 +01:00
creeper123123321 b20dad57fe Fix tab completion on Sponge 2018-06-14 13:24:42 -03:00
Myles a41cbdde7f Merge pull request #841 from creeper123123321/dev2
Enchantment and display name rewriting, use a map for new to old items
2018-06-13 22:38:14 +01:00
creeper123123321 32ce40e19e Enchantment and display name rewriting, use a map for new to old items 2018-06-13 17:12:43 -03:00
Mats fe71654f5b Merge pull request #839 from creeper123123321/dev2
Fix block tags
2018-06-05 20:58:28 +02:00
creeper123123321 bef1f76e45 Fix block tags 2018-06-05 15:41:34 -03:00
Myles 752f039411 Merge pull request #838 from creeper123123321/dev2
1.13 Tags
2018-06-05 17:55:49 +01:00
creeper123123321 047bbe0edb Merge branch 'dev' of https://github.com/MylesIsCool/ViaVersion into dev2 2018-06-05 13:51:00 -03:00
creeper123123321 f022a57b23 tags 2018-06-05 13:50:28 -03:00
Mats 235948a001 Merge pull request #837 from creeper123123321/dev2
Revert mappings changes and update handlers
2018-06-04 23:34:32 +02:00
creeper123123321 c650b5c0bb Revert "Update 1.13 mappings TODO fix 1.12 mappings"
This reverts commit e334486e96.
2018-06-04 18:08:44 -03:00
creeper123123321 81f9f5ec60 Merge branch 'dev' of https://github.com/MylesIsCool/ViaVersion into dev2 2018-06-04 17:36:27 -03:00
Matsv 870a9ba68f Regenerate 1.12 mappings with LI, TODO: diagnose wrong 1.13 items 2018-06-04 22:25:50 +02:00
Matsv e334486e96 Update 1.13 mappings TODO fix 1.12 mappings 2018-06-04 20:42:23 +02:00
Matsv e9633c6522 Bump to 1.13-pre1 2018-06-04 20:32:27 +02:00
creeper123123321 2ea42eab62 update handlers 2018-05-31 17:20:41 -03:00
Myles 06056de6bb Merge pull request #836 from creeper123123321/dev2
18w22c
2018-05-31 20:18:47 +01:00
creeper123123321 067da7e1d9 18w22c 2018-05-31 12:03:45 -03:00
Mats 8c02947c05 Merge pull request #834 from creeper123123321/dev2
18w21b
2018-05-26 14:38:01 +02:00
creeper123123321 9d39bb2d62 18w21b 2018-05-26 08:52:31 -03:00
creeper123123321 6a4f2f6830 18w21a 2018-05-23 15:28:22 -03:00
creeper123123321 120b12feeb 18w20c 2018-05-17 14:09:36 -03:00
Myles 40853ae92b Merge pull request #831 from creeper123123321/dev2
18w20b
2018-05-16 21:40:36 +01:00
creeper123123321 bb64329b07 18w20b 2018-05-16 17:12:43 -03:00
creeper123123321 5878c53aa4 18w20a + mapping changes
(cherry picked from commit 57b5a0d)
2018-05-15 17:00:14 -03:00
Myles f4d1c3fcf2 Merge pull request #829 from creeper123123321/dev2
18w19b
2018-05-13 14:45:03 +01:00
creeper123123321 136adaebd5 18w19b 2018-05-09 15:45:09 -03:00
creeper123123321 188cc5019f Maybe better performance? 2018-04-21 11:11:12 -03:00
creeper123123321 e41f445e92 18w16a 2018-04-19 19:39:30 -03:00
Myles bd283910fc Merge pull request #823 from creeper123123321/dev2
18w16a
2018-04-19 20:54:30 +01:00
creeper123123321 1e0113a58a 18w16a 2018-04-19 16:29:50 -03:00
Matsv 8bf43648ce Regenerate EntityTypeRewriter 2018-04-14 10:23:35 +02:00
Matsv 7d5451558d Generate sound changes for 18w15a 2018-04-13 09:55:49 +02:00
Matsv c61d5d480e Regenerate EntityTypes 2018-04-12 22:30:00 +02:00
Matsv 960f8ddce7 Bump 16w15a (TODO auto regenerate entities with PAaaS) 2018-04-12 21:59:51 +02:00
Matsv dc758b767f Reimplement spawnegg items 2018-04-08 17:02:46 +02:00
Matsv 3176d892dd Regenerate 1.12 items using codename GT 2018-04-08 14:26:36 +02:00
Matsv 495d162ef2 Handle block entities to identifier correctly 1.10->1.11 (TODO handle correctly in ViaBackwards) 2018-04-07 18:00:18 +02:00
Matsv b61b52c57e Fix AreaEffectCloud metadata rewriting when index [9,10,11] is not provided 2018-04-06 21:02:02 +02:00
Matsv f2f485731f Update to 18w14b 2018-04-06 19:52:45 +02:00
Matsv 1aad25776c Handle AreaEffectCloud metadata 2018-04-05 19:18:14 +02:00
Matsv 07fa0f3e55 Handle (id+(data<<12)) encoded particle blocks; finish particle rewriting (: 2018-04-05 19:01:37 +02:00
Matsv 45105d8c6a Handle particle BlockTypes 2018-04-04 22:51:42 +02:00
Matsv 613001a600 Handle removed particles 2018-04-04 21:46:59 +02:00
Matsv 0ec5777f12 Fix particle arguments, randomize reddustHandler 2018-04-04 21:45:23 +02:00
Matsv d066c2596b Handle particles with 0 parameters 2018-04-04 21:09:54 +02:00
Mats c0c1a6bbcf Merge pull request #820 from creeper123123321/dev
Fix setFlatBlock, update mappings and change some things on item rewriting
2018-04-04 20:22:40 +02:00
creeper123123321 b7fde6390e Update mappings, change some things on item rewriter 2018-04-04 14:58:20 -03:00
creeper123123321 feba8785d7 Merge branch 'dev' of https://github.com/MylesIsCool/ViaVersion into dev 2018-04-04 13:17:26 -03:00
Matsv 4a172a27ad Bump protocol (TODO handle new item? (regenerate mappings)) 2018-04-04 18:12:23 +02:00
Matsv ace9c2d9ec Progress on ParticleRewriter. (TODO finish data types / cleanup code) 2018-04-02 20:24:44 +02:00
Matsv 70e106eeab Start working on particles 2018-04-02 17:06:25 +02:00
Matsv 4d38ca1b3c Fix invisible banners on placement (#819). Send the blockupdate before the Update Block Entity is sent. 2018-04-02 15:51:56 +02:00
Matsv 576bee40fc Change default cobblestone_wall to up=true 2018-04-02 15:07:04 +02:00
Matsv 0efb17af83 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2018-03-29 20:43:45 +02:00
Matsv 0228a2849d Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into upmaster 2018-03-29 20:42:48 +02:00
Matsv af53a96f67 Rip anonymous GitHub gists. :( Use ViaVersion dump! :D 2018-03-29 20:42:11 +02:00
creeper123123321 7eab459195 Fix missing setFlatBlock 2018-03-24 16:39:48 -03:00
Mats 5801cd1e0f Merge pull request #816 from creeper123123321/dev
Fix last pull request
2018-03-20 18:52:14 +01:00
creeper123123321 6bb0f2145e thinking that i fixed 2018-03-20 14:48:32 -03:00
Mats 15f67392dc Merge pull request #815 from creeper123123321/dev
Block and item rewriting changes
2018-03-20 18:41:43 +01:00
creeper123123321 6571c42c39 shield mapping 2018-03-20 14:36:15 -03:00
Matsv 851fa4ca54 Handle packet 'Recipe Book Data' changes (ignore for now) 2018-03-20 18:35:58 +01:00
creeper123123321 39dea80d9c todo 2018-03-20 14:27:47 -03:00
creeper123123321 c102ca7f15 shield, damageable, map item rewriting 2018-03-20 14:21:37 -03:00
creeper123123321 9fe187c049 Fix block and item rewriting 2018-03-20 13:46:26 -03:00
Matsv f56971e5ac Remove debug code 2018-03-20 17:21:04 +01:00
Matsv fbaaa78b81 Transform FallingBlock to the new block format 2018-03-20 17:19:35 +01:00
Matsv acb960bfdf Transform Minecart metadata (9) to the new block format 2018-03-20 16:56:32 +01:00
Matsv 0ada2496de Handle new Zombie metatag & change reset color to 21 (as documented on wiki.vg) 2018-03-20 15:55:27 +01:00
Matsv b7ca30efe8 Fix crash on scoreboard deletion 2018-03-20 14:31:14 +01:00
Matsv db57916af4 Handle PacketMultiBlockChange correctly 2018-03-20 11:28:44 +01:00
Matsv 4f3074eca8 Correct x, z for BlockStorage 2018-03-20 10:14:47 +01:00
Matsv a6af99fdbc Handle dog color changes 2018-03-19 20:09:07 +01:00
Matsv d6df48430b Cleanup Entity1_13Types 2018-03-18 14:28:54 +01:00
Matsv 7a01376144 Generate Entity1_13Types 2018-03-18 14:11:40 +01:00
Matsv 2fb9533575 Auto-generate entity id changes to prepare for PAaaS EnityTypes generation 2018-03-17 17:25:35 +01:00
Mats 66a4d7c2ee Merge pull request #812 from creeper123123321/dev
18w11a sounds + mappings
2018-03-17 15:27:35 +01:00
creeper123123321 c66c277221 grass path 2018-03-17 11:22:47 -03:00
creeper123123321 98a731e5df 18w11a sounds 2018-03-17 10:58:04 -03:00
creeper123123321 74cb0d5167 18w11a mappings 2018-03-17 10:43:11 -03:00
creeper123123321 478812d648 Merge pull request #2 from MylesIsCool/dev
Pull @creeper123123321 's work and bump to 18w11a!
2018-03-17 10:37:48 -03:00
Matsv e759fbb5db Pull @creeper123123321 's work and bump to 18w11a! 2018-03-17 14:28:53 +01:00
creeper123123321 c24485b5f9 18w10d - todo entities 2018-03-12 17:05:08 -03:00
creeper123123321 8eae83f218 18w09a 2018-03-03 11:59:19 -03:00
creeper123123321 09495695f2 18w09a 2018-03-03 11:58:53 -03:00
creeper123123321 14a86160d6 18w08b trying to not crash 2018-02-24 07:04:12 -03:00
creeper123123321 f59f178cec Merge pull request #1 from MylesIsCool/master
merge master
2018-02-24 06:55:10 -03:00
creeper123123321 6498c010f8 18w08b trying entity rewrite^2 2018-02-24 06:28:36 -03:00
creeper123123321 909bbc43d0 18w08b trying entity rewrite but didn't worked 2018-02-23 17:46:56 -03:00
creeper123123321 ce326e24e6 18w08b trying entity rewrite but didn't worked 2018-02-23 17:38:50 -03:00
creeper123123321 4de081efda 18w08a sound rewrite 2018-02-21 19:25:56 -03:00
creeper123123321 8848758578 todo 2018-02-19 19:19:20 -03:00
creeper123123321 326c6cb158 18w07c - Fix skull handler 2018-02-19 14:44:14 -03:00
creeper123123321 4e4b35b2e7 18w07c - Fix skull handler 2018-02-19 14:42:54 -03:00
creeper123123321 d7caf2ae3c 18w07c - Handlers 2018-02-18 12:38:26 -03:00
creeper123123321 700f0c293e 18w07c - Fix some inventory issues + mappings, thanks Gerrygames 2018-02-18 05:55:52 -03:00
creeper123123321 00dedaa1ff 18w07c - Fix some inventory issues + mappings, thanks Gerrygames 2018-02-18 05:53:57 -03:00
creeper123123321 34cba80fd8 18w07c* - MISSING MAPPINGS 2018-02-17 20:43:08 -02:00
mmxw11 172ac19585 18w07b - MISSING MAPPINGS 2018-02-17 20:37:50 -02:00
Myles 05617a95b7 Merge pull request #802 from mmxw11/master
Fix inventory issues + support jdk9
2018-02-05 21:55:44 +00:00
mmxw11 c46bdcf42b Fix inventory handling
fixes #780 & #800
2018-01-22 21:32:22 +02:00
mmxw11 f739060ebb Update Lombok
...to make it work with jdk9
2018-01-21 11:55:48 +02:00
Matsv b9e4466ef0 Update protocol to 18w03b 2018-01-19 11:12:05 +01:00
Matsv be4af60ad1 Merge branches 'dev' and 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2018-01-19 11:06:18 +01:00
Matsv 721297bf21 Correct runRepeatingSync order 2018-01-19 11:05:16 +01:00
Matsv 9ff20f3fea 18w02a 2018-01-11 16:14:34 +01:00
Matsv 566c9dbda0 Remove debug message 2018-01-07 17:28:50 +01:00
Matsv ff5bb8acc6 Handle new Pumpkin Carve sound & handle new StopSound packet 2018-01-07 17:22:54 +01:00
Matsv 195b89f24c Change Sun's NotImplementedException to UnsupportedOperationException 2018-01-06 15:29:34 +01:00
Matsv 012aac97ee Handle changed block entities. Fixes banners,beds & flowerpots 2018-01-06 15:23:49 +01:00
Matsv ba70dae9ad Handle team packet changes 2018-01-05 15:50:01 +01:00
Matsv c43e702ed9 Cancel the packet that caused non x character crash for now & check for empty custom names 2018-01-04 16:00:55 +01:00
Matsv 9dfbe3b263 Read FlatItem correctly & fix incoming Item type 2018-01-04 15:41:10 +01:00
Matsv 444eabcebf Handle metadata correctly, implement new MetaTypes & bump protocol to 18w01a (non-stable) 2018-01-04 14:59:59 +01:00
Myles ede4fa5a5d Rewrite BlockId, cancel changed packets, rewrite metadata even if type not found 2017-12-24 12:20:09 +00:00
Matsv cc4ae6eb80 Bump to 17w50a (no stable). 2017-12-24 13:08:20 +01:00
Myles 0a37031418 Correctly convert between ITEM -> FLAT_ITEM 2017-12-18 15:48:25 +00:00
Myles bd9096ef6d Flat item should only write NBT when id != 0 2017-12-16 22:17:12 +00:00
Myles 246dc34835 Fix tab completion not completing mid-word, also makes code simpler 2017-12-14 21:25:42 +00:00
Myles f90029319e Recipe packets are fine, remap scoreboard objectives 2017-12-14 21:19:03 +00:00
Myles 18dc323f7f Named Sound Effect has no changes (apart from id changes) 2017-12-14 19:46:01 +00:00
Myles a948503895 Better tab support (handle spacing properly) 2017-12-14 19:45:29 +00:00
Myles 616c9474ce Better fallback for block mismatch 2017-12-14 18:45:29 +00:00
Myles 77dc403bb9 Implement tab complete for the snapshot 2017-12-14 18:45:16 +00:00
Myles 6fd1ee227f Implement item conversation so it will map back properly 2017-12-13 21:52:24 +00:00
Myles 19eb478067 [WIP] 17w49a Basic block + item support (inventory transactions are broken / some issues with wrong block)
This will be fully implemented over the coming weeks. Please don't report missing features etc.
2017-12-11 23:39:34 +00:00
Myles 54540fb8ef Merge branch 'master' into dev 2017-12-11 12:20:49 +00:00
Myles 5a74e129a4 Change 'quick-move-action-fix' to default disabled.
This is until we can ensure no bugs happen with it if we're required to release.
See #780
2017-11-28 15:17:02 +00:00
Myles 12c21c9b0a Add a few extra null checks into ProtocolDetectorService
Under certain conditions these can be null.
2017-11-26 13:45:39 +00:00
Myles 61836895b0 Update to 17w45b 2017-11-10 20:58:30 +00:00
Myles 5f36302057 Base 17w45a update (missing areaeffectcloud remap) 2017-11-08 18:12:15 +00:00
Matsv 1b9bf4b36e 16w43b 2017-10-26 16:05:25 +02:00
Matsv 9b9cdf8b8f Support for 17w43a 2017-10-26 15:39:57 +02:00
Myles ab1a586b4c Merge pull request #765 from Pokechu22/mc-111054
Backport fix for MC-111054
2017-10-22 14:18:42 +01:00
Pokechu22 030a3fe4ac Backport fix for MC-111054
The max length of the locale was increased in 1.12-pre3; we need to undo that.
2017-10-21 12:05:23 -07:00
Myles fd01b9a6d2 Don't display achievement broadcasts to 1.12+ #757 2017-10-11 21:12:02 +01:00
Myles 11be597d11 Torch support for paper patch #758 2017-10-11 20:48:45 +01:00
Myles 875e5d7252 Merge pull request #754 from mmxw11/master
Improve inventory handling for Bukkit servers
2017-10-11 20:43:57 +01:00
Myles e372a56827 Refactor code to make field / class names better 2017-10-08 15:33:43 +01:00
mmxw11 471f1ae71d Try make it compile with Travis...
... don't use diamond operators?
2017-10-05 22:11:06 +03:00
mmxw11 a27808ade1 Add config for quick move action patch 2017-10-05 22:05:53 +03:00
mmxw11 2703e849cb Increase the waiting time 2017-09-28 20:47:13 +03:00
mmxw11 d57ef2b303 Fix inv provider not working on 1.8 servers 2017-09-28 20:44:49 +03:00
mmxw11 5a7626f280 Merge pull request #1 from mmxw11/dev
Merge branches 'dev' and 'master' of https://github.com/mmxw11/ViaVersion into master
2017-09-25 21:55:14 +03:00
mmxw11 1c4e0051a0 Finish inventory provider
+ Support 1.9+ servers
2017-09-25 21:49:43 +03:00
mmxw11 b3d3921f6e Support item provider on a 1.8 server
... 1.9 is on the way
2017-09-25 18:04:39 +03:00
mmxw11 976c418c9e Start implementing inv update task 2017-09-25 16:13:56 +03:00
mmxw11 b2669129f2 More work on the inv provider 2017-09-24 22:11:54 +03:00
mmxw11 343e316e4c Make InvContainerItemProvider 2017-09-24 21:35:38 +03:00
mmxw11 ce219e208c Check the right type 2017-09-24 21:17:07 +03:00
Myles 358267d6e3 Merge pull request #752 from mmxw11/master
Format the book data correctly, fixes #737 + spaces
2017-09-24 17:19:01 +01:00
mmxw11 786788aa23 Oops forgot to remove the note 2017-09-22 17:18:21 +03:00
mmxw11 49b20e37cb Properly format book data 2017-09-22 17:16:04 +03:00
Myles 3f5362a857 1.12.2 Support 2017-09-18 10:28:05 +01:00
Myles c7c61df0b8 Minecraft 1.12.2 Pre-release 1 Support 2017-09-13 15:45:45 +01:00
Myles 298835be42 Move config to assets/viaversion & refactor Config
Config loading is done by the implementing class.
Platforms can now specify the URL of the default config.
2017-09-11 13:10:54 +01:00
Myles 4a51958da4 Merge pull request #727 from RapidTheNerd/patch-1
Pls fix
2017-08-05 23:04:23 +01:00
George Marr cff23db7d3 Pls fix
DO IT
2017-08-05 23:03:06 +01:00
Myles f70059b4b6 Ensure it's a string 2017-08-03 17:36:48 +01:00
Myles 757d22da23 Switch back to snapshot 2017-08-03 16:02:50 +01:00
Myles 4bc4aa26a4 Fix grammar in command errors. 2017-08-03 16:01:00 +01:00
Matsv cbc0a12dd6 1.12.1 update 2017-08-03 14:59:03 +02:00
Matsv 100a147a4a Add packet names 2017-08-03 14:45:11 +02:00
Matsv c405424500 Compatibility for 1.12.1-pre1 2017-08-02 13:44:14 +02:00
Matsv 23091d60ff Change maven version 2017-08-01 17:30:26 +02:00
Matsv f0968408b6 Cancel the new packet for now 2017-08-01 16:42:15 +02:00
Matsv 2bf2be071d Handle incoming packet id changes 2017-08-01 16:18:38 +02:00
Matsv c502e2cf7e Handle outgoing packet id changes 2017-08-01 16:04:47 +02:00
Matsv 2d8446b4e3 Start 1.12.1 development 2017-08-01 15:34:22 +02:00
Myles 279162d720 Ensure only 1 server saves config value at a time. 2017-07-31 15:25:04 +01:00
Myles a64c21da8b Fix invalid json nbt chat messages, #712 2017-07-31 15:24:25 +01:00
Myles 4d58c717cd Fix auto-team not sending in the right order, #699 2017-06-29 20:04:40 +01:00
Myles 634f92b5cd Fix inventory crashes in recent commit #701 2017-06-26 13:51:18 +01:00
Myles 24c4af486c Fix breaking change in last commit 2017-06-24 21:17:10 +01:00
Myles 280fe1aed0 Fix Evocation Illager animation on 1.12 2017-06-24 16:27:14 +01:00
Myles 7cfa78557e 1.12 beds will now be red, #689 2017-06-24 16:26:42 +01:00
Myles f599583856 Fix 1.11 entity id rewriting not applying to dropped items 2017-06-24 15:40:09 +01:00
Myles 10688a7067 Don't produce errors while ViaVersion is not active during boot, #686 2017-06-12 18:22:09 +01:00
Myles 188419feb0 1.1.1 SNAPSHOT 2017-06-09 19:10:56 +01:00
Myles fd44e2e9bd 1.1.1 release 2017-06-09 17:04:05 +01:00
Matsv e19d7e88bd Implement 1.12 Meta Type & Remove Pre6 support since Spigot released 1.12 2017-06-08 16:59:33 +02:00
Matsv 2446577188 Read all the remaining bytes fixes #681 2017-06-08 12:11:44 +02:00
Myles fef435b9fb As per popular request, 1.12 clients for 1.12-pre6 servers. 2017-06-07 16:50:22 +01:00
Myles 1cb3b985a7 Fix hologram patch not working on 1.12 2017-06-07 15:13:04 +01:00
Myles 2292175e9a Ensure Bungee protocol order as well as ensuring it picks a protocol that viaversion knows. 2017-06-07 14:01:08 +01:00
Myles ef04346019 Move back to snapshot for 1.1.1 ViaVersion 2017-06-07 13:07:05 +01:00
Myles 381ff1e5d3 1.12 update 2017-06-07 12:58:51 +01:00
Matsv 079f8df6e0 Merge branches 'dev' and 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2017-06-01 21:47:37 +02:00
Myles 56637f50bc Merge pull request #676 from RaynLegends/master
Improved the shield handling (1.9->1.8)
2017-06-01 19:11:31 +01:00
Matsv 914888dade Refactor Snapshot to 1.12 as preparation for tomorrows release 2017-06-01 18:49:07 +02:00
RaynLegends 8e20df57a9 Improved the shield handling (1.9->1.8) 2017-06-01 18:23:16 +02:00
Matsv 7d5191fa2f Implement 1.12 MetaTypes 2017-06-01 16:00:35 +02:00
Matsv 08528a1745 Addd get/setBlock to the interface of ChunkSection 2017-06-01 15:44:41 +02:00
Matsv a8e3d9ec95 Update to 1.12-pre7 2017-05-31 14:05:18 +02:00
Matsv e5dd9b61a4 Remove wrong EntityType 2017-05-31 00:26:28 +02:00
Matsv 6ee2d0574f Bump version from 1.0.5 -to 1.1.0 since this won't be just a bugfix update. 2017-05-29 20:23:54 +02:00
Myles 91b5a8036c 1.12-pre6 2017-05-29 13:59:02 +01:00
Myles 24ab0d8590 Merge branch 'master' into dev 2017-05-27 20:41:19 +01:00
Myles d8f55006ff Ensure connection isn’t null (reloads etc), fixes #674 2017-05-27 20:41:00 +01:00
Matsv 0817d28b88 Merge branches 'dev' and 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2017-05-27 16:39:43 +02:00
Matsv 577c8b4eaf Add a getBlock method in ChunkSection1_9_3_4.java 2017-05-27 16:39:07 +02:00
Matsv 5b5f0dce24 Manually hide Entity BossBars on (from 1.8.x) server switch. Fixes #666 2017-05-25 18:14:56 +02:00
Myles a818b9a9d4 Add discord server 2017-05-22 15:50:22 +01:00
Myles 3160c076f0 Add discord server 2017-05-22 15:49:42 +01:00
Myles 6d0b28fac4 Merge branch 'master' into dev 2017-05-22 13:38:37 +01:00
Myles ce286cf322 Remove unnecessary synchronising 2017-05-22 13:38:22 +01:00
Myles 7d001c61a8 Fix packet id typo causing random dc’s #669 2017-05-22 13:17:24 +01:00
Myles a09e8b9f4d Fix comment with 1.12-pre5 2017-05-19 22:35:24 +01:00
Myles 395d020411 Update to 1.12-pre5 2017-05-19 22:32:21 +01:00
Myles ece4455130 Fix chunk sending #667 2017-05-18 22:58:27 +01:00
Matsv cc64ffff98 Update to 1.12-pre4 2017-05-18 15:03:27 +02:00
Matsv dd332420e5 Fix invisible beds for 1.12-pre3 2017-05-17 21:52:36 +02:00
Myles ce8ba6a5af Merge branch 'master' into dev 2017-05-17 19:44:00 +01:00
Myles 21eb824395 Better support for nbt arrays rereading in chunks 2017-05-17 19:43:48 +01:00
Myles 246e5ca742 Merge branch 'master' into dev 2017-05-17 18:16:07 +01:00
Myles 2bd03ad92c Fix chunks on 1.11 encoder 2017-05-17 18:15:52 +01:00
Myles 7971dc797b Handle packet 2017-05-17 18:14:47 +01:00
Myles 36c047bfa0 Merge branch 'dev' of https://github.com/MylesIsCool/ViaVersion into dev 2017-05-17 17:09:27 +01:00
Myles d7daab7e64 1.12-pre3 2017-05-17 16:26:12 +01:00
Matsv b925e91bbb Merge branch 'upmaster' into dev 2017-05-14 17:13:04 +02:00
Matsv 3b1341f2b3 Cleanup code 2017-05-14 16:15:21 +02:00
Matsv 667ad0d059 Rewrite Spawner entity ID, fix #643 2017-05-14 16:02:04 +02:00
Matsv da98722470 Merge branches 'dev' and 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2017-05-14 14:50:44 +02:00
Matsv c92fcc9f9a Add NullCheck for #657 fixes #663 2017-05-14 14:50:00 +02:00
Matsv 8d66ce776c Add NullCheck for #657 fixes #663 2017-05-14 14:47:00 +02:00
Matsv 412202e105 Merge branch 'dev' of https://github.com/MylesIsCool/ViaVersion into dev 2017-05-14 14:39:02 +02:00
Matsv 35c9e4e268 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2017-05-14 14:38:45 +02:00
Matsv 81ea78e003 Update dependencies fix #662 2017-05-14 14:34:51 +02:00
Myles 833698fe8a Update to 1.12-pre2 2017-05-11 18:05:20 +01:00
Myles 70964e9ba9 Merge branch 'master' into dev 2017-05-11 18:02:50 +01:00
Myles 255a4d516e Merge pull request #657 from KernelFreeze/master
Fixing item count on 1.11, where size <= 0. (#553)
2017-05-10 20:52:22 +01:00
Matsv 11d26c13b8 1.12-pre1 2017-05-10 18:03:15 +02:00
Matsv 00b4396f86 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2017-05-10 18:00:18 +02:00
KernelFreeze 1d5d0012e6 Item count on 1.11. 2017-05-09 23:32:32 -05:00
KernelFreeze 18c706ab8a Fixing item count on 1.11, where size <= 0. Fixes #553 2017-05-09 23:19:23 -05:00
Myles 6a65a35dee 17w18b 2017-05-04 18:51:38 +01:00
Myles 37aab2c759 ViaVersion for 17w18a 2017-05-03 15:00:37 +01:00
Myles 18ad5da081 17w17b 2017-04-27 15:02:17 +01:00
Myles 9f65e727c9 17w17a 2017-04-26 15:34:24 +01:00
xBytez efa6e8ec31 Fix README.md typo that prevents the table from showing. (#654)
* Fix README.md typo that prevents the table from showing.

* Remove extra unneeded bracket from README.md
2017-04-26 13:33:10 +01:00
Myles a7df7715b1 Update to 17w16b 2017-04-21 21:26:30 +01:00
Myles a9831c842c 1.8.8 -> 1.9.4, fix hand item being sent in different tick 2017-04-20 22:03:09 +01:00
Myles 439a5f90c1 Merge branch 'dev' of https://github.com/MylesIsCool/ViaVersion into dev 2017-04-20 16:31:57 +01:00
Myles a6491cf792 17w16a support 2017-04-20 16:31:11 +01:00
Myles e1025afb54 1716a support 2017-04-20 16:23:09 +01:00
AlfieC a5dddf371d Fix critical bug (#636) 2017-04-12 18:20:27 +01:00
DoNotSpamPls fe95bbf312 1.0.4 -> 1.0.5 (#649) 2017-04-12 18:20:18 +01:00
Myles 0bab4f62de Update to 17w15a, (some sound stuff may of changed) 2017-04-12 11:55:32 +01:00
Myles 981b5cf3bf Add sound shifting for snapshot 2017-04-05 20:24:19 +01:00
Matsv 89f47c6a6a Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into dev 2017-04-05 21:09:47 +02:00
Matsv 9fd1687348 Use PacketWrapper for BossBar's instead of raw 2017-04-05 21:08:27 +02:00
Myles 899eac0e7e Fix ProtocolSupport not working on new versions #629 (+1 ProtocolSupport having nice code) 2017-04-05 20:05:08 +01:00
Myles efad8f41a1 13w14a 2017-04-05 18:09:36 +01:00
Myles ee81935a74 Update to 17w13b
Note: I had an issue with some packet not working, if you have steps to replicate please make an issue.
2017-04-01 21:55:51 +01:00
Myles e3c4253c13 Merge branch 'master' into dev 2017-04-01 00:07:32 +01:00
Myles 9d991cdd26 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion 2017-02-17 14:15:45 +00:00
Myles 3fdbf5b062 Revert previous Server protocol check, add a call to ProtocolRegistry to force class load. 2017-02-17 14:15:27 +00:00
Phineas 40937acfa0 Update to 2017 (#632) 2017-02-15 18:31:22 +00:00
Myles 99e4ab22e3 Only inject channels when server protocol is known #631 2017-02-13 17:22:52 +00:00
Myles 8da0c4310c Update to 17w06a 2017-02-08 14:10:18 +00:00
Myles 280da6b8e9 Update README 2017-02-03 16:33:34 +00:00
Myles 71ff8a773b Back to dev 2017-02-03 16:32:56 +00:00
Myles e3c1b9bf64 1.0.4 Release 2017-02-03 16:27:18 +00:00
Myles a52552dcb4 Save boss bars to BungeeCord which are made by Withers / Enderdragons 2017-02-03 16:24:14 +00:00
Myles e8039e158f Fix horse spawn eggs 2017-02-01 15:58:53 +00:00
Myles c37ef71f72 Fix spawn eggs for 1.11+ #598 2017-01-30 18:02:12 +00:00
Myles 0388f340cc Don’t support older versions if protocol support is installed, fixes #615 2017-01-30 17:15:47 +00:00
Myles 5e437d26d9 Fix typo 2017-01-12 22:10:05 +00:00
Myles c10c3547b9 Move dumps to gists #608 2017-01-03 15:53:20 +00:00
Myles 528a8e5587 Update OpenNBT 2016-12-24 17:27:59 +00:00
Myles ea4487e33f Back to dev 2016-12-20 21:46:19 +00:00
Myles c2578bd212 Bump to 1.0.3 2016-12-20 21:06:23 +00:00
Myles a1347dd669 Move 1.11.1 support to new class, fixes any other support issues (or just upgrade bungee etc) 2016-12-20 20:54:28 +00:00
Myles 3228ba65ae Fix #587 2016-12-20 20:13:19 +00:00
Myles 08b2d5b7e8 Fix #604 2016-12-20 20:11:21 +00:00
Myles 2b89dbce0e Back to snapshot 2016-12-20 16:14:13 +00:00
Myles f256309487 Bump version to 1.0.2 2016-12-20 16:07:37 +00:00
Myles 462abb1ef9 Update to snapshot 1.11.1 2016-12-15 15:39:38 +00:00
Myles a35408d14f New config option for disabling piston animation for 1.11 clients #570 2016-12-15 15:32:54 +00:00
Myles 81d4deaea7 Fix block metadata #580 2016-11-28 23:47:49 +00:00
Myles 9103f89aff 1.0.2-SNAPSHOT 2016-11-16 19:58:59 +00:00
Myles 8e4c2648a3 1.0.1 Release 2016-11-16 19:57:20 +00:00
Myles ad020ec329 Fix wrong packet format for 1.8 brewing #562 2016-11-16 18:14:47 +00:00
Matsv df3be302af Send the chunkbulk packets immediately. Fixes #535 2016-11-16 17:15:36 +01:00
Gianluca Falcomer 8e3b8cb572 Update ViaCommandHandler.java (#558) 2016-11-16 16:15:24 +01:00
Myles ff1554556e Fixed 1.7 UUID, oops. Thanks @MineTheCube 2016-11-15 21:17:39 +00:00
Myles b15c93c416 Use length for UUID compat as contains is expensive 2016-11-15 19:53:22 +00:00
Myles 071b42c9e0 Fix 1.7.2 support when used with ProtocolSupport 2016-11-15 19:11:40 +00:00
Matsv 304f9b34fd Send empty metadata flags on server switch to prevent an Elytra glitch on 1.8 fixes #555 2016-11-15 18:10:14 +01:00
Myles c817a0e9cb Add null check to hand patch 2016-11-15 17:07:31 +00:00
Myles 744252d492 Don't handle null users 2016-11-15 17:01:22 +00:00
Myles 9186361a29 Change ConcurrentHashMaps to just Maps for Java 7 support 2016-11-15 15:17:16 +00:00
Myles bf01c9ea0e Fix getting connection twice 2016-11-15 08:17:15 +00:00
Myles bee260e2b4 Ignore null users 2016-11-14 23:42:29 +00:00
Myles 21811991f1 Correct elytra dropping, fixes #545 2016-11-14 23:35:47 +00:00
Myles a2809f8d5c Add count to /viaver list, #540 2016-11-14 22:38:39 +00:00
Myles 95f2b597da This is billy, he got lost on his way to the last commit, apologies. 2016-11-14 22:20:08 +00:00
Myles fa348fbc23 Fix villager trading on 1.11 #534 2016-11-14 22:17:23 +00:00
Matsv d277701caa Ignore if the setMainHand doesn't exist 2016-11-14 21:13:18 +01:00
Matsv 9b7f68a888 Store the mainHand and change it on serverChange for Bungee, fixes #536 2016-11-14 20:59:06 +01:00
Myles 7e837ef9db Ensure we don't save and load config at same time 2016-11-14 18:46:27 +00:00
Myles eb78fe4bfc Better flexibility with number loading 2016-11-14 18:29:45 +00:00
Matsv 689f0fd5db Back to the snapshots 2016-11-14 19:17:20 +01:00
Myles 32316cf3ab Fix character limit to 100 for messages, #530 2016-11-14 18:14:49 +00:00
Matsv d450c9b4d6 1.11 and bump version 2016-11-14 16:15:20 +01:00
Myles 622673d1d3 Small javadoc tweaks 2016-11-14 13:21:06 +00:00
Myles 1209beb47d Allow servers to manually be probed with API 2016-11-14 12:38:39 +00:00
Myles f4eeb94a2e Better support for malformed json packets #528 2016-11-14 12:03:22 +00:00
Myles fac7eab59e Prepare for 1.0.0 2016-11-13 14:04:56 +00:00
Myles e430bfce06 Fix uninjection when different handler order 2016-11-13 13:34:22 +00:00
Matsv dd55cc3cf2 Merge branch '1.11-DEV' of https://github.com/MylesIsCool/ViaVersion into 1.11-DEV 2016-11-13 14:26:21 +01:00
Matsv 9937a173d1 Use the correct platform name and version for Sponge 2016-11-13 14:26:04 +01:00
Myles 1c584040ca Use logger instead of System.out 2016-11-13 13:25:56 +00:00
Myles 10a2df5a7d Use plugin description from project pom.xml and fix sponge.
This disables the sponge plugin annotation processor and uses our own mcmod.info
2016-11-13 13:15:26 +00:00
Matsv 1bec3cf1d0 Change the metadata transformer fail message 2016-11-13 13:36:03 +01:00
Matsv 4142797380 Implement PlatformVersion for better dump output 2016-11-13 12:36:48 +01:00
Matsv 68fc884d2a Change the platform name to the full name that includes the version 2016-11-12 13:16:27 +01:00
Matsv 2872bdd1c3 Update the snapshot comment to 1.11-pre1 2016-11-08 16:09:00 +01:00
Matsv 7d29a0c0af 1.11-pre1 2016-11-08 16:02:11 +01:00
Matsv dd6423de06 Remove event-based commandblock listeners 2016-11-06 11:30:28 +01:00
Matsv 52bbf1affe Handle the actionbar packet change 2016-11-06 10:37:26 +01:00
Matsv cfaded6cf8 Make CommandBlocks work on BungeeCord with 1.8.8 child servers 2016-11-02 18:14:57 +01:00
Matsv 69e444f83d Fix Bungee constant entity ids 2016-11-02 18:07:21 +01:00
Matsv c896ed5f63 Move the Bungee server switch handler to an event instead of inside the encoder, this will also make ViaBackwards work correctly 2016-11-02 17:17:41 +01:00
Myles 9f8456a336 16w43a compatibility 2016-10-27 13:23:30 +01:00
Myles bd11c98e45 Better support for ChannelInitializer detection (incase they do something funny, fixes latest PS dev) 2016-10-26 17:34:09 +01:00
Myles 55fccba711 Support for new PS when package isn't found 2016-10-26 17:33:16 +01:00
Matsv 783542401b Update sounds to 16w42a 2016-10-25 19:31:32 +02:00
Matsv 2424057536 Translate messages from legacy, fix #521 2016-10-25 18:34:20 +02:00
Myles b6dbe82d16 Fix lower version support (default to client version if we can't port it instead of server) #519 2016-10-23 21:18:18 +01:00
Max Qian f92b7e5b80 Tell ProtocolSupport to decode MINECRAFT_FUTURE packets using the default decoder (for 1.9.4) 2016-10-19 14:44:25 +01:00
Myles 8093c424e2 WIP fix, ping works but it still doesn't connect 2016-10-19 14:44:25 +01:00
Matsv 839d46f5ed Merge remote-tracking branch 'upstream/1.11-DEV' into 1.11-DEV 2016-10-19 15:31:45 +02:00
Matsv de0b9a2a68 16w42a 2016-10-19 15:31:29 +02:00
Myles c3bd45cd58 Better naming for version info 2016-10-17 23:05:21 +01:00
Myles c4bab6c9af Optimise reflection in some cases where method isn't cached. 2016-10-16 16:25:53 +01:00
Myles f33d22531b Merge branch 'master' into 1.11-DEV 2016-10-14 23:07:50 +01:00
Myles 9ccbdb69c5 Fix #515 Disconnect Message not being fixed json 2016-10-14 23:06:11 +01:00
Myles e9008923eb Revert "Add json fixing to login disconnect #515"
This reverts commit 301e84d698.
2016-10-14 23:03:40 +01:00
Myles 301e84d698 Add json fixing to login disconnect #515 2016-10-14 23:02:11 +01:00
Matsv 5aad3306eb 16w41a 2016-10-13 17:01:04 +02:00
Matsv d30bbcd4a3 16w40a 2016-10-06 16:40:47 +02:00
Matsv 003197b476 Change circle.yml to java 8 since Sponge uses Java 8 2016-10-05 20:10:22 +02:00
Myles a3e15bce4d Use correct tags for javadocs 2016-10-04 21:57:14 +01:00
Matsv e43026231e Move sponge-legacy up 2016-10-04 21:20:59 +02:00
Matsv f100f6e3f0 Rename Snapshot to 1.11 2016-10-04 20:04:49 +02:00
Mats 8ae2842e5f Merge pull request #509 from MylesIsCool/modular
Merge modular into 1.11
2016-10-04 19:57:24 +02:00
Matsv 54be03bf77 Merge branches '1.11-DEV' and 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-10-04 19:35:48 +02:00
Matsv 27fc4dd684 Rewrite sounds, thanks @Pokechu22 for open-sourcing your forks of Hamburglar & Burger Vitrine :) 2016-10-04 19:35:20 +02:00
Myles 2a1f0f812b Move Sponge to API 5, add legacy support module 2016-10-04 00:26:27 +01:00
Myles 64cde13ea7 Ensure order is kept with maps & yaml (as well as concurrency with maps) 2016-10-02 20:50:34 +01:00
Matsv 7d23b12f85 Implement the UpdateListener for Bungee 2016-10-02 21:35:54 +02:00
Myles 4b3f757881 Rename scan servers to probe 2016-10-02 19:45:55 +01:00
Myles d0e7f05d50 Remove commented line 2016-10-02 19:41:02 +01:00
Myles 21c957b8d5 Config for protocol versions
Also make config concurrent
2016-10-02 19:40:38 +01:00
Matsv 3fe25f68b1 Fix another infinite loop, @MylesIsCool and I are great at creating them ;) 2016-10-02 12:03:56 +02:00
Matsv 3354a46283 Remove some more debug messages 2016-10-02 11:41:18 +02:00
Matsv 975743c76f Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-10-02 11:28:10 +02:00
Matsv d3b214965b Add server info to the dump (#505) 2016-10-02 11:27:45 +02:00
Myles eb8065ad20 Tab complete for bungee 2016-10-01 21:30:39 +01:00
Matsv 7d3548956e Fix 16w39c 2016-10-01 20:56:14 +02:00
Matsv 3de961f641 Remove infinite loop 2016-10-01 20:26:04 +02:00
Matsv 59620f7f93 Add a command to force search versions @ Bungee 2016-10-01 15:38:53 +02:00
Matsv ba3aa4566e Remove some debug messages that prevent Jenkins from building. 2016-10-01 14:56:08 +02:00
Matsv 8445a6d9db Fix wrong handling if the client and child server have the same protocol id 2016-10-01 14:27:39 +02:00
Matsv f53c8c67e2 Fix Bukkit config NPE, only change the protocol id if ViaVersion can support it and support unsupported Bungee protocol ids (Not working correctly yet) 2016-10-01 13:31:14 +02:00
Myles b4976bd302 Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-10-01 00:11:08 +01:00
Myles ec848d7201 Reflection for Bungee stuffs 2016-10-01 00:10:54 +01:00
Matsv 8c03a296c2 Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-10-01 00:59:56 +02:00
Matsv 65a6e25f1b Remove debug message 2016-10-01 00:59:42 +02:00
Myles 178b625ca0 Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-09-30 23:55:21 +01:00
Matsv 152993f749 Get bungee protocol version detection working. Still some odd issues. 2016-10-01 00:53:50 +02:00
Matsv ca246f9d95 Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-09-30 23:02:53 +02:00
Matsv f1d53bb7ac Start working on Bungee protocol id detection. 2016-09-30 23:02:34 +02:00
Myles 30950a7d74 Don't include guava in the jar & go for lower version for bukkit compatibility 2016-09-30 20:51:01 +01:00
Myles 305f6b7ce2 Implement Hand Item Cache for Sponge 2016-09-30 20:48:02 +01:00
Matsv 313b794285 Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-09-30 20:09:03 +02:00
Matsv 7031d431da Implement 1_11 entity / parent class structure and patch holograms the other way around! Thanks for fixing Mojang :-) #482 2016-09-30 20:08:39 +02:00
Myles 655e14b36e Make dumping pretty print + add Bungee dumping 2016-09-30 16:30:28 +01:00
Matsv f881f3d484 Merge branches '1.11-DEV' and 'modular' of https://github.com/MylesIsCool/ViaVersion into modular
# Conflicts:
#	pom.xml
2016-09-30 17:19:51 +02:00
Matsv 4d3302a926 Support for 16w39c 2016-09-30 17:14:14 +02:00
Matsv b2df970af5 Implement removePortedClient on Bungee 2016-09-30 16:20:29 +02:00
Myles b7b322a525 Full config api for all platforms using snakeyaml + comments 2016-09-30 00:34:16 +01:00
Myles 771c00b146 Implement Task Ids 2016-09-29 22:55:08 +01:00
Myles 23f1589c28 Update commands to add new platform specific command also add platform to updater. 2016-09-29 22:35:51 +01:00
Myles eb72db9a5f Update TODO 2016-09-29 21:30:09 +01:00
Myles 10fc8f846d Fix PacketWrapper sending and implement Movement Transmitter for Bungee 2016-09-29 21:29:58 +01:00
Myles 31c9332e56 Fix chunks for BungeeCord 2016-09-29 20:46:31 +01:00
Myles b0d64bfebd Fix a bug in chunks (still not working fully)
Also remove bungeecord-proxy
2016-09-29 20:40:58 +01:00
Matsv ffbd399993 16w39b 2016-09-29 18:43:13 +02:00
Matsv aeec7e5f95 Start working on packet-level chunk bulks 2016-09-29 16:33:14 +02:00
Myles 36301a595b Fix Bungee Support (Excluding Chunks) + Rename Handlers 2016-09-29 15:25:18 +01:00
Matsv a864bf7c18 Support for 16w39a 2016-09-28 16:14:52 +02:00
Matsv 0454169588 Add viaver alias 2016-09-27 19:38:13 +02:00
Matsv 8ea3623a79 Stop using new Gson() everywhere (#505) 2016-09-27 19:15:39 +02:00
Myles 866e494d3c Remove Commons 2016-09-27 17:48:56 +01:00
Myles d5108061c1 Implement World Change 2016-09-27 17:38:56 +01:00
Myles 396998c7fc Factor & Javadoc update 2016-09-27 17:31:10 +01:00
Matsv ff3d76a387 Move the todo list to #505 2016-09-26 22:45:54 +02:00
Matsv 51c469882b Port Bukkit listeners to Sponge 2016-09-26 22:30:59 +02:00
Myles 8b9a1750de Basic Config API for sponge, need to do comments 2016-09-26 20:12:34 +01:00
Myles 3411c3d144 Add encoder name 2016-09-26 17:57:36 +01:00
Myles cdab5b3f5b Inject into Bungee, (does not get past login from when i've tested)
Also add commands
2016-09-26 14:48:46 +01:00
Myles 42edffb309 Change reflection to NMSUtil, and start work on Bungee (doesn't work) 2016-09-26 13:50:20 +01:00
Matsv 42efc736c3 Cleanup metadata 2016-09-26 14:36:10 +02:00
Myles 30bb91fc8a Revert Mats moving the repo 2016-09-26 13:14:38 +01:00
Myles 14daca5fea Fix 1.9.4+ support and also fix sponge support to work better.
Tested on SpongeVanilla + SpongeForge
(1.8.8 & 1.9.4)
2016-09-26 13:11:46 +01:00
Matsv 8396c5a3e3 Merge branch 'modular' of https://github.com/MylesIsCool/ViaVersion into modular 2016-09-26 13:25:47 +02:00
Matsv e136d1db94 Basic Bungee structure 2016-09-26 13:25:28 +02:00
Myles 90dabce0d2 Sponge: Fix dump, add load message, move loading, handle reload
And fix travis
2016-09-26 11:48:06 +01:00
Matsv 9a8a6e5b16 Implement PPS for Sponge 2016-09-26 11:16:20 +02:00
Matsv 4840db095c Fix metadata 2016-09-26 11:02:54 +02:00
Myles b371c14a27 Add Sponge Support 2016-09-26 01:44:21 +01:00
Myles a1fbca11f0 Queue tasks & Fix PPS 2016-09-25 21:02:12 +01:00
Myles 0fe9ccf4a8 Make pom.xml better 2016-09-25 20:43:32 +01:00
Matsv 08713947b7 Add BukkitViaLoader to the builder and limit the builder methods 2016-09-25 21:42:22 +02:00
Matsv e56bce2f31 Create builder for ViaManager 2016-09-25 21:33:47 +02:00
Matsv 573374866b Optimize imports & reformat code 2016-09-25 21:17:09 +02:00
Matsv 32afa2a9a3 Fix building and change versions 2016-09-25 21:10:41 +02:00
Myles 669cbcd142 Fix maven so it compiles 2016-09-25 20:05:58 +01:00
Myles 471076cbe1 Update Changelog 2016-09-25 19:44:05 +01:00
Matsv 79d353d458 Basic configuration api and add platform specific dump info 2016-09-25 20:41:34 +02:00
Myles 30d477c6d2 Add Bulk Chunks, need to do full packet reading as a fallback though 2016-09-25 19:34:24 +01:00
Myles d3f5ebdba7 Update TODO 2016-09-25 18:52:37 +01:00
Matsv 4b94c8ad02 Map all entity and object ids / parents and fix metadata searcher 2016-09-25 19:50:50 +02:00
Myles 7a7c3f15d8 Add required provider for movement (for reflection caching) 2016-09-25 18:26:14 +01:00
Myles 52610f7c66 Use HandItemProvider for 1.8 hand items 2016-09-25 18:06:04 +01:00
Matsv 84ee4410a6 Use generics for bossbars 2016-09-25 18:20:42 +02:00
Myles 49d51de263 Start moving listeners away 2016-09-25 17:17:07 +01:00
Myles 848b0cf113 Make ViaCommandSender better, fix quite a few of the commands. 2016-09-25 16:03:03 +01:00
Myles c4ffdc1b7c Migrate to our own types + use ids instead of materials 2016-09-25 15:40:30 +01:00
Myles 49b602994a Migrate Environment to our own type (todo javadocs for it) 2016-09-25 15:00:05 +01:00
Myles 05930ad791 Add ViaManager and abstraction / Add todo list 2016-09-25 14:39:37 +01:00
Matsv e7ab232b28 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into modular 2016-09-25 12:49:22 +02:00
Matsv 3f88a16c6c Merge branches '1.11-DEV' and 'master' of https://github.com/MylesIsCool/ViaVersion into 1.11-DEV 2016-09-25 12:48:22 +02:00
Matsv 1a6b98deca Cancel second-hand packets to prevent double interact Fix #502 2016-09-25 12:19:23 +02:00
Matsv 598863d43a Add onCommand and onTabComplete to the interface 2016-09-24 20:12:12 +02:00
Matsv b146257b1a Abstract the BossBar for multi-platform support 2016-09-24 19:31:41 +02:00
Myles dc01fb59b8 Doesn't compile but start work towards seperating into modules... (with legacy support hopefully for basic API) 2016-09-23 18:49:59 +01:00
Myles 58ed2c0d9e Merge branch 'master' into 1.11-DEV 2016-09-23 15:55:47 +01:00
Matsv 3762a9d3b1 Actually fix #500, mode changed to VarIntEnum at 1.8->1.9 but we never changed it. 2016-09-21 15:26:06 +02:00
Matsv 5a88963929 Fix #500 2016-09-21 15:14:31 +02:00
Nick 1b69243326 Update README.md (#498) 2016-09-20 19:23:21 +01:00
Matsv 3e2a391348 Looks like Intellij didn't commit the 16w38a changes 2016-09-20 16:53:01 +02:00
Matsv a330d2b148 Compatibility for 16w38a and sync with master 2016-09-20 16:43:42 +02:00
Nick 573f769825 Update Bungee.java (#494) 2016-09-13 18:56:26 +02:00
Myles 9de49176fb Add Matsv to authors 2016-09-12 17:59:15 +01:00
Mats e6220f39e5 Support for 16w36a 2016-09-08 18:31:27 +02:00
Myles 8f656d9dac Fix ListWrapper, I'm not even sure why I did this... but hey! 2016-09-05 12:24:33 +01:00
Matsv 15bcf3f065 Support for 16w35a 2016-09-01 15:57:25 +02:00
Myles 536e2e33e0 Update Description & Don't use BungeeCord ChatColor 2016-08-28 11:38:38 +01:00
Mats ae58f0c1ab Update the issue template 2016-08-25 18:00:16 +02:00
Myles 7d9cd5bfbf We're gonna use 0.9.10 until 1.11 release which we'll use 1.0.0 2016-08-25 16:56:01 +01:00
Myles 25a7915c7f 0.9.9 Version 2016-08-25 16:52:34 +01:00
Myles 822d582074 Deprecate isPorted, we port all players use getPlayerVersion instead. 2016-08-24 20:40:53 +01:00
Matsv d815c0e682 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into 1.11-DEV 2016-08-24 16:46:47 +02:00
Matsv f8a73d5fc2 Merge branch 'master' of https://github.com/Matsv/ViaVersion into upmaster 2016-08-22 21:38:19 +02:00
Matsv a0ad97947d Add the configuration to the dump command, also add a toString method to the ProtocolVersion class. 2016-08-22 21:37:51 +02:00
Myles 6ea5d0849d Missed a bit off the README 2016-08-21 15:52:59 +01:00
Myles eba512ef0b Update README with IRC 2016-08-21 15:51:21 +01:00
Matsv 725ab0f713 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into 1.11-DEV 2016-08-20 16:29:01 +02:00
Matsv 0f96c24c78 Merge branch 'master' of https://github.com/Matsv/ViaVersion into dumpthemall 2016-08-20 16:21:19 +02:00
Matsv f2e4c37cd9 Add ViaVersion dump command to get all the relevant info we need by bug reports. 2016-08-20 16:19:44 +02:00
Myles f159a2250c SemVer compatibility, also change up the messages a bit. 2016-08-20 13:47:09 +01:00
Myles ed311e4059 Clean up some messages to be more understandable. 2016-08-20 12:03:23 +01:00
AlfieC 6aae98a8a9 typo (#485) 2016-08-17 23:32:21 +02:00
Matsv 99f9cf3340 Support for 16w33a 2016-08-17 16:45:33 +02:00
Matsv 2074039285 Merge branch '1.11-DEV' of https://github.com/MylesIsCool/ViaVersion into 1.11-DEV 2016-08-11 17:07:57 +02:00
Matsv b438ff61a2 Support for 16w32b 2016-08-11 17:07:35 +02:00
Myles c36e43b573 Remove unused imports 2016-08-10 20:36:34 +01:00
Matsv be383a524c Woops, remove ; 2016-08-10 21:34:13 +02:00
Matsv 9c6cd22817 Gotta catch them all 2016-08-10 21:33:32 +02:00
Myles 85de7c35ea Fix metadata :) 2016-08-10 20:23:13 +01:00
Matsv 0dd8c33aa9 Handle villager profession 2016-08-10 20:48:45 +02:00
Myles 8cc2538e6c Push type converting to new entity types. 2016-08-10 19:38:59 +01:00
Matsv 04d87ebba7 Merge branch '1.11-DEV' of https://github.com/MylesIsCool/ViaVersion into 1.11-DEV
# Conflicts:
#	src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_10/ProtocolSnapshotTo1_10.java
2016-08-10 20:14:11 +02:00
Matsv 8c4b5b613c Fix spawneggs 2016-08-10 20:12:27 +02:00
Myles 6add512fe1 Start work on Remapping Types 2016-08-10 19:10:05 +01:00
Myles 73b8a2fc9a Start support for entity type id tracking 2016-08-10 18:54:56 +01:00
Myles 03cc48c991 Use constant of 1 for collect, (Tested). 2016-08-10 16:11:39 +01:00
Matsv 44544925a1 map packet changes. 2016-08-10 15:59:13 +02:00
Matsv 7cadf832f5 Preparations for the snapshot. 2016-08-10 14:51:32 +02:00
Matsv 0f3daa5dc4 Merge branch 'chunkFix' of https://github.com/Matsv/ViaVersion into upmaster 2016-08-08 18:00:40 +02:00
Matsv f258cf8c89 Stop depending on versions for the ChunkTypes. fix cast exceptions by using a ChunkType in front of it. 2016-08-08 17:38:11 +02:00
Matsv ca759c056e Add some missing sounds 2016-08-07 17:53:08 +02:00
Matsv d715607826 Implement 1_8 writing 2016-08-05 20:17:39 +02:00
inventivetalent afca92d122 update requests to use /v2 (#479) 2016-08-04 20:42:03 +01:00
Myles ae37b34692 Snapshot 2016-08-01 14:07:33 +01:00
Myles 9e42a368e0 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion 2016-08-01 14:06:11 +01:00
Myles 27982efd29 Bump version to 0.9.8 2016-08-01 14:05:07 +01:00
Mason c3b343fbc8 Allow non-solid blocks to be placed at feet (#472) 2016-07-22 21:06:51 +01:00
Matsv 9bedb6c741 Move some classes to other packages 2016-07-17 12:00:46 +02:00
Matsv 873f4dd298 Give it some protection 2016-07-11 22:06:00 +02:00
Matsv 693990644f Rename the Meta(List)1_9_1_10Type to Metadata(List)1_9Type and cleanup the listeners 2016-07-11 20:27:44 +02:00
Matsv b2680d76a6 WIP cleanup 2016-07-11 15:52:06 +02:00
Matsv db935b454f Make the Metadata types version based and remove the NoGravity tag init since it doesn't seem needed. 2016-07-11 13:48:48 +02:00
Myles c207a9bfff Count other worlds as nether instead of imploding. 2016-07-10 12:35:46 +01:00
Myles f5bd041c7b Fix PacketListenerAPI load to be before Via, fixes #463. Tested with NickNamer 2016-07-09 15:21:17 +01:00
Myles 07d89b24af Custom reload message #459 2016-07-09 14:41:07 +01:00
Myles 1d0c0c527c Snapshot 2016-07-08 12:56:34 +01:00
Myles 7a9cb86563 0.9.7 release 2016-07-08 12:55:05 +01:00
Myles 87b1919863 Let the normal send go through the event loop. Fix signs are sent before the chunks on a 1.9.4 server with a 1.9-1.9.2 client (#460) 2016-07-03 12:05:32 +01:00
Myles d164e413c2 Snapshot 2016-07-02 23:34:31 +01:00
Myles 76d7db044f Version bump + small dead code fix 2016-07-02 23:28:54 +01:00
Myles 046ebb8ecc Fix chunk bug 2016-07-02 23:22:44 +01:00
Myles bccde04ace Back to snapshot 2016-07-02 22:37:29 +01:00
Myles 9385f03722 Bump version and tiny bit of formatting fix 2016-07-02 22:33:54 +01:00
Myles b48fc17ead Transform block 36 for 1.9.2 reading, and also use PartialType. 2016-07-02 22:32:40 +01:00
Myles b50d0075ca PacketWrapper allow returning of ChannelFuture with send, and fix blocked protocols disconnect.
Also remove a TODO.
2016-07-02 22:19:43 +01:00
Myles 84d006c71d Merge branch 'lenis-patch' 2016-07-02 22:06:39 +01:00
Myles 212da9c46c Fix resetReader being wrong, ty @Matsv for helping solve this 2016-07-02 22:05:08 +01:00
Myles 8edb7048a1 Code cleanup and implement index fix by @Matsv 2016-07-02 21:23:28 +01:00
Myles abe3c4b0c9 Identify unsigned byte properly 2016-07-02 21:07:41 +01:00
Myles c6d3c97c65 Fix clearing of wrapper 2016-07-02 21:07:22 +01:00
Matsv 13c6a9d612 Change getBlockId to get instead of indexOf 2016-07-02 20:45:34 +02:00
Myles 7d2ef743ac Fix stupidity, thanks @Pokechu22 <3 2016-07-02 19:09:38 +01:00
Myles 598d0f96d8 Not sure if i'm working forward or backwards on this, but pushing for progress 2016-07-01 20:17:25 +01:00
Matsv cbc22922d3 Set default force-sign-transformer to false 2016-07-01 18:51:42 +02:00
Myles 49783d36c2 Add link to docs. 2016-07-01 17:13:01 +01:00
Myles 70d91b4f87 Blocked versions now included when server sends supported versions, javadoc fixes & simple colour for blocked-msg. 2016-07-01 16:36:19 +01:00
Myles 17f3d13267 Fix #450, ProtocolSupport concurrency issues, also make listwrapper sync'd 2016-06-30 00:26:12 +01:00
Myles 559674bf58 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion 2016-06-29 16:43:42 +01:00
Myles fbc298bc30 Add some more detail to the config 2016-06-29 16:38:38 +01:00
Matsv e36902c441 Add possibility to block specific protocol versions 2016-06-29 12:26:03 +02:00
Matsv 805c78989a Port all the clients to prevent issues like ViaVersions BossBarAPI not working for clients on the same protocol. (If you use the api on a 1.9> server) 2016-06-29 11:35:15 +02:00
Mats 85e416171c Let the transformer handle the signs (#456) 2016-06-28 13:16:36 +02:00
Mats b55c0d0783 Possibility to force the json transformer (#455)
* Possibility to force the json transform

* Escape all the Strings. Who likes double quotes anyways.
2016-06-26 21:47:08 +01:00
Myles 33b4b3835f Update Contributors and version in README 2016-06-25 23:38:04 +01:00
Matsv 8ccd772105 Change the formatting a bit. merged #421 2016-06-25 13:22:18 +02:00
Matsv 8677c632df Merge remote-tracking branch 'jor/potion' into upmaster 2016-06-25 13:19:14 +02:00
Myles 560476c56f Should fix #452 2016-06-24 14:02:29 +01:00
lenis0012 20bbe7cec6 Support 1.9.2 servers
This code basically reads 1.9 data so it can then be transformed to add
in the tile entities.
it geta a little funky when it already loaded it as a 1.8 chunk tho, so
i had to add some methods to the chunk api.

in short: I hate minecraft
2016-06-23 04:00:59 +02:00
Myles 1a002486d0 Move back to snapshot, oops 2016-06-22 23:37:58 +01:00
Myles 26fcdfe3bc Allow ability to replace piston extension block to prevent crashing. 2016-06-22 23:34:32 +01:00
Mats 4af98b220c Fix piston tile entity crash (#443) 2016-06-22 21:37:53 +01:00
Myles f91fcb4ea8 Bump version 2016-06-22 21:33:25 +01:00
Myles b3060e0dc8 Start work on 1.9.2 chunk stuff, no where near done bit stuck on detecting skylight. 2016-06-22 21:32:26 +01:00
Myles 808a9a7d82 Small PPS change to allow %pps to be used as a placeholder. 2016-06-22 21:31:27 +01:00
Myles 32c43e6023 Fix chunks not being written and array type being weird. 2016-06-22 21:22:19 +01:00
Matsv 4c9c50f939 WIP: Move the TileEntities writer to the 1.9 transformer. 2016-06-22 22:00:24 +02:00
Matsv ac1b35379e Remove not required tags, and remove tested todo's 2016-06-22 20:38:40 +02:00
Myles b743589d77 This works but lags, only for 1.8 server. 2016-06-22 19:22:38 +01:00
Myles 9dad0a0d5e Fix the arrays 2016-06-22 18:20:42 +01:00
Matsv f5b49bc9ce Experimental implementation for block entities into chunks 2016-06-22 19:07:46 +02:00
Matsv b3612a68b0 Merge branch '1.10.1-chunkrefactor' of https://github.com/MylesIsCool/ViaVersion into 1.10.1 2016-06-22 18:36:42 +02:00
Myles 7385db02c2 Reorganise packages and push initial interface 2016-06-22 17:35:07 +01:00
Matsv 501d2ec3a2 Rewrite block tile entities. Not tested yet 2016-06-22 18:03:27 +02:00
Myles 1217a9b7e2 Make versions ordered by the index inserted. (Seems to work best over alphabetical) 2016-06-19 23:32:41 +01:00
Myles 6740c5c6dc Spring cleaning & make /viaver pps say when no players. 2016-06-19 22:36:15 +01:00
Myles 44e8056fb3 Add more versions & use ProtocolSupport API if not ported. 2016-06-19 22:35:49 +01:00
Myles d1da412cf7 Disable our system when an unknown handshake happens, fixes support for older mc versions. 2016-06-19 22:04:54 +01:00
Myles 6534a5414e Basic compatibility with ProtocolSupport, doesn't seem to work with 1.6.4 due to issues with our Login Handler. 2016-06-19 18:08:49 +01:00
Myles 91344a0b50 Cleanup some of the block placement code. 2016-06-19 18:07:00 +01:00
Myles cdd9ff4469 Back to snapshot 2016-06-15 19:47:10 +01:00
Myles d88b76db85 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion 2016-06-15 19:45:28 +01:00
Myles bc1d57853c Bump version 2016-06-15 19:44:25 +01:00
Troy Frew 27d6c12556 Added TacoSpigot to the block place fix. (#437)
TacoSpigot is a fork of PaperSpigot that people use.
2016-06-13 09:29:10 +02:00
Mats a76dd1ba49 Merge pull request #427 from Harry5573/master
Correct hologram Y offset
2016-06-10 15:38:52 +02:00
Mats 1a4388b3e7 Convert the Elytra sound properly they added in 1.9.2. Fix #430 (#432)
* Convert the Elytra sound properly they added in 1.9.2. Fix #430

* Change wrong version in comment

* Remove the passthrough
2016-06-09 16:03:01 +01:00
Mats f1b81f77d6 Use Myles new Magic transformer for the ArmorListener (#429)
* Use Myles new Magic transformer for the ArmorListener

* Use Myles new Magic transformer for the CommandBlockListener
2016-06-09 10:49:31 +01:00
Myles d6edec3a55 Allow packets to be transformed after sent by specifying the current protocol, woo! 2016-06-09 02:44:12 +01:00
Harry 094f4c6d58 Correct hologram Y offset
https://github.com/filoghost/HolographicDisplays/blob/master/HolographicDisplays/Plugin/com/gmail/filoghost/holographicdisplays/util/Offsets.java#L15 The offset is by default -1.25 for 1.8, however 1.9 clients require only -0.29. (-1.25 - -0.29) = -0.96 which should be the correct offset.
2016-06-08 21:43:15 +01:00
Matsv c57d0f60f9 Change to DEV version 2016-06-08 20:40:50 +02:00
Matsv dd5cd1ca48 Remove experimental message from readme 2016-06-08 20:38:39 +02:00
joserobjr ab4a565700 Update README.md (#426) 2016-06-08 20:36:29 +02:00
Myles f8ac54e237 Fix splash potion crash. 2016-06-08 19:02:11 +01:00
joserobjr 089e07fe49 Changes the random chest sounds to normal chest. (#424) 2016-06-08 19:09:19 +02:00
yzimroni 1d3b8f802c Update names from 'snapshot' to '1.10' (#422) 2016-06-08 18:00:21 +02:00
Myles 27283e48a2 Bump the version to avoid bad downloads. 2016-06-08 16:10:59 +01:00
Matsv d22584afbc Bye bungee we will not miss you, you eat our memory 2016-06-08 17:02:13 +02:00
Matsv 249ab01425 Rename package 2016-06-08 16:41:00 +02:00
Matsv 851097de44 Rename package 2016-06-08 16:38:59 +02:00
Matsv c095a51f7c 1.10 support and version bump 2016-06-08 16:35:06 +02:00
Matsv 5e62b7001e Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into 1.10 2016-06-08 15:35:55 +02:00
joserobjr a79533bf72 Fixed uncraftable potion conversions from 1.8 to 1.9 2016-06-08 10:31:03 -03:00
joserobjr e3510d01d6 Fixes potion data conversion from 1.8 to 1.9 2016-06-08 08:09:13 -03:00
Mats 8cc4ba168a Patch EchoPet wrong metadata value (#419) 2016-06-08 11:29:08 +01:00
Matsv 264a21d092 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into 1.10 2016-06-08 11:37:23 +02:00
Mats e2585db350 Make the main class cleaner by giving the config his own class (#418) 2016-06-07 19:18:48 +02:00
Matsv a2f7a52d31 Support for 1.10-pre2 2016-06-07 17:29:30 +02:00
Matsv d04121202d Modify the config comments to & 1.10 2016-06-07 09:11:33 +02:00
Matsv 95517ade2c Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into 1.10 2016-06-03 22:18:28 +02:00
Matsv c9441de7e4 Change from info to severe 2016-06-03 21:15:53 +02:00
Matsv dc946cb845 An amazing feature. 2016-06-03 20:49:06 +02:00
Myles 5fa30d9adb Merge branch 'master' into 1.10 2016-06-03 18:52:52 +01:00
Myles a7043424ec Support ProtocolLib + late-bind, also it now tells you the plugin to blame if it goes wrong. How nice! 2016-06-03 18:52:25 +01:00
Matsv e1b3d21732 Woops, the sounds were still broken. Now it should be fixed. no lies this time 2016-06-02 21:19:48 +02:00
Matsv 8ffc056a7e Cleanup and change class/package names from 1.9.3 2016-06-02 21:00:18 +02:00
Matsv 7c274fb03d Handle new sounds 2016-06-02 20:52:55 +02:00
Matsv 3b533b5138 Compatibility with 1.10-pre1 (number 2, git didn't push everything for some reason) 2016-06-02 18:37:05 +02:00
Matsv 5665510f7e Compatibility with 1.10-pre1 2016-06-02 18:34:04 +02:00
Matsv 47faa21ef4 Add latest build to readme & auto-build test 2016-05-27 19:44:21 +02:00
Myles 575f457830 0.8.5 SNAPSHOT 2016-05-27 18:37:34 +01:00
Matsv d5bf7909e8 Sync with master 2016-05-27 19:16:22 +02:00
Myles fdf90b7931 0.8.4 Release 2016-05-27 18:05:46 +01:00
Myles e3305e4eae Automatically buffer unknown entities, removes 2 config values and deprecate api 2016-05-27 01:00:01 +01:00
Matsv 15fe8d394e Support for 16w21b 2016-05-26 19:02:06 +02:00
Matsv 082db38c40 Merge branch 'master' of https://github.com/MylesIsCool/ViaVersion into 1.10 2016-05-26 17:03:40 +02:00
Myles be54dc41d1 Add SkinRestorer to plugin.yml unsure if this will fix anything 2016-05-26 14:27:27 +01:00
Myles 487e79c043 Fix javadocs 2016-05-26 13:54:22 +01:00
Matsv ef6390a0b8 Update version for the buildserver 2016-05-26 11:16:12 +02:00
Matsv 9d9fc65633 Support for 16w21a, how fun. A snapshot without packet changes 2016-05-25 16:44:20 +02:00
Matsv 6eac61c912 Sync with master 2016-05-24 21:17:30 +02:00
Matsv d89362a271 Sync with master 2016-05-24 21:13:28 +02:00
Matsv 0a407069fa Add Burger to sources :) 2016-05-24 21:09:04 +02:00
Myles 661fdb1127 Bump version 2016-05-22 11:42:53 +01:00
Myles 9e6c0f72a8 Update version to be 1.9.3/4 2016-05-22 11:41:59 +01:00
Myles 70ad2613f1 Update config to look a bit more nicer, doesn't have the extra space when generated by bukkit. 2016-05-22 11:41:27 +01:00
Myles 9052946c45 Merge branch 'master' into 1.10 2016-05-21 22:12:10 +01:00
Myles 3ddc43bf7b Implement isSpigot() in the API and make it so xray does not activate if they do not use spigot. 2016-05-21 22:07:20 +01:00
Matsv cdb757eae5 Implement Myles idea to just use templates instead of defining compatibility 2016-05-21 21:19:20 +02:00
Matsv 50a3e03649 Possibility to add 'isCompatible' with other types. Fixes crashes on a 1.8 server 2016-05-21 20:54:26 +02:00
Matsv 957284930e Fix sounds 2016-05-21 16:19:12 +02:00
Matsv 198a24371c Sync with master 2016-05-21 15:01:25 +02:00
Mats bcc994b0dd Add possibility to get the supported versions from the api and status response (#402)
* Possibility  to send the Supported versions inside the status response packet

* Make lowercase
2016-05-19 18:56:42 +01:00
Matsv f870bd5a32 Transform pitch correctly 2016-05-19 13:07:51 +02:00
Matsv a14abd6f4f Handle the new Metadata value for 16w20a 2016-05-19 12:18:04 +02:00
Matsv 2456c3cf17 Basic support for the new 1.10 snapshot 16w20a 2016-05-18 16:43:57 +02:00
Myles 9828e4ae1d Add maven default goal.
Requested by our lord and saviour @Aikar
2016-05-17 23:40:00 +01:00
834 changed files with 271678 additions and 10015 deletions

No files matched your search

+92
View File
@@ -0,0 +1,92 @@
name: Bug Report
description: Report a bug or console error
labels: [Unconfirmed]
body:
- type: markdown
attributes:
value: |
**Before reporting a bug, please see if using master/dev builds from https://ci.viaversion.com/ fixes your issue.**
Whenever you see fit, you can upload images or video to any of the textfields.
- type: input
attributes:
label: "`/viaversion dump` Output"
description: |
Run `/viaversion dump` in the console or in the chat, then copy and paste the given link here.
placeholder: |
https://dump.viaversion.com/...
validations:
required: true
- type: textarea
attributes:
label: Console Error
description: |
If you encounter warnings/errors in your console, **paste them with https://paste.gg/ and put the paste link here**.
If the error is small/less than 10 lines, you may put it directly into this field.
value: |
```
Put the paste.gg link or text here.
```
placeholder: Please do not remove the grave accents; simply replace the line of text in the middle.
validations:
required: false
- type: textarea
attributes:
label: Bug Description
description: |
Describe the unexpected behavior.
If you want to attach screenshots, use the comment field at the bottom of the page.
placeholder: |
Example: "Placing signs on 1.13.2 causes text to disappear."
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: |
List the steps on how we can reproduce the issue. Make sure we can easily understand what you mean with each step.
placeholder: |
Example:
1. Login with a 1.13.2 client
2. Place a sign
3. The sign text is displayed wrong
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: |
Describe what exactly you expected to happen.
placeholder: |
Example: "Placed sign text should not disappear."
validations:
required: true
- type: textarea
attributes:
label: Additional Server Info
description: |
Do you use a proxy (eg. BungeeCord)? What software do you use and what plugins?
placeholder: |
Example: "I also use BungeeCord with the following plugins: x, y, z"
validations:
required: false
- type: checkboxes
attributes:
label: Checklist
description: Make sure you have followed each of the steps outlined here.
options:
- label: Via plugins are only running on **EITHER** the backend servers (e.g. Paper) **OR** the proxy (e.g. BungeeCord), **not on both**.
required: true
- label: I have included a ViaVersion dump.
required: true
- label: If applicable, I have included a paste (**not a screenshot**) of the error.
required: true
- label: I have tried the latest build(s) from https://ci.viaversion.com/ and the issue still persists.
required: true
+8
View File
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Dev builds
url: https://ci.viaversion.com/
about: Before reporting a bug, please check if using master/dev builds from our ci fixes your issue.
- name: ViaVersion Discord
url: https://discord.gg/viaversion
about: For smaller issues or questions, you can also join our Discord server.
@@ -0,0 +1,37 @@
name: Feature Request
description: Suggest a feature to be added
body:
- type: textarea
attributes:
label: Problem Description
description: |
Describe the issue you are facing or why you need the feature to be added.
placeholder: |
I am always frustrated with...
validations:
required: true
- type: textarea
attributes:
label: Solution Description
description: |
Describe the solution you would like to see.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: |
Describe alternatives you have considered.
validations:
required: false
- type: textarea
attributes:
label: Additional Info
description: |
Does the feature apply to any specific version or environment?
validations:
required: false
+28
View File
@@ -0,0 +1,28 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Java CI with Gradle
on: [push, pull_request]
jobs:
build:
# Only run on PRs if the source branch is on a different repo. We do not need to run everything twice.
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
- name: Build with Gradle
run: ./gradlew build
- uses: actions/upload-artifact@v2
with:
name: artifact
path: build/libs
+4 -8
View File
@@ -18,9 +18,8 @@ hs_err_pid*
# Ignore IDEA directory
.idea/*
# Include the project's code style settings file
!.idea/codeStyleSettings.xml
!.idea/copyright/*
!.idea/scopes/*
# Include the project's dictionary
!.idea/dictionaries/
@@ -109,8 +108,5 @@ nbactions.xml
nb-configuration.xml
.nb-gradle/
### Git ###
# Don't exclude the .gitignore itself
!.gitignore
### MacOS ###
.DS_Store
+11
View File
@@ -0,0 +1,11 @@
<component name="CopyrightManager">
<settings>
<module2copyright>
<element module="ViaVersion-API" copyright="viaversion-mit" />
<element module="ViaVersion" copyright="viaversion-gpl" />
</module2copyright>
<LanguageOptions name="__TEMPLATE__">
<option name="addBlankAfter" value="false" />
</LanguageOptions>
</settings>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion&#10;Copyright (C) 2016-2022 ViaVersion and contributors&#10;&#10;This program is free software: you can redistribute it and/or modify&#10;it under the terms of the GNU General Public License as published by&#10;the Free Software Foundation, either version 3 of the License, or&#10;(at your option) any later version.&#10;&#10;This program is distributed in the hope that it will be useful,&#10;but WITHOUT ANY WARRANTY; without even the implied warranty of&#10;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10;GNU General Public License for more details.&#10;&#10;You should have received a copy of the GNU General Public License&#10;along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;." />
<option name="myName" value="viaversion-gpl" />
</copyright>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion&#10;Copyright (C) 2016-2022 ViaVersion and contributors&#10;&#10;Permission is hereby granted, free of charge, to any person obtaining a copy&#10;of this software and associated documentation files (the &quot;Software&quot;), to deal&#10;in the Software without restriction, including without limitation the rights&#10;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell&#10;copies of the Software, and to permit persons to whom the Software is&#10;furnished to do so, subject to the following conditions:&#10;&#10;The above copyright notice and this permission notice shall be included in all&#10;copies or substantial portions of the Software.&#10;&#10;THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR&#10;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,&#10;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE&#10;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER&#10;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,&#10;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE&#10;SOFTWARE." />
<option name="myName" value="viaversion-mit" />
</copyright>
</component>
+3
View File
@@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="ViaVersion" pattern="com.viaversion.viaversion..*&amp;&amp;!src[viaversion-parent.viaversion-api*]:*..*" />
</component>
+3
View File
@@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="ViaVersion-API" pattern="src[viaversion-parent.viaversion-api*]:*..*&amp;&amp;!src[viaversion-parent.viaversion-api.main]:com.viaversion.viaversion.api.minecraft.nbt.*" />
</component>
-12
View File
@@ -1,12 +0,0 @@
sudo: false
language: java
jdk: oraclejdk7
cache:
directories:
- '$HOME/.m2/repository'
script:
- mvn dependency:purge-local-repository -DactTransitively=false -DreResolve=false
- mvn clean install -B -U
-12
View File
@@ -1,12 +0,0 @@
### What version of ViaVersion are you using? Type /ver viaversion
### What version of Spigot are you using? Type /ver
### What plugins are you using? Type /plugins
### Are you using any additional software like BungeeCord? If so, what software and version? (Please list your plugins as well)
### How does this error happen? login? Using an item?
### Is there an error in the console? Use pastebin.com. Is there a kick message?
+669 -19
View File
@@ -1,24 +1,674 @@
License:
--------
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
MIT License
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Copyright (c) 2016
Preamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+50 -41
View File
@@ -1,46 +1,27 @@
# ViaVersion 0.8.2
[![Build Status](https://travis-ci.org/MylesIsCool/ViaVersion.svg?branch=master)](https://travis-ci.org/MylesIsCool/ViaVersion)
[![Gitter](https://badges.gitter.im/MylesIsCool/ViaVersion.svg)](https://gitter.im/MylesIsCool/ViaVersion)
# ViaVersion - Spigot, Sponge, BungeeCord, Velocity
**Allows the connection of 1.9 clients to 1.8**
[![Latest Release](https://img.shields.io/github/v/release/ViaVersion/ViaVersion)](https://viaversion.com)
[![Build Status](https://github.com/ViaVersion/ViaVersion/actions/workflows/gradle.yml/badge.svg?branch=master)](https://github.com/ViaVersion/ViaVersion/actions)
[![Discord](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://viaversion.com/discord)
This plugin modifies netty to allow connection of 1.9 clients to 1.8,
**Allows the connection of higher client versions to lower server versions**
###*Don't use late bind*
Supported Versions:
This took 100s hours of work, so if you enjoy this consider looking into contacting me and supporting my projects.
![Table (https://i.imgur.com/uDM9HR8.png)](https://i.imgur.com/RRa5KnK.png)
**Contributor Chat:** https://gitter.im/MylesIsCool/ViaVersion
On Paper you may also use ProtocolSupport, but ensure you have the right build for your server version.
**User Docs:** https://docs.viaversion.com/display/VIAVERSION/
Sources:
--------
**[wiki.vg](https://wiki.vg)** (Used for information regarding packet structure, we also contribute back)
**wiki.vg** (Protocol info, though I did have to find a lot myself)
**OpenNBT** (used for slot rewriting)
Contributors:
--------
**Myself** (harhar)
**Matsv/StamBoom**
**HugoDaBosss**
**SanderGielisse**
**Paulomart**
**gigosaurus**
**fillefilip8**
**lenis0012**
**[Burger](https://github.com/Pokechu22/Burger)** (See [PAaaS](https://github.com/Matsv/Paaas))
**[OpenNBT](https://github.com/ViaVersion/OpenNBT)**
Releases / Dev Builds:
@@ -49,22 +30,50 @@ You can find official releases here:
https://www.spigotmc.org/resources/viaversion.19254/history
----------
You can find unofficial dev builds here:
You can find official dev builds here:
**Terrobility's Build Server:** https://ci.terrocidepvp.net/job/ViaVersion/
**Jenkins:** https://ci.viaversion.com
**sgdc3's Build Server:** http://ci.xephi.fr/job/ViaVersion/
**sgdc3's Maven:** http://ci.xephi.fr/plugin/repository/everything/
**JavaDocs:** https://jd.viaversion.com
**Maven Repository:**
```xml
<repository>
<id>viaversion-repo</id>
<url>https://repo.viaversion.com</url>
</repository>
```
**API-artifact:**
```xml
<dependency>
<groupId>com.viaversion</groupId>
<artifactId>viaversion-api</artifactId>
<version>LATEST</version>
<scope>provided</scope>
</dependency>
```
Replace the version depending on your needs.
If you need access to the existing protocol or platform implementations, use the parent artifact `viaversion`.
Please note the [differences in licensing](#license).
Building:
--------
After cloning this repository, build the project with Gradle by running `./gradlew build` and take the created jar out of
the `build/libs` directory.
**JavaDocs:** https://jd.matsv.nl/
License:
--------
The entirety of the [API directory](api) (including the legacy API directory) is licensed under the MIT License; see [licenses/MIT.md](licenses/MIT.md) for
details.
MIT License, see LICENSE for more details.
Thanks!
Everything else, unless explicitly stated otherwise, is licensed under the GNU General Public License, including the end
product as a whole; see [licenses/GPL.md](licenses/GPL.md) for details.
Special thanks to all our [Contributors](https://github.com/ViaVersion/ViaVersion/graphs/contributors).
+25
View File
@@ -0,0 +1,25 @@
plugins {
id("com.github.johnrengelman.shadow")
}
// Shade and relocate adventure in an extra module, so that common/the rest can directly depend on a
// relocated adventure without breaking native platform's adventure usage with project wide relocation
tasks {
shadowJar {
relocate("net.kyori", "com.viaversion.viaversion.libs.kyori")
}
build {
dependsOn(shadowJar)
}
}
dependencies {
api(libs.bundles.adventure) {
exclude("org.checkerframework")
exclude("net.kyori", "adventure-api")
exclude("net.kyori", "adventure-bom")
exclude("com.google.code.gson", "gson")
}
}
publishShadowJar()
+3
View File
@@ -0,0 +1,3 @@
dependencies {
compileOnly(projects.viaversionApi)
}
@@ -0,0 +1,102 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api;
import io.netty.buffer.ByteBuf;
import us.myles.ViaVersion.api.boss.BossBar;
import us.myles.ViaVersion.api.boss.BossColor;
import us.myles.ViaVersion.api.boss.BossStyle;
import java.util.SortedSet;
import java.util.UUID;
/**
* @deprecated may be removed at some point, use {@link com.viaversion.viaversion.api.Via}
*/
@Deprecated
public class Via<T> implements ViaAPI<T> {
private static final ViaAPI INSTANCE = new Via();
private Via() {
}
@Deprecated
public static ViaAPI getAPI() {
return INSTANCE;
}
@Override
public int getPlayerVersion(T player) {
return com.viaversion.viaversion.api.Via.getAPI().getPlayerVersion(player);
}
@Override
public int getPlayerVersion(UUID uuid) {
return com.viaversion.viaversion.api.Via.getAPI().getPlayerVersion(uuid);
}
@Override
public boolean isInjected(UUID playerUUID) {
return com.viaversion.viaversion.api.Via.getAPI().isInjected(playerUUID);
}
@Override
public String getVersion() {
return com.viaversion.viaversion.api.Via.getAPI().getVersion();
}
@Override
public void sendRawPacket(T player, ByteBuf packet) {
com.viaversion.viaversion.api.Via.getAPI().sendRawPacket(player, packet);
}
@Override
public void sendRawPacket(UUID uuid, ByteBuf packet) {
com.viaversion.viaversion.api.Via.getAPI().sendRawPacket(uuid, packet);
}
@Override
public BossBar createBossBar(String title, BossColor color, BossStyle style) {
return new BossBar(com.viaversion.viaversion.api.Via.getAPI().legacyAPI().createLegacyBossBar(title,
com.viaversion.viaversion.api.legacy.bossbar.BossColor.values()[color.ordinal()],
com.viaversion.viaversion.api.legacy.bossbar.BossStyle.values()[style.ordinal()]));
}
@Override
public BossBar createBossBar(String title, float health, BossColor color, BossStyle style) {
return new BossBar(com.viaversion.viaversion.api.Via.getAPI().legacyAPI().createLegacyBossBar(title, health,
com.viaversion.viaversion.api.legacy.bossbar.BossColor.values()[color.ordinal()],
com.viaversion.viaversion.api.legacy.bossbar.BossStyle.values()[style.ordinal()]));
}
@Override
public SortedSet<Integer> getSupportedVersions() {
return com.viaversion.viaversion.api.Via.getAPI().getSupportedVersions();
}
@Override
public SortedSet<Integer> getFullSupportedVersions() {
return com.viaversion.viaversion.api.Via.getAPI().getFullSupportedVersions();
}
}
@@ -0,0 +1,63 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api;
import com.viaversion.viaversion.api.Via;
import io.netty.buffer.ByteBuf;
import us.myles.ViaVersion.api.boss.BossBar;
import us.myles.ViaVersion.api.boss.BossColor;
import us.myles.ViaVersion.api.boss.BossStyle;
import java.util.SortedSet;
import java.util.UUID;
/**
* @deprecated may be removed at some point, use {@link Via#getAPI()}
*/
@Deprecated
public interface ViaAPI<T> {
int getPlayerVersion(T player);
int getPlayerVersion(UUID uuid);
default boolean isPorted(UUID playerUUID) {
return isInjected(playerUUID);
}
boolean isInjected(UUID playerUUID);
String getVersion();
void sendRawPacket(T player, ByteBuf packet);
void sendRawPacket(UUID uuid, ByteBuf packet);
BossBar createBossBar(String title, BossColor color, BossStyle style);
BossBar createBossBar(String title, float health, BossColor color, BossStyle style);
SortedSet<Integer> getSupportedVersions();
SortedSet<Integer> getFullSupportedVersions();
}
@@ -0,0 +1,133 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api.boss;
import java.util.Set;
import java.util.UUID;
@Deprecated
public class BossBar<T> {
private final com.viaversion.viaversion.api.legacy.bossbar.BossBar bossBar;
public BossBar(com.viaversion.viaversion.api.legacy.bossbar.BossBar bossBar) {
this.bossBar = bossBar;
}
public String getTitle() {
return bossBar.getTitle();
}
public BossBar setTitle(String title) {
bossBar.setTitle(title);
return this;
}
public float getHealth() {
return bossBar.getHealth();
}
public BossBar setHealth(float health) {
bossBar.setHealth(health);
return this;
}
public BossColor getColor() {
return BossColor.values()[bossBar.getColor().ordinal()];
}
public BossBar setColor(BossColor color) {
bossBar.setColor(com.viaversion.viaversion.api.legacy.bossbar.BossColor.values()[color.ordinal()]);
return this;
}
public BossStyle getStyle() {
return BossStyle.values()[bossBar.getStyle().ordinal()];
}
public BossBar setStyle(BossStyle style) {
bossBar.setStyle(com.viaversion.viaversion.api.legacy.bossbar.BossStyle.values()[style.ordinal()]);
return this;
}
@Deprecated
public BossBar addPlayer(T player) {
return this;
}
public BossBar addPlayer(UUID player) {
bossBar.addPlayer(player);
return this;
}
@Deprecated
public BossBar addPlayers(T... players) {
return this;
}
@Deprecated
public BossBar removePlayer(T player) {
return this;
}
public BossBar removePlayer(UUID uuid) {
bossBar.removePlayer(uuid);
return this;
}
public BossBar addFlag(BossFlag flag) {
bossBar.addFlag(com.viaversion.viaversion.api.legacy.bossbar.BossFlag.values()[flag.ordinal()]);
return this;
}
public BossBar removeFlag(BossFlag flag) {
bossBar.removeFlag(com.viaversion.viaversion.api.legacy.bossbar.BossFlag.values()[flag.ordinal()]);
return this;
}
public boolean hasFlag(BossFlag flag) {
return bossBar.hasFlag(com.viaversion.viaversion.api.legacy.bossbar.BossFlag.values()[flag.ordinal()]);
}
public Set<UUID> getPlayers() {
return bossBar.getPlayers();
}
public BossBar show() {
bossBar.show();
return this;
}
public BossBar hide() {
bossBar.hide();
return this;
}
public boolean isVisible() {
return bossBar.isVisible();
}
public UUID getId() {
return bossBar.getId();
}
}
@@ -0,0 +1,45 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api.boss;
@Deprecated
public enum BossColor {
PINK(0),
BLUE(1),
RED(2),
GREEN(3),
YELLOW(4),
PURPLE(5),
WHITE(6);
private final int id;
BossColor(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,40 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api.boss;
@Deprecated
public enum BossFlag {
DARKEN_SKY(1),
PLAY_BOSS_MUSIC(2);
private final int id;
BossFlag(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,43 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api.boss;
@Deprecated
public enum BossStyle {
SOLID(0),
SEGMENTED_6(1),
SEGMENTED_10(2),
SEGMENTED_12(3),
SEGMENTED_20(4);
private final int id;
BossStyle(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,33 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api.protocol;
/**
* @deprecated may be removed at some point, use {@link com.viaversion.viaversion.api.protocol.ProtocolManager}
*/
@Deprecated
public class ProtocolRegistry {
@Deprecated
public static int SERVER_PROTOCOL = -1;
}
@@ -0,0 +1,248 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package us.myles.ViaVersion.api.protocol;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.protocol.version.VersionRange;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
/**
* @deprecated will no longer be updated and may be removed at some point, use {@link com.viaversion.viaversion.api.protocol.version.ProtocolVersion}
*/
@Deprecated
public class ProtocolVersion {
private static final Int2ObjectMap<ProtocolVersion> versions = new Int2ObjectOpenHashMap<>();
private static final List<ProtocolVersion> versionList = new ArrayList<>();
public static final ProtocolVersion v1_4_6 = register(51, "1.4.6/7", new VersionRange("1.4", 6, 7));
public static final ProtocolVersion v1_5_1 = register(60, "1.5.1");
public static final ProtocolVersion v1_5_2 = register(61, "1.5.2");
public static final ProtocolVersion v_1_6_1 = register(73, "1.6.1");
public static final ProtocolVersion v_1_6_2 = register(74, "1.6.2");
public static final ProtocolVersion v_1_6_3 = register(77, "1.6.3");
public static final ProtocolVersion v_1_6_4 = register(78, "1.6.4");
public static final ProtocolVersion v1_7_1 = register(4, "1.7-1.7.5", new VersionRange("1.7", 0, 5));
public static final ProtocolVersion v1_7_6 = register(5, "1.7.6-1.7.10", new VersionRange("1.7", 6, 10));
public static final ProtocolVersion v1_8 = register(47, "1.8.x");
public static final ProtocolVersion v1_9 = register(107, "1.9");
public static final ProtocolVersion v1_9_1 = register(108, "1.9.1");
public static final ProtocolVersion v1_9_2 = register(109, "1.9.2");
public static final ProtocolVersion v1_9_3 = register(110, "1.9.3/4", new VersionRange("1.9", 3, 4));
public static final ProtocolVersion v1_10 = register(210, "1.10.x");
public static final ProtocolVersion v1_11 = register(315, "1.11");
public static final ProtocolVersion v1_11_1 = register(316, "1.11.1/2", new VersionRange("1.11", 1, 2));
public static final ProtocolVersion v1_12 = register(335, "1.12");
public static final ProtocolVersion v1_12_1 = register(338, "1.12.1");
public static final ProtocolVersion v1_12_2 = register(340, "1.12.2");
public static final ProtocolVersion v1_13 = register(393, "1.13");
public static final ProtocolVersion v1_13_1 = register(401, "1.13.1");
public static final ProtocolVersion v1_13_2 = register(404, "1.13.2");
public static final ProtocolVersion v1_14 = register(477, "1.14");
public static final ProtocolVersion v1_14_1 = register(480, "1.14.1");
public static final ProtocolVersion v1_14_2 = register(485, "1.14.2");
public static final ProtocolVersion v1_14_3 = register(490, "1.14.3");
public static final ProtocolVersion v1_14_4 = register(498, "1.14.4");
public static final ProtocolVersion v1_15 = register(573, "1.15");
public static final ProtocolVersion v1_15_1 = register(575, "1.15.1");
public static final ProtocolVersion v1_15_2 = register(578, "1.15.2");
public static final ProtocolVersion v1_16 = register(735, "1.16");
public static final ProtocolVersion v1_16_1 = register(736, "1.16.1");
public static final ProtocolVersion v1_16_2 = register(751, "1.16.2");
public static final ProtocolVersion v1_16_3 = register(753, "1.16.3");
public static final ProtocolVersion v1_16_4 = register(754, "1.16.4/5", new VersionRange("1.16", 4, 5));
public static final ProtocolVersion v1_17 = register(755, "1.17");
public static final ProtocolVersion v1_17_1 = register(756, "1.17.1");
public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1));
public static final ProtocolVersion v1_18_2 = register(758, "1.18.2");
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
public static ProtocolVersion register(int version, String name) {
return register(version, -1, name);
}
public static ProtocolVersion register(int version, int snapshotVersion, String name) {
return register(version, snapshotVersion, name, null);
}
public static ProtocolVersion register(int version, String name, @Nullable VersionRange versionRange) {
return register(version, -1, name, versionRange);
}
public static ProtocolVersion register(int version, int snapshotVersion, String name, @Nullable VersionRange versionRange) {
ProtocolVersion protocol = new ProtocolVersion(version, snapshotVersion, name, versionRange);
versionList.add(protocol);
versions.put(protocol.getVersion(), protocol);
if (protocol.isSnapshot()) {
versions.put(protocol.getFullSnapshotVersion(), protocol);
}
return protocol;
}
public static boolean isRegistered(int id) {
return versions.containsKey(id);
}
public static @NonNull ProtocolVersion getProtocol(int id) {
ProtocolVersion protocolVersion = versions.get(id);
if (protocolVersion != null) {
return protocolVersion;
} else {
return new ProtocolVersion(id, "Unknown (" + id + ")");
}
}
public static int getIndex(ProtocolVersion version) {
return versionList.indexOf(version);
}
public static List<ProtocolVersion> getProtocols() {
return Collections.unmodifiableList(new ArrayList<>(versions.values()));
}
public static @Nullable ProtocolVersion getClosest(String protocol) {
for (ProtocolVersion version : versions.values()) {
String name = version.getName();
if (name.equals(protocol)) {
return version;
}
if (version.isVersionWildcard()) {
// Test against the major version with and without a minor version
String majorVersion = name.substring(0, name.length() - 2);
if (majorVersion.equals(protocol) || (protocol.startsWith(name.substring(0, name.length() - 1)))) {
return version;
}
} else if (version.isRange()) {
if (version.getIncludedVersions().contains(protocol)) {
return version;
}
}
}
return null;
}
private final int version;
private final int snapshotVersion;
private final String name;
private final boolean versionWildcard;
private final Set<String> includedVersions;
public ProtocolVersion(int version, String name) {
this(version, -1, name, null);
}
public ProtocolVersion(int version, int snapshotVersion, String name, @Nullable VersionRange versionRange) {
this.version = version;
this.snapshotVersion = snapshotVersion;
this.name = name;
this.versionWildcard = name.endsWith(".x");
Preconditions.checkArgument(!versionWildcard || versionRange == null, "A version cannot be a wildcard and a range at the same time!");
if (versionRange != null) {
includedVersions = new LinkedHashSet<>();
for (int i = versionRange.rangeFrom(); i <= versionRange.rangeTo(); i++) {
if (i == 0) {
includedVersions.add(versionRange.baseVersion()); // Keep both the base version and with ".0" appended
}
includedVersions.add(versionRange.baseVersion() + "." + i);
}
} else {
includedVersions = Collections.singleton(name);
}
}
public int getVersion() {
return version;
}
public int getSnapshotVersion() {
Preconditions.checkArgument(isSnapshot());
return snapshotVersion;
}
public int getFullSnapshotVersion() {
Preconditions.checkArgument(isSnapshot());
return (1 << 30) | snapshotVersion; // Bit indicating snapshot versions
}
public int getOriginalVersion() {
return snapshotVersion == -1 ? version : ((1 << 30) | snapshotVersion);
}
public boolean isKnown() {
return version != -1;
}
public boolean isRange() {
return includedVersions.size() != 1;
}
public Set<String> getIncludedVersions() {
return Collections.unmodifiableSet(includedVersions);
}
public boolean isVersionWildcard() {
return versionWildcard;
}
public String getName() {
return name;
}
public boolean isSnapshot() {
return snapshotVersion != -1;
}
public int getId() {
return version;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ProtocolVersion that = (ProtocolVersion) o;
return version == that.version;
}
@Override
public int hashCode() {
return version;
}
@Override
public String toString() {
return String.format("%s (%d)", this.name, this.version);
}
}
+29
View File
@@ -0,0 +1,29 @@
plugins {
id("net.kyori.blossom")
id("via.shadow-conventions")
}
blossom {
replaceToken("\$VERSION", project.version)
replaceToken("\$IMPL_VERSION", "git-ViaVersion-${project.version}:${rootProject.latestCommitHash()}")
}
dependencies {
api(projects.adventure) {
targetConfiguration = "shadow"
}
api(libs.fastutil)
api(libs.flare)
api(libs.flareFastutil)
api(libs.openNBT)
api(libs.gson)
compileOnlyApi(libs.snakeYaml)
compileOnlyApi(libs.netty)
compileOnlyApi(libs.guava)
compileOnlyApi(libs.checkerQual)
}
java {
withJavadocJar()
}
@@ -0,0 +1,81 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api;
import com.google.common.base.Preconditions;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.platform.ViaPlatform;
public final class Via {
private static ViaManager manager;
/**
* Returns the API associated with the current platform.
*
* @return API instance
* @throws IllegalArgumentException if the platform has not loaded yet
*/
public static ViaAPI getAPI() {
return manager().getPlatform().getApi();
}
/**
* Returns the ViaManager with methods beyond the simple API {@link ViaAPI} provides.
*
* @return manager to interact with various Via parts
* @throws IllegalArgumentException if the platform has not loaded yet
*/
public static ViaManager getManager() {
return manager();
}
/**
* Returns the config associated with the current platform.
*
* @return config instance
* @throws IllegalArgumentException if the platform has not loaded yet
*/
public static ViaVersionConfig getConfig() {
return manager().getPlatform().getConf();
}
public static ViaPlatform getPlatform() {
return manager().getPlatform();
}
/**
* Register the ViaManager associated with the platform.
*
* @param viaManager The ViaManager
* @throws IllegalArgumentException if the manager has already been set
*/
public static void init(ViaManager viaManager) {
Preconditions.checkArgument(manager == null, "ViaManager is already set");
Via.manager = viaManager;
}
private static ViaManager manager() {
Preconditions.checkArgument(manager != null, "ViaVersion has not loaded the platform yet");
return manager;
}
}
@@ -0,0 +1,160 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api;
import com.viaversion.viaversion.api.connection.ConnectionManager;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.legacy.LegacyViaAPI;
import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.api.protocol.ProtocolManager;
import com.viaversion.viaversion.api.protocol.version.ServerProtocolVersion;
import io.netty.buffer.ByteBuf;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.SortedSet;
import java.util.UUID;
/**
* General api point. For more specialized api methods, see {@link Via#getManager()}.
*
* @param <T> player type for the specific platform
* @see ViaManager
* @see ProtocolManager
* @see ConnectionManager
* @see ViaPlatform
*/
public interface ViaAPI<T> {
/**
* Returns the <b>major version</b> matching {@link #getVersion()}.
* It is highly advised to check against the major version and to disable/not initiate
* any hooks into ViaVersion if given and expected versions do not match.
*
* @return major plugin version
* @since 4.0.2
*/
default int majorVersion() {
return 4;
}
/**
* Returns an <b>internally based API version</b> incremented with meaningful API changes.
* This includes breaking changes to existing API and larger additions.
*
* @return API version incremented with meaningful API changes
*/
default int apiVersion() {
return 10;
}
/**
* Returns the server's protocol version info.
*
* @return the server's protocol version info
*/
ServerProtocolVersion getServerVersion();
/**
* Returns the protocol version of a player.
* This will also retrieve the version from ProtocolSupport if it's being used.
*
* @param player the platform's player object, e.g. Bukkit this is Player
* @return protocol version, for example (47=1.8-1.8.8, 107=1.9, 108=1.9.1), or -1 if no longer connected
*/
int getPlayerVersion(T player);
/**
* Returns the protocol version of a player.
*
* @param uuid UUID of a player
* @return protocol version, for example (47=1.8-1.8.8, 107=1.9, 108=1.9.1), or -1 if not connected
*/
int getPlayerVersion(UUID uuid);
/**
* Returns whether Via injected into this player connection.
*
* @param uuid uuid of the player
* @return whether Via has a cached a UserConnection for this player
*/
boolean isInjected(UUID uuid);
/**
* Returns the Via injected UserConnection if present.
*
* @param uuid uuid of the player
* @return user connection if present
*/
@Nullable UserConnection getConnection(UUID uuid);
/**
* Returns the version of the plugin.
*
* @return plugin version
*/
String getVersion();
/**
* Sends a raw packet to the player.
*
* @param player the platform's player object, e.g. for Bukkit this is Player
* @param packet the packet; you need a VarInt Id, then the packet contents
* @throws IllegalArgumentException if the player is not injected by Via
*/
void sendRawPacket(T player, ByteBuf packet);
/**
* Sends a raw packet to the player.
*
* @param uuid the uuid from the player to send packet
* @param packet the packet; you need a VarInt Id, then the packet contents
* @throws IllegalArgumentException if the player is not injected by Via
*/
void sendRawPacket(UUID uuid, ByteBuf packet);
/**
* Returns the supported protocol versions.
* This method removes any blocked protocol versions.
*
* @return a list of protocol versions
* @see #getFullSupportedVersions() for a full list
*/
SortedSet<Integer> getSupportedVersions();
/**
* Returns the supported protocol versions, including blocked protocols.
*
* @return a list of protocol versions
*/
SortedSet<Integer> getFullSupportedVersions();
/**
* Returns legacy api only applicable on/to legacy versions.
* <p>
* These methods are safe to use and are unlikely to be removed,
* but it is important to be aware of their limited use.
*
* @return legacy api only applicable on/to legacy versions
*/
LegacyViaAPI<T> legacyAPI();
}
@@ -0,0 +1,128 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api;
import com.viaversion.viaversion.api.command.ViaVersionCommand;
import com.viaversion.viaversion.api.connection.ConnectionManager;
import com.viaversion.viaversion.api.debug.DebugHandler;
import com.viaversion.viaversion.api.platform.ViaInjector;
import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.platform.providers.ViaProviders;
import com.viaversion.viaversion.api.protocol.ProtocolManager;
import java.util.Set;
public interface ViaManager {
/**
* Returns the protocol manager for registering/getting protocols and their mapping data loading.
*
* @return protocol manager
*/
ProtocolManager getProtocolManager();
/**
* Returns platform for handling platform specific configuration, tasks, and plugin data.
*
* @return platform
*/
ViaPlatform<?> getPlatform();
/**
* Returns the userconnection manager for handling clients connected to the server.
*
* @return userconnection manager
*/
ConnectionManager getConnectionManager();
/**
* Returns the manager for Via providers.
*
* @return provider manager
*/
ViaProviders getProviders();
/**
* Returns the injector for injecting netty handlers and initially getting the server protocol version.
*
* @return injector
*/
ViaInjector getInjector();
/**
* Returns the command handler for managing ViaVersion subcommands.
*
* @return command handler
*/
ViaVersionCommand getCommandHandler();
/**
* Returns the platform loader responsible for registering listeners, providers and such.
*
* @return platform loader
*/
ViaPlatformLoader getLoader();
/**
* If debug is enabled, packets and other otherwise suppressed warnings will be logged.
*
* @return true if enabled
*/
@Deprecated
default boolean isDebug() {
return debugHandler().enabled();
}
/**
* Sets the debug mode. If enabled, packets and other otherwise suppressed warnings will be logged.
*
* @param debug whether debug should be enabled
*/
@Deprecated
default void setDebug(boolean debug) {
debugHandler().setEnabled(debug);
}
/**
* Returns the debug handler.
*
* @return debug handler
*/
DebugHandler debugHandler();
/**
* Returns a mutable set of self-added subplatform version strings.
* This set is expanded by the subplatform itself (e.g. ViaBackwards), and may not contain all running ones.
*
* @return mutable set of subplatform versions
*/
Set<String> getSubPlatforms();
/**
* Adds a runnable to be executed when ViaVersion has finished its init before the full server load.
*
* @param runnable runnable to be executed
*/
void addEnableListener(Runnable runnable);
}
@@ -0,0 +1,56 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.command;
import java.util.UUID;
public interface ViaCommandSender {
/**
* Check if the sender has a permission.
*
* @param permission Permission string eg. viaversion.admin
* @return True if the sender has the permission
*/
boolean hasPermission(String permission);
/**
* Send a message to the sender
*
* @param msg The message to send
*/
void sendMessage(String msg);
/**
* Get the senders UUID.
*
* @return The senders UUID
*/
UUID getUUID();
/**
* Get the senders name.
*
* @return The senders name
*/
String getName();
}
@@ -0,0 +1,105 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.command;
import com.viaversion.viaversion.util.ChatColorUtil;
import java.util.Collections;
import java.util.List;
public abstract class ViaSubCommand {
/**
* Subcommand name
*
* @return The commands name
*/
public abstract String name();
/**
* subcommand description, this'll show in /viaversion list
*
* @return The commands description
*/
public abstract String description();
/**
* Usage example:
* "playerversion [name]"
*
* @return The commands usage
*/
public String usage() {
return name();
}
/**
* Permission, null for everyone
*
* @return The permission required to use the commands
*/
public String permission() {
return "viaversion.admin";
}
/**
* Gets triggered on execution
*
* @param sender Command sender
* @param args Arguments
* @return commands executed succesfully if false, show usage
*/
public abstract boolean execute(ViaCommandSender sender, String[] args);
/**
* Yay, possibility to implement tab-completion
*
* @param sender Command sender
* @param args args
* @return tab complete possibilities
*/
public List<String> onTabComplete(ViaCommandSender sender, String[] args) {
return Collections.emptyList();
}
/**
* Replaces color codes in a string.
*
* @param s string to replace
* @return output String
*/
public static String color(String s) {
return ChatColorUtil.translateAlternateColorCodes(s);
}
/**
* Send a color coded string with replacements to a user.
*
* @param sender target to send the message to
* @param message message
* @param args objects to replace
*/
public static void sendMessage(ViaCommandSender sender, String message, Object... args) {
sender.sendMessage(color(args == null ? message : String.format(message, args)));
}
}
@@ -0,0 +1,73 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.command;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.List;
public interface ViaVersionCommand {
/**
* Register your own subcommand inside ViaVersion
*
* @param command Your own SubCommand instance to handle it.
* @throws Exception throws an exception when the subcommand already exists or if it's not valid, example: spacee
*/
void registerSubCommand(ViaSubCommand command) throws Exception;
/**
* Check if a subcommand is registered.
*
* @param name Subcommand name
* @return true if it exists
*/
boolean hasSubCommand(String name);
/**
* Get subcommand instance by name
*
* @param name subcommand name
* @return ViaSubCommand instance
*/
@Nullable ViaSubCommand getSubCommand(String name);
/**
* Executed when the Command sender executes the commands
*
* @param sender Sender object
* @param args arguments provided
* @return was successful
*/
boolean onCommand(ViaCommandSender sender, String[] args);
/**
* Executed when the Command sender tab-completes
*
* @param sender Sender object
* @param args arguments provided
* @return was successful
*/
List<String> onTabComplete(ViaCommandSender sender, String[] args);
void showHelp(ViaCommandSender sender);
}
@@ -0,0 +1,53 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.configuration;
import java.util.Map;
public interface ConfigurationProvider {
/**
* Sets the specified path to the given value.
*
* @param path Path of the object to set.
* @param value New value to set the path to
*/
void set(String path, Object value);
/**
* Saves the config
*/
void saveConfig();
/**
* Reloads the config
*/
void reloadConfig();
/**
* Get all the configuration values
*
* @return Map with key-values
*/
Map<String, Object> getValues();
}
@@ -0,0 +1,458 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.configuration;
import com.google.gson.JsonElement;
import com.viaversion.viaversion.api.connection.StorableObject;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.WorldIdentifiers;
import com.viaversion.viaversion.api.protocol.version.BlockedProtocolVersions;
import it.unimi.dsi.fastutil.ints.IntSet;
public interface ViaVersionConfig {
/**
* Get if the plugin should check for updates
*
* @return true if update checking is enabled
*/
boolean isCheckForUpdates();
/**
* Sets whether to check for updates. This updates the internally cached value
* as well as the config, but does not save the config to disk.
*
* @param checkForUpdates true to check for updates on server start and joins
*/
void setCheckForUpdates(boolean checkForUpdates);
/**
* Get if collision preventing for players is enabled
*
* @return true if collision preventing is enabled
*/
boolean isPreventCollision();
/**
* Get if 1.9 &amp; 1.10 clients are shown the new effect indicator in the top-right corner
*
* @return true if the using of the new effect indicator is enabled
*/
boolean isNewEffectIndicator();
/**
* Get if 1.9 &amp; 1.10 clients are shown the new death message on the death screen
*
* @return true if enabled
*/
boolean isShowNewDeathMessages();
/**
* Get if metadata errors will be suppressed
*
* @return true if metadata errors suppression is enabled
*/
boolean isSuppressMetadataErrors();
/**
* Get if blocking in 1.9 &amp; 1.10 appears as a player holding a shield
*
* @return true if shield blocking is enabled
*/
boolean isShieldBlocking();
/**
* Whether the player can block with the shield without a delay.
* <p>
* This option requires {@link #isShowShieldWhenSwordInHand()} to be disabled
*
* @return {@code true} if non delayed shield blocking is enabled.
*/
boolean isNoDelayShieldBlocking();
/**
* Puts the shield into the second hand when holding a sword.
* The shield will disappear when switching to another item.
* <p>
* This option requires {@link #isShieldBlocking()} to be enabled
*
* @return {@code true} if the shield should appear when holding a sword
*/
boolean isShowShieldWhenSwordInHand();
/**
* Get if armor stand positions are fixed so holograms show up at the correct height in 1.9 &amp; 1.10
*
* @return true if hologram patching is enabled
*/
boolean isHologramPatch();
/**
* Get if the 1.11 piston animation patch is enabled
*
* @return true if the piston patch is enabled.
*/
boolean isPistonAnimationPatch();
/**
* Get if boss bars are fixed for 1.9 &amp; 1.10 clients
*
* @return true if boss bar patching is enabled
*/
boolean isBossbarPatch();
/**
* Get if the boss bars for 1.9 &amp; 1.10 clients are being stopped from flickering
* This will keep all boss bars on 100% (not recommended)
*
* @return true if boss bar anti flickering is enabled
*/
boolean isBossbarAntiflicker();
/**
* Get the vertical offset armor stands are being moved with when the hologram patch is enabled
*
* @return the vertical offset holograms will be moved with
*/
double getHologramYOffset();
/**
* Get if players will be automatically put in the same team when collision preventing is enabled
*
* @return true if automatic teaming is enabled
*/
boolean isAutoTeam();
/**
* Get the maximum number of packets a client can send per second.
*
* @return The number of packets a client can send per second.
*/
int getMaxPPS();
/**
* Get the kick message sent if the user hits the max packets per second.
*
* @return Kick message, with colour codes using '&amp;amp;'
*/
String getMaxPPSKickMessage();
/**
* The time in seconds that should be tracked for warnings
*
* @return Time in seconds that should be tracked for warnings
*/
int getTrackingPeriod();
/**
* The number of packets per second to count as a warning
*
* @return The number of packets per second to count as a warning.
*/
int getWarningPPS();
/**
* Get the maximum number of warnings the client can have in the interval
*
* @return The number of packets a client can send per second.
*/
int getMaxWarnings();
/**
* Get the kick message sent if the user goes over the warnings in the interval
*
* @return Kick message, with colour codes using '&amp;amp;'
*/
String getMaxWarningsKickMessage();
/**
* Is anti-xray enabled?
*
* @return A boolean
*/
boolean isAntiXRay();
/**
* Send supported versions in the status response packet
*
* @return If true, enabled
*/
boolean isSendSupportedVersions();
/**
* Stimulate the player tick
*
* @return if true, enabled
*/
boolean isSimulatePlayerTick();
/**
* Use the item cache to prevent high resource usage
*
* @return if true, enabled
*/
boolean isItemCache();
/**
* Use the NMS player ticking
*
* @return if true, enabled
*/
boolean isNMSPlayerTicking();
/**
* Replace extended pistons on 1.10 chunk loading.
*
* @return true if to replace them
*/
boolean isReplacePistons();
/**
* Get the id for replacing extended pistons.
*
* @return The integer id
*/
int getPistonReplacementId();
/**
* Fix 1.9+ clients not rendering the far away chunks
*
* @return true to fix chunk borders
*/
boolean isChunkBorderFix();
/**
* Force json transform
*
* @return true if enabled
*/
boolean isForceJsonTransform();
/**
* Should we fix nbt array's in json chat messages for 1.12 clients
*
* @return true if enabled
*/
boolean is1_12NBTArrayFix();
/**
* Should we make team colours based on the last colour in team prefix
*
* @return true if enabled
*/
boolean is1_13TeamColourFix();
/**
* Should we fix shift quick move action for 1.12 clients
*
* @return true if enabled
*/
boolean is1_12QuickMoveActionFix();
/**
* API to check for blocked protocol versions.
*
* @return blocked protocol versions
*/
BlockedProtocolVersions blockedProtocolVersions();
/**
* Get the blocked protocols
*
* @return An Integer list
* @deprecated use {@link #blockedProtocolVersions()}
*/
@Deprecated/*(forRemoval = true)*/
default IntSet getBlockedProtocols() {
return blockedProtocolVersions().singleBlockedVersions();
}
/**
* Get the custom disconnect message
*
* @return Disconnect message
*/
String getBlockedDisconnectMsg();
/**
* Get the message sent to players being kicked on reload.
* Players are kicked to stop the server crashing
*
* @return Disconnect message
*/
String getReloadDisconnectMsg();
/**
* Should we hide errors that occur when trying to convert block and item data over versions?
*
* @return true if enabled
*/
boolean isSuppressConversionWarnings();
/**
* Should we disable the 1.13 auto-complete feature to stop spam kicks? (for any server lower than 1.13)
*
* @return true if enabled
*/
boolean isDisable1_13AutoComplete();
/**
* Tries to minimize cooldown animation.
*
* @return true if enabled
*/
boolean isMinimizeCooldown();
/**
* Enable the serverside blockconnections for 1.13+ clients
*
* @return true if enabled
*/
boolean isServersideBlockConnections();
/**
* Get the type of block-connection provider which should be used
*
* @return String world for world-level or packet for packet-level
*/
String getBlockConnectionMethod();
/**
* When activated, only the most important blocks are saved in the BlockStorage.
*
* @return true if enabled
*/
boolean isReduceBlockStorageMemory();
/**
* When activated with serverside-blockconnections, flower parts with blocks above will be sent as stems.
* Useful for lobbyservers where users can't build and those stems are used decoratively.
*
* @return true if enabled
*/
boolean isStemWhenBlockAbove();
/**
* Vines not connected to any blocks will be mapped to air for 1.13+ clients to prevent them from climbing up.
*
* @return true if enabled
*/
boolean isVineClimbFix();
/**
* When activated, the 1-layer snow will be sent as 2-layer snow to 1.13+ clients to have collision.
*
* @return true if enabled
*/
boolean isSnowCollisionFix();
/**
* When activated, infested blocks will be mapped to their normal stone variants for 1.13+ clients.
*
* @return true if enabled
*/
boolean isInfestedBlocksFix();
/**
* When greater than 0, enables tab complete request delaying by x ticks
*
* @return the delay in ticks
*/
int get1_13TabCompleteDelay();
/**
* When activated, edited books with more than 50 pages will be shortened to 50.
*
* @return true if enabled
*/
boolean isTruncate1_14Books();
/**
* Handles left handed info by using unused bit 7 on Client Settings packet
*
* @return true if enabled
*/
boolean isLeftHandedHandling();
/**
* Fixes velocity bugs due to different hitbox for 1.9-1.13 clients on 1.8 servers.
*
* @return true if enabled
*/
boolean is1_9HitboxFix();
/**
* Fixes velocity bugs due to different hitbox for 1.14+ clients on sub 1.14 servers.
*
* @return true if enabled
*/
boolean is1_14HitboxFix();
/**
* Fixes non full blocks having 0 light for 1.14+ clients on sub 1.14 servers.
*
* @return true if enabled
*/
boolean isNonFullBlockLightFix();
boolean is1_14HealthNaNFix();
/**
* Should 1.15 clients respawn instantly / without showing the death screen.
*
* @return true if enabled
*/
boolean is1_15InstantRespawn();
/**
* Ignores incoming plugin channel messages of 1.16+ clients with channel names longer than 32 charatcers.
*
* @return true if enabled
*/
boolean isIgnoreLong1_16ChannelNames();
/**
* Force 1.17+ client to accept the server resource pack.
*
* @return true if enabled
*/
boolean isForcedUse1_17ResourcePack();
/**
* Get the message that is sent when a user displays a resource pack prompt.
*
* @return cached serialized component
*/
JsonElement get1_17ResourcePackPrompt();
/***
* Get the world names that should be returned for each Vanilla dimension.
* Note that this can be overriden per-user by using {@link UserConnection#put(StorableObject)} with
* a custom instance of {@link WorldIdentifiers} for the user's {@link UserConnection}.
*
* @return the global map from vanilla dimensions to world name
*/
WorldIdentifiers get1_16WorldNamesMap();
boolean cache1_17Light();
}
@@ -0,0 +1,104 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
/**
* Handles injected UserConnections
*/
public interface ConnectionManager {
/**
* Returns if Via injected into this player connection.
*
* @param playerId player uuid
* @return true if the player is handled by Via
*/
boolean isClientConnected(UUID playerId);
/**
* Frontend connections will have the UUID stored. Override this if your platform isn't always frontend.
* UUIDs can't be duplicate between frontend connections.
*
* @return true if the user is a frontend connection
*/
default boolean isFrontEnd(UserConnection connection) {
return !connection.isClientSide();
}
/**
* Returns the frontend UserConnection from the player connected to this proxy server
* Returns null when there isn't a server or connection was not found
* When ViaVersion is reloaded, this method may not return some players.
* May not return ProtocolSupport players.
* <p>
* Note that connections are removed as soon as their channel is closed,
* so avoid using this method during player quits for example.
*
* @return frontend UserConnection of the player connected to this proxy server
*/
@Nullable UserConnection getConnectedClient(UUID clientIdentifier);
/**
* Returns the UUID from the frontend connection to this proxy server
* Returns null when there isn't a server or this connection isn't frontend or it doesn't have an id
* When ViaVersion is reloaded, this method may not return some players.
* May not return ProtocolSupport players.
* <p>
* Note that connections are removed as soon as their channel is closed,
* so avoid using this method during player quits for example.
*
* @return UUID of the frontend connection to this proxy server
*/
@Nullable UUID getConnectedClientId(UserConnection connection);
/**
* Returns all UserConnections which are registered
* May contain duplicated UUIDs on multiple ProtocolInfo.
* May contain frontend, backend and/or client-sided connections.
* When ViaVersion is reloaded, this method may not return some players.
* May not contain ProtocolSupport players.
*
* @return connected UserConnections
*/
Set<UserConnection> getConnections();
/**
* Returns a map containing the UUIDs and frontend UserConnections from players connected to this proxy server
* Returns empty list when there isn't a server
* When ViaVersion is reloaded, this method may not return some players.
* May not contain ProtocolSupport players.
*
* @return map containing the UUIDs and frontend UserConnections from players connected to this proxy server
*/
Map<UUID, UserConnection> getConnectedClients();
void onLoginSuccess(UserConnection connection);
void onDisconnect(UserConnection connection);
}
@@ -0,0 +1,97 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
import com.viaversion.viaversion.api.protocol.ProtocolPipeline;
import com.viaversion.viaversion.api.protocol.packet.State;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.UUID;
public interface ProtocolInfo {
/**
* Returns the protocol state the user is currently in.
*
* @return protocol state
*/
State getState();
void setState(State state);
/**
* Returns the user's protocol version, or -1 if not set.
* This is set during the {@link State#HANDSHAKE} state.
*
* @return protocol version, or -1 if not set
*/
int getProtocolVersion();
void setProtocolVersion(int protocolVersion);
/**
* Returns the server protocol version the user is connected to, or -1 if not set.
* This is set during the {@link State#HANDSHAKE} state.
*
* @return server protocol version, or -1 if not set
*/
int getServerProtocolVersion();
void setServerProtocolVersion(int serverProtocolVersion);
/**
* Returns the username associated with this connection.
* This is set once the connection enters the {@link State#PLAY} state.
*
* @return username, set when entering the {@link State#PLAY} state
*/
@Nullable String getUsername();
void setUsername(String username);
/**
* Returns the uuid associated with this connection.
* This is set once the connection enters the {@link State#PLAY} state.
*
* @return uuid, set when entering the {@link State#PLAY} state
*/
@Nullable UUID getUuid();
void setUuid(UUID uuid);
/**
* Returns the user's pipeline.
*
* @return protocol pipeline
*/
ProtocolPipeline getPipeline();
void setPipeline(ProtocolPipeline pipeline);
/**
* Returns the user connection this info represents.
*
* @return user connection
*/
UserConnection getUser();
}
@@ -0,0 +1,32 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
/**
* Dummy interface used to explicitly identify objects storable in user connections.
*
* @see UserConnection#get(Class)
* @see UserConnection#put(StorableObject)
*/
public interface StorableObject {
}
@@ -0,0 +1,35 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
public abstract class StoredObject implements StorableObject {
private final UserConnection user;
protected StoredObject(UserConnection user) {
this.user = user;
}
public UserConnection getUser() {
return user;
}
}
@@ -0,0 +1,321 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.connection;
import com.viaversion.viaversion.api.configuration.ViaVersionConfig;
import com.viaversion.viaversion.api.data.entity.EntityTracker;
import com.viaversion.viaversion.api.protocol.Protocol;
import com.viaversion.viaversion.api.protocol.packet.PacketTracker;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.exception.CancelException;
import com.viaversion.viaversion.exception.InformativeException;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Collection;
import java.util.Map;
import java.util.UUID;
import java.util.function.Function;
public interface UserConnection {
/**
* Get an object from the storage.
*
* @param objectClass The class of the object to get
* @param <T> The type of the class you want to get.
* @return The requested object
*/
@Nullable <T extends StorableObject> T get(Class<T> objectClass);
/**
* Check if the storage has an object.
*
* @param objectClass The object class to check
* @return True if the object is in the storage
*/
boolean has(Class<? extends StorableObject> objectClass);
/**
* Put an object into the stored objects based on class.
*
* @param object The object to store.
*/
void put(StorableObject object);
/**
* Returns a collection of entity trackers currently registered.
*
* @return collection of entity trackers currently registered
*/
Collection<EntityTracker> getEntityTrackers();
/**
* Returns the entity tracker by the given protocol class if present.
*
* @param protocolClass protocol class
* @param <T> entity tracker type
* @return entity tracker if present
*/
@Nullable <T extends EntityTracker> T getEntityTracker(Class<? extends Protocol> protocolClass);
/**
* Adds an entity tracker to the user connection.
*
* @param protocolClass protocol class
* @param tracker entity tracker
*/
void addEntityTracker(Class<? extends Protocol> protocolClass, EntityTracker tracker);
/**
* Clear stored objects and entity trackers.
* Used for Bungee when switching servers.
*/
void clearStoredObjects();
/**
* Sends a raw packet to the connection on the current thread.
*
* @param packet raw packet to send
*/
void sendRawPacket(ByteBuf packet);
/**
* Send a raw packet to the player, submitted to the netty event loop.
*
* @param packet raw packet to send
*/
void scheduleSendRawPacket(ByteBuf packet);
/**
* Send a raw packet to the player with returning the future.
*
* @param packet The raw packet to send
* @return ChannelFuture of the packet being sent
*/
ChannelFuture sendRawPacketFuture(ByteBuf packet);
/**
* Returns the user's packet tracker used for the inbuilt packet-limiter.
*
* @return packet tracker
*/
PacketTracker getPacketTracker();
/**
* Disconnect a connection.
*
* @param reason The reason to use, not used if player is not active.
*/
void disconnect(String reason);
/**
* Sends a raw packet to the server on the current thread.
*
* @param packet raw packet to be sent
*/
void sendRawPacketToServer(ByteBuf packet);
/**
* Sends a raw packet to the server, submitted to the netty event loop.
*
* @param packet raw packet to be sent
*/
void scheduleSendRawPacketToServer(ByteBuf packet);
/**
* Monitors serverbound packets and returns whether a packet can/should be processed.
*
* @return false if this packet should be cancelled
*/
boolean checkServerboundPacket();
/**
* Monitors clientbound packets and returns whether a packet can/should be processed.
*
* @return false if this packet should be cancelled
*/
boolean checkClientboundPacket();
/**
* @see #checkClientboundPacket()
* @see #checkServerboundPacket()
*/
default boolean checkIncomingPacket() {
return isClientSide() ? checkClientboundPacket() : checkServerboundPacket();
}
/**
* @see #checkClientboundPacket()
* @see #checkServerboundPacket()
*/
default boolean checkOutgoingPacket() {
return isClientSide() ? checkServerboundPacket() : checkClientboundPacket();
}
/**
* Checks if packets needs transforming.
*
* @return whether packets should be passed through
*/
boolean shouldTransformPacket();
/**
* Transforms the clientbound packet contained in ByteBuf.
*
* @param buf ByteBuf with packet id and packet contents
* @param cancelSupplier function called with original CancelException for generating the Exception when the packet is cancelled
* @throws CancelException if the packet should be cancelled
* @throws InformativeException if packet transforming failed
* @throws Exception if any other processing outside of transforming fails
*/
void transformClientbound(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception;
/**
* Transforms the serverbound packet contained in ByteBuf.
*
* @param buf ByteBuf with packet id and packet contents
* @param cancelSupplier Function called with original CancelException for generating the Exception used when
* packet is cancelled
* @throws CancelException if the packet should be cancelled
* @throws InformativeException if packet transforming failed
* @throws Exception if any other processing outside of transforming fails
*/
void transformServerbound(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception;
/**
* Transforms the packet depending on whether the connection is clientside or not.
*
* @see #transformClientbound(ByteBuf, Function)
* @see #transformServerbound(ByteBuf, Function)
*/
default void transformOutgoing(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception {
if (isClientSide()) {
transformServerbound(buf, cancelSupplier);
} else {
transformClientbound(buf, cancelSupplier);
}
}
/**
* Transforms the packet depending on whether the connection is clientside or not.
*
* @see #transformClientbound(ByteBuf, Function)
* @see #transformServerbound(ByteBuf, Function)
*/
default void transformIncoming(ByteBuf buf, Function<Throwable, Exception> cancelSupplier) throws Exception {
if (isClientSide()) {
transformClientbound(buf, cancelSupplier);
} else {
transformServerbound(buf, cancelSupplier);
}
}
/**
* Returns the internal id incremented for each new connection.
*
* @return internal id
*/
long getId();
/**
* Returns the netty channel if present.
*
* @return netty channel if present
*/
@Nullable Channel getChannel();
/**
* Returns info containing the current protocol state and userdata.
*
* @return info containing the current protocol state and userdata
*/
ProtocolInfo getProtocolInfo();
/**
* Returns a map of stored objects.
*
* @return map of stored objects
* @see #has(Class)
* @see #get(Class)
* @see #put(StorableObject)
*/
Map<Class<?>, StorableObject> getStoredObjects();
/**
* Returns whether the connection has protocols other than the base protocol applied.
*
* @return whether the connection is active
*/
boolean isActive();
void setActive(boolean active);
/**
* Returns whether the connection is pending a disconnect, initiated through {@link #disconnect(String)}.
*
* @return whether the connection is pending a disconnect
*/
boolean isPendingDisconnect();
void setPendingDisconnect(boolean pendingDisconnect);
/**
* Returns whether this is a client-side connection.
* This is a mod integrated into the client itself, or for example a backend Velocity connection.
*
* @return whether this is a client-side connection
*/
boolean isClientSide();
/**
* Returns whether {@link ViaVersionConfig#blockedProtocolVersions()} should be checked for this connection.
*
* @return whether blocked protocols should be applied
*/
boolean shouldApplyBlockProtocol();
/**
* Returns whether the packet limiter applies to this user.
*
* @return whether the packet limiter applies to this user
*/
boolean isPacketLimiterEnabled();
/**
* Sets the status of the packet limiter.
*
* @param packetLimiterEnabled whether the packet limiter should be enabled
*/
void setPacketLimiterEnabled(boolean packetLimiterEnabled);
/**
* Returns a newly generated uuid that will let a packet be passed through without
* transformig its contents if used together with {@link PacketWrapper#PASSTHROUGH_ID}.
*
* @return generated passthrough token
*/
UUID generatePassthroughToken();
}
@@ -0,0 +1,135 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Arrays;
public class IntArrayMappings implements Mappings {
private final int[] oldToNew;
private final int mappedIds;
protected IntArrayMappings(final int[] oldToNew, final int mappedIds) {
this.oldToNew = oldToNew;
this.mappedIds = mappedIds;
}
public static IntArrayMappings of(final int[] oldToNew, final int mappedIds) {
return new IntArrayMappings(oldToNew, mappedIds);
}
public static Builder<IntArrayMappings> builder() {
return Mappings.builder(IntArrayMappings::new);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(int[] oldToNew) {
this(oldToNew, -1);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(int size, JsonObject oldMapping, JsonObject newMapping, @Nullable JsonObject diffMapping) {
oldToNew = new int[size];
Arrays.fill(oldToNew, -1);
this.mappedIds = newMapping.size();
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping, diffMapping);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(JsonObject oldMapping, JsonObject newMapping, @Nullable JsonObject diffMapping) {
this(oldMapping.entrySet().size(), oldMapping, newMapping, diffMapping);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(int size, JsonObject oldMapping, JsonObject newMapping) {
oldToNew = new int[size];
Arrays.fill(oldToNew, -1);
mappedIds = -1;
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(JsonObject oldMapping, JsonObject newMapping) {
this(oldMapping.entrySet().size(), oldMapping, newMapping);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping, JsonObject diffMapping, boolean warnOnMissing) {
oldToNew = new int[size];
Arrays.fill(oldToNew, -1);
mappedIds = -1;
MappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping, diffMapping, warnOnMissing);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping, boolean warnOnMissing) {
this(size, oldMapping, newMapping, null, warnOnMissing);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping, boolean warnOnMissing) {
this(oldMapping.size(), oldMapping, newMapping, warnOnMissing);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(int size, JsonArray oldMapping, JsonArray newMapping) {
this(size, oldMapping, newMapping, true);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping, JsonObject diffMapping) {
this(oldMapping.size(), oldMapping, newMapping, diffMapping, true);
}
@Deprecated/*(forRemoval = true)*/
public IntArrayMappings(JsonArray oldMapping, JsonArray newMapping) {
this(oldMapping.size(), oldMapping, newMapping, true);
}
@Override
public int getNewId(int id) {
return id >= 0 && id < oldToNew.length ? oldToNew[id] : -1;
}
@Override
public void setNewId(int id, int newId) {
oldToNew[id] = newId;
}
@Override
public int size() {
return oldToNew.length;
}
@Override
public int mappedSize() {
return mappedIds;
}
public int[] getOldToNew() {
return oldToNew;
}
}
@@ -0,0 +1,105 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.viaversion.viaversion.api.minecraft.RegistryType;
import com.viaversion.viaversion.api.minecraft.TagData;
import com.viaversion.viaversion.util.Int2IntBiMap;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.List;
public interface MappingData {
/**
* Loads the mapping data.
*/
void load();
/**
* Returns the mapped block state id, or -1 if unmapped.
*
* @param id unmapped block state id
* @return mapped block state id, or -1 if unmapped
* @throws NullPointerException if this mappingdata does not hold block state mappings
*/
int getNewBlockStateId(int id);
/**
* Returns the mapped block id, or -1 if unmapped.
*
* @param id unmapped block id
* @return mapped block id, or -1 if unmapped
* @throws NullPointerException if this mappingdata does not hold block mappings
*/
int getNewBlockId(int id);
/**
* Returns the mapped item id, or -1 if unmapped.
*
* @param id unmapped item id
* @return mapped item id, or -1 if unmapped
* @throws NullPointerException if this mappingdata does not hold item mappings
*/
int getNewItemId(int id);
/**
* Returns the backwards mapped item id, or -1 if unmapped.
*
* @param id mapped item id
* @return backwards mapped item id, or -1 if unmapped
* @throws NullPointerException if this mappingdata does not hold item mappings
*/
int getOldItemId(int id);
/**
* Returns the mapped particle id, or -1 if unmapped.
*
* @param id unmapped particle id
* @return mapped particle id, or -1 if unmapped
* @throws NullPointerException if this mappingdata does not hold particle mappings
*/
int getNewParticleId(int id);
/**
* Returns a list of tags to send if present.
*
* @param type registry tag type
* @return list of tags to send if present, else null
*/
@Nullable List<TagData> getTags(RegistryType type);
@Nullable Int2IntBiMap getItemMappings();
@Nullable ParticleMappings getParticleMappings();
@Nullable Mappings getBlockMappings();
@Nullable Mappings getBlockEntityMappings();
@Nullable Mappings getBlockStateMappings();
@Nullable Mappings getSoundMappings();
@Nullable Mappings getStatisticsMappings();
}
@@ -0,0 +1,243 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.RegistryType;
import com.viaversion.viaversion.api.minecraft.TagData;
import com.viaversion.viaversion.util.Int2IntBiHashMap;
import com.viaversion.viaversion.util.Int2IntBiMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
public class MappingDataBase implements MappingData {
protected final String oldVersion;
protected final String newVersion;
protected final boolean hasDiffFile;
protected Int2IntBiMap itemMappings;
protected ParticleMappings particleMappings;
protected Mappings blockMappings;
protected Mappings blockStateMappings;
protected Mappings blockEntityMappings;
protected Mappings soundMappings;
protected Mappings statisticsMappings;
protected Map<RegistryType, List<TagData>> tags;
protected boolean loadItems = true;
public MappingDataBase(String oldVersion, String newVersion) {
this(oldVersion, newVersion, false);
}
public MappingDataBase(String oldVersion, String newVersion, boolean hasDiffFile) {
this.oldVersion = oldVersion;
this.newVersion = newVersion;
this.hasDiffFile = hasDiffFile;
}
@Override
public void load() {
getLogger().info("Loading " + oldVersion + " -> " + newVersion + " mappings...");
JsonObject diffmapping = hasDiffFile ? loadDiffFile() : null;
JsonObject oldMappings = MappingDataLoader.loadData("mapping-" + oldVersion + ".json", true);
JsonObject newMappings = MappingDataLoader.loadData("mapping-" + newVersion + ".json", true);
blockMappings = loadFromObject(oldMappings, newMappings, diffmapping, "blocks");
blockStateMappings = loadFromObject(oldMappings, newMappings, diffmapping, "blockstates");
blockEntityMappings = loadFromArray(oldMappings, newMappings, diffmapping, "blockentities");
soundMappings = loadFromArray(oldMappings, newMappings, diffmapping, "sounds");
statisticsMappings = loadFromArray(oldMappings, newMappings, diffmapping, "statistics");
Mappings particles = loadFromArray(oldMappings, newMappings, diffmapping, "particles");
if (particles != null) {
particleMappings = new ParticleMappings(oldMappings.getAsJsonArray("particles"), newMappings.getAsJsonArray("particles"), particles);
}
if (loadItems && newMappings.has("items")) {
itemMappings = new Int2IntBiHashMap();
itemMappings.defaultReturnValue(-1);
MappingDataLoader.mapIdentifiers(itemMappings, oldMappings.getAsJsonObject("items"), newMappings.getAsJsonObject("items"),
diffmapping != null ? diffmapping.getAsJsonObject("items") : null, true);
}
if (diffmapping != null && diffmapping.has("tags")) {
this.tags = new EnumMap<>(RegistryType.class);
JsonObject tags = diffmapping.getAsJsonObject("tags");
if (tags.has(RegistryType.ITEM.resourceLocation())) {
loadTags(RegistryType.ITEM, tags, MappingDataLoader.indexedObjectToMap(newMappings.getAsJsonObject("items")));
}
if (tags.has(RegistryType.BLOCK.resourceLocation())) {
loadTags(RegistryType.BLOCK, tags, MappingDataLoader.indexedObjectToMap(newMappings.getAsJsonObject("blocks")));
}
}
loadExtras(oldMappings, newMappings, diffmapping);
}
private void loadTags(RegistryType type, JsonObject object, Object2IntMap<String> typeMapping) {
JsonObject tags = object.getAsJsonObject(type.resourceLocation());
List<TagData> tagsList = new ArrayList<>(tags.size());
for (Map.Entry<String, JsonElement> entry : tags.entrySet()) {
JsonArray array = entry.getValue().getAsJsonArray();
int[] entries = new int[array.size()];
int i = 0;
for (JsonElement element : array) {
String stringId = element.getAsString();
if (!typeMapping.containsKey(stringId) && !typeMapping.containsKey(stringId = stringId.replace("minecraft:", ""))) { // aaa
getLogger().warning(type + " Tags contains invalid type identifier " + stringId + " in tag " + entry.getKey());
continue;
}
entries[i++] = typeMapping.getInt(stringId);
}
tagsList.add(new TagData(entry.getKey(), entries));
}
this.tags.put(type, tagsList);
}
@Override
public int getNewBlockStateId(int id) {
return checkValidity(id, blockStateMappings.getNewId(id), "blockstate");
}
@Override
public int getNewBlockId(int id) {
return checkValidity(id, blockMappings.getNewId(id), "block");
}
@Override
public int getNewItemId(int id) {
return checkValidity(id, itemMappings.get(id), "item");
}
@Override
public int getOldItemId(int id) {
int oldId = itemMappings.inverse().get(id);
// Remap new items to stone
return oldId != -1 ? oldId : 1;
}
@Override
public int getNewParticleId(int id) {
return checkValidity(id, particleMappings.getMappings().getNewId(id), "particles");
}
@Override
public @Nullable List<TagData> getTags(RegistryType type) {
return tags != null ? tags.get(type) : null;
}
@Override
public @Nullable Int2IntBiMap getItemMappings() {
return itemMappings;
}
@Override
public @Nullable ParticleMappings getParticleMappings() {
return particleMappings;
}
@Override
public @Nullable Mappings getBlockMappings() {
return blockMappings;
}
@Override
public @Nullable Mappings getBlockEntityMappings() {
return blockEntityMappings;
}
@Override
public @Nullable Mappings getBlockStateMappings() {
return blockStateMappings;
}
@Override
public @Nullable Mappings getSoundMappings() {
return soundMappings;
}
@Override
public @Nullable Mappings getStatisticsMappings() {
return statisticsMappings;
}
protected @Nullable Mappings loadFromArray(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
return IntArrayMappings.builder().unmapped(oldMappings.getAsJsonArray(key))
.mapped(newMappings.getAsJsonArray(key)).diffMappings(diff).build();
}
protected @Nullable Mappings loadFromObject(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings, String key) {
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
return IntArrayMappings.builder().unmapped(oldMappings.getAsJsonObject(key))
.mapped(newMappings.getAsJsonObject(key)).diffMappings(diff).build();
}
protected @Nullable JsonObject loadDiffFile() {
return MappingDataLoader.loadData("mappingdiff-" + oldVersion + "to" + newVersion + ".json");
}
protected Logger getLogger() {
return Via.getPlatform().getLogger();
}
/**
* Returns the given mapped id if valid, else 0 with a warning logged to the console.
*
* @param id unmapped id
* @param mappedId mapped id
* @param type mapping type (e.g. "item")
* @return the given mapped id if valid, else 0
*/
protected int checkValidity(int id, int mappedId, String type) {
if (mappedId == -1) {
getLogger().warning(String.format("Missing %s %s for %s %s %d", newVersion, type, oldVersion, type, id));
return 0;
}
return mappedId;
}
/**
* To be overridden.
*
* @param oldMappings old mappings
* @param newMappings new mappings
* @param diffMappings diff mappings if present
*/
protected void loadExtras(JsonObject oldMappings, JsonObject newMappings, @Nullable JsonObject diffMappings) {
}
}
@@ -0,0 +1,252 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonIOException;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.util.GsonUtil;
import com.viaversion.viaversion.util.Int2IntBiMap;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class MappingDataLoader {
private static final Map<String, JsonObject> MAPPINGS_CACHE = new ConcurrentHashMap<>();
private static boolean cacheJsonMappings;
/**
* Returns true if a selected number of mappings should be cached.
* If enabled, cleanup should be done after the cache is no longer needed.
*
* @return true if mappings should be cached
*/
public static boolean isCacheJsonMappings() {
return cacheJsonMappings;
}
public static void enableMappingsCache() {
cacheJsonMappings = true;
}
/**
* Returns the cached mappings. Cleared after ViaVersion has been fully loaded.
*
* @return cached mapping file json objects
* @see #isCacheJsonMappings()
*/
public static Map<String, JsonObject> getMappingsCache() {
return MAPPINGS_CACHE;
}
/**
* Loads the file from the plugin folder if present, else from the bundled resources.
*
* @return loaded json object, or null if not found or invalid
*/
public static @Nullable JsonObject loadFromDataDir(String name) {
File file = new File(Via.getPlatform().getDataFolder(), name);
if (!file.exists()) return loadData(name);
// Load the file from the platform's directory if present
try (FileReader reader = new FileReader(file)) {
return GsonUtil.getGson().fromJson(reader, JsonObject.class);
} catch (JsonSyntaxException e) {
// Users might mess up the format, so let's catch the syntax error
Via.getPlatform().getLogger().warning(name + " is badly formatted!");
e.printStackTrace();
} catch (IOException | JsonIOException e) {
e.printStackTrace();
}
return null;
}
/**
* Loads the file from the bundled resources. Uses the cache if enabled.
*
* @return loaded json object from bundled resources if present
*/
public static @Nullable JsonObject loadData(String name) {
return loadData(name, false);
}
/**
* Loads the file from the bundled resources. Uses the cache if enabled.
*
* @param cacheIfEnabled whether loaded files should be cached
* @return loaded json object from bundled resources if present
*/
public static @Nullable JsonObject loadData(String name, boolean cacheIfEnabled) {
if (cacheJsonMappings) {
JsonObject cached = MAPPINGS_CACHE.get(name);
if (cached != null) {
return cached;
}
}
InputStream stream = getResource(name);
if (stream == null) return null;
InputStreamReader reader = new InputStreamReader(stream);
try {
JsonObject object = GsonUtil.getGson().fromJson(reader, JsonObject.class);
if (cacheIfEnabled && cacheJsonMappings) {
MAPPINGS_CACHE.put(name, object);
}
return object;
} finally {
try {
reader.close();
} catch (IOException ignored) {
// Ignored
}
}
}
public static void mapIdentifiers(Int2IntBiMap output, JsonObject oldIdentifiers, JsonObject newIdentifiers, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
int value = mapIdentifierEntry(entry, newIdentifierMap, diffIdentifiers, warnOnMissing);
if (value != -1) {
output.put(Integer.parseInt(entry.getKey()), value);
}
}
}
@Deprecated/*(forRemoval = true)*/
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers) {
mapIdentifiers(output, oldIdentifiers, newIdentifiers, null);
}
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
int value = mapIdentifierEntry(entry, newIdentifierMap, diffIdentifiers, warnOnMissing);
if (value != -1) {
output[Integer.parseInt(entry.getKey())] = value;
}
}
}
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, @Nullable JsonObject diffIdentifiers) {
mapIdentifiers(output, oldIdentifiers, newIdentifiers, diffIdentifiers, true);
}
private static int mapIdentifierEntry(Map.Entry<String, JsonElement> entry, Object2IntMap newIdentifierMap, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
int value = newIdentifierMap.getInt(entry.getValue().getAsString());
if (value == -1) {
// Search in diff mappings
if (diffIdentifiers != null) {
JsonElement diffElement = diffIdentifiers.get(entry.getKey());
if (diffElement != null) {
value = newIdentifierMap.getInt(diffElement.getAsString());
}
}
if (value == -1) {
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
Via.getPlatform().getLogger().warning("No key for " + entry.getValue() + " :( ");
}
return -1;
}
}
return value;
}
@Deprecated/*(forRemoval = true)*/
public static void mapIdentifiers(int[] output, JsonArray oldIdentifiers, JsonArray newIdentifiers, boolean warnOnMissing) {
mapIdentifiers(output, oldIdentifiers, newIdentifiers, null, warnOnMissing);
}
public static void mapIdentifiers(int[] output, JsonArray oldIdentifiers, JsonArray newIdentifiers, @Nullable JsonObject diffIdentifiers, boolean warnOnMissing) {
Object2IntMap<String> newIdentifierMap = MappingDataLoader.arrayToMap(newIdentifiers);
for (int i = 0; i < oldIdentifiers.size(); i++) {
JsonElement oldIdentifier = oldIdentifiers.get(i);
int mappedId = newIdentifierMap.getInt(oldIdentifier.getAsString());
if (mappedId == -1) {
// Search in diff mappings
if (diffIdentifiers != null) {
JsonElement diffElement = diffIdentifiers.get(oldIdentifier.getAsString());
if (diffElement != null) {
String mappedName = diffElement.getAsString();
if (mappedName.isEmpty()) continue; // "empty" remaps
mappedId = newIdentifierMap.getInt(mappedName);
}
}
if (mappedId == -1) {
if (warnOnMissing && !Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
Via.getPlatform().getLogger().warning("No key for " + oldIdentifier + " :( ");
}
continue;
}
}
output[i] = mappedId;
}
}
/**
* Returns a map of the object entries hashed by their id value.
*
* @param object json object
* @return map with indexes hashed by their id value
*/
public static Object2IntMap<String> indexedObjectToMap(JsonObject object) {
Object2IntMap<String> map = new Object2IntOpenHashMap<>(object.size(), .99F);
map.defaultReturnValue(-1);
for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
map.put(entry.getValue().getAsString(), Integer.parseInt(entry.getKey()));
}
return map;
}
/**
* Returns a map of the array entries hashed by their id value.
*
* @param array json array
* @return map with indexes hashed by their id value
*/
public static Object2IntMap<String> arrayToMap(JsonArray array) {
Object2IntMap<String> map = new Object2IntOpenHashMap<>(array.size(), .99F);
map.defaultReturnValue(-1);
for (int i = 0; i < array.size(); i++) {
map.put(array.get(i).getAsString(), i);
}
return map;
}
public static @Nullable InputStream getResource(String name) {
return MappingDataLoader.class.getClassLoader().getResourceAsStream("assets/viaversion/data/" + name);
}
}
@@ -0,0 +1,182 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.util.Arrays;
public interface Mappings {
/**
* Returns the mapped id from the given id, or -1 if invalid/out of bounds.
*
* @param id unmapped id
* @return mapped id, or -1 if invalid/out of bounds
*/
int getNewId(int id);
/**
* Manually maps a specific id.
*
* @param id unmapped id
* @param newId mapped id
* @throws IndexOutOfBoundsException if the unmapped id is invalid
*/
void setNewId(int id, int newId);
/**
* Returns amount of unmapped entries, being the size of the mapping.
*
* @return amount of unmapped entries
*/
int size();
/**
* Returns the amount of new ids total, even if it does not have a direct mapping.
* Returns -1 if unknown.
*
* @return amount of new ids, or -1 if unknown
*/
int mappedSize();
static <T extends Mappings> Builder<T> builder(final MappingsSupplier<T> supplier) {
return new Builder(supplier);
}
@FunctionalInterface
interface MappingsSupplier<T extends Mappings> {
T supply(int[] mappings, int mappedIds);
}
class Builder<T extends Mappings> {
protected final MappingsSupplier<T> supplier;
protected JsonElement unmapped;
protected JsonElement mapped;
protected JsonObject diffMappings;
protected int mappedSize = -1;
protected int size = -1;
protected boolean warnOnMissing = true;
protected Builder(final MappingsSupplier<T> supplier) {
this.supplier = supplier;
}
/**
* Sets a custom entry size different to the size of the unmapped collection.
*
* @param size custom entry size
* @return self
*/
public Builder<T> customEntrySize(final int size) {
this.size = size;
return this;
}
/**
* Sets a custom entry mapped ids count different to the size of the mapped collection.
*
* @param size custom mapped id count
* @return self
*/
public Builder<T> customMappedSize(final int size) {
this.mappedSize = size;
return this;
}
/**
* Sets whether warnings should be logged for missing mapped ids.
*
* @param warnOnMissing whether warnings should be logged for missing mapped ids
* @return self
*/
public Builder<T> warnOnMissing(final boolean warnOnMissing) {
this.warnOnMissing = warnOnMissing;
return this;
}
public Builder<T> unmapped(final JsonArray unmappedArray) {
this.unmapped = unmappedArray;
return this;
}
public Builder<T> unmapped(final JsonObject unmappedObject) {
this.unmapped = unmappedObject;
return this;
}
public Builder<T> mapped(final JsonArray mappedArray) {
this.mapped = mappedArray;
return this;
}
public Builder<T> mapped(final JsonObject mappedObject) {
this.mapped = mappedObject;
return this;
}
public Builder<T> diffMappings(final JsonObject diffMappings) {
this.diffMappings = diffMappings;
return this;
}
public T build() {
final int size = this.size != -1 ? this.size : size(unmapped);
final int mappedSize = this.mappedSize != -1 ? this.mappedSize : size(mapped);
final int[] mappings = new int[size];
Arrays.fill(mappings, -1);
// Do conversion if one is an array and the other an object, otherwise directly map
if (unmapped.isJsonArray()) {
if (mapped.isJsonObject()) {
MappingDataLoader.mapIdentifiers(mappings, toJsonObject(unmapped.getAsJsonArray()), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
} else {
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonArray(), mapped.getAsJsonArray(), diffMappings, warnOnMissing);
}
} else if (mapped.isJsonArray()) {
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), toJsonObject(mapped.getAsJsonArray()), diffMappings, warnOnMissing);
} else {
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
}
return supplier.supply(mappings, mappedSize);
}
protected int size(final JsonElement element) {
return element.isJsonObject() ? element.getAsJsonObject().size() : element.getAsJsonArray().size();
}
protected JsonObject toJsonObject(final JsonArray array) {
final JsonObject object = new JsonObject();
for (int i = 0; i < array.size(); i++) {
final JsonElement element = array.get(i);
object.add(Integer.toString(i), element);
}
return object;
}
}
}
@@ -0,0 +1,105 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data;
import com.google.gson.JsonArray;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
public class ParticleMappings {
private final Object2IntMap<String> stringToId;
private final Object2IntMap<String> mappedStringToId;
private final Mappings mappings;
private final IntList itemParticleIds = new IntArrayList(2);
private final IntList blockParticleIds = new IntArrayList(4);
public ParticleMappings(JsonArray oldMappings, JsonArray newMappings, Mappings mappings) {
this.mappings = mappings;
stringToId = MappingDataLoader.arrayToMap(oldMappings);
mappedStringToId = MappingDataLoader.arrayToMap(newMappings);
stringToId.defaultReturnValue(-1);
mappedStringToId.defaultReturnValue(-1);
addBlockParticle("block");
addBlockParticle("falling_dust");
addBlockParticle("block_marker");
addItemParticle("item");
}
/**
* Returns the unmapped integer id for the given identifier, or -1 if not found.
*
* @param identifier unmapped string identifier
* @return unmapped int id, or -1 if not found
*/
public int id(String identifier) {
return stringToId.getInt(identifier);
}
/**
* Returns the mapped integer id for the given mapped identifier, or -1 if not found.
*
* @param mappedIdentifier mapped string identifier
* @return mapped int id, or -1 if not found
*/
public int mappedId(String mappedIdentifier) {
return mappedStringToId.getInt(mappedIdentifier);
}
public Mappings getMappings() {
return mappings;
}
public boolean addItemParticle(final String identifier) {
final int id = id(identifier);
return id != -1 && itemParticleIds.add(id);
}
public boolean addBlockParticle(final String identifier) {
final int id = id(identifier);
return id != -1 && blockParticleIds.add(id);
}
public boolean isBlockParticle(final int id) {
return blockParticleIds.contains(id);
}
public boolean isItemParticle(final int id) {
return itemParticleIds.contains(id);
}
@Deprecated/*(forRemoval = true)*/
public int getBlockId() {
return id("block");
}
@Deprecated/*(forRemoval = true)*/
public int getFallingDustId() {
return id("falling_dust");
}
@Deprecated/*(forRemoval = true)*/
public int getItemId() {
return id("item");
}
}
@@ -0,0 +1,28 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
public interface ClientEntityIdChangeListener {
void setClientEntityId(int entityId);
}
@@ -0,0 +1,154 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface EntityTracker {
/**
* User connection the tracker belongs to.
*
* @return user connection
*/
UserConnection user();
/**
* Tracks an entity.
*
* @param id entity id
* @param type entity type
*/
void addEntity(int id, EntityType type);
/**
* Returns whether the entity is currently tracked.
*
* @param id entity id
* @return whether the entity is tracked
*/
boolean hasEntity(int id);
/**
* Entity type of the entity if tracked.
* This returning null does not necessarily mean no entity by the id exists.
*
* @param id entity id
* @return entity type of the entity if tracked
*/
@Nullable EntityType entityType(int id);
/**
* Untracks an entity.
*
* @param id entity id
*/
void removeEntity(int id);
/**
* Clears stored entity types and data.
*/
void clearEntities();
/**
* Returns the stored entity data if an entity with the id is tracked, else null.
* If no data has been initialized yet, it will be done and returned by this method.
*
* @param id entity id
* @return stored entity data if an entity with the id is tracked, else null
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
*/
@Nullable StoredEntityData entityData(int id);
/**
* Returns stored entity data if it has previously been initialized by {@link #entityData(int)}, else null.
*
* @param id entity id
* @return stored entity data if it has previously been initialized by {@link #entityData(int)}
* @throws IllegalArgumentException if entitiy data storage has not been enabled via the implementation
*/
@Nullable StoredEntityData entityDataIfPresent(int id);
/**
* Returns the client entity id or -1 if unset.
*
* @return client entity id or -1 if unset
*/
int clientEntityId();
/**
* Sets the client entity id.
*
* @param clientEntityId client entity id
*/
void setClientEntityId(int clientEntityId);
/**
* Returns the current world section height (block height / 16).
* This is always 16 for sub 1.17 worlds.
*
* @return current world section height
*/
int currentWorldSectionHeight();
/**
* Sets the current world section height.
*
* @param currentWorldSectionHeight world section height
*/
void setCurrentWorldSectionHeight(int currentWorldSectionHeight);
/**
* Returns the minimum y of the current player world.
*
* @return minimum y of the current world
*/
int currentMinY();
/**
* Sets the minimum y of the current player world.
*
* @param currentMinY minimum y of the current world
*/
void setCurrentMinY(int currentMinY);
/**
* Returns the name of the world the player is currently in.
*
* @return world name of the current world
*/
@Nullable String currentWorld();
/**
* Sets the name of the world the player is currently in.
*
* @param currentWorld name of the current world
*/
void setCurrentWorld(String currentWorld);
int biomesSent();
void setBiomesSent(int biomesSent);
}
@@ -0,0 +1,60 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.data.entity;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface StoredEntityData {
/**
* Returns the entity type of the stored entity.
*
* @return entity type
*/
EntityType type();
/**
* Checks if the storage contains an object of the given type.
*
* @param objectClass object class to check
* @return whether an object of the given type is in the storage
*/
boolean has(Class<?> objectClass);
/**
* Returns an object from the storage if present.
*
* @param objectClass class of the object to get
* @param <T> object type
* @return object if present
*/
@Nullable <T> T get(Class<T> objectClass);
/**
* Stores an object based on its class.
*
* @param object object to store
*/
void put(Object object);
}
@@ -0,0 +1,85 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.debug;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
public interface DebugHandler {
/**
* Returns whether debug mode is enabled.
*
* @return whether debug mode is enabled
*/
boolean enabled();
/**
* Sets debug mode.
*
* @param enabled whether debug should be enabled
*/
void setEnabled(boolean enabled);
/**
* Adds a packet type name to the list of packet types to log.
*
* @param packetTypeName packet type name
*/
void addPacketTypeNameToLog(String packetTypeName);
/**
* Removes a packet type name from the list of packet types to log.
*
* @param packetTypeName packet type name
*/
boolean removePacketTypeNameToLog(String packetTypeName);
/**
* Resets packet type filters.
*/
void clearPacketTypesToLog();
/**
* Returns whether packets should be logged after being transformed.
* Set to true by default.
*
* @return whether packets should be logged after being transformed
*/
boolean logPostPacketTransform();
/**
* Sets whether packets should be logged after being transformed.
*
* @param logPostPacketTransform whether packets should be logged after being transformed
*/
void setLogPostPacketTransform(boolean logPostPacketTransform);
/**
* Returns whether the given packet should be logged.
* If no specific packet type has been added, all packet types will be logged.
*
* @param wrapper packet wrapper
* @return whether the packet should be logged
*/
boolean shouldLog(PacketWrapper wrapper);
}
@@ -0,0 +1,58 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy;
import com.viaversion.viaversion.api.legacy.bossbar.BossBar;
import com.viaversion.viaversion.api.legacy.bossbar.BossColor;
import com.viaversion.viaversion.api.legacy.bossbar.BossStyle;
/**
* API only applicable on or to legacy versions of Minecraft.
*
* @param <T> player type
*/
public interface LegacyViaAPI<T> {
/**
* Creates a new bossbar instance. This only works on pre 1.9 servers for 1.9+ clients.
*
* @param title title
* @param health health, between 0 and 1 (inclusive)
* @param color color
* @param style style
* @return new bossbar instance
*/
BossBar createLegacyBossBar(String title, float health, BossColor color, BossStyle style);
/**
* Creates a new bossbar instance with full health. This only works on pre 1.9 servers for 1.9+ clients.
*
* @param title title
* @param color color
* @param style style
* @return new bossbar instance
*/
default BossBar createLegacyBossBar(String title, BossColor color, BossStyle style) {
return createLegacyBossBar(title, 1F, color, style);
}
}
@@ -0,0 +1,187 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
import com.viaversion.viaversion.api.connection.UserConnection;
import java.util.Set;
import java.util.UUID;
public interface BossBar {
/**
* Get the current title
*
* @return the title
*/
String getTitle();
/**
* Change the title
*
* @param title Title can be in either JSON or just text
* @return The BossBar object
*/
BossBar setTitle(String title);
/**
* Get the health
*
* @return float between 0F - 1F
*/
float getHealth();
/**
* Change the health
*
* @param health this float has to be between 0F - 1F
* @return The BossBar object
*/
BossBar setHealth(float health);
/**
* Get the bossbar color
*
* @return The colour
*/
BossColor getColor();
/**
* Yay colors!
*
* @param color Whatever color you want!
* @return The BossBar object
*/
BossBar setColor(BossColor color);
/**
* Get the bosbar style
*
* @return BossStyle
*/
BossStyle getStyle();
/**
* Change the bosbar style
*
* @param style BossStyle
* @return The BossBar object
*/
BossBar setStyle(BossStyle style);
/**
* Show the bossbar to a player (uuid). This only works for frontend connections. Use #addConnection(UserConnection) for other types.
*
* @param player uuid of the player
* @return The BossBar object
*/
BossBar addPlayer(UUID player);
/**
* Show the bossbar to a player connection.
*
* @param conn UserConnection of the connection
* @return The BossBar object
*/
BossBar addConnection(UserConnection conn);
/**
* Removes the bossbar from a player. This only works for frontend connections. For others types, use #removeConnection(UserConnection)
*
* @param uuid The players UUID
* @return The BossBar object
*/
BossBar removePlayer(UUID uuid);
/**
* Removes the bossbar from a player connection.
*
* @param conn The UserConnection
* @return The BossBar object
*/
BossBar removeConnection(UserConnection conn);
/**
* Add flags
*
* @param flag The flag to add
* @return The BossBar object
*/
BossBar addFlag(BossFlag flag);
/**
* Remove flags.
*
* @param flag The flag to remove
* @return The BossBar object
*/
BossBar removeFlag(BossFlag flag);
/**
* @param flag The flag to check against
* @return True if it has the flag
*/
boolean hasFlag(BossFlag flag);
/**
* Get players. Only returns UUIDs which are front-end. For all connections, use #getConnections()
*
* @return UUIDS from players (sorry I lied)
*/
Set<UUID> getPlayers();
/**
* Get UserConnections.
*
* @return UserConnection from players
*/
Set<UserConnection> getConnections();
/**
* Show the bossbar to everyone (In the getPlayer set)
*
* @return The BossBar object
*/
BossBar show();
/**
* Hide the bossbar from everyone (In the getPlayer set)
*
* @return The BossBar object
*/
BossBar hide();
/**
* Is it visible?
*
* @return visibility changable with show() and hide()
*/
boolean isVisible();
/**
* Get the UUID of this bossbar
*
* @return Unique Id for this bossbar
*/
UUID getId();
}
@@ -0,0 +1,44 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
public enum BossColor {
PINK(0),
BLUE(1),
RED(2),
GREEN(3),
YELLOW(4),
PURPLE(5),
WHITE(6);
private final int id;
BossColor(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,40 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
public enum BossFlag {
DARKEN_SKY(1),
PLAY_BOSS_MUSIC(2),
CREATE_FOG(4);
private final int id;
BossFlag(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,42 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.legacy.bossbar;
public enum BossStyle {
SOLID(0),
SEGMENTED_6(1),
SEGMENTED_10(2),
SEGMENTED_12(3),
SEGMENTED_20(4);
private final int id;
BossStyle(int id) {
this.id = id;
}
public int getId() {
return id;
}
}
@@ -0,0 +1,68 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public interface BlockChangeRecord {
/**
* Returns the relative x coordinate within the chunk section.
*
* @return relative x coordinate within the chunk section
*/
byte getSectionX();
/**
* Returns the relative y coordinate within the chunk section.
*
* @return relative y coordinate within the chunk section
*/
byte getSectionY();
/**
* Returns the relative z coordinate within the chunk section.
*
* @return relative z coordinate within the chunk section
*/
byte getSectionZ();
/**
* Returns the absolute y coordinate based on the given chunk section y.
*
* @param chunkSectionY chunk section
* @return absolute y coordinate
*/
short getY(int chunkSectionY);
/**
* @return absolute y coordinate
* @deprecated 1.16+ stores the relative y coordinate
*/
@Deprecated
default short getY() {
return getY(-1);
}
int getBlockId();
void setBlockId(int blockId);
}
@@ -0,0 +1,72 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.google.common.base.Preconditions;
public class BlockChangeRecord1_16_2 implements BlockChangeRecord {
private final byte sectionX;
private final byte sectionY;
private final byte sectionZ;
private int blockId;
public BlockChangeRecord1_16_2(byte sectionX, byte sectionY, byte sectionZ, int blockId) {
this.sectionX = sectionX;
this.sectionY = sectionY;
this.sectionZ = sectionZ;
this.blockId = blockId;
}
public BlockChangeRecord1_16_2(int sectionX, int sectionY, int sectionZ, int blockId) {
this((byte) sectionX, (byte) sectionY, (byte) sectionZ, blockId);
}
@Override
public byte getSectionX() {
return sectionX;
}
@Override
public byte getSectionY() {
return sectionY;
}
@Override
public byte getSectionZ() {
return sectionZ;
}
@Override
public short getY(int chunkSectionY) {
Preconditions.checkArgument(chunkSectionY >= 0, "Invalid chunkSectionY: " + chunkSectionY);
return (short) ((chunkSectionY << 4) + sectionY);
}
public int getBlockId() {
return blockId;
}
public void setBlockId(int blockId) {
this.blockId = blockId;
}
}
@@ -0,0 +1,76 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public class BlockChangeRecord1_8 implements BlockChangeRecord {
private final byte sectionX;
private final short y;
private final byte sectionZ;
private int blockId;
public BlockChangeRecord1_8(byte sectionX, short y, byte sectionZ, int blockId) {
this.sectionX = sectionX;
this.y = y;
this.sectionZ = sectionZ;
this.blockId = blockId;
}
public BlockChangeRecord1_8(int sectionX, int y, int sectionZ, int blockId) {
this((byte) sectionX, (short) y, (byte) sectionZ, blockId);
}
/**
* @return x coordinate within the chunk section
*/
public byte getSectionX() {
return sectionX;
}
@Override
public byte getSectionY() {
return (byte) (y & 0xF);
}
/**
* @return y coordinate
*/
@Override
public short getY(int chunkSectionY) {
return y;
}
/**
* @return z coordinate within the chunk section
*/
public byte getSectionZ() {
return sectionZ;
}
public int getBlockId() {
return blockId;
}
public void setBlockId(int blockId) {
this.blockId = blockId;
}
}
@@ -0,0 +1,104 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import java.util.HashMap;
import java.util.Map;
public enum BlockFace {
NORTH((byte) 0, (byte) 0, (byte) -1, EnumAxis.Z),
SOUTH((byte) 0, (byte) 0, (byte) 1, EnumAxis.Z),
EAST((byte) 1, (byte) 0, (byte) 0, EnumAxis.X),
WEST((byte) -1, (byte) 0, (byte) 0, EnumAxis.X),
TOP((byte) 0, (byte) 1, (byte) 0, EnumAxis.Y),
BOTTOM((byte) 0, (byte) -1, (byte) 0, EnumAxis.Y);
public static final BlockFace[] HORIZONTAL = new BlockFace[]{NORTH, SOUTH, EAST, WEST};
private static final Map<BlockFace, BlockFace> opposites = new HashMap<>();
static {
opposites.put(BlockFace.NORTH, BlockFace.SOUTH);
opposites.put(BlockFace.SOUTH, BlockFace.NORTH);
opposites.put(BlockFace.EAST, BlockFace.WEST);
opposites.put(BlockFace.WEST, BlockFace.EAST);
opposites.put(BlockFace.TOP, BlockFace.BOTTOM);
opposites.put(BlockFace.BOTTOM, BlockFace.TOP);
}
private final byte modX;
private final byte modY;
private final byte modZ;
private final EnumAxis axis;
BlockFace(byte modX, byte modY, byte modZ, EnumAxis axis) {
this.modX = modX;
this.modY = modY;
this.modZ = modZ;
this.axis = axis;
}
public BlockFace opposite() {
return opposites.get(this);
}
public byte modX() {
return modX;
}
public byte modY() {
return modY;
}
public byte modZ() {
return modZ;
}
public EnumAxis axis() {
return axis;
}
@Deprecated/*(forRemoval = true)*/
public byte getModX() {
return modX;
}
@Deprecated/*(forRemoval = true)*/
public byte getModY() {
return modY;
}
@Deprecated/*(forRemoval = true)*/
public byte getModZ() {
return modZ;
}
@Deprecated/*(forRemoval = true)*/
public EnumAxis getAxis() {
return axis;
}
public enum EnumAxis {
X, Y, Z
}
}
@@ -0,0 +1,57 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public enum Environment {
NORMAL(0),
NETHER(-1),
END(1);
private final int id;
Environment(int id) {
this.id = id;
}
public int id() {
return id;
}
@Deprecated/*(forRemoval = true)*/
public int getId() {
return id;
}
public static Environment getEnvironmentById(int id) {
switch (id) {
default:
case -1:
return NETHER;
case 0:
return NORMAL;
case 1:
return END;
}
}
}
@@ -0,0 +1,62 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public class EulerAngle {
private final float x;
private final float y;
private final float z;
public EulerAngle(final float x, final float y, final float z) {
this.x = x;
this.y = y;
this.z = z;
}
public float x() {
return x;
}
public float y() {
return y;
}
public float z() {
return z;
}
@Deprecated/*(forRemoval = true)*/
public float getX() {
return x;
}
@Deprecated/*(forRemoval = true)*/
public float getY() {
return y;
}
@Deprecated/*(forRemoval = true)*/
public float getZ() {
return z;
}
}
@@ -0,0 +1,103 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public class Position {
private final int x;
private final int y;
private final int z;
public Position(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
@Deprecated/*(forRemoval=true)*/
public Position(int x, short y, int z) {
this(x, (int) y, z);
}
@Deprecated/*(forRemoval=true)*/
public Position(Position toCopy) {
this(toCopy.x(), toCopy.y(), toCopy.z());
}
public Position getRelative(BlockFace face) {
return new Position(x + face.modX(), (short) (y + face.modY()), z + face.modZ());
}
public int x() {
return x;
}
public int y() {
return y;
}
public int z() {
return z;
}
@Deprecated/*(forRemoval=true)*/
public int getX() {
return x;
}
@Deprecated/*(forRemoval=true)*/
public int getY() {
return y;
}
@Deprecated/*(forRemoval=true)*/
public int getZ() {
return z;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Position position = (Position) o;
if (x != position.x) return false;
if (y != position.y) return false;
return z == position.z;
}
@Override
public int hashCode() {
int result = x;
result = 31 * result + y;
result = 31 * result + z;
return result;
}
@Override
public String toString() {
return "Position{" +
"x=" + x +
", y=" + y +
", z=" + z +
'}';
}
}
@@ -0,0 +1,69 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.HashMap;
import java.util.Map;
public enum RegistryType {
BLOCK("block"),
ITEM("item"),
FLUID("fluid"),
ENTITY("entity_type"),
GAME_EVENT("game_event");
private static final Map<String, RegistryType> MAP = new HashMap<>();
private static final RegistryType[] VALUES = values();
static {
for (RegistryType type : getValues()) {
MAP.put(type.resourceLocation, type);
}
}
public static RegistryType[] getValues() {
return VALUES;
}
public static @Nullable RegistryType getByKey(String resourceKey) {
return MAP.get(resourceKey);
}
private final String resourceLocation;
RegistryType(final String resourceLocation) {
this.resourceLocation = resourceLocation;
}
@Deprecated/*(forRemoval = true)*/
public String getResourceLocation() {
return resourceLocation;
}
public String resourceLocation() {
return resourceLocation;
}
}
@@ -0,0 +1,41 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public final class TagData {
private final String identifier;
private final int[] entries;
public TagData(String identifier, int[] entries) {
this.identifier = identifier;
this.entries = entries;
}
public String identifier() {
return identifier;
}
public int[] entries() {
return entries;
}
}
@@ -0,0 +1,77 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public class Vector {
private int blockX;
private int blockY;
private int blockZ;
public Vector(int blockX, int blockY, int blockZ) {
this.blockX = blockX;
this.blockY = blockY;
this.blockZ = blockZ;
}
public int blockX() {
return blockX;
}
public int blockY() {
return blockY;
}
public int blockZ() {
return blockZ;
}
@Deprecated/*(forRemoval=true)*/
public int getBlockX() {
return blockX;
}
@Deprecated/*(forRemoval=true)*/
public int getBlockY() {
return blockY;
}
@Deprecated/*(forRemoval=true)*/
public int getBlockZ() {
return blockZ;
}
@Deprecated/*(forRemoval=true)*/
public void setBlockX(int blockX) {
this.blockX = blockX;
}
@Deprecated/*(forRemoval=true)*/
public void setBlockY(int blockY) {
this.blockY = blockY;
}
@Deprecated/*(forRemoval=true)*/
public void setBlockZ(int blockZ) {
this.blockZ = blockZ;
}
}
@@ -0,0 +1,62 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
public class VillagerData {
private final int type;
private final int profession;
private final int level;
public VillagerData(final int type, final int profession, final int level) {
this.type = type;
this.profession = profession;
this.level = level;
}
public int type() {
return type;
}
public int profession() {
return profession;
}
public int level() {
return level;
}
@Deprecated/*(forRemoval=true)*/
public int getType() {
return type;
}
@Deprecated/*(forRemoval=true)*/
public int getProfession() {
return profession;
}
@Deprecated/*(forRemoval=true)*/
public int getLevel() {
return level;
}
}
@@ -0,0 +1,57 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft;
import com.viaversion.viaversion.api.connection.StorableObject;
public class WorldIdentifiers implements StorableObject {
public static final String OVERWORLD_DEFAULT = "minecraft:overworld";
public static final String NETHER_DEFAULT = "minecraft:the_nether";
public static final String END_DEFAULT = "minecraft:the_end";
private final String overworld;
private final String nether;
private final String end;
public WorldIdentifiers(String overworld) {
this(overworld, NETHER_DEFAULT, END_DEFAULT);
}
public WorldIdentifiers(String overworld, String nether, String end) {
this.overworld = overworld;
this.nether = nether;
this.end = end;
}
public String overworld() {
return this.overworld;
}
public String nether() {
return this.nether;
}
public String end() {
return this.end;
}
}
@@ -0,0 +1,45 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.blockentity;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface BlockEntity {
default byte sectionX() {
return (byte) ((packedXZ() >> 4) & 15);
}
default byte sectionZ() {
return (byte) (packedXZ() & 15);
}
byte packedXZ();
short y();
int typeId();
@Nullable CompoundTag tag();
}
@@ -0,0 +1,59 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.blockentity;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
public final class BlockEntityImpl implements BlockEntity {
private final byte packedXZ;
private final short y;
private final int typeId;
private final CompoundTag tag;
public BlockEntityImpl(final byte packedXZ, final short y, final int typeId, final CompoundTag tag) {
this.packedXZ = packedXZ;
this.y = y;
this.typeId = typeId;
this.tag = tag;
}
@Override
public byte packedXZ() {
return packedXZ;
}
@Override
public short y() {
return y;
}
@Override
public int typeId() {
return typeId;
}
@Override
public CompoundTag tag() {
return tag;
}
}
@@ -0,0 +1,156 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.BitSet;
import java.util.List;
//TODO Move methods from distinctly different versions to different objects/interfaces
public class BaseChunk implements Chunk {
protected final int x;
protected final int z;
protected final boolean fullChunk;
protected boolean ignoreOldLightData;
protected BitSet chunkSectionBitSet;
protected int bitmask;
protected ChunkSection[] sections;
protected int[] biomeData;
protected CompoundTag heightMap;
protected final List<CompoundTag> blockEntities;
public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, @Nullable BitSet chunkSectionBitSet,
ChunkSection[] sections, int @Nullable [] biomeData, @Nullable CompoundTag heightMap, List<CompoundTag> blockEntities) {
this.x = x;
this.z = z;
this.fullChunk = fullChunk;
this.ignoreOldLightData = ignoreOldLightData;
this.chunkSectionBitSet = chunkSectionBitSet;
this.sections = sections;
this.biomeData = biomeData;
this.heightMap = heightMap;
this.blockEntities = blockEntities;
}
public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, CompoundTag heightMap, List<CompoundTag> blockEntities) {
this(x, z, fullChunk, ignoreOldLightData, null, sections, biomeData, heightMap, blockEntities);
this.bitmask = bitmask;
}
public BaseChunk(int x, int z, boolean fullChunk, boolean ignoreOldLightData, int bitmask, ChunkSection[] sections, int[] biomeData, List<CompoundTag> blockEntities) {
this(x, z, fullChunk, ignoreOldLightData, bitmask, sections, biomeData, null, blockEntities);
}
@Override
public boolean isBiomeData() {
return biomeData != null;
}
@Override
public int getX() {
return x;
}
@Override
public int getZ() {
return z;
}
@Override
public boolean isFullChunk() {
return fullChunk;
}
@Override
public boolean isIgnoreOldLightData() {
return ignoreOldLightData;
}
@Override
public void setIgnoreOldLightData(boolean ignoreOldLightData) {
this.ignoreOldLightData = ignoreOldLightData;
}
@Override
public int getBitmask() {
return bitmask;
}
@Override
public void setBitmask(int bitmask) {
this.bitmask = bitmask;
}
@Override
public @Nullable BitSet getChunkMask() {
return chunkSectionBitSet;
}
@Override
public void setChunkMask(BitSet chunkSectionMask) {
this.chunkSectionBitSet = chunkSectionMask;
}
@Override
public ChunkSection[] getSections() {
return sections;
}
@Override
public void setSections(ChunkSection[] sections) {
this.sections = sections;
}
@Override
public int @Nullable [] getBiomeData() {
return biomeData;
}
@Override
public void setBiomeData(int @Nullable [] biomeData) {
this.biomeData = biomeData;
}
@Override
public @Nullable CompoundTag getHeightMap() {
return heightMap;
}
@Override
public void setHeightMap(final CompoundTag heightMap) {
this.heightMap = heightMap;
}
@Override
public List<CompoundTag> getBlockEntities() {
return blockEntities;
}
@Override
public List<BlockEntity> blockEntities() {
throw new UnsupportedOperationException();
}
}
@@ -0,0 +1,127 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.BitSet;
import java.util.List;
// TODO specialized sub interfaces
public interface Chunk {
/**
* Returns the chunk x coordinate.
*
* @return chunk x coordinate
*/
int getX();
/**
* Returns the chunk z coordinate.
*
* @return chunk z coordinate
*/
int getZ();
/**
* Returns whether this chunk holds biome data, always true for 1.17+ chunks.
*
* @return true if this chunk holds biome data
*/
boolean isBiomeData();
/**
* Returns whether this is a full chunk, always true for 1.17+ chunks.
*
* @return true if this is a full chunk
*/
boolean isFullChunk();
boolean isIgnoreOldLightData();
void setIgnoreOldLightData(boolean ignoreOldLightData);
/**
* Returns the chunk section bit mask for chunks &lt; 1.17.
*
* @return chunk section bit mask for chunks &lt; 1.17
* @see #getChunkMask()
*/
int getBitmask();
void setBitmask(int bitmask);
/**
* Returns the chunk section bit mask, only non-null for 1.17+ chunks.
*
* @return chunk section bit mask, only non-null for 1.17+ chunks
* @see #getBitmask()
*/
@Nullable BitSet getChunkMask();
void setChunkMask(BitSet chunkSectionMask);
/**
* Returns an array of nullable chunk section entries.
*
* @return array of nullable chunk sections
*/
@Nullable ChunkSection[] getSections();
void setSections(ChunkSection[] sections);
/**
* Returns the chunk's raw biome data. The format the biomes are stored may vary.
*
* @return raw biome data
*/
int @Nullable [] getBiomeData();
void setBiomeData(int @Nullable [] biomeData);
/**
* Returns a compoundtag containing the chunk's heightmaps if present.
*
* @return compoundtag containing heightmaps if present
*/
@Nullable CompoundTag getHeightMap();
void setHeightMap(@Nullable CompoundTag heightMap);
/**
* Returns a list of block entities.
*
* @return list of block entities
*/
List<CompoundTag> getBlockEntities();
/**
* Returns a list of block entities.
*
* @return list of block entities
*/
List<BlockEntity> blockEntities();
}
@@ -0,0 +1,136 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.BitSet;
import java.util.List;
public class Chunk1_18 implements Chunk {
protected final int x;
protected final int z;
protected ChunkSection[] sections;
protected CompoundTag heightMap;
protected final List<BlockEntity> blockEntities;
public Chunk1_18(int x, int z, ChunkSection[] sections, CompoundTag heightMap, List<BlockEntity> blockEntities) {
this.x = x;
this.z = z;
this.sections = sections;
this.heightMap = heightMap;
this.blockEntities = blockEntities;
}
@Override
public boolean isBiomeData() {
return false;
}
@Override
public int getX() {
return x;
}
@Override
public int getZ() {
return z;
}
@Override
public boolean isFullChunk() {
return true;
}
@Override
public boolean isIgnoreOldLightData() {
return false;
}
@Override
public void setIgnoreOldLightData(boolean ignoreOldLightData) {
throw new UnsupportedOperationException();
}
@Override
public int getBitmask() {
return -1;
}
@Override
public void setBitmask(int bitmask) {
throw new UnsupportedOperationException();
}
@Override
public @Nullable BitSet getChunkMask() {
return null;
}
@Override
public void setChunkMask(BitSet chunkSectionMask) {
throw new UnsupportedOperationException();
}
@Override
public ChunkSection[] getSections() {
return sections;
}
@Override
public void setSections(ChunkSection[] sections) {
this.sections = sections;
}
@Override
public int @Nullable [] getBiomeData() {
return null;
}
@Override
public void setBiomeData(int @Nullable [] biomeData) {
throw new UnsupportedOperationException();
}
@Override
public @Nullable CompoundTag getHeightMap() {
return heightMap;
}
@Override
public void setHeightMap(final CompoundTag heightMap) {
this.heightMap = heightMap;
}
@Override
public List<CompoundTag> getBlockEntities() {
throw new UnsupportedOperationException();
}
@Override
public List<BlockEntity> blockEntities() {
return blockEntities;
}
}
@@ -0,0 +1,163 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ChunkSection {
/**
* Size (dimensions) of blocks in a chunks section.
*/
int SIZE = 16 * 16 * 16; // width * depth * height
/**
* Size (dimensions) of biomes in a chunks section.
*/
int BIOME_SIZE = 4 * 4 * 4;
static int index(int x, int y, int z) {
return y << 8 | z << 4 | x;
}
@Deprecated/*(forRemoval = true)*/
default int getFlatBlock(int idx) {
return palette(PaletteType.BLOCKS).idAt(idx);
}
@Deprecated/*(forRemoval = true)*/
default int getFlatBlock(int x, int y, int z) {
return getFlatBlock(index(x, y, z));
}
@Deprecated/*(forRemoval = true)*/
default void setFlatBlock(int idx, int id) {
palette(PaletteType.BLOCKS).setIdAt(idx, id);
}
@Deprecated/*(forRemoval = true)*/
default void setFlatBlock(int x, int y, int z, int id) {
setFlatBlock(index(x, y, z), id);
}
@Deprecated/*(forRemoval = true)*/
default int getBlockWithoutData(int x, int y, int z) {
return getFlatBlock(x, y, z) >> 4;
}
@Deprecated/*(forRemoval = true)*/
default int getBlockData(int x, int y, int z) {
return getFlatBlock(x, y, z) & 0xF;
}
@Deprecated/*(forRemoval = true)*/
default void setBlockWithData(int x, int y, int z, int type, int data) {
setFlatBlock(index(x, y, z), type << 4 | (data & 0xF));
}
@Deprecated/*(forRemoval = true)*/
default void setBlockWithData(int idx, int type, int data) {
setFlatBlock(idx, type << 4 | (data & 0xF));
}
@Deprecated/*(forRemoval = true)*/
default void setPaletteIndex(int idx, int index) {
palette(PaletteType.BLOCKS).setPaletteIndexAt(idx, index);
}
@Deprecated/*(forRemoval = true)*/
default int getPaletteIndex(int idx) {
return palette(PaletteType.BLOCKS).paletteIndexAt(idx);
}
@Deprecated/*(forRemoval = true)*/
default int getPaletteSize() {
return palette(PaletteType.BLOCKS).size();
}
@Deprecated/*(forRemoval = true)*/
default int getPaletteEntry(int index) {
return palette(PaletteType.BLOCKS).idByIndex(index);
}
@Deprecated/*(forRemoval = true)*/
default void setPaletteEntry(int index, int id) {
palette(PaletteType.BLOCKS).setIdByIndex(index, id);
}
@Deprecated/*(forRemoval = true)*/
default void replacePaletteEntry(int oldId, int newId) {
palette(PaletteType.BLOCKS).replaceId(oldId, newId);
}
@Deprecated/*(forRemoval = true)*/
default void addPaletteEntry(int id) {
palette(PaletteType.BLOCKS).addId(id);
}
@Deprecated/*(forRemoval = true)*/
default void clearPalette() {
palette(PaletteType.BLOCKS).clear();
}
/**
* Returns the number of non-air blocks in this section.
*
* @return non-air blocks in this section
*/
int getNonAirBlocksCount();
void setNonAirBlocksCount(int nonAirBlocksCount);
/**
* Returns whether this section holds light data.
* Only true for &lt; 1.14 chunks.
*
* @return whether this section holds light data
*/
default boolean hasLight() {
return getLight() != null;
}
/**
* Returns the light of the chunk section.
* Only present for &lt; 1.14 chunks, otherwise sent separately.
*
* @return chunk section light if present
*/
@Nullable ChunkSectionLight getLight();
void setLight(@Nullable ChunkSectionLight light);
/**
* Returns the palette of the given type if present.
*
* @param type type of the palette
* @return palette
*/
@Nullable DataPalette palette(PaletteType type);
void addPalette(PaletteType type, DataPalette blockPalette);
void removePalette(PaletteType type);
}
@@ -0,0 +1,86 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.EnumMap;
public class ChunkSectionImpl implements ChunkSection {
private final EnumMap<PaletteType, DataPalette> palettes = new EnumMap<>(PaletteType.class);
private ChunkSectionLight light;
private int nonAirBlocksCount;
public ChunkSectionImpl() {
}
public ChunkSectionImpl(final boolean holdsLight) {
addPalette(PaletteType.BLOCKS, new DataPaletteImpl(ChunkSection.SIZE));
if (holdsLight) {
this.light = new ChunkSectionLightImpl();
}
}
public ChunkSectionImpl(final boolean holdsLight, final int expectedPaletteLength) {
addPalette(PaletteType.BLOCKS, new DataPaletteImpl(ChunkSection.SIZE, expectedPaletteLength));
if (holdsLight) {
this.light = new ChunkSectionLightImpl();
}
}
@Override
public int getNonAirBlocksCount() {
return nonAirBlocksCount;
}
@Override
public void setNonAirBlocksCount(final int nonAirBlocksCount) {
this.nonAirBlocksCount = nonAirBlocksCount;
}
@Override
public @Nullable ChunkSectionLight getLight() {
return light;
}
@Override
public void setLight(@Nullable final ChunkSectionLight light) {
this.light = light;
}
@Override
public DataPalette palette(final PaletteType type) {
return palettes.get(type);
}
@Override
public void addPalette(final PaletteType type, final DataPalette palette) {
palettes.put(type, palette);
}
@Override
public void removePalette(final PaletteType type) {
palettes.remove(type);
}
}
@@ -0,0 +1,113 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import io.netty.buffer.ByteBuf;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ChunkSectionLight {
/**
* Length of the sky and block light nibble arrays.
*/
int LIGHT_LENGTH = 16 * 16 * 16 / 2; // Dimensions / 2 (nibble bit count)
/**
* Returns whether the section has sky light.
*
* @return true if skylight is present
*/
boolean hasSkyLight();
/**
* Returns whether the section has block light.
* This returns true unless specifically set to null.
*
* @return true if skylight is present
*/
boolean hasBlockLight();
/**
* Returns the nibblearray's raw sky light byte array if present.
*
* @return the nibblearray's raw sky light byte array if present
* @see #hasSkyLight()
*/
byte @Nullable [] getSkyLight();
/**
* Returns the nibblearray's raw block light byte array if present.
*
* @return the nibblearray's raw block light byte array if present
* @see #hasBlockLight()
*/
byte @Nullable [] getBlockLight();
/**
* Set the sky light array.
*
* @param data raw sky light data
*/
void setSkyLight(byte[] data);
/**
* Set the block light array.
*
* @param data raw block light data
*/
void setBlockLight(byte[] data);
/**
* Returns the sky light nibblearray.
*
* @return sky light nibblearray
* @see #hasSkyLight()
*/
@Nullable NibbleArray getSkyLightNibbleArray();
/**
* Returns the block light nibblearray.
*
* @return block light nibblearray
* @see #hasBlockLight()
*/
@Nullable NibbleArray getBlockLightNibbleArray();
void readSkyLight(ByteBuf input);
void readBlockLight(ByteBuf input);
/**
* Write the sky light to a buffer.
*
* @param output buffer to write to
*/
void writeSkyLight(ByteBuf output);
/**
* Write the block light to a buffer.
*
* @param output buffer to write to
*/
void writeBlockLight(ByteBuf output);
}
@@ -0,0 +1,113 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import io.netty.buffer.ByteBuf;
import org.checkerframework.checker.nullness.qual.Nullable;
public class ChunkSectionLightImpl implements ChunkSectionLight {
private NibbleArray blockLight;
private NibbleArray skyLight;
public ChunkSectionLightImpl() {
// Block light is always written
this.blockLight = new NibbleArray(ChunkSection.SIZE);
}
@Override
public void setBlockLight(byte[] data) {
if (data.length != LIGHT_LENGTH) throw new IllegalArgumentException("Data length != " + LIGHT_LENGTH);
if (this.blockLight == null) {
this.blockLight = new NibbleArray(data);
} else {
this.blockLight.setHandle(data);
}
}
@Override
public void setSkyLight(byte[] data) {
if (data.length != LIGHT_LENGTH) throw new IllegalArgumentException("Data length != " + LIGHT_LENGTH);
if (this.skyLight == null) {
this.skyLight = new NibbleArray(data);
} else {
this.skyLight.setHandle(data);
}
}
@Override
public byte @Nullable [] getBlockLight() {
return blockLight == null ? null : blockLight.getHandle();
}
@Override
public @Nullable NibbleArray getBlockLightNibbleArray() {
return blockLight;
}
@Override
public byte @Nullable [] getSkyLight() {
return skyLight == null ? null : skyLight.getHandle();
}
@Override
public @Nullable NibbleArray getSkyLightNibbleArray() {
return skyLight;
}
@Override
public void readBlockLight(ByteBuf input) {
if (this.blockLight == null) {
this.blockLight = new NibbleArray(LIGHT_LENGTH * 2);
}
input.readBytes(this.blockLight.getHandle());
}
@Override
public void readSkyLight(ByteBuf input) {
if (this.skyLight == null) {
this.skyLight = new NibbleArray(LIGHT_LENGTH * 2);
}
input.readBytes(this.skyLight.getHandle());
}
@Override
public void writeBlockLight(ByteBuf output) {
output.writeBytes(blockLight.getHandle());
}
@Override
public void writeSkyLight(ByteBuf output) {
output.writeBytes(skyLight.getHandle());
}
@Override
public boolean hasSkyLight() {
return skyLight != null;
}
@Override
public boolean hasBlockLight() {
return blockLight != null;
}
}
@@ -0,0 +1,137 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
public interface DataPalette {
/**
* Returns the packet section index of the given coordinates.
*
* @param x x
* @param y y
* @param z z
* @return packed section index of the given coordinates
*/
int index(final int x, final int y, final int z);
/**
* Returns the value of the given chunk coordinate.
*
* @param sectionCoordinate section index within the section
* @return section state of the given index
*/
int idAt(int sectionCoordinate);
/**
* Returns the value of the section coordinate.
*
* @param sectionX section x
* @param sectionY section y
* @param sectionZ section z
* @return id of the given section coordinate
*/
default int idAt(final int sectionX, final int sectionY, final int sectionZ) {
return idAt(index(sectionX, sectionY, sectionZ));
}
/**
* Set a value in the chunk section.
* This method does not update non-air blocks count.
*
* @param sectionCoordinate section index within the section
* @param id id value
*/
void setIdAt(int sectionCoordinate, int id);
/**
* Set a value in the chunk section.
* This method does not update non-air blocks count.
*
* @param sectionX section x
* @param sectionY section y
* @param sectionZ section z
* @param id id value
*/
default void setIdAt(final int sectionX, final int sectionY, final int sectionZ, final int id) {
setIdAt(index(sectionX, sectionY, sectionZ), id);
}
/**
* Returns the id assigned to the given palette index.
*
* @param index palette index
* @return id assigned to the given palette index
*/
int idByIndex(int index);
/**
* Assigns an id assigned to the given palette index.
*
* @param index palette index
* @param id id value
*/
void setIdByIndex(int index, int id);
/**
* Returns the palette index of the given section index.
*
* @param packedCoordinate section index
* @return palette index of the given section index
*/
int paletteIndexAt(int packedCoordinate);
/**
* Sets the index of the given section coordinate.
*
* @param sectionCoordinate section index
* @param index palette index
*/
void setPaletteIndexAt(int sectionCoordinate, int index);
/**
* Adds a new id to the palette.
*
* @param id id value
*/
void addId(int id);
/**
* Replaces an id in the palette.
*
* @param oldId old id
* @param newId new id
*/
void replaceId(int oldId, int newId);
/**
* Returns the size of the palette.
*
* @return palette size
*/
int size();
/**
* Clears the palette.
*/
void clear();
}
@@ -0,0 +1,134 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import it.unimi.dsi.fastutil.ints.Int2IntMap;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;
public final class DataPaletteImpl implements DataPalette {
private final IntList palette;
private final Int2IntMap inversePalette;
private final int[] values;
private final int sizeBits;
public DataPaletteImpl(final int valuesLength) {
this(valuesLength, 8);
}
public DataPaletteImpl(final int valuesLength, final int expectedPaletteLength) {
this.values = new int[valuesLength];
sizeBits = Integer.numberOfTrailingZeros(valuesLength) / 3;
// Pre-size the palette array/map
palette = new IntArrayList(expectedPaletteLength);
inversePalette = new Int2IntOpenHashMap(expectedPaletteLength);
inversePalette.defaultReturnValue(-1);
}
@Override
public int index(final int x, final int y, final int z) {
return (y << this.sizeBits | z) << this.sizeBits | x;
}
@Override
public int idAt(final int sectionCoordinate) {
final int index = values[sectionCoordinate];
return palette.getInt(index);
}
@Override
public void setIdAt(final int sectionCoordinate, final int id) {
int index = inversePalette.get(id);
if (index == -1) {
index = palette.size();
palette.add(id);
inversePalette.put(id, index);
}
values[sectionCoordinate] = index;
}
@Override
public int paletteIndexAt(final int packedCoordinate) {
return values[packedCoordinate];
}
@Override
public void setPaletteIndexAt(final int sectionCoordinate, final int index) {
values[sectionCoordinate] = index;
}
@Override
public int size() {
return palette.size();
}
@Override
public int idByIndex(final int index) {
return palette.getInt(index);
}
@Override
public void setIdByIndex(final int index, final int id) {
final int oldId = palette.set(index, id);
if (oldId == id) return;
inversePalette.put(id, index);
if (inversePalette.get(oldId) == index) {
inversePalette.remove(oldId);
for (int i = 0; i < palette.size(); i++) {
if (palette.getInt(i) == oldId) {
inversePalette.put(oldId, i);
break;
}
}
}
}
@Override
public void replaceId(final int oldId, final int newId) {
final int index = inversePalette.remove(oldId);
if (index == -1) return;
inversePalette.put(newId, index);
for (int i = 0; i < palette.size(); i++) {
if (palette.getInt(i) == oldId) {
palette.set(i, newId);
}
}
}
@Override
public void addId(final int id) {
inversePalette.put(id, palette.size());
palette.add(id);
}
@Override
public void clear() {
palette.clear();
inversePalette.clear();
}
}
@@ -1,4 +1,26 @@
package us.myles.ViaVersion.api.minecraft.chunks;
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
import java.util.Arrays;
@@ -30,7 +52,7 @@ public class NibbleArray {
* @return The value at the given XYZ
*/
public byte get(int x, int y, int z) {
return get(y << 8 | z << 4 | x);
return get(ChunkSection.index(x, y, z));
}
/**
@@ -57,7 +79,7 @@ public class NibbleArray {
* @param value Desired Value
*/
public void set(int x, int y, int z, int value) {
set(y << 8 | z << 4 | x, value);
set(ChunkSection.index(x, y, z), value);
}
/**
@@ -67,11 +89,12 @@ public class NibbleArray {
* @param value The desired value
*/
public void set(int index, int value) {
index /= 2;
if (index % 2 == 0) {
handle[index] = (byte) (handle[index] & 0xF0 | value & 0xF);
index /= 2;
handle[index] = (byte) ((handle[index] & 0xF0) | (value & 0xF));
} else {
handle[index] = (byte) (handle[index] & 0xF | (value & 0xF) << 4);
index /= 2;
handle[index] = (byte) ((handle[index] & 0xF) | ((value & 0xF) << 4));
}
}
@@ -0,0 +1,44 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.chunks;
public enum PaletteType {
BLOCKS(ChunkSection.SIZE, 8),
BIOMES(ChunkSection.BIOME_SIZE, 3);
private final int size;
private final int highestBitsPerValue;
PaletteType(final int size, final int highestBitsPerValue) {
this.size = size;
this.highestBitsPerValue = highestBitsPerValue;
}
public int size() {
return size;
}
public int highestBitsPerValue() {
return highestBitsPerValue;
}
}
@@ -0,0 +1,242 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.api.Via;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
// 1.10 Entity / Object ids
public class Entity1_10Types {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
if (isObject)
type = ObjectType.getPCEntity(typeID);
else
type = EntityType.findById(typeID);
if (!type.isPresent()) {
Via.getPlatform().getLogger().severe("Could not find 1.10 type id " + typeID + " isObject=" + isObject);
return EntityType.ENTITY; // Fall back to the basic ENTITY
}
return type.get();
}
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
ENTITY(-1),
DROPPED_ITEM(1, ENTITY),
EXPERIENCE_ORB(2, ENTITY),
LEASH_HITCH(8, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
PAINTING(9, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
ARROW(10, ENTITY),
SNOWBALL(11, ENTITY), // Actually EntityProjectile
FIREBALL(12, ENTITY),
SMALL_FIREBALL(13, ENTITY),
ENDER_PEARL(14, ENTITY), // Actually EntityProjectile
ENDER_SIGNAL(15, ENTITY),
THROWN_EXP_BOTTLE(17, ENTITY),
ITEM_FRAME(18, ENTITY), // Actually EntityHanging
WITHER_SKULL(19, ENTITY),
PRIMED_TNT(20, ENTITY),
FALLING_BLOCK(21, ENTITY),
FIREWORK(22, ENTITY),
TIPPED_ARROW(23, ARROW),
SPECTRAL_ARROW(24, ARROW),
SHULKER_BULLET(25, ENTITY),
DRAGON_FIREBALL(26, FIREBALL),
ENTITY_LIVING(-1, ENTITY),
ENTITY_INSENTIENT(-1, ENTITY_LIVING),
ENTITY_AGEABLE(-1, ENTITY_INSENTIENT),
ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE),
ENTITY_HUMAN(-1, ENTITY_LIVING),
ARMOR_STAND(30, ENTITY_LIVING),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
MINECART_COMMAND(40, MINECART_ABSTRACT),
BOAT(41, ENTITY),
MINECART_RIDEABLE(42, MINECART_ABSTRACT),
MINECART_CHEST(43, MINECART_ABSTRACT),
MINECART_FURNACE(44, MINECART_ABSTRACT),
MINECART_TNT(45, MINECART_ABSTRACT),
MINECART_HOPPER(46, MINECART_ABSTRACT),
MINECART_MOB_SPAWNER(47, MINECART_ABSTRACT),
CREEPER(50, ENTITY_INSENTIENT),
SKELETON(51, ENTITY_INSENTIENT),
SPIDER(52, ENTITY_INSENTIENT),
GIANT(53, ENTITY_INSENTIENT),
ZOMBIE(54, ENTITY_INSENTIENT),
SLIME(55, ENTITY_INSENTIENT),
GHAST(56, ENTITY_INSENTIENT),
PIG_ZOMBIE(57, ZOMBIE),
ENDERMAN(58, ENTITY_INSENTIENT),
CAVE_SPIDER(59, SPIDER),
SILVERFISH(60, ENTITY_INSENTIENT),
BLAZE(61, ENTITY_INSENTIENT),
MAGMA_CUBE(62, SLIME),
ENDER_DRAGON(63, ENTITY_INSENTIENT),
WITHER(64, ENTITY_INSENTIENT),
BAT(65, ENTITY_INSENTIENT),
WITCH(66, ENTITY_INSENTIENT),
ENDERMITE(67, ENTITY_INSENTIENT),
GUARDIAN(68, ENTITY_INSENTIENT),
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
SHULKER(69, IRON_GOLEM),
PIG(90, ENTITY_AGEABLE),
SHEEP(91, ENTITY_AGEABLE),
COW(92, ENTITY_AGEABLE),
CHICKEN(93, ENTITY_AGEABLE),
SQUID(94, ENTITY_INSENTIENT),
WOLF(95, ENTITY_TAMEABLE_ANIMAL),
MUSHROOM_COW(96, COW),
SNOWMAN(97, IRON_GOLEM),
OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
HORSE(100, ENTITY_AGEABLE),
RABBIT(101, ENTITY_AGEABLE),
POLAR_BEAR(102, ENTITY_AGEABLE),
VILLAGER(120, ENTITY_AGEABLE),
ENDER_CRYSTAL(200, ENTITY),
SPLASH_POTION(-1, ENTITY),
LINGERING_POTION(-1, SPLASH_POTION),
AREA_EFFECT_CLOUD(-1, ENTITY),
EGG(-1, ENTITY),
FISHING_HOOK(-1, ENTITY),
LIGHTNING(-1, ENTITY),
WEATHER(-1, ENTITY),
PLAYER(-1, ENTITY_HUMAN),
COMPLEX_PART(-1, ENTITY);
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
private final int id;
private final EntityType parent;
EntityType(int id) {
this.id = id;
this.parent = null;
}
EntityType(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
static {
for (EntityType type : EntityType.values()) {
TYPES.put(type.id, type);
}
}
public static Optional<EntityType> findById(int id) {
if (id == -1) // Check if this is called
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
}
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
BOAT(1, EntityType.BOAT),
ITEM(2, EntityType.DROPPED_ITEM),
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
MINECART(10, EntityType.MINECART_RIDEABLE),
TNT_PRIMED(50, EntityType.PRIMED_TNT),
ENDER_CRYSTAL(51, EntityType.ENDER_CRYSTAL),
TIPPED_ARROW(60, EntityType.TIPPED_ARROW),
SNOWBALL(61, EntityType.SNOWBALL),
EGG(62, EntityType.EGG),
FIREBALL(63, EntityType.FIREBALL),
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
ENDER_PEARL(65, EntityType.ENDER_PEARL),
WITHER_SKULL(66, EntityType.WITHER_SKULL),
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
ITEM_FRAME(71, EntityType.ITEM_FRAME),
ENDER_SIGNAL(72, EntityType.ENDER_SIGNAL),
POTION(73, EntityType.SPLASH_POTION),
THROWN_EXP_BOTTLE(75, EntityType.THROWN_EXP_BOTTLE),
FIREWORK(76, EntityType.FIREWORK),
LEASH(77, EntityType.LEASH_HITCH),
ARMOR_STAND(78, EntityType.ARMOR_STAND),
FISHIHNG_HOOK(90, EntityType.FISHING_HOOK),
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL);
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
private final int id;
private final EntityType type;
static {
for (ObjectType type : ObjectType.values()) {
TYPES.put(type.id, type);
}
}
ObjectType(int id, EntityType type) {
this.id = id;
this.type = type;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getType() {
return type;
}
public static Optional<ObjectType> findById(int id) {
if (id == -1)
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
public static Optional<EntityType> getPCEntity(int id) {
Optional<ObjectType> output = findById(id);
if (!output.isPresent())
return Optional.empty();
return Optional.of(output.get().type);
}
}
}
@@ -0,0 +1,272 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.api.Via;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
// 1.11 Entity / Object ids
public class Entity1_11Types {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
if (isObject)
type = ObjectType.getPCEntity(typeID);
else
type = EntityType.findById(typeID);
if (!type.isPresent()) {
Via.getPlatform().getLogger().severe("Could not find 1.11 type id " + typeID + " isObject=" + isObject);
return EntityType.ENTITY; // Fall back to the basic ENTITY
}
return type.get();
}
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
ENTITY(-1),
DROPPED_ITEM(1, ENTITY),
EXPERIENCE_ORB(2, ENTITY),
LEASH_HITCH(8, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
PAINTING(9, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
ARROW(10, ENTITY),
SNOWBALL(11, ENTITY), // Actually EntityProjectile
FIREBALL(12, ENTITY),
SMALL_FIREBALL(13, ENTITY),
ENDER_PEARL(14, ENTITY), // Actually EntityProjectile
ENDER_SIGNAL(15, ENTITY),
THROWN_EXP_BOTTLE(17, ENTITY),
ITEM_FRAME(18, ENTITY), // Actually EntityHanging
WITHER_SKULL(19, ENTITY),
PRIMED_TNT(20, ENTITY),
FALLING_BLOCK(21, ENTITY),
FIREWORK(22, ENTITY),
SPECTRAL_ARROW(24, ARROW),
SHULKER_BULLET(25, ENTITY),
DRAGON_FIREBALL(26, FIREBALL),
EVOCATION_FANGS(33, ENTITY),
ENTITY_LIVING(-1, ENTITY),
ENTITY_INSENTIENT(-1, ENTITY_LIVING),
ENTITY_AGEABLE(-1, ENTITY_INSENTIENT),
ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE),
ENTITY_HUMAN(-1, ENTITY_LIVING),
ARMOR_STAND(30, ENTITY_LIVING),
EVOCATION_ILLAGER(34, ENTITY_INSENTIENT),
VEX(35, ENTITY_INSENTIENT),
VINDICATION_ILLAGER(36, ENTITY_INSENTIENT),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
MINECART_COMMAND(40, MINECART_ABSTRACT),
BOAT(41, ENTITY),
MINECART_RIDEABLE(42, MINECART_ABSTRACT),
MINECART_CHEST(43, MINECART_ABSTRACT),
MINECART_FURNACE(44, MINECART_ABSTRACT),
MINECART_TNT(45, MINECART_ABSTRACT),
MINECART_HOPPER(46, MINECART_ABSTRACT),
MINECART_MOB_SPAWNER(47, MINECART_ABSTRACT),
CREEPER(50, ENTITY_INSENTIENT),
ABSTRACT_SKELETON(-1, ENTITY_INSENTIENT),
SKELETON(51, ABSTRACT_SKELETON),
WITHER_SKELETON(5, ABSTRACT_SKELETON),
STRAY(6, ABSTRACT_SKELETON),
SPIDER(52, ENTITY_INSENTIENT),
GIANT(53, ENTITY_INSENTIENT),
ZOMBIE(54, ENTITY_INSENTIENT),
HUSK(23, ZOMBIE),
ZOMBIE_VILLAGER(27, ZOMBIE),
SLIME(55, ENTITY_INSENTIENT),
GHAST(56, ENTITY_INSENTIENT),
PIG_ZOMBIE(57, ZOMBIE),
ENDERMAN(58, ENTITY_INSENTIENT),
CAVE_SPIDER(59, SPIDER),
SILVERFISH(60, ENTITY_INSENTIENT),
BLAZE(61, ENTITY_INSENTIENT),
MAGMA_CUBE(62, SLIME),
ENDER_DRAGON(63, ENTITY_INSENTIENT),
WITHER(64, ENTITY_INSENTIENT),
BAT(65, ENTITY_INSENTIENT),
WITCH(66, ENTITY_INSENTIENT),
ENDERMITE(67, ENTITY_INSENTIENT),
GUARDIAN(68, ENTITY_INSENTIENT),
ELDER_GUARDIAN(4, GUARDIAN), // Moved down to avoid illegal forward reference
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
SHULKER(69, IRON_GOLEM),
PIG(90, ENTITY_AGEABLE),
SHEEP(91, ENTITY_AGEABLE),
COW(92, ENTITY_AGEABLE),
CHICKEN(93, ENTITY_AGEABLE),
SQUID(94, ENTITY_INSENTIENT),
WOLF(95, ENTITY_TAMEABLE_ANIMAL),
MUSHROOM_COW(96, COW),
SNOWMAN(97, IRON_GOLEM),
OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
ABSTRACT_HORSE(-1, ENTITY_AGEABLE),
HORSE(100, ABSTRACT_HORSE),
SKELETON_HORSE(28, ABSTRACT_HORSE),
ZOMBIE_HORSE(29, ABSTRACT_HORSE),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(31, CHESTED_HORSE),
MULE(32, CHESTED_HORSE),
LIAMA(103, CHESTED_HORSE),
RABBIT(101, ENTITY_AGEABLE),
POLAR_BEAR(102, ENTITY_AGEABLE),
VILLAGER(120, ENTITY_AGEABLE),
ENDER_CRYSTAL(200, ENTITY),
SPLASH_POTION(-1, ENTITY),
LINGERING_POTION(-1, SPLASH_POTION),
AREA_EFFECT_CLOUD(-1, ENTITY),
EGG(-1, ENTITY),
FISHING_HOOK(-1, ENTITY),
LIGHTNING(-1, ENTITY),
WEATHER(-1, ENTITY),
PLAYER(-1, ENTITY_HUMAN),
COMPLEX_PART(-1, ENTITY),
LIAMA_SPIT(-1, ENTITY);
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
private final int id;
private final EntityType parent;
EntityType(int id) {
this.id = id;
this.parent = null;
}
EntityType(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
for (EntityType type : EntityType.values()) {
TYPES.put(type.id, type);
}
}
public static Optional<EntityType> findById(int id) {
if (id == -1) // Check if this is called
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
}
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
BOAT(1, EntityType.BOAT),
ITEM(2, EntityType.DROPPED_ITEM),
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
MINECART(10, EntityType.MINECART_RIDEABLE),
TNT_PRIMED(50, EntityType.PRIMED_TNT),
ENDER_CRYSTAL(51, EntityType.ENDER_CRYSTAL),
TIPPED_ARROW(60, EntityType.ARROW),
SNOWBALL(61, EntityType.SNOWBALL),
EGG(62, EntityType.EGG),
FIREBALL(63, EntityType.FIREBALL),
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
ENDER_PEARL(65, EntityType.ENDER_PEARL),
WITHER_SKULL(66, EntityType.WITHER_SKULL),
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
LIAMA_SPIT(68, EntityType.LIAMA_SPIT),
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
ITEM_FRAME(71, EntityType.ITEM_FRAME),
ENDER_SIGNAL(72, EntityType.ENDER_SIGNAL),
POTION(73, EntityType.SPLASH_POTION),
THROWN_EXP_BOTTLE(75, EntityType.THROWN_EXP_BOTTLE),
FIREWORK(76, EntityType.FIREWORK),
LEASH(77, EntityType.LEASH_HITCH),
ARMOR_STAND(78, EntityType.ARMOR_STAND),
EVOCATION_FANGS(79, EntityType.EVOCATION_FANGS),
FISHIHNG_HOOK(90, EntityType.FISHING_HOOK),
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL);
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
private final int id;
private final EntityType type;
static {
for (ObjectType type : ObjectType.values()) {
TYPES.put(type.id, type);
}
}
ObjectType(int id, EntityType type) {
this.id = id;
this.type = type;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getType() {
return type;
}
public static Optional<ObjectType> findById(int id) {
if (id == -1)
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
public static Optional<EntityType> getPCEntity(int id) {
Optional<ObjectType> output = findById(id);
if (!output.isPresent())
return Optional.empty();
return Optional.of(output.get().type);
}
}
}
@@ -0,0 +1,276 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.api.Via;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
// 1.12 Entity / Object taken from https://github.com/Matsv/ViaBackwards/blob/master/core/src/main/java/nl/matsv/viabackwards/api/entities/types/EntityType1_12.java
public class Entity1_12Types {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
if (isObject)
type = ObjectType.getPCEntity(typeID);
else
type = EntityType.findById(typeID);
if (!type.isPresent()) {
Via.getPlatform().getLogger().severe("Could not find 1.12 type id " + typeID + " isObject=" + isObject);
return EntityType.ENTITY; // Fall back to the basic ENTITY
}
return type.get();
}
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
ENTITY(-1),
DROPPED_ITEM(1, ENTITY),
EXPERIENCE_ORB(2, ENTITY),
LEASH_HITCH(8, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
PAINTING(9, ENTITY), // Actually entity hanging but it doesn't make a lot of difference for metadata
ARROW(10, ENTITY),
SNOWBALL(11, ENTITY), // Actually EntityProjectile
FIREBALL(12, ENTITY),
SMALL_FIREBALL(13, ENTITY),
ENDER_PEARL(14, ENTITY), // Actually EntityProjectile
ENDER_SIGNAL(15, ENTITY),
THROWN_EXP_BOTTLE(17, ENTITY),
ITEM_FRAME(18, ENTITY), // Actually EntityHanging
WITHER_SKULL(19, ENTITY),
PRIMED_TNT(20, ENTITY),
FALLING_BLOCK(21, ENTITY),
FIREWORK(22, ENTITY),
SPECTRAL_ARROW(24, ARROW),
SHULKER_BULLET(25, ENTITY),
DRAGON_FIREBALL(26, FIREBALL),
EVOCATION_FANGS(33, ENTITY),
ENTITY_LIVING(-1, ENTITY),
ENTITY_INSENTIENT(-1, ENTITY_LIVING),
ENTITY_AGEABLE(-1, ENTITY_INSENTIENT),
ENTITY_TAMEABLE_ANIMAL(-1, ENTITY_AGEABLE),
ENTITY_HUMAN(-1, ENTITY_LIVING),
ARMOR_STAND(30, ENTITY_LIVING),
ENTITY_ILLAGER_ABSTRACT(-1, ENTITY_INSENTIENT),
EVOCATION_ILLAGER(34, ENTITY_ILLAGER_ABSTRACT),
VEX(35, ENTITY_INSENTIENT),
VINDICATION_ILLAGER(36, ENTITY_ILLAGER_ABSTRACT),
ILLUSION_ILLAGER(37, EVOCATION_ILLAGER),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
MINECART_COMMAND(40, MINECART_ABSTRACT),
BOAT(41, ENTITY),
MINECART_RIDEABLE(42, MINECART_ABSTRACT),
MINECART_CHEST(43, MINECART_ABSTRACT),
MINECART_FURNACE(44, MINECART_ABSTRACT),
MINECART_TNT(45, MINECART_ABSTRACT),
MINECART_HOPPER(46, MINECART_ABSTRACT),
MINECART_MOB_SPAWNER(47, MINECART_ABSTRACT),
CREEPER(50, ENTITY_INSENTIENT),
ABSTRACT_SKELETON(-1, ENTITY_INSENTIENT),
SKELETON(51, ABSTRACT_SKELETON),
WITHER_SKELETON(5, ABSTRACT_SKELETON),
STRAY(6, ABSTRACT_SKELETON),
SPIDER(52, ENTITY_INSENTIENT),
GIANT(53, ENTITY_INSENTIENT),
ZOMBIE(54, ENTITY_INSENTIENT),
HUSK(23, ZOMBIE),
ZOMBIE_VILLAGER(27, ZOMBIE),
SLIME(55, ENTITY_INSENTIENT),
GHAST(56, ENTITY_INSENTIENT),
PIG_ZOMBIE(57, ZOMBIE),
ENDERMAN(58, ENTITY_INSENTIENT),
CAVE_SPIDER(59, SPIDER),
SILVERFISH(60, ENTITY_INSENTIENT),
BLAZE(61, ENTITY_INSENTIENT),
MAGMA_CUBE(62, SLIME),
ENDER_DRAGON(63, ENTITY_INSENTIENT),
WITHER(64, ENTITY_INSENTIENT),
BAT(65, ENTITY_INSENTIENT),
WITCH(66, ENTITY_INSENTIENT),
ENDERMITE(67, ENTITY_INSENTIENT),
GUARDIAN(68, ENTITY_INSENTIENT),
ELDER_GUARDIAN(4, GUARDIAN), // Moved down to avoid illegal forward reference
IRON_GOLEM(99, ENTITY_INSENTIENT), // moved up to avoid illegal forward references
SHULKER(69, IRON_GOLEM),
PIG(90, ENTITY_AGEABLE),
SHEEP(91, ENTITY_AGEABLE),
COW(92, ENTITY_AGEABLE),
CHICKEN(93, ENTITY_AGEABLE),
SQUID(94, ENTITY_INSENTIENT),
WOLF(95, ENTITY_TAMEABLE_ANIMAL),
MUSHROOM_COW(96, COW),
SNOWMAN(97, IRON_GOLEM),
OCELOT(98, ENTITY_TAMEABLE_ANIMAL),
PARROT(105, ENTITY_TAMEABLE_ANIMAL),
ABSTRACT_HORSE(-1, ENTITY_AGEABLE),
HORSE(100, ABSTRACT_HORSE),
SKELETON_HORSE(28, ABSTRACT_HORSE),
ZOMBIE_HORSE(29, ABSTRACT_HORSE),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(31, CHESTED_HORSE),
MULE(32, CHESTED_HORSE),
LIAMA(103, CHESTED_HORSE),
RABBIT(101, ENTITY_AGEABLE),
POLAR_BEAR(102, ENTITY_AGEABLE),
VILLAGER(120, ENTITY_AGEABLE),
ENDER_CRYSTAL(200, ENTITY),
SPLASH_POTION(-1, ENTITY),
LINGERING_POTION(-1, SPLASH_POTION),
AREA_EFFECT_CLOUD(-1, ENTITY),
EGG(-1, ENTITY),
FISHING_HOOK(-1, ENTITY),
LIGHTNING(-1, ENTITY),
WEATHER(-1, ENTITY),
PLAYER(-1, ENTITY_HUMAN),
COMPLEX_PART(-1, ENTITY),
LIAMA_SPIT(-1, ENTITY);
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
private final int id;
private final EntityType parent;
EntityType(int id) {
this.id = id;
this.parent = null;
}
EntityType(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
for (EntityType type : EntityType.values()) {
TYPES.put(type.id, type);
}
}
public static Optional<EntityType> findById(int id) {
if (id == -1) // Check if this is called
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
}
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
BOAT(1, EntityType.BOAT),
ITEM(2, EntityType.DROPPED_ITEM),
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
MINECART(10, EntityType.MINECART_RIDEABLE),
TNT_PRIMED(50, EntityType.PRIMED_TNT),
ENDER_CRYSTAL(51, EntityType.ENDER_CRYSTAL),
TIPPED_ARROW(60, EntityType.ARROW),
SNOWBALL(61, EntityType.SNOWBALL),
EGG(62, EntityType.EGG),
FIREBALL(63, EntityType.FIREBALL),
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
ENDER_PEARL(65, EntityType.ENDER_PEARL),
WITHER_SKULL(66, EntityType.WITHER_SKULL),
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
LIAMA_SPIT(68, EntityType.LIAMA_SPIT),
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
ITEM_FRAME(71, EntityType.ITEM_FRAME),
ENDER_SIGNAL(72, EntityType.ENDER_SIGNAL),
POTION(73, EntityType.SPLASH_POTION),
THROWN_EXP_BOTTLE(75, EntityType.THROWN_EXP_BOTTLE),
FIREWORK(76, EntityType.FIREWORK),
LEASH(77, EntityType.LEASH_HITCH),
ARMOR_STAND(78, EntityType.ARMOR_STAND),
EVOCATION_FANGS(79, EntityType.EVOCATION_FANGS),
FISHIHNG_HOOK(90, EntityType.FISHING_HOOK),
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL);
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
private final int id;
private final EntityType type;
static {
for (ObjectType type : ObjectType.values()) {
TYPES.put(type.id, type);
}
}
ObjectType(int id, EntityType type) {
this.id = id;
this.type = type;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getType() {
return type;
}
public static Optional<ObjectType> findById(int id) {
if (id == -1)
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
public static Optional<EntityType> getPCEntity(int id) {
Optional<ObjectType> output = findById(id);
if (!output.isPresent())
return Optional.empty();
return Optional.of(output.get().type);
}
}
}
@@ -0,0 +1,332 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.api.Via;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
public class Entity1_13Types {
public static EntityType getTypeFromId(int typeID, boolean isObject) {
Optional<EntityType> type;
if (isObject)
type = ObjectType.getPCEntity(typeID);
else
type = EntityType.findById(typeID);
if (!type.isPresent()) {
Via.getPlatform().getLogger().severe("Could not find 1.13 type id " + typeID + " isObject=" + isObject);
return EntityType.ENTITY; // Fall back to the basic ENTITY
}
return type.get();
}
public enum EntityType implements com.viaversion.viaversion.api.minecraft.entities.EntityType {
// Auto generated
ENTITY(-1), // abm
AREA_EFFECT_CLOUD(0, ENTITY), // abk
END_CRYSTAL(16, ENTITY), // aho
EVOKER_FANGS(20, ENTITY), // ala
EXPERIENCE_ORB(22, ENTITY), // abs
EYE_OF_ENDER(23, ENTITY), // alb
FALLING_BLOCK(24, ENTITY), // aix
FIREWORK_ROCKET(25, ENTITY), // alc
ITEM(32, ENTITY), // aiy
LLAMA_SPIT(37, ENTITY), // ale
TNT(55, ENTITY), // aiz
SHULKER_BULLET(60, ENTITY), // alh
FISHING_BOBBER(93, ENTITY), // ais
LIVINGENTITY(-1, ENTITY), // abv
ARMOR_STAND(1, LIVINGENTITY), // ail
PLAYER(92, LIVINGENTITY), // aks
ABSTRACT_INSENTIENT(-1, LIVINGENTITY), // abw
ENDER_DRAGON(17, ABSTRACT_INSENTIENT), // ahp
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT), // acd
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE), // abj
VILLAGER(79, ABSTRACT_AGEABLE), // akn
// Animals
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE), // agd
CHICKEN(7, ABSTRACT_ANIMAL), // age
COW(9, ABSTRACT_ANIMAL), // agg
MOOSHROOM(47, COW), // agi
PIG(51, ABSTRACT_ANIMAL), // agl
POLAR_BEAR(54, ABSTRACT_ANIMAL), // agm
RABBIT(56, ABSTRACT_ANIMAL), // ago
SHEEP(58, ABSTRACT_ANIMAL), // agq
TURTLE(73, ABSTRACT_ANIMAL), // agv
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL), // acg
OCELOT(48, ABSTRACT_TAMEABLE_ANIMAL), // agj
WOLF(86, ABSTRACT_TAMEABLE_ANIMAL), // agy
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL), // agr
PARROT(50, ABSTRACT_PARROT), // agk
// Horses
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL), // aha
CHESTED_HORSE(-1, ABSTRACT_HORSE), // agz
DONKEY(11, CHESTED_HORSE), // ahb
MULE(46, CHESTED_HORSE), // ahf
LLAMA(36, CHESTED_HORSE), // ahe
HORSE(29, ABSTRACT_HORSE), // ahc
SKELETON_HORSE(63, ABSTRACT_HORSE), // ahg
ZOMBIE_HORSE(88, ABSTRACT_HORSE), // ahi
// Golem
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE), // agc
SNOW_GOLEM(66, ABSTRACT_GOLEM), // ags
IRON_GOLEM(80, ABSTRACT_GOLEM), // agw
SHULKER(59, ABSTRACT_GOLEM), // ajx
// Fish
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE), // agb
COD(8, ABSTRACT_FISHES), // agf
PUFFERFISH(52, ABSTRACT_FISHES), // agn
SALMON(57, ABSTRACT_FISHES), // agp
TROPICAL_FISH(72, ABSTRACT_FISHES), // agu
// Monsters
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE), // ajs
BLAZE(4, ABSTRACT_MONSTER), // ajd
CREEPER(10, ABSTRACT_MONSTER), // ajf
ENDERMITE(19, ABSTRACT_MONSTER), // ajj
ENDERMAN(18, ABSTRACT_MONSTER), // aji
GIANT(27, ABSTRACT_MONSTER), // ajn
SILVERFISH(61, ABSTRACT_MONSTER), // ajy
VEX(78, ABSTRACT_MONSTER), // ake
WITCH(82, ABSTRACT_MONSTER), // akg
WITHER(83, ABSTRACT_MONSTER), // aij
// Illagers
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER), // ajb
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE), // akb
EVOKER(21, ABSTRACT_EVO_ILLU_ILLAGER), // ajl
ILLUSIONER(31, ABSTRACT_EVO_ILLU_ILLAGER), // ajq
VINDICATOR(81, ABSTRACT_ILLAGER_BASE), // akf
// Skeletons
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER), // ajc
SKELETON(62, ABSTRACT_SKELETON), // ajz
STRAY(71, ABSTRACT_SKELETON), // akd
WITHER_SKELETON(84, ABSTRACT_SKELETON), // akh
// Guardians
GUARDIAN(28, ABSTRACT_MONSTER), // ajo
ELDER_GUARDIAN(15, GUARDIAN), // ajh
// Spiders
SPIDER(69, ABSTRACT_MONSTER), // akc
CAVE_SPIDER(6, SPIDER), // aje
// Zombies - META CHECKED
ZOMBIE(87, ABSTRACT_MONSTER), // aki
DROWNED(14, ZOMBIE), // ajg
HUSK(30, ZOMBIE), // ajp
ZOMBIE_PIGMAN(53, ZOMBIE), // aju
ZOMBIE_VILLAGER(89, ZOMBIE), // akj
// Flying entities
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT), // abt
GHAST(26, ABSTRACT_FLYING), // ajm
PHANTOM(90, ABSTRACT_FLYING), // ajt
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT), // afy
BAT(3, ABSTRACT_AMBIENT), // afz
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT), // agx
SQUID(70, ABSTRACT_WATERMOB), // agt
DOLPHIN(12, ABSTRACT_WATERMOB),
// Slimes
SLIME(64, ABSTRACT_INSENTIENT), // aka
MAGMA_CUBE(38, SLIME), // ajr
// Hangable objects
ABSTRACT_HANGING(-1, ENTITY), // aim
LEASH_KNOT(35, ABSTRACT_HANGING), // aio
ITEM_FRAME(33, ABSTRACT_HANGING), // ain
PAINTING(49, ABSTRACT_HANGING), // aiq
ABSTRACT_LIGHTNING(-1, ENTITY), // aiu
LIGHTNING_BOLT(91, ABSTRACT_LIGHTNING), // aiv
// Arrows
ABSTRACT_ARROW(-1, ENTITY), // akw
ARROW(2, ABSTRACT_ARROW), // aky
SPECTRAL_ARROW(68, ABSTRACT_ARROW), // alk
TRIDENT(94, ABSTRACT_ARROW), // alq
// Fireballs
ABSTRACT_FIREBALL(-1, ENTITY), // akx
DRAGON_FIREBALL(13, ABSTRACT_FIREBALL), // akz
FIREBALL(34, ABSTRACT_FIREBALL), // ald
SMALL_FIREBALL(65, ABSTRACT_FIREBALL), // ali
WITHER_SKULL(85, ABSTRACT_FIREBALL), // alr
// Projectiles
PROJECTILE_ABSTRACT(-1, ENTITY), // all
SNOWBALL(67, PROJECTILE_ABSTRACT), // alj
ENDER_PEARL(75, PROJECTILE_ABSTRACT), // aln
EGG(74, PROJECTILE_ABSTRACT), // alm
POTION(77, PROJECTILE_ABSTRACT), // alp
EXPERIENCE_BOTTLE(76, PROJECTILE_ABSTRACT), // alo
// Vehicles
MINECART_ABSTRACT(-1, ENTITY), // alt
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT), // alu
CHEST_MINECART(40, CHESTED_MINECART_ABSTRACT), // alx
HOPPER_MINECART(43, CHESTED_MINECART_ABSTRACT), // ama
MINECART(39, MINECART_ABSTRACT), // alw
FURNACE_MINECART(42, MINECART_ABSTRACT), // alz
COMMAND_BLOCK_MINECART(41, MINECART_ABSTRACT), // aly
TNT_MINECART(45, MINECART_ABSTRACT), // amc
SPAWNER_MINECART(44, MINECART_ABSTRACT), // amb
BOAT(5, ENTITY); // alv
private static final Map<Integer, EntityType> TYPES = new HashMap<>();
private final int id;
private final EntityType parent;
EntityType(int id) {
this.id = id;
this.parent = null;
}
EntityType(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
for (EntityType type : EntityType.values()) {
TYPES.put(type.id, type);
}
}
public static Optional<EntityType> findById(int id) {
if (id == -1) // Check if this is called
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
}
public enum ObjectType implements com.viaversion.viaversion.api.minecraft.entities.ObjectType {
BOAT(1, EntityType.BOAT),
ITEM(2, EntityType.ITEM),
AREA_EFFECT_CLOUD(3, EntityType.AREA_EFFECT_CLOUD),
MINECART(10, EntityType.MINECART),
TNT_PRIMED(50, EntityType.TNT),
ENDER_CRYSTAL(51, EntityType.END_CRYSTAL),
TIPPED_ARROW(60, EntityType.ARROW),
SNOWBALL(61, EntityType.SNOWBALL),
EGG(62, EntityType.EGG),
FIREBALL(63, EntityType.FIREBALL),
SMALL_FIREBALL(64, EntityType.SMALL_FIREBALL),
ENDER_PEARL(65, EntityType.ENDER_PEARL),
WITHER_SKULL(66, EntityType.WITHER_SKULL),
SHULKER_BULLET(67, EntityType.SHULKER_BULLET),
LLAMA_SPIT(68, EntityType.LLAMA_SPIT),
FALLING_BLOCK(70, EntityType.FALLING_BLOCK),
ITEM_FRAME(71, EntityType.ITEM_FRAME),
EYE_OF_ENDER(72, EntityType.EYE_OF_ENDER),
POTION(73, EntityType.POTION),
EXPERIENCE_BOTTLE(75, EntityType.EXPERIENCE_BOTTLE),
FIREWORK_ROCKET(76, EntityType.FIREWORK_ROCKET),
LEASH(77, EntityType.LEASH_KNOT),
ARMOR_STAND(78, EntityType.ARMOR_STAND),
EVOKER_FANGS(79, EntityType.EVOKER_FANGS),
FISHIHNG_HOOK(90, EntityType.FISHING_BOBBER),
SPECTRAL_ARROW(91, EntityType.SPECTRAL_ARROW),
DRAGON_FIREBALL(93, EntityType.DRAGON_FIREBALL),
TRIDENT(94, EntityType.TRIDENT);
private static final Map<Integer, ObjectType> TYPES = new HashMap<>();
private final int id;
private final EntityType type;
static {
for (ObjectType type : ObjectType.values()) {
TYPES.put(type.id, type);
}
}
ObjectType(int id, EntityType type) {
this.id = id;
this.type = type;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getType() {
return type;
}
public static Optional<ObjectType> findById(int id) {
if (id == -1)
return Optional.empty();
return Optional.ofNullable(TYPES.get(id));
}
public static Optional<EntityType> getPCEntity(int id) {
Optional<ObjectType> output = findById(id);
if (!output.isPresent())
return Optional.empty();
return Optional.of(output.get().type);
}
public static Optional<ObjectType> fromEntityType(EntityType type) {
for (ObjectType ent : ObjectType.values())
if (ent.type == type)
return Optional.of(ent);
return Optional.empty();
}
}
}
@@ -0,0 +1,234 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_14Types implements EntityType {
ENTITY(-1),
AREA_EFFECT_CLOUD(0, ENTITY),
END_CRYSTAL(17, ENTITY),
EVOKER_FANGS(21, ENTITY),
EXPERIENCE_ORB(23, ENTITY),
EYE_OF_ENDER(24, ENTITY),
FALLING_BLOCK(25, ENTITY),
FIREWORK_ROCKET(26, ENTITY),
ITEM(34, ENTITY),
LLAMA_SPIT(39, ENTITY),
TNT(58, ENTITY),
SHULKER_BULLET(63, ENTITY),
FISHING_BOBBER(101, ENTITY),
LIVINGENTITY(-1, ENTITY),
ARMOR_STAND(1, LIVINGENTITY),
PLAYER(100, LIVINGENTITY),
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
ENDER_DRAGON(18, ABSTRACT_INSENTIENT),
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
VILLAGER(84, ABSTRACT_AGEABLE),
WANDERING_TRADER(88, ABSTRACT_AGEABLE),
// Animals
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
DOLPHIN(13, ABSTRACT_INSENTIENT),
CHICKEN(8, ABSTRACT_ANIMAL),
COW(10, ABSTRACT_ANIMAL),
MOOSHROOM(49, COW),
PANDA(52, ABSTRACT_INSENTIENT),
PIG(54, ABSTRACT_ANIMAL),
POLAR_BEAR(57, ABSTRACT_ANIMAL),
RABBIT(59, ABSTRACT_ANIMAL),
SHEEP(61, ABSTRACT_ANIMAL),
TURTLE(77, ABSTRACT_ANIMAL),
FOX(27, ABSTRACT_ANIMAL),
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
CAT(6, ABSTRACT_TAMEABLE_ANIMAL),
OCELOT(50, ABSTRACT_TAMEABLE_ANIMAL),
WOLF(93, ABSTRACT_TAMEABLE_ANIMAL),
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
PARROT(53, ABSTRACT_PARROT),
// Horses
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(12, CHESTED_HORSE),
MULE(48, CHESTED_HORSE),
LLAMA(38, CHESTED_HORSE),
TRADER_LLAMA(75, CHESTED_HORSE),
HORSE(31, ABSTRACT_HORSE),
SKELETON_HORSE(66, ABSTRACT_HORSE),
ZOMBIE_HORSE(95, ABSTRACT_HORSE),
// Golem
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
SNOW_GOLEM(69, ABSTRACT_GOLEM),
IRON_GOLEM(85, ABSTRACT_GOLEM),
SHULKER(62, ABSTRACT_GOLEM),
// Fish
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
COD(9, ABSTRACT_FISHES),
PUFFERFISH(55, ABSTRACT_FISHES),
SALMON(60, ABSTRACT_FISHES),
TROPICAL_FISH(76, ABSTRACT_FISHES),
// Monsters
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
BLAZE(4, ABSTRACT_MONSTER),
CREEPER(11, ABSTRACT_MONSTER),
ENDERMITE(20, ABSTRACT_MONSTER),
ENDERMAN(19, ABSTRACT_MONSTER),
GIANT(29, ABSTRACT_MONSTER),
SILVERFISH(64, ABSTRACT_MONSTER),
VEX(83, ABSTRACT_MONSTER),
WITCH(89, ABSTRACT_MONSTER),
WITHER(90, ABSTRACT_MONSTER),
RAVAGER(98, ABSTRACT_MONSTER),
// Illagers
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
EVOKER(22, ABSTRACT_EVO_ILLU_ILLAGER),
ILLUSIONER(33, ABSTRACT_EVO_ILLU_ILLAGER),
VINDICATOR(86, ABSTRACT_ILLAGER_BASE),
PILLAGER(87, ABSTRACT_ILLAGER_BASE),
// Skeletons
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
SKELETON(65, ABSTRACT_SKELETON),
STRAY(74, ABSTRACT_SKELETON),
WITHER_SKELETON(91, ABSTRACT_SKELETON),
// Guardians
GUARDIAN(30, ABSTRACT_MONSTER),
ELDER_GUARDIAN(16, GUARDIAN),
// Spiders
SPIDER(72, ABSTRACT_MONSTER),
CAVE_SPIDER(7, SPIDER),
// Zombies - META CHECKED
ZOMBIE(94, ABSTRACT_MONSTER),
DROWNED(15, ZOMBIE),
HUSK(32, ZOMBIE),
ZOMBIE_PIGMAN(56, ZOMBIE),
ZOMBIE_VILLAGER(96, ZOMBIE),
// Flying entities
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
GHAST(28, ABSTRACT_FLYING),
PHANTOM(97, ABSTRACT_FLYING),
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
BAT(3, ABSTRACT_AMBIENT),
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
SQUID(73, ABSTRACT_WATERMOB),
// Slimes
SLIME(67, ABSTRACT_INSENTIENT),
MAGMA_CUBE(40, SLIME),
// Hangable objects
ABSTRACT_HANGING(-1, ENTITY),
LEASH_KNOT(37, ABSTRACT_HANGING),
ITEM_FRAME(35, ABSTRACT_HANGING),
PAINTING(51, ABSTRACT_HANGING),
ABSTRACT_LIGHTNING(-1, ENTITY),
LIGHTNING_BOLT(99, ABSTRACT_LIGHTNING),
// Arrows
ABSTRACT_ARROW(-1, ENTITY),
ARROW(2, ABSTRACT_ARROW),
SPECTRAL_ARROW(71, ABSTRACT_ARROW),
TRIDENT(82, ABSTRACT_ARROW),
// Fireballs
ABSTRACT_FIREBALL(-1, ENTITY),
DRAGON_FIREBALL(14, ABSTRACT_FIREBALL),
FIREBALL(36, ABSTRACT_FIREBALL),
SMALL_FIREBALL(68, ABSTRACT_FIREBALL),
WITHER_SKULL(92, ABSTRACT_FIREBALL),
// Projectiles
PROJECTILE_ABSTRACT(-1, ENTITY),
SNOWBALL(70, PROJECTILE_ABSTRACT),
ENDER_PEARL(79, PROJECTILE_ABSTRACT),
EGG(78, PROJECTILE_ABSTRACT),
POTION(81, PROJECTILE_ABSTRACT),
EXPERIENCE_BOTTLE(80, PROJECTILE_ABSTRACT),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
CHEST_MINECART(42, CHESTED_MINECART_ABSTRACT),
HOPPER_MINECART(45, CHESTED_MINECART_ABSTRACT),
MINECART(41, MINECART_ABSTRACT),
FURNACE_MINECART(44, MINECART_ABSTRACT),
COMMAND_BLOCK_MINECART(43, MINECART_ABSTRACT),
TNT_MINECART(47, MINECART_ABSTRACT),
SPAWNER_MINECART(46, MINECART_ABSTRACT),
BOAT(5, ENTITY);
private static final EntityType[] TYPES;
private final int id;
private final EntityType parent;
Entity1_14Types(int id) {
this.id = id;
this.parent = null;
}
Entity1_14Types(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
TYPES = EntityTypeUtil.toOrderedArray(values());
}
public static EntityType getTypeFromId(int typeId) {
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
}
}
@@ -0,0 +1,236 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_15Types implements EntityType {
ENTITY(-1),
AREA_EFFECT_CLOUD(0, ENTITY),
END_CRYSTAL(18, ENTITY),
EVOKER_FANGS(22, ENTITY),
EXPERIENCE_ORB(24, ENTITY),
EYE_OF_ENDER(25, ENTITY),
FALLING_BLOCK(26, ENTITY),
FIREWORK_ROCKET(27, ENTITY),
ITEM(35, ENTITY),
LLAMA_SPIT(40, ENTITY),
TNT(59, ENTITY),
SHULKER_BULLET(64, ENTITY),
FISHING_BOBBER(102, ENTITY),
LIVINGENTITY(-1, ENTITY),
ARMOR_STAND(1, LIVINGENTITY),
PLAYER(101, LIVINGENTITY),
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
ENDER_DRAGON(19, ABSTRACT_INSENTIENT),
BEE(4, ABSTRACT_INSENTIENT),
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
VILLAGER(85, ABSTRACT_AGEABLE),
WANDERING_TRADER(89, ABSTRACT_AGEABLE),
// Animals
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
DOLPHIN(14, ABSTRACT_INSENTIENT),
CHICKEN(9, ABSTRACT_ANIMAL),
COW(11, ABSTRACT_ANIMAL),
MOOSHROOM(50, COW),
PANDA(53, ABSTRACT_INSENTIENT),
PIG(55, ABSTRACT_ANIMAL),
POLAR_BEAR(58, ABSTRACT_ANIMAL),
RABBIT(60, ABSTRACT_ANIMAL),
SHEEP(62, ABSTRACT_ANIMAL),
TURTLE(78, ABSTRACT_ANIMAL),
FOX(28, ABSTRACT_ANIMAL),
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
CAT(7, ABSTRACT_TAMEABLE_ANIMAL),
OCELOT(51, ABSTRACT_TAMEABLE_ANIMAL),
WOLF(94, ABSTRACT_TAMEABLE_ANIMAL),
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
PARROT(54, ABSTRACT_PARROT),
// Horses
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(13, CHESTED_HORSE),
MULE(49, CHESTED_HORSE),
LLAMA(39, CHESTED_HORSE),
TRADER_LLAMA(76, CHESTED_HORSE),
HORSE(32, ABSTRACT_HORSE),
SKELETON_HORSE(67, ABSTRACT_HORSE),
ZOMBIE_HORSE(96, ABSTRACT_HORSE),
// Golem
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
SNOW_GOLEM(70, ABSTRACT_GOLEM),
IRON_GOLEM(86, ABSTRACT_GOLEM),
SHULKER(63, ABSTRACT_GOLEM),
// Fish
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
COD(10, ABSTRACT_FISHES),
PUFFERFISH(56, ABSTRACT_FISHES),
SALMON(61, ABSTRACT_FISHES),
TROPICAL_FISH(77, ABSTRACT_FISHES),
// Monsters
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
BLAZE(5, ABSTRACT_MONSTER),
CREEPER(12, ABSTRACT_MONSTER),
ENDERMITE(21, ABSTRACT_MONSTER),
ENDERMAN(20, ABSTRACT_MONSTER),
GIANT(30, ABSTRACT_MONSTER),
SILVERFISH(65, ABSTRACT_MONSTER),
VEX(84, ABSTRACT_MONSTER),
WITCH(90, ABSTRACT_MONSTER),
WITHER(91, ABSTRACT_MONSTER),
RAVAGER(99, ABSTRACT_MONSTER),
// Illagers
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
EVOKER(23, ABSTRACT_EVO_ILLU_ILLAGER),
ILLUSIONER(34, ABSTRACT_EVO_ILLU_ILLAGER),
VINDICATOR(87, ABSTRACT_ILLAGER_BASE),
PILLAGER(88, ABSTRACT_ILLAGER_BASE),
// Skeletons
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
SKELETON(66, ABSTRACT_SKELETON),
STRAY(75, ABSTRACT_SKELETON),
WITHER_SKELETON(92, ABSTRACT_SKELETON),
// Guardians
GUARDIAN(31, ABSTRACT_MONSTER),
ELDER_GUARDIAN(17, GUARDIAN),
// Spiders
SPIDER(73, ABSTRACT_MONSTER),
CAVE_SPIDER(8, SPIDER),
// Zombies
ZOMBIE(95, ABSTRACT_MONSTER),
DROWNED(16, ZOMBIE),
HUSK(33, ZOMBIE),
ZOMBIE_PIGMAN(57, ZOMBIE),
ZOMBIE_VILLAGER(97, ZOMBIE),
// Flying entities
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
GHAST(29, ABSTRACT_FLYING),
PHANTOM(98, ABSTRACT_FLYING),
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
BAT(3, ABSTRACT_AMBIENT),
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
SQUID(74, ABSTRACT_WATERMOB),
// Slimes
SLIME(68, ABSTRACT_INSENTIENT),
MAGMA_CUBE(41, SLIME),
// Hangable objects
ABSTRACT_HANGING(-1, ENTITY),
LEASH_KNOT(38, ABSTRACT_HANGING),
ITEM_FRAME(36, ABSTRACT_HANGING),
PAINTING(52, ABSTRACT_HANGING),
ABSTRACT_LIGHTNING(-1, ENTITY),
LIGHTNING_BOLT(100, ABSTRACT_LIGHTNING),
// Arrows
ABSTRACT_ARROW(-1, ENTITY),
ARROW(2, ABSTRACT_ARROW),
SPECTRAL_ARROW(72, ABSTRACT_ARROW),
TRIDENT(83, ABSTRACT_ARROW),
// Fireballs
ABSTRACT_FIREBALL(-1, ENTITY),
DRAGON_FIREBALL(15, ABSTRACT_FIREBALL),
FIREBALL(37, ABSTRACT_FIREBALL),
SMALL_FIREBALL(69, ABSTRACT_FIREBALL),
WITHER_SKULL(93, ABSTRACT_FIREBALL),
// Projectiles
PROJECTILE_ABSTRACT(-1, ENTITY),
SNOWBALL(71, PROJECTILE_ABSTRACT),
ENDER_PEARL(80, PROJECTILE_ABSTRACT),
EGG(79, PROJECTILE_ABSTRACT),
POTION(82, PROJECTILE_ABSTRACT),
EXPERIENCE_BOTTLE(81, PROJECTILE_ABSTRACT),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
CHEST_MINECART(43, CHESTED_MINECART_ABSTRACT),
HOPPER_MINECART(46, CHESTED_MINECART_ABSTRACT),
MINECART(42, MINECART_ABSTRACT),
FURNACE_MINECART(45, MINECART_ABSTRACT),
COMMAND_BLOCK_MINECART(44, MINECART_ABSTRACT),
TNT_MINECART(48, MINECART_ABSTRACT),
SPAWNER_MINECART(47, MINECART_ABSTRACT),
BOAT(6, ENTITY);
private static final EntityType[] TYPES;
private final int id;
private final EntityType parent;
Entity1_15Types(int id) {
this.id = id;
this.parent = null;
}
Entity1_15Types(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
TYPES = EntityTypeUtil.toOrderedArray(values());
}
public static EntityType getTypeFromId(int typeId) {
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
}
}
@@ -0,0 +1,241 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_16Types implements EntityType {
ENTITY(-1),
AREA_EFFECT_CLOUD(0, ENTITY),
END_CRYSTAL(18, ENTITY),
EVOKER_FANGS(23, ENTITY),
EXPERIENCE_ORB(24, ENTITY),
EYE_OF_ENDER(25, ENTITY),
FALLING_BLOCK(26, ENTITY),
FIREWORK_ROCKET(27, ENTITY),
ITEM(37, ENTITY),
LLAMA_SPIT(43, ENTITY),
TNT(63, ENTITY),
SHULKER_BULLET(70, ENTITY),
FISHING_BOBBER(106, ENTITY),
LIVINGENTITY(-1, ENTITY),
ARMOR_STAND(1, LIVINGENTITY),
PLAYER(105, LIVINGENTITY),
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
ENDER_DRAGON(19, ABSTRACT_INSENTIENT),
BEE(4, ABSTRACT_INSENTIENT),
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
VILLAGER(92, ABSTRACT_AGEABLE),
WANDERING_TRADER(94, ABSTRACT_AGEABLE),
// Animals
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
DOLPHIN(13, ABSTRACT_INSENTIENT),
CHICKEN(9, ABSTRACT_ANIMAL),
COW(11, ABSTRACT_ANIMAL),
MOOSHROOM(53, COW),
PANDA(56, ABSTRACT_INSENTIENT),
PIG(59, ABSTRACT_ANIMAL),
POLAR_BEAR(62, ABSTRACT_ANIMAL),
RABBIT(65, ABSTRACT_ANIMAL),
SHEEP(68, ABSTRACT_ANIMAL),
TURTLE(90, ABSTRACT_ANIMAL),
FOX(28, ABSTRACT_ANIMAL),
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
CAT(7, ABSTRACT_TAMEABLE_ANIMAL),
OCELOT(54, ABSTRACT_TAMEABLE_ANIMAL),
WOLF(99, ABSTRACT_TAMEABLE_ANIMAL),
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
PARROT(57, ABSTRACT_PARROT),
// Horses
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(14, CHESTED_HORSE),
MULE(52, CHESTED_HORSE),
LLAMA(42, CHESTED_HORSE),
TRADER_LLAMA(88, CHESTED_HORSE),
HORSE(33, ABSTRACT_HORSE),
SKELETON_HORSE(73, ABSTRACT_HORSE),
ZOMBIE_HORSE(102, ABSTRACT_HORSE),
// Golem
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
SNOW_GOLEM(76, ABSTRACT_GOLEM),
IRON_GOLEM(36, ABSTRACT_GOLEM),
SHULKER(69, ABSTRACT_GOLEM),
// Fish
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
COD(10, ABSTRACT_FISHES),
PUFFERFISH(64, ABSTRACT_FISHES),
SALMON(67, ABSTRACT_FISHES),
TROPICAL_FISH(89, ABSTRACT_FISHES),
// Monsters
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
BLAZE(5, ABSTRACT_MONSTER),
CREEPER(12, ABSTRACT_MONSTER),
ENDERMITE(21, ABSTRACT_MONSTER),
ENDERMAN(20, ABSTRACT_MONSTER),
GIANT(30, ABSTRACT_MONSTER),
SILVERFISH(71, ABSTRACT_MONSTER),
VEX(91, ABSTRACT_MONSTER),
WITCH(95, ABSTRACT_MONSTER),
WITHER(96, ABSTRACT_MONSTER),
RAVAGER(66, ABSTRACT_MONSTER),
PIGLIN(60, ABSTRACT_MONSTER),
HOGLIN(32, ABSTRACT_ANIMAL),
STRIDER(82, ABSTRACT_ANIMAL),
ZOGLIN(100, ABSTRACT_MONSTER),
// Illagers
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
EVOKER(22, ABSTRACT_EVO_ILLU_ILLAGER),
ILLUSIONER(35, ABSTRACT_EVO_ILLU_ILLAGER),
VINDICATOR(93, ABSTRACT_ILLAGER_BASE),
PILLAGER(61, ABSTRACT_ILLAGER_BASE),
// Skeletons
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
SKELETON(72, ABSTRACT_SKELETON),
STRAY(81, ABSTRACT_SKELETON),
WITHER_SKELETON(97, ABSTRACT_SKELETON),
// Guardians
GUARDIAN(31, ABSTRACT_MONSTER),
ELDER_GUARDIAN(17, GUARDIAN),
// Spiders
SPIDER(79, ABSTRACT_MONSTER),
CAVE_SPIDER(8, SPIDER),
// Zombies
ZOMBIE(101, ABSTRACT_MONSTER),
DROWNED(16, ZOMBIE),
HUSK(34, ZOMBIE),
ZOMBIFIED_PIGLIN(104, ZOMBIE),
ZOMBIE_VILLAGER(103, ZOMBIE),
// Flying entities
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
GHAST(29, ABSTRACT_FLYING),
PHANTOM(58, ABSTRACT_FLYING),
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
BAT(3, ABSTRACT_AMBIENT),
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
SQUID(80, ABSTRACT_WATERMOB),
// Slimes
SLIME(74, ABSTRACT_INSENTIENT),
MAGMA_CUBE(44, SLIME),
// Hangable objects
ABSTRACT_HANGING(-1, ENTITY),
LEASH_KNOT(40, ABSTRACT_HANGING),
ITEM_FRAME(38, ABSTRACT_HANGING),
PAINTING(55, ABSTRACT_HANGING),
ABSTRACT_LIGHTNING(-1, ENTITY),
LIGHTNING_BOLT(41, ABSTRACT_LIGHTNING),
// Arrows
ABSTRACT_ARROW(-1, ENTITY),
ARROW(2, ABSTRACT_ARROW),
SPECTRAL_ARROW(78, ABSTRACT_ARROW),
TRIDENT(87, ABSTRACT_ARROW),
// Fireballs
ABSTRACT_FIREBALL(-1, ENTITY),
DRAGON_FIREBALL(15, ABSTRACT_FIREBALL),
FIREBALL(39, ABSTRACT_FIREBALL),
SMALL_FIREBALL(75, ABSTRACT_FIREBALL),
WITHER_SKULL(98, ABSTRACT_FIREBALL),
// Projectiles
PROJECTILE_ABSTRACT(-1, ENTITY),
SNOWBALL(77, PROJECTILE_ABSTRACT),
ENDER_PEARL(84, PROJECTILE_ABSTRACT),
EGG(83, PROJECTILE_ABSTRACT),
POTION(86, PROJECTILE_ABSTRACT),
EXPERIENCE_BOTTLE(85, PROJECTILE_ABSTRACT),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
CHEST_MINECART(46, CHESTED_MINECART_ABSTRACT),
HOPPER_MINECART(49, CHESTED_MINECART_ABSTRACT),
MINECART(45, MINECART_ABSTRACT),
FURNACE_MINECART(48, MINECART_ABSTRACT),
COMMAND_BLOCK_MINECART(47, MINECART_ABSTRACT),
TNT_MINECART(51, MINECART_ABSTRACT),
SPAWNER_MINECART(50, MINECART_ABSTRACT),
BOAT(6, ENTITY);
private static final EntityType[] TYPES;
private final int id;
private final EntityType parent;
Entity1_16Types(int id) {
this.id = id;
this.parent = null;
}
Entity1_16Types(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
TYPES = EntityTypeUtil.toOrderedArray(values());
}
public static EntityType getTypeFromId(int typeId) {
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
}
}
@@ -0,0 +1,245 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_16_2Types implements EntityType {
ENTITY(-1),
AREA_EFFECT_CLOUD(0, ENTITY),
END_CRYSTAL(18, ENTITY),
EVOKER_FANGS(23, ENTITY),
EXPERIENCE_ORB(24, ENTITY),
EYE_OF_ENDER(25, ENTITY),
FALLING_BLOCK(26, ENTITY),
FIREWORK_ROCKET(27, ENTITY),
ITEM(37, ENTITY),
LLAMA_SPIT(43, ENTITY),
TNT(64, ENTITY),
SHULKER_BULLET(71, ENTITY),
FISHING_BOBBER(107, ENTITY),
LIVINGENTITY(-1, ENTITY),
ARMOR_STAND(1, LIVINGENTITY),
PLAYER(106, LIVINGENTITY),
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
ENDER_DRAGON(19, ABSTRACT_INSENTIENT),
BEE(4, ABSTRACT_INSENTIENT),
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
VILLAGER(93, ABSTRACT_AGEABLE),
WANDERING_TRADER(95, ABSTRACT_AGEABLE),
// Animals
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
DOLPHIN(13, ABSTRACT_INSENTIENT),
CHICKEN(9, ABSTRACT_ANIMAL),
COW(11, ABSTRACT_ANIMAL),
MOOSHROOM(53, COW),
PANDA(56, ABSTRACT_INSENTIENT),
PIG(59, ABSTRACT_ANIMAL),
POLAR_BEAR(63, ABSTRACT_ANIMAL),
RABBIT(66, ABSTRACT_ANIMAL),
SHEEP(69, ABSTRACT_ANIMAL),
TURTLE(91, ABSTRACT_ANIMAL),
FOX(28, ABSTRACT_ANIMAL),
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
CAT(7, ABSTRACT_TAMEABLE_ANIMAL),
OCELOT(54, ABSTRACT_TAMEABLE_ANIMAL),
WOLF(100, ABSTRACT_TAMEABLE_ANIMAL),
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
PARROT(57, ABSTRACT_PARROT),
// Horses
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(14, CHESTED_HORSE),
MULE(52, CHESTED_HORSE),
LLAMA(42, CHESTED_HORSE),
TRADER_LLAMA(89, CHESTED_HORSE),
HORSE(33, ABSTRACT_HORSE),
SKELETON_HORSE(74, ABSTRACT_HORSE),
ZOMBIE_HORSE(103, ABSTRACT_HORSE),
// Golem
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
SNOW_GOLEM(77, ABSTRACT_GOLEM),
IRON_GOLEM(36, ABSTRACT_GOLEM),
SHULKER(70, ABSTRACT_GOLEM),
// Fish
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
COD(10, ABSTRACT_FISHES),
PUFFERFISH(65, ABSTRACT_FISHES),
SALMON(68, ABSTRACT_FISHES),
TROPICAL_FISH(90, ABSTRACT_FISHES),
// Monsters
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
BLAZE(5, ABSTRACT_MONSTER),
CREEPER(12, ABSTRACT_MONSTER),
ENDERMITE(21, ABSTRACT_MONSTER),
ENDERMAN(20, ABSTRACT_MONSTER),
GIANT(30, ABSTRACT_MONSTER),
SILVERFISH(72, ABSTRACT_MONSTER),
VEX(92, ABSTRACT_MONSTER),
WITCH(96, ABSTRACT_MONSTER),
WITHER(97, ABSTRACT_MONSTER),
RAVAGER(67, ABSTRACT_MONSTER),
ABSTRACT_PIGLIN(-1, ABSTRACT_MONSTER),
PIGLIN(60, ABSTRACT_PIGLIN),
PIGLIN_BRUTE(61, ABSTRACT_PIGLIN),
HOGLIN(32, ABSTRACT_ANIMAL),
STRIDER(83, ABSTRACT_ANIMAL),
ZOGLIN(101, ABSTRACT_MONSTER),
// Illagers
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
EVOKER(22, ABSTRACT_EVO_ILLU_ILLAGER),
ILLUSIONER(35, ABSTRACT_EVO_ILLU_ILLAGER),
VINDICATOR(94, ABSTRACT_ILLAGER_BASE),
PILLAGER(62, ABSTRACT_ILLAGER_BASE),
// Skeletons
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
SKELETON(73, ABSTRACT_SKELETON),
STRAY(82, ABSTRACT_SKELETON),
WITHER_SKELETON(98, ABSTRACT_SKELETON),
// Guardians
GUARDIAN(31, ABSTRACT_MONSTER),
ELDER_GUARDIAN(17, GUARDIAN),
// Spiders
SPIDER(80, ABSTRACT_MONSTER),
CAVE_SPIDER(8, SPIDER),
// Zombies
ZOMBIE(102, ABSTRACT_MONSTER),
DROWNED(16, ZOMBIE),
HUSK(34, ZOMBIE),
ZOMBIFIED_PIGLIN(105, ZOMBIE),
ZOMBIE_VILLAGER(104, ZOMBIE),
// Flying entities
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
GHAST(29, ABSTRACT_FLYING),
PHANTOM(58, ABSTRACT_FLYING),
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
BAT(3, ABSTRACT_AMBIENT),
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
SQUID(81, ABSTRACT_WATERMOB),
// Slimes
SLIME(75, ABSTRACT_INSENTIENT),
MAGMA_CUBE(44, SLIME),
// Hangable objects
ABSTRACT_HANGING(-1, ENTITY),
LEASH_KNOT(40, ABSTRACT_HANGING),
ITEM_FRAME(38, ABSTRACT_HANGING),
PAINTING(55, ABSTRACT_HANGING),
ABSTRACT_LIGHTNING(-1, ENTITY),
LIGHTNING_BOLT(41, ABSTRACT_LIGHTNING),
// Arrows
ABSTRACT_ARROW(-1, ENTITY),
ARROW(2, ABSTRACT_ARROW),
SPECTRAL_ARROW(79, ABSTRACT_ARROW),
TRIDENT(88, ABSTRACT_ARROW),
// Fireballs
ABSTRACT_FIREBALL(-1, ENTITY),
DRAGON_FIREBALL(15, ABSTRACT_FIREBALL),
FIREBALL(39, ABSTRACT_FIREBALL),
SMALL_FIREBALL(76, ABSTRACT_FIREBALL),
WITHER_SKULL(99, ABSTRACT_FIREBALL),
// Projectiles
PROJECTILE_ABSTRACT(-1, ENTITY),
SNOWBALL(78, PROJECTILE_ABSTRACT),
ENDER_PEARL(85, PROJECTILE_ABSTRACT),
EGG(84, PROJECTILE_ABSTRACT),
POTION(87, PROJECTILE_ABSTRACT),
EXPERIENCE_BOTTLE(86, PROJECTILE_ABSTRACT),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
CHEST_MINECART(46, CHESTED_MINECART_ABSTRACT),
HOPPER_MINECART(49, CHESTED_MINECART_ABSTRACT),
MINECART(45, MINECART_ABSTRACT),
FURNACE_MINECART(48, MINECART_ABSTRACT),
COMMAND_BLOCK_MINECART(47, MINECART_ABSTRACT),
TNT_MINECART(51, MINECART_ABSTRACT),
SPAWNER_MINECART(50, MINECART_ABSTRACT),
BOAT(6, ENTITY);
private static final EntityType[] TYPES;
private final int id;
private final EntityType parent;
Entity1_16_2Types(int id) {
this.id = id;
this.parent = null;
}
Entity1_16_2Types(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
TYPES = EntityTypeUtil.toOrderedArray(values());
}
public static EntityType getTypeFromId(int typeId) {
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
}
}
@@ -0,0 +1,250 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import com.viaversion.viaversion.util.EntityTypeUtil;
public enum Entity1_17Types implements EntityType {
ENTITY(-1),
AREA_EFFECT_CLOUD(0, ENTITY),
END_CRYSTAL(19, ENTITY),
EVOKER_FANGS(24, ENTITY),
EXPERIENCE_ORB(25, ENTITY),
EYE_OF_ENDER(26, ENTITY),
FALLING_BLOCK(27, ENTITY),
FIREWORK_ROCKET(28, ENTITY),
ITEM(41, ENTITY),
LLAMA_SPIT(47, ENTITY),
TNT(69, ENTITY),
SHULKER_BULLET(76, ENTITY),
FISHING_BOBBER(112, ENTITY),
LIVINGENTITY(-1, ENTITY),
ARMOR_STAND(1, LIVINGENTITY),
MARKER(49, ENTITY),
PLAYER(111, LIVINGENTITY),
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
ENDER_DRAGON(20, ABSTRACT_INSENTIENT),
BEE(5, ABSTRACT_INSENTIENT),
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
VILLAGER(98, ABSTRACT_AGEABLE),
WANDERING_TRADER(100, ABSTRACT_AGEABLE),
// Animals
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
AXOLOTL(3, ABSTRACT_ANIMAL),
DOLPHIN(14, ABSTRACT_INSENTIENT),
CHICKEN(10, ABSTRACT_ANIMAL),
COW(12, ABSTRACT_ANIMAL),
MOOSHROOM(58, COW),
PANDA(61, ABSTRACT_INSENTIENT),
PIG(64, ABSTRACT_ANIMAL),
POLAR_BEAR(68, ABSTRACT_ANIMAL),
RABBIT(71, ABSTRACT_ANIMAL),
SHEEP(74, ABSTRACT_ANIMAL),
TURTLE(96, ABSTRACT_ANIMAL),
FOX(29, ABSTRACT_ANIMAL),
GOAT(34, ABSTRACT_ANIMAL),
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
CAT(8, ABSTRACT_TAMEABLE_ANIMAL),
OCELOT(59, ABSTRACT_TAMEABLE_ANIMAL),
WOLF(105, ABSTRACT_TAMEABLE_ANIMAL),
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
PARROT(62, ABSTRACT_PARROT),
// Horses
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(15, CHESTED_HORSE),
MULE(57, CHESTED_HORSE),
LLAMA(46, CHESTED_HORSE),
TRADER_LLAMA(94, CHESTED_HORSE),
HORSE(37, ABSTRACT_HORSE),
SKELETON_HORSE(79, ABSTRACT_HORSE),
ZOMBIE_HORSE(108, ABSTRACT_HORSE),
// Golem
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
SNOW_GOLEM(82, ABSTRACT_GOLEM),
IRON_GOLEM(40, ABSTRACT_GOLEM),
SHULKER(75, ABSTRACT_GOLEM),
// Fish
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
COD(11, ABSTRACT_FISHES),
PUFFERFISH(70, ABSTRACT_FISHES),
SALMON(73, ABSTRACT_FISHES),
TROPICAL_FISH(95, ABSTRACT_FISHES),
// Monsters
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
BLAZE(6, ABSTRACT_MONSTER),
CREEPER(13, ABSTRACT_MONSTER),
ENDERMITE(22, ABSTRACT_MONSTER),
ENDERMAN(21, ABSTRACT_MONSTER),
GIANT(31, ABSTRACT_MONSTER),
SILVERFISH(77, ABSTRACT_MONSTER),
VEX(97, ABSTRACT_MONSTER),
WITCH(101, ABSTRACT_MONSTER),
WITHER(102, ABSTRACT_MONSTER),
RAVAGER(72, ABSTRACT_MONSTER),
ABSTRACT_PIGLIN(-1, ABSTRACT_MONSTER),
PIGLIN(65, ABSTRACT_PIGLIN),
PIGLIN_BRUTE(66, ABSTRACT_PIGLIN),
HOGLIN(36, ABSTRACT_ANIMAL),
STRIDER(88, ABSTRACT_ANIMAL),
ZOGLIN(106, ABSTRACT_MONSTER),
// Illagers
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
EVOKER(23, ABSTRACT_EVO_ILLU_ILLAGER),
ILLUSIONER(39, ABSTRACT_EVO_ILLU_ILLAGER),
VINDICATOR(99, ABSTRACT_ILLAGER_BASE),
PILLAGER(67, ABSTRACT_ILLAGER_BASE),
// Skeletons
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
SKELETON(78, ABSTRACT_SKELETON),
STRAY(87, ABSTRACT_SKELETON),
WITHER_SKELETON(103, ABSTRACT_SKELETON),
// Guardians
GUARDIAN(35, ABSTRACT_MONSTER),
ELDER_GUARDIAN(18, GUARDIAN),
// Spiders
SPIDER(85, ABSTRACT_MONSTER),
CAVE_SPIDER(9, SPIDER),
// Zombies
ZOMBIE(107, ABSTRACT_MONSTER),
DROWNED(17, ZOMBIE),
HUSK(38, ZOMBIE),
ZOMBIFIED_PIGLIN(110, ZOMBIE),
ZOMBIE_VILLAGER(109, ZOMBIE),
// Flying entities
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
GHAST(30, ABSTRACT_FLYING),
PHANTOM(63, ABSTRACT_FLYING),
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
BAT(4, ABSTRACT_AMBIENT),
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
SQUID(86, ABSTRACT_WATERMOB),
GLOW_SQUID(33, SQUID),
// Slimes
SLIME(80, ABSTRACT_INSENTIENT),
MAGMA_CUBE(48, SLIME),
// Hangable objects
ABSTRACT_HANGING(-1, ENTITY),
LEASH_KNOT(44, ABSTRACT_HANGING),
ITEM_FRAME(42, ABSTRACT_HANGING),
GLOW_ITEM_FRAME(32, ITEM_FRAME),
PAINTING(60, ABSTRACT_HANGING),
ABSTRACT_LIGHTNING(-1, ENTITY),
LIGHTNING_BOLT(45, ABSTRACT_LIGHTNING),
// Arrows
ABSTRACT_ARROW(-1, ENTITY),
ARROW(2, ABSTRACT_ARROW),
SPECTRAL_ARROW(84, ABSTRACT_ARROW),
TRIDENT(93, ABSTRACT_ARROW),
// Fireballs
ABSTRACT_FIREBALL(-1, ENTITY),
DRAGON_FIREBALL(16, ABSTRACT_FIREBALL),
FIREBALL(43, ABSTRACT_FIREBALL),
SMALL_FIREBALL(81, ABSTRACT_FIREBALL),
WITHER_SKULL(104, ABSTRACT_FIREBALL),
// Projectiles
PROJECTILE_ABSTRACT(-1, ENTITY),
SNOWBALL(83, PROJECTILE_ABSTRACT),
ENDER_PEARL(90, PROJECTILE_ABSTRACT),
EGG(89, PROJECTILE_ABSTRACT),
POTION(92, PROJECTILE_ABSTRACT),
EXPERIENCE_BOTTLE(91, PROJECTILE_ABSTRACT),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
CHEST_MINECART(51, CHESTED_MINECART_ABSTRACT),
HOPPER_MINECART(54, CHESTED_MINECART_ABSTRACT),
MINECART(50, MINECART_ABSTRACT),
FURNACE_MINECART(53, MINECART_ABSTRACT),
COMMAND_BLOCK_MINECART(52, MINECART_ABSTRACT),
TNT_MINECART(56, MINECART_ABSTRACT),
SPAWNER_MINECART(55, MINECART_ABSTRACT),
BOAT(7, ENTITY);
private static final EntityType[] TYPES;
private final int id;
private final EntityType parent;
Entity1_17Types(int id) {
this.id = id;
this.parent = null;
}
Entity1_17Types(int id, EntityType parent) {
this.id = id;
this.parent = parent;
}
@Override
public int getId() {
return id;
}
@Override
public EntityType getParent() {
return parent;
}
static {
TYPES = EntityTypeUtil.toOrderedArray(values());
}
public static EntityType getTypeFromId(int typeId) {
return EntityTypeUtil.getTypeFromId(TYPES, typeId, ENTITY);
}
}
@@ -0,0 +1,82 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface EntityType {
/**
* Returns the entity id.
*
* @return entity id
*/
int getId();
/**
* Returns the parent entity type if present.
*
* @return parent entity type if present
*/
@Nullable EntityType getParent();
/**
* Returns the entity type name, not necessarily matching the Vanilla type name.
*
* @return entity type name
*/
String name();
default boolean is(EntityType... types) {
for (EntityType type : types) {
if (this == type) {
return true;
}
}
return false;
}
default boolean is(EntityType type) {
return this == type;
}
/**
* Returns whether the current type is equal to the given type, or has it as a parent type.
*
* @param type entity type to check against
* @return true if the current type is equal to the given type, or has it as a parent type
*/
default boolean isOrHasParent(EntityType type) {
EntityType parent = this;
do {
if (parent == type) {
return true;
}
parent = parent.getParent();
} while (parent != null);
return false;
}
}
@@ -0,0 +1,33 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.entities;
/**
* Represents a legacy object entity type.
*/
public interface ObjectType {
int getId();
EntityType getType();
}
@@ -0,0 +1,129 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.item;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.google.gson.annotations.SerializedName;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Objects;
public class DataItem implements Item {
@SerializedName(value = "identifier", alternate = "id")
private int identifier;
private byte amount;
private short data;
private CompoundTag tag;
public DataItem() {
}
public DataItem(int identifier, byte amount, short data, @Nullable CompoundTag tag) {
this.identifier = identifier;
this.amount = amount;
this.data = data;
this.tag = tag;
}
public DataItem(Item toCopy) {
this(toCopy.identifier(), (byte) toCopy.amount(), toCopy.data(), toCopy.tag());
}
@Override
public int identifier() {
return identifier;
}
@Override
public void setIdentifier(int identifier) {
this.identifier = identifier;
}
@Override
public int amount() {
return amount;
}
@Override
public void setAmount(int amount) {
if (amount > Byte.MAX_VALUE || amount < Byte.MIN_VALUE) {
throw new IllegalArgumentException("Invalid item amount: " + amount);
}
this.amount = (byte) amount;
}
@Override
public short data() {
return data;
}
@Override
public void setData(short data) {
this.data = data;
}
@Override
public @Nullable CompoundTag tag() {
return tag;
}
@Override
public void setTag(@Nullable CompoundTag tag) {
this.tag = tag;
}
@Override
public Item copy() {
return new DataItem(identifier, amount, data, tag);
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DataItem item = (DataItem) o;
if (identifier != item.identifier) return false;
if (amount != item.amount) return false;
if (data != item.data) return false;
return Objects.equals(tag, item.tag);
}
@Override
public int hashCode() {
int result = identifier;
result = 31 * result + (int) amount;
result = 31 * result + (int) data;
result = 31 * result + (tag != null ? tag.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Item{" +
"identifier=" + identifier +
", amount=" + amount +
", data=" + data +
", tag=" + tag +
'}';
}
}
@@ -0,0 +1,97 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.item;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface Item {
/**
* Returns the item identifier.
*
* @return item identifier
*/
int identifier();
/**
* Sets the item identifier.
*
* @param identifier item identifier
*/
void setIdentifier(int identifier);
/**
* Returns the item amount.
*
* @return item amount
*/
int amount();
/**
* Returns the item amount.
*
* @param amount item amount
*/
void setAmount(int amount);
/**
* Returns the item data. Always 0 for 1.13+ items.
*
* @return item data
*/
default short data() {
return 0;
}
/**
* Sets the item data used in versions before 1.13.
*
* @param data item data
* @throws UnsupportedOperationException if the item implementation does not store data
*/
default void setData(short data) {
throw new UnsupportedOperationException();
}
/**
* Returns the item compound tag if present.
*
* @return item tag
*/
@Nullable CompoundTag tag();
/**
* Sets the item compound tag.
*
* @param tag item tag
*/
void setTag(@Nullable CompoundTag tag);
/**
* Returns a copy of the item.
*
* @return copy of the item
*/
Item copy();
}
@@ -0,0 +1,82 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata;
import com.viaversion.viaversion.api.type.Type;
public interface MetaType {
/**
* Get the write/read type
*
* @return Type instance
*/
Type type();
/**
* Get type id from the specific MetaDataType
*
* @return Type id as an integer
*/
int typeId();
static MetaType create(final int typeId, final Type<?> type) {
return new MetaTypeImpl(typeId, type);
}
final class MetaTypeImpl implements MetaType {
private final int typeId;
private final Type<?> type;
MetaTypeImpl(final int typeId, final Type<?> type) {
this.typeId = typeId;
this.type = type;
}
@Override
public int typeId() {
return typeId;
}
@Override
public Type<?> type() {
return type;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final MetaTypeImpl metaType = (MetaTypeImpl) o;
if (typeId != metaType.typeId) return false;
return type.equals(metaType.type);
}
@Override
public int hashCode() {
int result = typeId;
result = 31 * result + type.hashCode();
return result;
}
}
}
@@ -0,0 +1,144 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata;
import com.google.common.base.Preconditions;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Objects;
public final class Metadata {
private int id;
private MetaType metaType;
private Object value;
/**
* Creates a new metadata instance.
*
* @param id metadata index
* @param metaType metadata type
* @param value value if present
* @throws IllegalArgumentException if the value and metaType are incompatible
*/
public Metadata(int id, MetaType metaType, @Nullable Object value) {
this.id = id;
this.metaType = metaType;
this.value = checkValue(metaType, value);
}
public int id() {
return id;
}
public void setId(int id) {
this.id = id;
}
public MetaType metaType() {
return metaType;
}
/**
* Sets the metadata type if compatible with the current value.
*
* @param metaType metadata type
* @throws IllegalArgumentException if the metadata type and current value are incompatible
* @see #setTypeAndValue(MetaType, Object)
*/
public void setMetaType(MetaType metaType) {
checkValue(metaType, this.value);
this.metaType = metaType;
}
public @Nullable <T> T value() {
return (T) value;
}
public @Nullable Object getValue() {
return value;
}
/**
* Sets the metadata value if compatible with the current meta type.
*
* @param value value
* @throws IllegalArgumentException if the value and current metaType are incompatible
* @see #setTypeAndValue(MetaType, Object)
*/
public void setValue(@Nullable Object value) {
this.value = checkValue(this.metaType, value);
}
/**
* Sets metadata type and value.
*
* @param metaType metadata type
* @param value value
* @throws IllegalArgumentException if the value and metaType are incompatible
*/
public void setTypeAndValue(MetaType metaType, @Nullable Object value) {
this.value = checkValue(metaType, value);
this.metaType = metaType;
}
private Object checkValue(MetaType metaType, @Nullable Object value) {
Preconditions.checkNotNull(metaType);
if (value != null && !metaType.type().getOutputClass().isAssignableFrom(value.getClass())) {
throw new IllegalArgumentException("Metadata value and metaType are incompatible. Type=" + metaType
+ ", value=" + value + " (" + value.getClass().getSimpleName() + ")");
}
return value;
}
@Deprecated
public void setMetaTypeUnsafe(MetaType type) {
this.metaType = type;
}
@Override
public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Metadata metadata = (Metadata) o;
if (id != metadata.id) return false;
if (metaType != metadata.metaType) return false;
return Objects.equals(value, metadata.value);
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + metaType.hashCode();
result = 31 * result + (value != null ? value.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Metadata{" +
"id=" + id +
", metaType=" + metaType +
", value=" + value +
'}';
}
}
@@ -0,0 +1,51 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
public abstract class AbstractMetaTypes implements MetaTypes {
private final MetaType[] values;
protected AbstractMetaTypes(final int values) {
this.values = new MetaType[values];
}
@Override
public MetaType byId(final int id) {
return values[id];
}
@Override
public MetaType[] values() {
return values;
}
protected MetaType add(final int typeId, final Type<?> type) {
final MetaType metaType = MetaType.create(typeId, type);
values[typeId] = metaType;
return metaType;
}
}
@@ -0,0 +1,65 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
public enum MetaType1_12 implements MetaType {
Byte(0, Type.BYTE),
VarInt(1, Type.VAR_INT),
Float(2, Type.FLOAT),
String(3, Type.STRING),
Chat(4, Type.COMPONENT),
Slot(5, Type.ITEM),
Boolean(6, Type.BOOLEAN),
Vector3F(7, Type.ROTATION),
Position(8, Type.POSITION),
OptPosition(9, Type.OPTIONAL_POSITION),
Direction(10, Type.VAR_INT),
OptUUID(11, Type.OPTIONAL_UUID),
BlockID(12, Type.VAR_INT),
NBTTag(13, Type.NBT);
private final int typeID;
private final Type type;
MetaType1_12(int typeID, Type type) {
this.typeID = typeID;
this.type = type;
}
public static MetaType1_12 byId(int id) {
return values()[id];
}
@Override
public int typeId() {
return typeID;
}
@Override
public Type type() {
return type;
}
}
@@ -0,0 +1,69 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_13;
@Deprecated/*(forRemoval = true)*/
public enum MetaType1_13 implements MetaType {
Byte(0, Type.BYTE),
VarInt(1, Type.VAR_INT),
Float(2, Type.FLOAT),
String(3, Type.STRING),
Chat(4, Type.COMPONENT),
OptChat(5, Type.OPTIONAL_COMPONENT),
Slot(6, Type.FLAT_ITEM),
Boolean(7, Type.BOOLEAN),
Vector3F(8, Type.ROTATION),
Position(9, Type.POSITION),
OptPosition(10, Type.OPTIONAL_POSITION),
Direction(11, Type.VAR_INT),
OptUUID(12, Type.OPTIONAL_UUID),
BlockID(13, Type.VAR_INT),
NBTTag(14, Type.NBT),
PARTICLE(15, Types1_13.PARTICLE);
private final int typeID;
private final Type type;
MetaType1_13(int typeID, Type type) {
this.typeID = typeID;
this.type = type;
}
public static MetaType1_13 byId(int id) {
return values()[id];
}
@Override
public int typeId() {
return typeID;
}
@Override
public Type type() {
return type;
}
}
@@ -0,0 +1,69 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_13_2;
@Deprecated/*(forRemoval = true)*/
public enum MetaType1_13_2 implements MetaType {
Byte(0, Type.BYTE),
VarInt(1, Type.VAR_INT),
Float(2, Type.FLOAT),
String(3, Type.STRING),
Chat(4, Type.COMPONENT),
OptChat(5, Type.OPTIONAL_COMPONENT),
Slot(6, Type.FLAT_VAR_INT_ITEM),
Boolean(7, Type.BOOLEAN),
Vector3F(8, Type.ROTATION),
Position(9, Type.POSITION),
OptPosition(10, Type.OPTIONAL_POSITION),
Direction(11, Type.VAR_INT),
OptUUID(12, Type.OPTIONAL_UUID),
BlockID(13, Type.VAR_INT),
NBTTag(14, Type.NBT),
PARTICLE(15, Types1_13_2.PARTICLE);
private final int typeID;
private final Type type;
MetaType1_13_2(int typeID, Type type) {
this.typeID = typeID;
this.type = type;
}
public static MetaType1_13_2 byId(int id) {
return values()[id];
}
@Override
public int typeId() {
return typeID;
}
@Override
public Type type() {
return type;
}
}
@@ -0,0 +1,72 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_14;
@Deprecated/*(forRemoval = true)*/
public enum MetaType1_14 implements MetaType {
Byte(0, Type.BYTE),
VarInt(1, Type.VAR_INT),
Float(2, Type.FLOAT),
String(3, Type.STRING),
Chat(4, Type.COMPONENT),
OptChat(5, Type.OPTIONAL_COMPONENT),
Slot(6, Type.FLAT_VAR_INT_ITEM),
Boolean(7, Type.BOOLEAN),
Vector3F(8, Type.ROTATION),
Position(9, Type.POSITION1_14),
OptPosition(10, Type.OPTIONAL_POSITION_1_14),
Direction(11, Type.VAR_INT),
OptUUID(12, Type.OPTIONAL_UUID),
BlockID(13, Type.VAR_INT),
NBTTag(14, Type.NBT),
PARTICLE(15, Types1_14.PARTICLE),
VillagerData(16, Type.VILLAGER_DATA),
OptVarInt(17, Type.OPTIONAL_VAR_INT),
Pose(18, Type.VAR_INT);
private final int typeID;
private final Type type;
MetaType1_14(int typeID, Type type) {
this.typeID = typeID;
this.type = type;
}
public static MetaType1_14 byId(int id) {
return values()[id];
}
@Override
public int typeId() {
return typeID;
}
@Override
public Type type() {
return type;
}
}
@@ -0,0 +1,73 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_16;
@Deprecated/*(forRemoval = true)*/
public enum MetaType1_16 implements MetaType {
BYTE(0, Type.BYTE),
VAR_INT(1, Type.VAR_INT),
FLOAT(2, Type.FLOAT),
STRING(3, Type.STRING),
COMPONENT(4, Type.COMPONENT),
OPT_COMPONENT(5, Type.OPTIONAL_COMPONENT),
ITEM(6, Type.FLAT_VAR_INT_ITEM),
BOOLEAN(7, Type.BOOLEAN),
ROTATION(8, Type.ROTATION),
POSITION(9, Type.POSITION1_14),
OPT_POSITION(10, Type.OPTIONAL_POSITION_1_14),
DIRECTION(11, Type.VAR_INT),
OPT_UUID(12, Type.OPTIONAL_UUID),
BLOCK_STATE(13, Type.VAR_INT),
NBT(14, Type.NBT),
PARTICLE(15, Types1_16.PARTICLE),
VILLAGER_DATA(16, Type.VILLAGER_DATA),
OPT_VAR_INT(17, Type.OPTIONAL_VAR_INT),
POSE(18, Type.VAR_INT);
private static final MetaType1_16[] VALUES = values();
private final int typeId;
private final Type type;
MetaType1_16(int typeId, Type type) {
this.typeId = typeId;
this.type = type;
}
public static MetaType1_16 byId(int id) {
return VALUES[id];
}
@Override
public int typeId() {
return typeId;
}
@Override
public Type type() {
return type;
}
}
@@ -0,0 +1,73 @@
/*
* This file is part of ViaVersion - https://github.com/ViaVersion/ViaVersion
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.viaversion.viaversion.api.minecraft.metadata.types;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_17;
@Deprecated/*(forRemoval = true)*/
public enum MetaType1_17 implements MetaType {
BYTE(0, Type.BYTE),
VAR_INT(1, Type.VAR_INT),
FLOAT(2, Type.FLOAT),
STRING(3, Type.STRING),
COMPONENT(4, Type.COMPONENT),
OPT_COMPONENT(5, Type.OPTIONAL_COMPONENT),
ITEM(6, Type.FLAT_VAR_INT_ITEM),
BOOLEAN(7, Type.BOOLEAN),
ROTATION(8, Type.ROTATION),
POSITION(9, Type.POSITION1_14),
OPT_POSITION(10, Type.OPTIONAL_POSITION_1_14),
DIRECTION(11, Type.VAR_INT),
OPT_UUID(12, Type.OPTIONAL_UUID),
BLOCK_STATE(13, Type.VAR_INT),
NBT(14, Type.NBT),
PARTICLE(15, Types1_17.PARTICLE),
VILLAGER_DATA(16, Type.VILLAGER_DATA),
OPT_VAR_INT(17, Type.OPTIONAL_VAR_INT),
POSE(18, Type.VAR_INT);
private static final MetaType1_17[] VALUES = values();
private final int typeId;
private final Type type;
MetaType1_17(int typeId, Type type) {
this.typeId = typeId;
this.type = type;
}
public static MetaType1_17 byId(int id) {
return VALUES[id];
}
@Override
public int typeId() {
return typeId;
}
@Override
public Type type() {
return type;
}
}
Loaded 100 of 834 files, more files were not shown because too many files have changed in this diff. Show more