Compare commits

..
3681 Commits
Author SHA1 Message Date
NotAlexNoyle f767de3beb Exclude CODEOWNERS from language statistics 2026-10-27 08:25:14 -04:00
NotAlexNoyle 78dcd67723 Add CODEOWNERS (one staff approval) 2026-10-27 08:25:14 -04:00
NotAlexNoyle f3249e6b9e No-op update checker 2026-06-17 04:12:41 -04:00
NotAlexNoyle 0099e0e3d2 Update plugin name to PacketEvents 2026-03-25 12:59:10 -04:00
NotAlexNoyle f2569fd50e Update plugin name 2026-03-25 10:16:10 -04:00
NotAlexNoyle e90aeef31b Clarify API compatibility with 2.11.2 2026-03-25 05:22:35 -04:00
NotAlexNoyle 3d653a1856 Fi9x build 2026-03-25 05:15:30 -04:00
NotAlexNoyle b5e0b5ceca Backport to java 17 and 1.19.4 2026-03-25 04:56:47 -04:00
booky dcc3cec023 Remove ProtocolSupport dependency during compilation
Use reflection instead because jitpack sucks (and ProtocolSupport is pretty much legacy now anyway)
2026-03-08 16:43:03 +01:00
booky 989c38f377 Fix misleading nbt limiter error message 2026-03-08 15:37:15 +01:00
retrooper fea65c7891 Merge pull request #1452 from ruViolence/add-missing-equals-hashcode-tostring
Add missing equals, hashCode and toString methods
2026-02-27 13:58:23 -05:00
booky d49555c5e1 Fix fabric mod initialization
Fixes https://github.com/retrooper/packetevents/issues/1453
2026-02-21 03:23:47 +01:00
ruViolence dedb96e5cb Add missing equals, hashCode and toString methods 2026-02-03 22:59:21 +08:00
booky 1b0a8bf8de Implement wrapped nbtlist support in compound list getter/setter 2026-01-27 15:41:55 +01:00
retrooper 8bf18ac3c6 bump to 2.11.3 snapshot 2026-01-26 20:03:22 -05:00
retrooper 61a91ca4a9 step 2: initiating 2.11.2 update 2026-01-26 18:58:43 -05:00
retrooper 5e281eb967 initiating 2.11.2 update 2026-01-26 18:55:40 -05:00
booky f0b29d0266 Initialize SynchronizedRegistriesHandler during packetevents load
Hopefully prevents a random deadlock which I am not sure how to debug/reproduce
2026-01-22 10:12:14 +01:00
booky 4ec6b01e6a Don't mix jspecify and jetbrains annotations in internal StaticChatType constructor
I don't know why, but this messes up our testing for correct annotations on the TypesBuilderData parameter
2026-01-20 09:31:27 +01:00
booky 58a1ada322 Fix various equality/nullability issues with registry values 2026-01-20 09:23:38 +01:00
booky 195ee0446a Add more equality methods for env attributes and particle data 2026-01-20 08:48:56 +01:00
booky 629080cfb3 Explicitly specify Locale#ROOT for all String#toLowerCaser() calls 2026-01-19 14:46:14 +01:00
booky 2390e06ad3 Fix dimension type copying not using new data entry
Should fix https://github.com/retrooper/packetevents/issues/1437
2026-01-19 13:37:57 +01:00
booky b6a3e39cae Remove end skylight for 1.21.8 and below
Fixes #1426
2026-01-16 23:31:02 +01:00
booky 548312ea34 Fix nullability annotations for packet events 2026-01-14 15:35:18 +01:00
booky 1c1702b11d Mark whole UpdateChecker class as internal 2026-01-14 15:32:37 +01:00
retrooper eb09f196e5 Merge pull request #1435 from nickuc-com/fix-chat-processor
Fix chat message processor for version 1.7
2026-01-11 11:31:29 -05:00
Nick d122518bcf Do not rename ChatMessageProcessorLegacy class 2026-01-10 18:32:22 -03:00
retrooper fd53b95457 code duplication in release builds suggestion corrected 2026-01-10 16:20:37 -05:00
retrooper 76af835e2e Merge pull request #1431 from GrimAnticheat/feat/vector-offset-multiple-of-blockface
Add new offset(Blockface face, int i) method to Vector3f/d/i classes
2026-01-10 16:07:15 -05:00
booky 90a196d3bc Log warning message when failing to uninject from velocity initializer
It shouldn't break anything, but it's a massive memory leak

Follow-up to #1379
2026-01-10 19:15:11 +01:00
booky ae928dbee1 Add all removed blocks to their new block tags
Follow-up to #1434 which moves the legacy chain block outside the auto-generated code block

Also fixes the same issue for grass_path
2026-01-10 19:02:27 +01:00
Nick fa701e81cf Fix chat message processor for version 1.7 2026-01-10 02:38:29 -03:00
Axionize c44e502dab Refactor: Rename offset parameter and add JavaDoc
- Renamed parameter 'i' to 'distance' in Vector3i, Vector3f, and Vector3d to improve code readability.
- Added JavaDoc to offset methods to explain the functionality as requested.
2026-01-09 22:17:35 -05:00
retrooper 8669b0f183 Recommend release builds (and fallback to development builds) to users who run outdated software. 2026-01-09 22:02:34 -05:00
retrooper 2b9e7b1166 Merge pull request #1379 from Rothes/velocity-hot-disable
Support uninject on velocity
2026-01-09 20:59:36 -05:00
retrooper 5a00e5c79f resort to more common terminology in comment 2026-01-09 20:55:46 -05:00
retrooper 887fa9ff4c Merge pull request #1434 from Ayouuuu/2.0
Add CHAIN to the CHAINS tag
2026-01-09 20:40:21 -05:00
Ayou ac962ce70d Add CHAIN to the CHAINS tag 2026-01-09 12:47:50 +08:00
Axionize 21866cc94f Add new offset(Blockface face, int i) method to Vector3f/d/i classes 2026-01-04 20:11:26 -05:00
retrooper 497c8dbd94 Update README.md 2026-01-04 19:28:20 -05:00
booky 40cd6b43cb Merge pull request #1407 from NgLoader/fix-thread-save-packet-prepare
fix: thread save packet type init
2026-01-04 23:05:35 +01:00
booky 84b3392e9a Replace more PacketType#prepare usage
Also mark methods as internal
2026-01-04 22:59:14 +01:00
booky b654ab1b54 Fix infiniburn tag parsing for 1.18.1 and older
Fixes https://github.com/retrooper/packetevents/issues/1429
2026-01-04 22:49:22 +01:00
booky 1639b73a0d Fix unexpected NPE if bukkit entity is null during unsafe lookup
Caused by these lookups being inherently unsafe
2026-01-04 21:26:23 +01:00
booky 74163d2edf Allow parsing component entity uuids as strings
Fixes https://github.com/retrooper/packetevents/issues/1430
2026-01-04 21:20:20 +01:00
booky a35742fc64 [skip ci] Bump some dependencies 2026-01-04 20:16:03 +01:00
retrooper 2768b3445f Update library description in README.md 2026-01-04 12:40:51 -05:00
retrooper 7763337e37 increment version to 2.11.2 for snapshot builds 2025-12-21 08:56:53 +01:00
retrooper c93fcd2c0f initiating update to 2.11.1 2025-12-21 08:46:45 +01:00
booky ae20589b1a Merge pull request #1424 from nickuc-com/2.0
Fix NoSuchMethodError: 'Class ClickEvent$Action.payloadType()' error
2025-12-19 04:10:22 +01:00
Nick 6e2005c6c9 Fix NoSuchMethodError: 'Class ClickEvent$Action.payloadType()' error for Adventure 4.21 or older 2025-12-18 18:10:05 -03:00
booky d7f3ff6e06 Fix modrinth release publishing not working for some modules
Caused by our sources jar being the exact same as the last one for some modules
2025-12-18 16:53:25 +01:00
booky 75b6d14aac Normalize SimpleRegistry name inputs
Fixes https://github.com/retrooper/packetevents/issues/1419
2025-12-18 12:56:03 +01:00
booky f250854243 Fix login plugin message reading/writing 2025-12-16 15:13:53 +01:00
booky bfd1b40482 Don't wrap timelines registry twice
Should have no effect, just a small cleanup change
2025-12-16 14:27:57 +01:00
booky 941bf7c30e Add system property for activating NbtCodecException debug traces 2025-12-16 13:30:34 +01:00
booky 28f14a7b42 Finalize registry entries after all registries have been loaded
Should fix https://github.com/retrooper/packetevents/issues/1419
2025-12-15 23:31:34 +01:00
AoElite a3dc1118f8 Merge pull request #1182 from Axionize/feat/comprehensive-statetype-integrity-testing
Add comprehrensive test to ensure integrity of all StateType mappings and getting corresponding WrappedBlockStates
2025-12-12 03:06:52 -05:00
Axionize 8b9ca0541a Merge remote-tracking branch 'axionize/feat/comprehensive-statetype-integrity-testing' into feat/comprehensive-statetype-integrity-testing
# Conflicts:
#	testlibs.versions.toml
2025-12-12 02:33:47 -05:00
Axionize 6680d33abb Update StateType test for 1.21.10 and improve robustness 2025-12-12 02:24:39 -05:00
Axionize 4e6ae10528 Merge branch '2.0' into feat/comprehensive-statetype-integrity-testing
# Conflicts:
#	testlibs.versions.toml
2025-12-12 01:50:29 -05:00
booky c728f2fd05 Merge pull request #1417 from vadim-soude/feat/add-comment-WrapperPlayServerChangeGameState
Add comment to indicate the mojang name of the packet the wrapper is handling
2025-12-11 14:22:16 +01:00
Vadim Soudé aa54f50116 Add comment to indicate the mojang name of the packet the wrapper is haddling
This is some parity comment in regard of ClientboundLevelEventPacket
2025-12-11 14:13:56 +01:00
booky f9775eb3ce Fix sound codec typo 2025-12-10 14:58:32 +01:00
retrooper d8adfb132a bump version to 2.11.1 snapshot 2025-12-09 21:41:45 +01:00
retrooper ebd8a66d05 releasing packetevents 2.11.0 2025-12-09 21:06:09 +01:00
retrooper 024d4b93a3 Merge pull request #1405 from booky10/feat/1.21.11-support
1.21.11 support
2025-12-09 20:39:01 +01:00
retrooper a04e0eddc7 update packetevents 2.11.0 snapshot 2025-12-09 20:31:19 +01:00
retrooper 0c1e3ee82d add copyright notices 2025-12-09 20:16:38 +01:00
booky e65004c12e Update base item components for 1.21.11 2025-12-09 19:59:43 +01:00
booky e61a83e5ad Update attack range item component with changes from 1.21.11-pre4 2025-12-09 19:46:29 +01:00
booky 10d126cbe7 Merge branch '2.0' into feat/1.21.11-support 2025-12-09 17:23:06 +01:00
booky 39df65b111 Fix ClassStructureTest breaking dimension mappings test 2025-12-09 16:41:44 +01:00
booky d8c39f6463 Compare name maps using DeepComparableEntity if available 2025-12-09 15:24:09 +01:00
booky b97c13b487 Implement extra mapping steps to support version-specific named elements 2025-12-09 15:18:27 +01:00
AoElite 71c8f41bd4 Merge pull request #1411 from AoElite/resourcekey-refactor
ResourceLocation refactor
2025-12-08 22:19:04 -05:00
booky eeea9d7fdc Bump fabric minecraft version 2025-12-08 22:47:09 +01:00
booky e46deea6c5 Fix paper 1.21.11-rc2 startup errors 2025-12-08 22:42:58 +01:00
booky 0e30d2f5ee Fix VersionRange check 2025-12-08 22:23:12 +01:00
booky c2634d2dc3 Define dimension types with new data 2025-12-08 15:40:19 +01:00
AoElite d1254391aa remove redundant lowercase conversion 2025-12-08 09:27:15 -05:00
AoElite 3dae51062d Refactor ResourceLocation to use Key simplifying key handling. Additionally, fixed an issue with StateTypes creating ResourceLocations with invalid key formatting. 2025-12-08 09:14:37 -05:00
AoElite 86e454077a Show full exceptions during tests 2025-12-08 09:11:44 -05:00
booky 7d032a3e4a Implement version-specific named registry object definitions 2025-12-08 14:38:23 +01:00
booky b4b6ff015e Implement new DimensionType codec 2025-12-08 13:57:29 +01:00
booky db647ba73a WIP, start integrating env attributes into dimension types 2025-12-08 00:39:16 +01:00
booky 5dd5de04a8 Add timelines registry to sync data loading 2025-12-07 23:49:01 +01:00
retrooper bfbeb8dafc Merge pull request #1409 from groundbreakingmc/2.0
fix: correct default buffer size to match comment
2025-12-07 23:40:36 +01:00
booky 577590b1eb Load timelines registry data 2025-12-07 23:40:17 +01:00
booky c828e8b111 Refactor env attribute package structure 2025-12-07 23:11:46 +01:00
booky 9109e247db Resolve TODOs, fix tests 2025-12-07 23:06:52 +01:00
booky fe29db24cf Implement environment attribute easing types 2025-12-07 22:39:10 +01:00
booky 3c8079aee2 Finish EnvironmentAttributeMap implementation 2025-12-07 20:33:36 +01:00
GroundbreakingMC ee82a47abb fix: correct default buffer size to match comment
The code previously used 1 << 20 bytes (1MiB) for DEFAULT_MAX_SIZE,
but the comment stated 2MiB. This updates the value to 2 << 20 bytes
to match the comment and intended behavior.
2025-12-07 04:45:22 +01:00
booky 7251ee1b18 Finish env attribute types 2025-12-06 19:49:25 +01:00
booky 1582bca318 Some work on env attribute types and modifiers 2025-12-06 18:47:55 +01:00
booky 0615c78075 Some more work on timeline codecs 2025-12-06 16:58:29 +01:00
Nils Gereke fbb80124db fix: thread save Ãpacket type init 2025-11-30 21:58:54 +01:00
booky 3430b25b5e Start implementing timelines 2025-11-28 16:19:51 +01:00
booky def0ce4840 Start implementing environment attribute map entry codec
WIP, just a push before I start working on this again tomorrow
2025-11-28 04:06:23 +01:00
booky ed89d0a5a8 Update packaged biome data 2025-11-27 10:56:59 +01:00
booky 7af96fec84 Fix test failure 2025-11-27 10:56:37 +01:00
booky d8fd027415 Update block and item tags
We need to find a better solution for tags
2025-11-27 09:36:41 +01:00
booky 4441e04472 Update biomes decoding/encoding to 1.21.11 2025-11-27 01:53:59 +01:00
booky c5bec028c0 Finish environment attributes 2025-11-27 00:11:04 +01:00
booky bd6008d5a7 Start implementing environment attributes 2025-11-26 23:10:51 +01:00
booky fc4157127a Add environment attribute and timeline registry ids 2025-11-26 22:37:43 +01:00
booky ea3c9d085e Document mojang names for WrapperPlayServerOpenHorseWindow 2025-11-26 22:34:58 +01:00
booky 1b1a104cc4 Add stab digging action 2025-11-26 22:34:49 +01:00
booky 6d43d90367 Fix other remaining test issues 2025-11-25 10:16:50 +01:00
booky 3323449eea Fix zombie nautilus variant registry loading 2025-11-25 09:52:01 +01:00
booky c72ca2baa0 Implement new data component types 2025-11-25 09:49:39 +01:00
booky d4e6fff86e Add ZombieNautilusVariant to registry loading 2025-11-25 09:05:15 +01:00
booky 06c96900ec Implement ZombieNautilusVariant 2025-11-25 08:40:59 +01:00
booky a0dd21bed5 Start updating to 1.21.11 2025-11-24 17:35:08 +01:00
AoElite b25c0f9850 Merge branch '2.0' into feat/comprehensive-statetype-integrity-testing 2025-11-22 10:34:32 -05:00
AoElite f9ab88c9e4 Merge pull request #1394 from retrooper/copilot/improve-slow-code-efficiency
Optimize loop performance: cache size() calls and use entrySet() iteration
2025-11-22 10:28:27 -05:00
retrooper 3238a3eca4 Merge pull request #1401 from NoJokeFNA/patch-1
Document protocol version for 1.19.1 and 1.19.2
2025-11-20 23:04:34 +01:00
Julian 8685846be3 Document protocol version for 1.19.1 and 1.19.2
Add comment explaining protocol version for 1.19.1 and 1.19.2
2025-11-19 14:02:18 +01:00
retrooper 2ebfa4185b minor correction of a copyright year 2025-11-19 13:55:14 +01:00
booky c4b4c8d9e0 Merge pull request #1393 from MesterMan03/2.0
Fix custom click event payload field being stripped during NBT serialization
2025-11-11 00:30:25 +01:00
booky 60dd509fcb Implement proper nb string parsing
We apparently have included adventure nbt for some time now for some reason, so we can also just use it to parse SNBT strings
2025-11-10 13:43:29 +01:00
booky b6c67c320e Remove version check
We don't do any version checks in the nbt serializer when serializing
2025-11-10 13:16:56 +01:00
copilot-swe-agent[bot]andretrooper e4676a18fe Optimize loop performance by caching size() and using entrySet()
Co-authored-by: retrooper <49798017+retrooper@users.noreply.github.com>
2025-11-08 00:59:09 +00:00
copilot-swe-agent[bot] a5b0758b67 Initial plan 2025-11-08 00:53:13 +00:00
MesterMan03 27ba69fa43 Fix custom click event payload field being stripped during NBT serialization
- Fixed deserialization: Now properly uses NbtTagHolder with the actual payload NBT instead of hardcoded "0b"
- Fixed serialization: Now writes the payload field to NBT when it exists and is not empty (also checks for Minecraft version 1.21.6+)
- Added comprehensive tests for custom click event payload preservation
2025-11-08 00:15:12 +01:00
booky 14b162b098 Merge pull request #1380 from Rothes/palette-constructor
Add constructor with data array to ListPalette
2025-11-06 13:21:06 +01:00
Rothes f1e9a6f1e8 Guarantee data array length 2025-11-06 17:53:18 +08:00
retrooper 00c8164201 2.10.2 snapshot 2025-11-04 19:32:53 +01:00
retrooper 206d1e03bb 2.10.1 release 2025-11-04 17:42:44 +01:00
retrooper c180263e3f Merge pull request #1389 from SamB440/sponge-adventure
Validate Sponge Adventure version & fix logging
2025-11-04 13:59:17 +01:00
retrooper 8872c65ba2 Merge pull request #1374 from booky10/fix/particle-types-1-21-9
Fix 1.21.9/1.21.10 particle types
2025-11-04 13:56:53 +01:00
retrooper abe79fb351 I couldn't find a better solution to this. 2025-11-04 13:50:07 +01:00
booky b76a014432 Merge pull request #1382 from TheFaser/fix/fabric-player-head
Fix nbt list unwrapping logic
2025-11-04 12:45:10 +01:00
Rothes c7b9e15cef Verify data length 2025-11-04 04:20:02 +08:00
booky fade6da4e2 Fix missing tag unwrapping 2025-11-03 20:59:34 +01:00
retrooper 86c67bfe52 Merge pull request #1390 from retrooper/revert-1384-2.0
Revert "Check if Velocity anti-bots closed the channel before initializing"
2025-11-02 21:33:52 +01:00
retrooper 6cda366bc2 Revert "Check if Velocity anti-bots closed the channel before initializing" 2025-11-02 21:33:30 +01:00
SamB440 2771c6c5d1 Validate Sponge Adventure version & fix logging 2025-11-01 16:43:28 +00:00
booky 7ba541843b Merge pull request #1387 from Axionize/fix/lp-vector-3
Fix incorrect encoding of LPVector3d
2025-10-30 23:05:56 +01:00
TheFaser 47ac4d5894 simplify NBT list conversion logic 2025-10-30 22:30:17 +05:00
TheFaser 6c424946fe Revert "add support for decoding item profile properties from NBT lists, fix #1377"
This reverts commit 0d030d0ca7.
2025-10-30 22:29:59 +05:00
Axionize b4e5b10299 Fix incorrect mul calculation for LPVector3d 2025-10-30 12:52:32 -04:00
booky efeb9019a6 Merge pull request #1384 from linsaftw/2.0
Check if Velocity anti-bots closed the channel before initializing
2025-10-27 20:31:00 +01:00
linsaftw 5b994a58da Check if Velocity anti-bots closed the channel before initializing 2025-10-27 14:47:57 -03:00
TheFaser 0d030d0ca7 add support for decoding item profile properties from NBT lists, fix #1377 2025-10-27 11:48:08 +05:00
Rothes 8b45ddd4ef Not to inject channel if plugin is terminated 2025-10-26 20:50:36 +08:00
Rothes cff73e9e67 Add constructor with data array to ListPalette 2025-10-26 15:45:44 +08:00
Rothes a7fa150836 Support uninject on velocity 2025-10-26 15:35:36 +08:00
booky10 7225117fea Fix bees component for 1.21.9+
Fixes #1378
2025-10-26 04:46:43 +01:00
booky10 3f44016db1 Merge branch '2.0' into fix/particle-types-1-21-9 2025-10-19 23:33:46 +02:00
retrooper c0dc2c5908 2.10.1 snapshot 2025-10-19 22:38:36 +02:00
booky10 8a0ebb77eb Downgrade buildscript jackson dependency
Our publishing plugin isn't compatible with jackson v2.20.0, which is provided by the run-task plugin
2025-10-19 21:11:01 +02:00
booky10 4ebb0acbfe Implement new spell effect particle data 2025-10-19 18:20:56 +02:00
booky10 b4831c4f09 Add color data to flash particle 2025-10-19 18:04:41 +02:00
booky10 17563f1856 Implement new dragon breath particle data 2025-10-19 17:55:16 +02:00
booky10 486cf4c74d Place sources and javadoc jars in root build directory
This will now allow our actions artifact upload task to pick up these files again, which fixes our automatic javadoc generation
2025-10-19 05:01:24 +02:00
retrooper 0528f0ebc6 2.10.0 release 2025-10-19 01:06:32 +02:00
booky ce43c2ba84 Merge pull request #1370 from TheFaser/2.0
update adventure version and add support object components
2025-10-18 01:38:40 +02:00
booky10 f37bb34cdf Reapply adventure serializer patch and update it
I hate this stupid fucking shit mess, can we just stop shading adventure please?
2025-10-18 01:25:56 +02:00
booky10 3fb60fa2c5 Update adventure patch classes to v4.25.0
I hate this adventure mess we are in
2025-10-18 00:36:55 +02:00
booky10 e59c1a5d3a Revert "Temporarily revert adventure patch"
This reverts commit 3831a7d1f0.
2025-10-18 00:31:55 +02:00
booky10 3831a7d1f0 Temporarily revert adventure patch 2025-10-18 00:30:25 +02:00
booky10 f7aee7c797 Align some lines in patched adventure subproject with real adventure 2025-10-18 00:27:50 +02:00
booky10 68b0a65288 Use ItemProfile nbt codec in adventure nbt serializer 2025-10-18 00:01:22 +02:00
booky10 7633319f2a Add full support for decoding/encoding ItemProfile to/from nbt tags
I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs I hate codecs
2025-10-17 23:52:48 +02:00
booky10 ca8ca25a3f Fix PlayerModelType reading/writing
I didn't expect mojang to use a simple boolean here
2025-10-17 23:39:43 +02:00
booky10 a96657d600 Don't check for version when decoding 2025-10-17 22:25:14 +02:00
booky10 bf664a4314 Merge branch '2.0' into TheFaser/2.0 2025-10-17 22:19:46 +02:00
TheFaser 8dd5bec27f remove double version check for sprite serialization 2025-10-12 19:28:03 +05:00
booky10 e11ae8b2cf Fix SpigotReflectionUtil#recentTPS() trying to read legacy fields 2025-10-09 21:53:15 +02:00
TheFaser c8f070cf7d add backward compatibility 2025-10-08 16:38:45 +05:00
TheFaser cc76a19fe3 add player head texture support 2025-10-08 12:45:58 +05:00
TheFaser d0b4ca57d1 fix hat boolean 2025-10-08 12:45:05 +05:00
TheFaser 18d103d202 add some comments 2025-10-08 12:27:18 +05:00
TheFaser 56241cee40 remove unnecessary atlas reading 2025-10-08 12:00:31 +05:00
TheFaser 061874fa46 add support for serializing and deserializing object components 2025-10-08 02:49:54 +05:00
TheFaser c1d22c98ef update adventure version to 4.25.0 2025-10-08 02:49:03 +05:00
booky 06c7afd21a Merge pull request #1369 from ManInMyVan/feat/wrappedblockstate/hasproperty
add WrappedBlockState#hasProperty(StateValue)
2025-10-07 22:39:35 +02:00
ManInMyVan ecb360eabd add WrappedBlockState#hasProperty(StateValue) 2025-10-07 13:49:50 -06:00
booky10 56941722aa Add minimum support for ItemLock network serialization
Fixes #1129

The problem is that the lock component is serialized using codecs (to nbt) instead of using stream codecs and packetevents doesn't have a great way to parse nbt how vanilla does it yet
Vanilla allows millions of different ways to write nbt (because of user input)
2025-10-07 20:39:56 +02:00
booky 2452d753af Merge pull request #1368 from TheFaser/2.0
fix: resolve NoSuchMethodError in login event with isAllowed() check
2025-10-07 19:03:35 +02:00
TheFaser 2085a725b0 fix: resolve NoSuchMethodError in login event with isAllowed() check 2025-10-07 21:28:51 +05:00
retrooper b67f99e8ea Merge pull request #1361 from booky10/feat/1.21.9-support
1.21.9/1.21.10 support
2025-10-06 12:21:33 +02:00
retrooper eee5dd7fa2 2.10.0 snapshot 2025-10-06 12:18:57 +02:00
retrooper 9c5e2bd4c9 patch: minor corrections to copyright year 2025-10-06 12:12:01 +02:00
booky10 87efd2dcf3 Merge branch '2.0' into feat/1.21.9-support 2025-10-05 20:39:47 +02:00
booky 170e1a9cb5 Merge pull request #1362 from rafi67000/gradleUpdate
Gradle update
2025-10-05 20:37:45 +02:00
booky10 7d4ef278cd Update fastutil in buildSrc 2025-10-05 20:20:12 +02:00
booky10 05c6d3447a Don't force wrapper version in build.gradle.kts 2025-10-05 20:17:19 +02:00
booky10 ef9f8d2000 Change workflow artifact uploading paths 2025-10-05 20:15:07 +02:00
rafi67000 9d192b61ea Update MockBukkit 2025-10-03 20:01:14 +02:00
rafi67000 d4d7e96c15 Update Loom 2025-10-03 20:00:59 +02:00
booky10 918fa83388 Fix player instance not being available for first few play packets
This now pauses packet processing until the player instance has been set, see javadoc comment on the InternalPaperJoinListener for more details
2025-10-02 23:25:26 +02:00
booky10 34f26bb3bd Make fabric support 1.21.9
Also tries to fix inconsistencies in when the player object was set for fabric
2025-10-02 20:13:11 +02:00
booky10 ccbfa6cf00 Mark 1.21.10 as supported 2025-10-02 18:48:37 +02:00
rafi67000 bcb429ec7f Fix workflow 2025-10-02 13:42:47 +02:00
rafi67000 5f38d74cfc Replace deprecated task registration 2025-10-01 18:47:43 +02:00
rafi67000 5111c354c1 Update mod-publish 2025-10-01 18:46:49 +02:00
rafi67000 643b2e9975 Update shadow 2025-10-01 18:46:38 +02:00
rafi67000 d9bc12b05e Update gradle to 9.1.0 2025-10-01 16:53:31 +02:00
booky10 f7e6de8594 Fix a few minor issues 2025-10-01 03:31:18 +02:00
booky10 8275088bda Update ItemProfile component to 1.21.9 2025-10-01 02:01:48 +02:00
booky10 06dd7a5555 Update entity data component to 1.21.9 2025-10-01 01:27:36 +02:00
booky10 4fa6bccaa7 Fix compile issue because of generics 2025-10-01 00:48:27 +02:00
booky10 7df7e3700b Update packet types to 1.21.9 2025-10-01 00:39:30 +02:00
booky10 adf1b2692a Update blocktags/itemtags to 1.21.9 2025-10-01 00:30:45 +02:00
booky10 b57d3364a3 Update block state properties to 1.21.9 2025-10-01 00:21:53 +02:00
booky10 48e67537c1 Update registries to 1.21.9 2025-10-01 00:17:20 +02:00
booky10 fe7455e379 Update entity data serializers 2025-09-30 22:25:39 +02:00
booky10 01e4f20c68 Finish packet wrapper updates 2025-09-30 21:30:47 +02:00
booky10 bf066d6156 Update explosion packet to 1.21.9 2025-09-30 18:29:29 +02:00
booky10 20bf1fd89d Implement debug packet wrappers 2025-09-30 05:32:49 +02:00
booky10 f2a470f943 Start implementing debug subscription network serialization 2025-09-30 02:47:05 +02:00
booky10 845077ff35 Some packet wrapper updates 2025-09-30 01:26:41 +02:00
booky10 ff03e29b3f Implement low/less precision Vec3d 2025-09-30 01:26:27 +02:00
booky10 fad9a4873f Work aroundl warning on paper server startup for now 2025-09-29 18:13:02 +02:00
booky10 ad21d93863 Fix paper runtask 2025-09-29 16:08:21 +02:00
booky10 4d366d06cd Add 1.21.9 server/client version 2025-09-29 13:53:25 +02:00
booky10 197a3c956e Revert breaking changes
- Deprecates PlayerData#getUser()/#setUser(UserProfile) instead of removing it without warning
- Reverts changes to signatures in WrapperPlayClientClickWindow, still tries to keep the fixes made by AO
2025-09-29 04:41:54 +02:00
booky10 f8371c461d Add small editorconfig 2025-09-29 04:30:28 +02:00
booky10 02f0855d3d Add missing sealevel getters/setters to WrapperPlayServerRespawn 2025-09-29 04:30:28 +02:00
booky 22a4085978 Merge pull request #1358 from Jyguy/fix-click-window-wrapper
Fix CLICK_WINDOW wrapper write length
2025-09-29 04:30:21 +02:00
Jyguy acae93e9cf Fix CLICK_WINDOW wrapper write length 2025-09-28 21:09:08 -04:00
booky 803cf8f109 Merge pull request #1357 from Axionize/2.0
Fix Build Issues due to Missing Dependencies and with Gradle 9.0.0
2025-09-27 22:42:16 +02:00
Axionize 4af2de9fee Fix building of bungeecoord due to removal of of Bungeecoord 1.21-R0.1-SNAPSHOT from paper repos 2025-09-27 15:14:28 -04:00
Axionize d916789acb Gradle 9.0.0 support 2025-09-27 14:36:39 -04:00
retrooper 54d120c296 Merge pull request #1333 from Beaness/patch-2 2025-09-20 09:09:38 +02:00
retrooper a84cbbd209 Merge pull request #1347 from AoElite/2.0
Improved getting slots and other improvements
2025-09-19 16:22:31 +02:00
retrooper 295b6f268e Merge pull request #1350 from scienziatopazzo/2.0
fix: remove duplicate setter for userProfile | WrapperPlayServerPlayerInfo
2025-09-19 16:22:11 +02:00
scienziato1pazzo a1e674f61d fix: remove duplicate setter for userProfile 2025-09-19 15:07:11 +02:00
AoElite bf1f896b39 ensure the cause is not null 2025-09-15 00:10:58 -04:00
AoElite eeb2b40138 convert nulls to empties 2025-09-14 23:56:44 -04:00
AoElite 60ff394785 fix more issues 2025-09-14 23:56:41 -04:00
AoElite 149c017099 fix mistake 2025-09-14 23:56:39 -04:00
AoElite 233d6c150c improve compatibility 2025-09-14 20:32:41 -04:00
AoElite 96aa95f9d7 dejankify WrapperPlayClientClickWindow 2025-09-14 20:20:32 -04:00
AoElite 7e1a8a704a improve getSlots backwards compatibility 2025-09-14 19:26:26 -04:00
AoElite cd769921b9 make the reading of slots to be changeable 2025-09-14 19:26:24 -04:00
AoElite 7d33952145 handle show_entity contents better 2025-09-14 19:26:21 -04:00
retrooper 58f1134254 Merge pull request #1341 from AoElite/wrapper-pref
Refactor properties and equipment processing to dedicated method
2025-09-05 13:05:31 +02:00
AoElite 6d1f2830d1 allow property reading to be overridden in update attribute packet wrappers 2025-09-05 06:11:21 -04:00
AoElite d103dd74f9 make the readEquipment method changeable with subclass overrides to allow optional performance optimizations 2025-09-05 04:19:35 -04:00
retrooper cd0f238b97 do not throw stacktrace for handshakes, in particular when the exception is caused by the handshake exception. 2025-08-29 10:34:48 +02:00
retrooper d7a475adfd PacketEvents 2.9.6-SNAPSHOT 2025-08-26 01:39:21 +02:00
retrooper ccfb6b422c PacketEvents 2.9.5 Update 2025-08-26 01:22:29 +02:00
booky10 2c8143ddb0 Add WrappedBlockState utility constructor to WrapperPlayServerBlockChange
Fixes #1325
2025-08-25 23:02:05 +02:00
booky10 f9892c598c Don't try to read direct wolf variant below 1.21
Fixes #1327
2025-08-25 22:59:49 +02:00
booky10andMesterMan03 3eb79fd6d2 Don't encode SingleOptionInputControl entries as strings for now
Packetevents doesn't support mixed nbt lists properly, so adding a string tag to a compound list will cause errors

Fixes #1334

Co-authored-by: MesterMan03 <MesterMan03+github@proton.me>
2025-08-25 22:52:41 +02:00
booky10 8ddceada42 Only error when reading chunk data if we managed to read more than allowed 2025-08-25 22:41:57 +02:00
booky10 a1c355d4c9 Cleanup NBT tag reading/writing 2025-08-25 21:20:40 +02:00
booky10 5c23459e1e Fix Direction Y/Z axis being swapped 2025-08-25 21:04:22 +02:00
booky10 af3dbc928b Mark SpigotChannelInjector encoder/decoder getters as nullable 2025-08-25 18:13:24 +02:00
booky10 bd1bc7f06a Check if the network channel is open instead of Player#isOnline if possible on kick
Player#isOnline() returns whether the player still exists in the internal bukkit player list, not whether the network channel is still active
2025-08-25 18:11:18 +02:00
retrooper 7f16b992eb Merge remote-tracking branch 'origin/2.0' into 2.0 2025-08-19 08:43:23 +02:00
retrooper 460884cbd8 patch: remove paper OfflinePlayer#isConnected reference; use Player#isOnline instead 2025-08-19 08:43:00 +02:00
Beanes 0cc99eadde Always try to fetch netty version 2025-08-18 19:49:27 +02:00
retrooper 24bf010d98 Merge pull request #1308 from Moulberry/fix/nbt-compound-getListOrThrow-NPE 2025-07-29 21:44:59 +02:00
retrooper e74adedf88 Merge pull request #1309 from Moulberry/fix/spigotchannelinjector-isplayerset-npe 2025-07-29 20:58:11 +02:00
Moulberry a34d03f422 Fix NPE in SpigotChannelInjector#isPlayerSet 2025-07-30 01:04:15 +08:00
Moulberry c0a9be3c7d Fix NBTCompound.java getListOrThrow always returning null 2025-07-30 01:01:28 +08:00
retrooper 8f352d9115 Merge pull request #1306 from rafi67000/gradleUpdate
ViaNBT, SpongeGradle, MockBukkit and shadow update
2025-07-22 23:55:39 +02:00
rafi67000 6ca306405c Update sponge plugin 2025-07-22 21:47:44 +02:00
rafi67000 d4190b2fde Update shadow plugin 2025-07-22 21:47:44 +02:00
rafi67000 30ed0bdcf3 Update ViaNBT 2025-07-22 21:47:44 +02:00
rafi67000 c3e2c3ee9e Update MockBukkit 2025-07-22 21:47:44 +02:00
retrooper 155f8520d4 increment packetevents version to 2.9.5-SNAPSHOT 2025-07-22 21:29:33 +02:00
retrooper 55b548d3ca packetevents release 2.9.4 2025-07-22 21:10:14 +02:00
retrooper 8eff09ff6e feat: SpigotConversionUtil#getEntityMetadata is now part of the API 2025-07-22 20:00:50 +02:00
retrooper 59596653a2 patch: correct WrapperPlayServerWorldBorder implementation for versions lower than 1.12 2025-07-20 20:54:10 +02:00
retrooper 4df76391cb feat: add support for extracting metadata from a Bukkit entity in SpigotReflectionUtil 2025-07-20 20:37:24 +02:00
retrooper 822f1d26b8 patch: re-add support for outdated server software with no accessible version 2025-07-19 22:04:32 +02:00
retrooper 55a42ab0e2 increment packetevents version to 2.9.4-SNAPSHOT 2025-07-17 16:47:11 +02:00
retrooper cdf3521154 packetevents 2.9.3 release 2025-07-17 16:36:51 +02:00
retrooper 820b530240 add 1.21.8 server version constant 2025-07-17 16:11:48 +02:00
retrooper 1823f61748 increment version to 2.9.3-snapshot 2025-07-17 15:54:24 +02:00
retrooper d27d8ffd6a packetevents 2.9.2 release 2025-07-17 15:18:28 +02:00
retrooper 7a57012822 Revert "Cleanup gradle configuration mess"
This reverts commit cfb054b8b2.
2025-07-17 14:01:23 +02:00
retrooper 0a10f4d861 Merge pull request #1265 from Luuzzi/2.0
fix spawn position for versions lower than 1.8 & protocol 4 support
2025-07-13 22:52:41 +02:00
retrooper d1a3145483 Merge pull request #1300 from GrimAnticheat/feature/read-list-max-size
Add new readList(Reader<K> reader, int maxSize) function to PacketWrapper
2025-07-13 22:46:25 +02:00
retrooper 08096106f8 patch: UserLoginEvent always fired in PlayerJoinEvent to provide UUID and username (so it's not a breaking change). 2025-07-13 22:41:22 +02:00
Luuzzi a3fbccc454 1.7.5 and lower doesn't have action START_JUMPING_WITH_HORSE 2025-07-13 20:36:10 +03:00
Luuzzi 9ea931d58d resolve #1301 2025-07-13 20:19:39 +03:00
Alexandr 364be4e34d Merge branch 'retrooper:2.0' into 2.0 2025-07-12 19:11:19 +03:00
Axionize b22394c288 Add new readList(Reader<K> reader, int maxSize) function to PacketWrapper 2025-07-12 09:49:19 -04:00
retrooper 208dfbc3f3 Merge pull request #1294 from booky10/fix/gradle-config-mess
Cleanup gradle configuration mess
2025-07-10 09:11:36 +02:00
booky10 cfb054b8b2 Cleanup gradle configuration mess 2025-07-10 04:58:23 +02:00
booky10 f47e6880fd [skip ci] Add fabric production run task 2025-07-10 02:53:39 +02:00
booky10 f55f791f8a [skip ci] Update gradle wrapper to v8.14.3 2025-07-10 02:53:38 +02:00
booky10 ba389ddb57 [skip ci] Fix changelog 2025-07-10 02:53:38 +02:00
booky10 2ce143d466 [skip ci] Increment version to v2.9.2 snapshot 2025-07-10 02:53:38 +02:00
booky10 b7f99503d9 Release packetevents v2.9.1 2025-07-10 02:14:43 +02:00
booky10 52adfbae8a Fix "publishMods" task name breaking shadow jar exclusions
This should be fixed properly, this is just a quick fix to get out a proper release
2025-07-10 02:08:11 +02:00
booky10 a861066cab Don't copy artifacts to root build directory 2025-07-10 02:07:21 +02:00
retrooper 1acec02bfb PacketEvents 2.9.1 snapshot 2025-07-10 01:27:48 +02:00
retrooper b88857386a Release PacketEvents 2.9.0 2025-07-10 00:42:32 +02:00
retrooper 4c48d4c1df Merge pull request #1291 from booky10/feat/publishing-workflow
Automatic release publishing
2025-07-10 00:34:47 +02:00
retrooper 68f8fd3d03 Merge pull request #1290 from booky10/fix/recursive-dialog-resolving
Store dialog click event field as reference for names
2025-07-10 00:29:56 +02:00
retrooper 2d625c6e7a feat: add setters to WrapperPlayServerWorldBorder 2025-07-10 00:15:19 +02:00
booky10 83fe2cce0d Revert "Setup testing setup v2"
This reverts commit 11e4033ec6.
2025-07-09 23:46:20 +02:00
booky10 73bfaebab6 Fix publishing type for github release
Was stable even for snapshots because version isn't set yet in root project
2025-07-09 23:39:57 +02:00
booky10 2ac61fd5cb Fix snapshot detection 2025-07-09 23:30:04 +02:00
booky10 7d31150b35 Add v2.6.0 and v2.7.0 changelogs to CHANGELOG.md 2025-07-09 23:28:19 +02:00
booky10 11e4033ec6 Setup testing setup v2 2025-07-09 23:20:51 +02:00
booky10 a6a8866727 Revert "Setup testing setup"
This reverts commit 84a0759288.
2025-07-09 23:20:08 +02:00
booky10 ce61c3ef52 Fix github tag name 2025-07-09 23:13:50 +02:00
retrooper 4602ea8107 Merge pull request #1251 from booky10/fix/attempt-fixing-random-login-race-condition-injection-issues
Attempt fixing random login race condition injection issues
2025-07-09 23:12:48 +02:00
booky10 5fb1a6c85e Write changelog to github output instead of stdout 2025-07-09 23:12:05 +02:00
retrooper 7e2ac525ac Merge pull request #1287 from booky10/feat/effect-wrapper
Add missing WrapperPlayServerEffect
2025-07-09 23:07:55 +02:00
booky10 7590d6f7de Fix missing loaders field for modrinth publishing 2025-07-09 22:58:24 +02:00
booky10 d7c2284ccb Add gradle preparation step to release workflow 2025-07-09 22:51:30 +02:00
booky10 84a0759288 Setup testing setup 2025-07-09 22:46:10 +02:00
booky10 0ca8e27fc8 Finish implementing release workflow 2025-07-09 22:43:04 +02:00
retrooper 5e30aef0a1 patch: correction of WORLD_BORDER wrapper 2025-07-09 21:26:31 +02:00
retrooper 9e53791fef patch: WrapperPlayServerWorldBorder exception fix for 1.8-1.11.2 2025-07-09 21:12:06 +02:00
booky10 8346918e86 Start implementing release automation workflow 2025-07-09 19:30:31 +02:00
booky10 7714c6253a Store dialog click event field as reference for names 2025-07-09 18:19:35 +02:00
booky10 0a00e970d7 Access ResourceKey location using fields instead of methods
Method order is sort-of unpredictable, my test in 1.21.4/1.21.6 resulted in the registry name being returned instead of the registry entry's name
2025-07-09 17:37:31 +02:00
retrooper d0dd8dc4cd patch: potentially fix SpigotConversionUtil#typeFromBukkitWorld for 1.17+ 2025-07-09 17:18:16 +02:00
booky10andjtJava bc01609828 Add missing WrapperPlayServerEffect
Based on https://github.com/retrooper/packetevents/pull/702

Fixes https://github.com/retrooper/packetevents/issues/415
Fixes https://github.com/retrooper/packetevents/pull/423

Co-authored-by: jtJava <ilovefuud@gmail.com>
2025-07-09 16:59:44 +02:00
booky10 c6e7bcb980 Remove useless zero-byte-suffix for chunk data
Mojang fixed the issue in 1.21.6, but we forgot to remove our fix too
2025-07-09 16:33:27 +02:00
booky10 8987194030 Fix changes to ChatMessage
Some small fixes to https://github.com/retrooper/packetevents/pull/1267

* Uses consistent version-specific gson serializer instead of platform-dependent one
* Uses component getters/setters instead of directly accessing field to allow for overrides to work
2025-07-09 15:52:45 +02:00
booky10 4495db796d Update comment in PlayerManagerImpl 2025-07-09 15:44:29 +02:00
booky10 e1a29a20a7 Small cleanup for listeners 2025-07-09 15:40:57 +02:00
booky10 bd5ef7cb30 Update to support paper's configuration api
Paper no longer creates the player object during the configuration phase, like vanilla
Also, paper has removed the early connection reference in the player object added by CraftBukkit in 1.20.5

PacketEvents now uses the pre-1.20.5 logic for extracting the player reference
As a result, all handshake/status/login/config packets won't have access to the player object;
play packets should always have the player set
2025-07-09 15:38:15 +02:00
booky10 36363c885c Merge branch '2.0' into fix/attempt-fixing-random-login-race-condition-injection-issues 2025-07-09 14:42:12 +02:00
retrooper a198f0e8d6 Merge pull request #1286 from retrooper/revert-1250-dev
Revert "Refactor TaskWrapper into interface and implementation classes"
2025-07-08 19:39:41 +02:00
retrooper 69cbe1e405 Revert "Refactor TaskWrapper into interface and implementation classes" 2025-07-08 19:39:19 +02:00
retrooper 2b0ec87da6 Merge pull request #1250 from ShortyDev/dev
Refactor TaskWrapper into interface and implementation classes
2025-07-08 14:46:55 +02:00
retrooper 08f95b8036 Merge branch '2.0' of https://github.com/retrooper/packetevents into 2.0 2025-07-08 14:34:42 +02:00
retrooper a15ad3a8d7 patch: typo, put actual code in comment; also removed previous sponsor of computational servers; 2025-07-08 14:34:35 +02:00
retrooper fef7f983b0 Merge pull request #1267 from iiAhmedYT/patch-1
Allow getting/setting json in ChatMessage
2025-07-08 14:27:57 +02:00
retrooper 71eae683fb Merge remote-tracking branch 'origin/2.0' into 2.0 2025-07-08 14:21:22 +02:00
retrooper f692f41025 patch: fix the plugin disabling on unsupported version check 2025-07-08 14:21:09 +02:00
retrooper 3b4acde6f8 Merge pull request #1273 from ineanto/2.0
feat: add RemoteChatSession getter
2025-07-08 14:13:17 +02:00
retrooper 6b14595582 patch: import optimization in spigot reflection util 2025-07-08 13:40:58 +02:00
retrooper 50c2a69449 patch: packetevents disables itself when running on an unsupported Minecraft version;
changing "packetevents 2.0 failed to inject" message;
2025-07-07 19:32:23 +02:00
Alexandr b62fc6922c Merge branch 'retrooper:2.0' into 2.0 2025-06-30 06:55:33 +03:00
Axionize cffc7750b9 Update comprehensive StateType test for 1.21.6/1.21.7 2025-06-29 22:34:12 -04:00
Axionize 838109ccd5 Cleaner Optimized Annotation Implementation 2025-06-29 22:23:59 -04:00
Axionize 67f413cc59 New Test Annotation Implementation 2025-06-29 22:23:59 -04:00
Axionize c498332c36 Add comprehensive test to ensure integrity of all StateType mappings and WrappedBlockStates 2025-06-29 22:23:55 -04:00
booky 1b5479f04f Merge pull request #1269 from HSGamer/2.0
correctly parse payload in WrapperCommonClientCustomClickAction
2025-06-29 17:20:13 +02:00
booky10 ac0041ff52 Read nbt end tags as null for custom click action packet 2025-06-29 17:13:25 +02:00
Luuzzi c6f129cdd3 added setData and getData to WrappedBlockState 2025-06-28 22:49:57 +03:00
ineanto 21226e6ac9 feat: add remote chat session getter via reflection 2025-06-28 21:41:46 +02:00
hsgamer b14f5f5031 correctly parse payload in WrapperCommonClientCustomClickAction
the payload is either an NBT or NBTEnd, but no boolean byte. So we don't have to check optional
close #1268
2025-06-27 13:22:11 +07:00
Ahmed Waleed 6ff9f8c401 Allow getting/setting json in ChatMessage 2025-06-27 02:04:00 +03:00
Luuzzi 22b28b7b35 1_7_10 -> 1_7_2. Also wrapper fixes 2025-06-26 23:23:17 +03:00
Luuzzi 9e7de426c0 fix incorrect shifts(get, set) in Chunk_v1_7 2025-06-26 13:17:53 +03:00
retrooper 77abb65bab Merge pull request #1264 from booky10/feat/1.21.7-support
1.21.7 support
2025-06-26 08:50:49 +02:00
Luuzzi a5188e5d78 added support for 1.7.2-1.7.5, seems it works fine 🤔 2025-06-26 07:03:53 +03:00
Luuzzi cce0ac2d7b fix spawn position for versions lower than 1.8 2025-06-26 06:27:49 +03:00
booky10andSteaf23 001f6b9fd7 Fix InputControl encoding
Co-authored-by: Steaf23 <steafmobile@gmail.com>
2025-06-26 03:44:27 +02:00
booky10 0395378726 Update registries for 1.21.7 2025-06-26 03:09:57 +02:00
booky10 31fe7a89d9 Add 1.21.7 protocol constants 2025-06-26 03:03:38 +02:00
booky d8b47495e4 Merge pull request #1258 from dawon/bugfix/fix-waypoint-info-types
Fix WaypointInfo types
2025-06-20 14:36:29 +02:00
Jakub Zacek cba4603ad8 Fix WaypointInfo types 2025-06-20 13:55:48 +02:00
booky10 f37c74d0d9 Convert PacketEventsEncoder to simple ChannelOutboundHandlerAdapter
This allows cancelling packets without throwing exceptions around

Fixes https://github.com/retrooper/packetevents/issues/1256
2025-06-19 19:34:27 +02:00
booky10 2085dfb84b Skip generating useless CancelPacketException stacktrace 2025-06-19 19:33:40 +02:00
booky10 cdad13d5c5 Fix WrapperPlayClientEntityAction actions for 1.21.6+
Fixes https://github.com/retrooper/packetevents/issues/1254
2025-06-19 19:12:35 +02:00
retrooper 95b50a44e9 Merge pull request #1255 from Cyramek/direction-fix 2025-06-19 17:30:31 +02:00
cyramek 78f630b5c1 fix direction vector being different from vanilla 2025-06-19 16:58:27 +02:00
retrooper 08d000ea82 Merge pull request #1234 from huanmeng-qwq/impl/advancements
Implement WrapperPlayServerUpdateAdvancements
2025-06-19 12:19:42 +02:00
booky10 28c4fdc7ce Merge branch '2.0' into fix/attempt-fixing-random-login-race-condition-injection-issues 2025-06-19 02:58:42 +02:00
booky10 96c81a69ae Fix compatibility with netty v4.0 (e.g. used by minecraft 1.8) 2025-06-19 02:58:21 +02:00
booky10 83720c6a81 Fix race condition on login for versions older than 1.20.5 2025-06-19 02:48:09 +02:00
booky10 c95acffab6 Resolve user in loginevent for 1.20.5+ 2025-06-19 02:01:37 +02:00
booky10 c2beb331f1 Implement support for resolving player connection through transferCookieConnection field
This makes it possible to get the connection info from a player object much sooner than otherwise
2025-06-19 01:57:07 +02:00
booky10 2667431ec9 Don't resolve entity id getter method by name 2025-06-18 23:19:23 +02:00
booky10 21ce0f4d34 Small cleanup to other advancement classes 2025-06-18 23:00:40 +02:00
booky10 21c1a7dfa8 Clean up Advancement class
- Removes version parameter from read method
- Convert comments to javadoc
- Add constructor for constructing Advancement without criteria list parameter
- Reorder getters/setters
2025-06-18 23:00:25 +02:00
booky10 518a995e8e Add abstraction class for criterion value in AdvancementProgress 2025-06-18 22:58:49 +02:00
booky10 e20e0854ab Remove unused ClientAsset 2025-06-18 22:58:28 +02:00
booky10 7c3cde51f0 Reformat WrapperPlayServerUpdateAdvancements
- Convert comments to javadoc
- Reorder getter/setter
- Don't make "showAdvancements" field nullable
2025-06-18 22:33:28 +02:00
booky10 cc18a7ad08 Don't register debug listener 2025-06-18 22:28:49 +02:00
booky10 35fa135e9e Fix formatting of Advancement/AdvancementDisplay 2025-06-18 22:26:52 +02:00
booky10 c68fe76156 Merge branch '2.0' into impl/advancements 2025-06-18 22:23:57 +02:00
retrooper 80846cfea2 Merge pull request #1247 from booky10/feat/1.21.6-support
1.21.6 support
2025-06-18 22:03:28 +02:00
retrooper 1a1b03c1f5 i'm not religious, but god bless aboookyrica 2025-06-18 22:01:26 +02:00
booky10 c411a1925b Also support void promises for sponge 2025-06-18 21:46:08 +02:00
booky10 d8b4f5b1b6 Account for void promises while writing on spigot platform 2025-06-18 21:37:16 +02:00
booky10 486c9a493a Add hydration block state property 2025-06-18 21:02:04 +02:00
booky10 b1ed98f53d Fix fabric connection error 2025-06-18 21:01:53 +02:00
ShortyDev ca8ca782fc refactor TaskWrapper into interface and implementation classes 2025-06-18 20:10:49 +02:00
booky10 c75f039c99 Update adventure to v4.23.0 2025-06-18 19:08:38 +02:00
booky10 c1324fe7fe Update adventure to v4.22.0 2025-06-17 18:06:52 +02:00
booky10 781d4a7c82 Add new ui sound category 2025-06-17 18:06:52 +02:00
retrooper 590479adda patch: ensure consistent naming of #getGameMode and #setGameMode 2025-06-17 16:48:37 +02:00
retrooper df2c50ccfc patch: ensure code can compile 2025-06-17 13:50:49 +02:00
retrooper f5b60ea3f2 feat: changed WrapperPlayServerUpdateAdvancements design; updated it to 1.21.5; relocated advancement classes to advancements folder; (requires some testing still) 2025-06-17 13:45:56 +02:00
booky10 c95194f147 Fix test errors 2025-06-16 05:16:03 +02:00
booky10 56a643f8d0 Implement item attribute display for 1.21.6 2025-06-16 04:54:42 +02:00
booky10 7daed688e0 Update equippable component to 1.21.6 2025-06-16 04:28:11 +02:00
booky10 f3782dffe1 Finish implement dialog bodies 2025-06-16 04:21:09 +02:00
booky10 b06063ebf7 Finish implement dialog inputs 2025-06-16 03:53:28 +02:00
booky10 6cb3d301d8 Finish implementing dialog types 2025-06-16 03:16:39 +02:00
booky10 1aab738dd5 Implement dialog actions 2025-06-16 02:44:07 +02:00
booky10 0aafad8b58 Some more dialog progress 2025-06-13 17:04:21 +02:00
huanmeng-qwq 910d77252e fix: Advancement#read & write 2025-06-13 21:59:52 +08:00
retrooper 524e6ca16d patch: added copyright notice to update advancements wrapper 2025-06-13 15:15:58 +02:00
retrooper 1aa88d05bf feat: more progress to WrapperPlayServerUpdateAdvancements; updating to 1.21.5 (incomplete) 2025-06-13 15:11:40 +02:00
huanmeng-qwq 70271f3694 update 2025-06-13 11:52:41 +08:00
booky10 62201ae3fa Start implementing dialogs 2025-06-11 17:55:36 +02:00
booky10 8ce56fc346 Quick fabric module update 2025-06-11 16:45:44 +02:00
booky10 8029fd1b4e Update block and item tags for 1.21.6 2025-06-11 16:39:27 +02:00
booky10 de19712dbb Add missing WrapperConfigServerPing 2025-06-11 16:33:12 +02:00
booky10 1d41037bdd Implement WrapperPlayClientChangeGameMode 2025-06-11 16:26:53 +02:00
booky10 a98b8c5604 Implement WrapperPlayServerWaypoint 2025-06-11 16:24:47 +02:00
booky10 7d5d2682b7 Implement waypoint api 2025-06-11 16:21:36 +02:00
booky10 2b5f8027f0 Implement new clientbound show dialog packet wrappers partially 2025-06-11 15:45:09 +02:00
booky10 1e37351b48 Implement new clientbound clear dialog packet wrappers 2025-06-11 15:40:49 +02:00
booky10 70c8aad74e Implement new serverbound custom click action packet wrappers 2025-06-11 15:38:03 +02:00
booky10 5527546f05 Update existing packet wrappers to 1.21.6 2025-06-11 15:18:56 +02:00
booky10 56671341ae Update packet type mappings for 1.21.6 2025-06-11 15:03:11 +02:00
booky10 41ea688ff3 Update registries for 1.21.6 2025-06-11 14:54:16 +02:00
booky10 004195144d Implement new cloud height for dimension types 2025-06-11 14:22:55 +02:00
booky10 962aefba17 Add new 1.21.6 version constants 2025-06-11 14:13:15 +02:00
huanmeng-qwq 88ec7a583d remove final modifier 2025-05-28 10:36:09 +08:00
huanmeng-qwq 2303d362d7 add setter 2025-05-28 10:32:34 +08:00
retrooper da0e95fa03 Merge pull request #1238 from booky10/fix/enchantment-refs
Fix issues with enchantment loading
2025-05-25 11:56:07 +02:00
booky10 c98bfad8b8 Merge branch '2.0' into fix/enchantment-refs 2025-05-25 04:59:33 +02:00
booky10 3dfb8389dc Bump gradle wrapper validation action to v4
I hope this fixes these random errors while building
2025-05-25 04:57:03 +02:00
booky10 7c74dd2e05 Allocate new buffer when re-encoding clientbound buffers with a limited capacity
Bungee now limits the maximum capacity of bytebufs, presumably because of https://github.com/SpigotMC/BungeeCord/commit/1279cca971b2d32b6bd75103d3a555fbbd629392

This now allocates a completely new bytebuf to ensure we don't run into the maximum bytebuf capacity

Fixes https://github.com/retrooper/packetevents/issues/1227
2025-05-25 04:56:21 +02:00
booky10 05eabbf667 Decode enchantment type exclusive set as mapped entity ref set on registry synchronization 2025-05-25 04:22:12 +02:00
booky10 d1cafe2bcc Resolve self-reference registry after adding entries to registry
Only relevant to enchantments for now
2025-05-25 03:57:49 +02:00
booky10 26078fcb59 Implement MappedEntityRefSet 2025-05-25 03:44:03 +02:00
booky10 3d602b9f96 Fix item reading/writing for 1.13/1.13.1
Just for future reference, so I don't have to remap + decompile these jars again:
* 1.12.2 logic: https://haste.pinofett.de/degt0ejhbr.java
* 1.13/1.13.1 logic: https://haste.pinofett.de/omr31l9mv9.java
* 1.13.2 logic: https://haste.pinofett.de/iul6y7vvny.java
2025-05-25 02:57:11 +02:00
huanmeng-qwq df4f9e425e update 2025-05-24 14:44:41 +08:00
huanmeng-qwq efb9766388 convert time to Optional 2025-05-23 18:17:27 +08:00
huanmeng-qwq ab0ad68d43 update 2025-05-23 18:12:38 +08:00
huanmeng-qwq 1be8db5ff4 update 2025-05-23 18:09:36 +08:00
huanmeng-qwq 1f68ee1f46 convert showAdvances to Optional 2025-05-23 18:00:13 +08:00
huanmeng-qwq e7c6ae4726 Implement WrapperPlayServerStatistics 2025-05-23 17:48:09 +08:00
huanmeng-qwq 5db1671895 Implement WrapperPlayServerUpdateAdvancements 2025-05-23 17:47:49 +08:00
retrooper 023a0da619 packetevents description change 2025-05-16 15:46:40 +02:00
retrooper 51863fa435 bump version to 2.8.1 snapshot 2025-05-15 15:20:19 +02:00
retrooper f46ec64e60 update: 2.8.0 release 2025-05-15 14:33:04 +02:00
retrooper f0d7a8e84d patch: fix tropical fish pattern mappings 2025-05-15 14:12:49 +02:00
retrooper ac4fac85ed Merge pull request #1220 from Loyisa/2.0
fix: minecraft:air isn't empty in <1.11
2025-05-14 23:49:46 +02:00
retrooper 8f274e0695 Merge pull request #1224 from Bram1903/fix/legacy-item-damage
Fixed: ItemStack#getDamageValue & ItemStack#setDamageValue
2025-05-14 13:03:45 +02:00
Bram cd0892ffe4 Fixed: ItemStack#getDamageValue & ItemStack#setDamageValue on version 1.12.2 and below 2025-05-11 20:42:43 +02:00
Loyisa f9398b58f7 fix: minecraft:air isn't empty in 1.8 2025-05-06 18:43:51 +08:00
booky10 9c9f5cf41d Fix missing saddle EquipmentSlotGroup 2025-05-03 17:50:21 +02:00
retrooper 5983395561 chore: update adventure to 4.21.0 (for 1.21.5 support) 2025-05-01 13:35:53 +02:00
retrooper 686bb4fd3f Merge pull request #1216 from Axionize/fix/teleport-flags
Fix Setting RelativeFlags
2025-05-01 13:31:24 +02:00
retrooper ff4ac7eefc Merge pull request #1162 from Rubenicos/fix/field-lookup
Fix recursive field lookup
2025-04-30 21:04:16 +02:00
retrooper 20b52fbcd9 Merge pull request #1212 from Beaness/patch-1
Add missing copy fields to spawn player wrapper
2025-04-30 21:01:33 +02:00
Axionize 424fd149e7 Fix setting relativeflags 2025-04-30 14:24:34 -04:00
Beanes e372f4f30a Add missing copy fields to spawn player wrapper 2025-04-28 21:11:59 +02:00
retrooper b520a2ea99 Merge pull request #1205 from booky10/feat/versioned-itemstacks
Add version and registry context to ItemStacks
2025-04-28 17:51:48 +02:00
booky10 4e4174b7d3 Add version and registry context to ItemStacks
As logic related to ItemStack has changed quite a lot throughout the versions, this now adds a version (and registry) field to ItemStacks
These fields are populated by packetevents automatically when reading ItemStacks

Using this new version, this properly updates the ItemStack api methods to how vanilla handles stuff now
Additionally, this should fix issues related to modern handling of item amounts breaking legacy negative stack sizes
(E.g. see https://github.com/retrooper/packetevents/pull/1192 and https://github.com/retrooper/packetevents/pull/1062)
2025-04-19 04:54:21 +02:00
booky10 0931f7c9e7 Merge remote-tracking branch 'upstream/2.0' into 2.0 2025-04-18 23:33:58 +02:00
booky10 4faf97cdb4 Increase bytebuf capacity when writing zero-byte-suffix for chunk data
See https://github.com/retrooper/packetevents/issues/1202#issuecomment-2816226784 for more info

Fixes #1202
2025-04-18 23:33:30 +02:00
booky 71fa7be70d Merge pull request #1158 from spring-dependency-management/spring-dependency-management-patch-1
Check classes before copying from last
2025-04-18 23:16:33 +02:00
booky a7cb0ce6bf Merge pull request #1177 from Axionize/refactor/eliminate-static-ProtocolManager-USERS-&-CHANNELS-use
Eliminate usage of static ProtocolManager fields which should be accessed on an instance basis
2025-04-18 20:03:04 +02:00
booky10 8fa1b820d4 Don't iterate over all channels when disconnecting a channel without a UUID 2025-04-18 19:09:01 +02:00
booky10 05f42bc9d5 Mark internal fields/methods as internal 2025-04-18 19:08:14 +02:00
booky10 b635dcbe54 Merge branch '2.0' into refactor/eliminate-static-ProtocolManager-USERS-&-CHANNELS-use 2025-04-18 19:01:42 +02:00
booky10 a1def4170c Check if last wrapper is an instance of this wrapper when copying 2025-04-18 18:59:02 +02:00
booky 53f1fc495b Merge pull request #1191 from Axionize/feat/runtime-obselete-annotation
Add new RuntimeObsolete annotation used for checking if a field is obsolete at runtime via reflection
2025-04-18 18:55:37 +02:00
booky10 17086d3017 Add registry #getByNameOrThrow/#getByIdOrThrow api 2025-04-18 18:30:56 +02:00
booky10 d604e9d6af Fix nbt encoding/decoding of MappedEntitySet tags 2025-04-18 18:25:56 +02:00
booky 76aba6fb8d Merge pull request #1159 from spring-dependency-management/spring-dependency-management-patch-2
Add getWrapperClass() to packet type
2025-04-18 18:04:37 +02:00
booky10 5e8ad3e6e2 Add missing wrapper class for structure block packet 2025-04-18 18:00:58 +02:00
booky10 2f780a22a0 Merge branch '2.0' into spring-dependency-management-patch-2 2025-04-18 17:57:47 +02:00
booky 7549b22604 Merge pull request #1192 from ManInMyVan/fix/itemstack-type-getter
make itemstack type getter always return type
2025-04-18 17:48:32 +02:00
booky 8083725b96 Merge pull request #1197 from Luuzzi/2.0
fixed a floating-point issue in .nbt files
2025-04-18 15:31:21 +02:00
booky 3e624ebde5 Merge pull request #1203 from Bram1903/fix/NullDisconnectLog
[Fix] Disconnected `null` due to invalid packet console log
2025-04-18 15:11:19 +02:00
booky 16f031c585 Merge pull request #1204 from MachineBreaker/patch-1
Remove server version check for SelectBundleItem selectedItemIndex check
2025-04-18 13:56:27 +02:00
MachineBreaker 32f7d0b68b Actually remove the version check since its useless 2025-04-18 07:35:36 -04:00
MachineBreaker 8a3a418d05 Use correct server version for SelectBundleItem selectedItemIndex check 2025-04-18 07:33:54 -04:00
Bram 3a76049868 Fixed: Disconnected null due to invalid packet 2025-04-18 13:06:57 +02:00
booky10 e7495c2e85 Remove ingredient from TrimMaterial for 1.21.5 2025-04-14 18:54:45 +02:00
booky10 a2726516b3 Fix 1.21.5 player chat message writing 2025-04-14 18:50:36 +02:00
booky10 bf57fef29c Remove template item from TrimPattern for 1.21.5 2025-04-14 18:06:43 +02:00
retrooper a9679cd5b2 Merge pull request #1199 from bridgelol/patch-1
chore: bump adventure to 4.20.0
2025-04-12 14:39:52 +02:00
Bridge 8e3eba761d chore: bump adventure to 4.20.0 2025-04-12 14:02:04 +02:00
retrooper b4ef9b90b9 patch: slight change to project description 2025-04-12 09:35:39 +02:00
Luuzzi b2ccbe0bed fixed a floating-point issue in .nbt files 2025-04-11 09:49:35 +03:00
ManInMyVan 1913c6603e make itemstack type getter always return type 2025-04-07 17:25:52 -06:00
Axionize 9eafaaab7d Add new RuntimeObsolete annotation used for checking if a field is obsolete at runtime via reflection 2025-04-07 18:05:40 -04:00
booky e672aa2b92 Merge pull request #1190 from retrooper/revert-1180-fix/fix-goat-horn-cooldown
Revert "Fix Goat Horn Cooldown"
2025-04-07 23:02:46 +02:00
retrooper 1ba1ec17fa Revert "Fix Goat Horn Cooldown" 2025-04-07 18:02:46 +02:00
booky10 288b0a5bed Fix instrument component for versions older than 1.21.5 2025-04-07 15:40:56 +02:00
booky10 2bc4056c9c Don't use MappedEntity instance for extracting TypesBuilderData when defining in registry
Fixes https://github.com/retrooper/packetevents/issues/1187
2025-04-07 15:28:31 +02:00
retrooper 1c0b85a689 Merge pull request #1180 from Axionize/fix/fix-goat-horn-cooldown
Fix Goat Horn Cooldown
2025-04-06 13:59:41 +02:00
retrooper 51e2538ea4 patch: slight changing of messaging 2025-04-06 13:36:12 +02:00
booky10 47645e4ea0 Fix backwards compatibility packet wrapper creation in chunk reader 2025-04-05 18:25:40 +02:00
booky10 5aa121db9a Update entity types to 1.21.5
Fixes https://github.com/retrooper/packetevents/issues/1186
2025-04-05 14:06:32 +02:00
spring-dependency-management c32300cd04 rebase on 1.21.5 2025-04-05 02:01:15 +01:00
retrooper 0d9b183ea1 feat: support earlier access of player object (as soon as JOIN_GAME packet) on spigot 2025-04-04 23:16:42 +02:00
retrooper a215fd9b4d add .kotlin from buildSrc to gitignore 2025-04-04 21:00:30 +02:00
retrooper 2ffb9335b3 Merge pull request #1174 from booky10/feat/1.21.5-support
1.21.5 support
2025-04-04 20:57:35 +02:00
retrooper d9ddf4e598 feat: bump version up to 2.8.0-SNAPSHOT 2025-04-04 20:52:14 +02:00
retrooper eb3b9593be patch: add missing copyright statement 2025-04-04 20:31:42 +02:00
booky e49b989025 Merge pull request #1139 from ytnoos/fix-wrappers
Fixed some wrappers
2025-04-01 14:37:40 +02:00
booky fdd7947728 Merge pull request #1171 from Axionize/fix/mark-embedded-channels-as-fake
Mark embedded channels as fake
2025-04-01 14:28:45 +02:00
booky cc4b69acf5 Merge pull request #1166 from ManInMyVan/fix/trial-spawner-requiresCorrectTool
fix trial spawner requiresCorrectTool
2025-04-01 14:27:37 +02:00
booky 3139282035 Merge pull request #1176 from ManInMyVan/fix/sus-gravel-sand-requiresCorrectTool
fix suspicious gravel and sand requiresCorrectTool
2025-04-01 14:26:38 +02:00
booky10 9a721c79d5 Don't write entity type tags below 1.14 2025-03-31 18:55:24 +02:00
booky10 5c4ccc544c Fix a lot of random registry issues 2025-03-31 18:47:52 +02:00
booky10 751b93c51f Setup registry registration check
Validates that all registry entries have been defined
2025-03-31 18:16:20 +02:00
booky10 1a0c9da630 Add more command argument type mappings 2025-03-31 18:02:45 +02:00
booky10 383a680a70 Fix legacy support for attributes 2025-03-31 17:47:40 +02:00
booky10 83e600c301 Fix Chunk_v1_9 writing on proxy 2025-03-31 17:41:25 +02:00
booky10 f69eb78aa4 Small legacy palette improvements 2025-03-31 17:41:11 +02:00
booky10 c046bd5a9d Use correct server version when reading/writing Chunk_v1_9
Fixes errors on proxies
2025-03-31 17:32:42 +02:00
booky10 8740a5ed0f Don't skip prefix of zero-bytes if it doesn't exist
Thanks ViaVersion!
2025-03-31 17:19:09 +02:00
booky10 9e89b0a5c7 Fix WrapperPlayServerTeams 1.21.5 reading 2025-03-31 17:15:07 +02:00
booky10 5b45f3c634 Fix entity data type names 2025-03-31 17:02:12 +02:00
booky10 a95250f4f7 Save bits per entry in data palette
If the amount of bits gets changed while constructing the palette, the storage would have the wrong length of data
Instead, be safe and get the amount of bits from the palette after its construction
2025-03-31 16:55:44 +02:00
booky10 fb31dab995 Small chunk palette cleanup
Also adds back proper resizing to block state list palettes
2025-03-31 16:32:18 +02:00
booky10 d3aba54f69 Handle 1.21.5 broken mojang zero byte suffix
See https://bugs.mojang.com/browse/MC-296121
2025-03-31 16:31:32 +02:00
booky10 e823e17f69 Fix hover event text reading 2025-03-31 15:40:02 +02:00
booky10 98e46dd38a Add remaining components types for 1.21.5 2025-03-31 15:08:43 +02:00
booky10 405caec719 Merge branch '2.0' into feat/1.21.5-support 2025-03-31 13:59:01 +02:00
booky10 c32b1b90b1 Default model type of chicken/cow/pig variants to normal 2025-03-31 13:58:10 +02:00
booky 2272315d83 Merge pull request #1181 from AoElite/conversion-fix
Keep block property order to fix conversions
2025-03-31 07:32:54 +02:00
AoElite dfd8eccf87 add a basic test for material conversions 2025-03-31 00:32:32 -04:00
AoElite b826fbc197 block data property order needs to be preserved 2025-03-31 00:32:27 -04:00
booky10 878c7a96d6 Update adventure nbt serializer to 1.21.5 2025-03-30 23:06:31 +02:00
booky10 3a1474c5a6 Add per-version adventure serializers
Required for changes done to click/hover events in 1.21.5
2025-03-30 22:45:40 +02:00
booky10 0f94fc8216 Fix unbreakable item component legacy handling 2025-03-30 21:50:41 +02:00
booky10 445893d664 Fix ItemEquippable reading for 1.21.5 2025-03-30 21:46:30 +02:00
booky10 e8cc99fa0d Add can_destroy_blocks_in_creative field to tool item component for 1.21.5 2025-03-30 21:45:51 +02:00
booky10 9948837294 Ensure base components get fully read 2025-03-30 21:40:38 +02:00
booky10 3e0191aa17 Remove chunk data palette length prefix for 1.21.5 2025-03-30 21:23:17 +02:00
booky10 8a3ee34e28 Small cleanup for chunk palette resizing 2025-03-30 21:10:45 +02:00
booky10 ae317c535b Merge remote-tracking branch 'origin/feat/1.21.5-support' into feat/1.21.5-support 2025-03-30 20:07:13 +02:00
booky10 2949af533f Refactor chunk data reading/writing
This deprecates NetStreamInput/NetStreamOutput as they just duplicate PacketWrapper api and do not carry as much context as a PacketWrapper, which is required for proper proxy support

This is a pretty big change to how chunk reading/writing currently works and should therefore be tested on a lot of versions
2025-03-30 20:05:20 +02:00
retrooper e90f377c61 patch: imports of certain test files were removed by ide (for some odd reason) 2025-03-30 19:26:12 +02:00
retrooper 088ded2190 patch: add forgotten copyright statements 2025-03-30 19:20:26 +02:00
Axionize 93a6e3f5ed Fix Goat Horn Cooldown
Cooldown Length: 7.0 seconds
Resource Group: minecraft:goat_horn
Encoded String: QOAAAAETbWluZWNyYWZ0OmdvYXRfaG9ybg==

See: https://github.com/retrooper/packetevents/pull/1180#issuecomment-2764633510
2025-03-30 12:37:35 -04:00
booky10 63a6b158eb Verify reader index change when reading length-prefixed item component patches 2025-03-30 16:25:52 +02:00
booky10 c471b691f7 Update smithing trim slot display to 1.21.5 2025-03-30 16:14:23 +02:00
booky10 b2c4bb8928 Add new test block related block entity types for 1.21.5 2025-03-30 15:53:48 +02:00
booky10 253d5f968e Merge branch '2.0' into feat/1.21.5-support 2025-03-30 14:47:46 +02:00
booky10andAxionize 533274fd45 Fix WrappedBlockState stringification
Co-authored-by: Axionize <154778082+axionize@users.noreply.github.com>

Closes #1179
2025-03-30 14:45:24 +02:00
booky10 4a35ebf7eb Bump fabric loom, parchment mappings and fabric loader 2025-03-30 05:21:26 +02:00
booky10 9dd45ffc48 Update gradle wrapper to v8.13 2025-03-30 05:16:36 +02:00
booky10 1e8bee4179 Fix workflow distribution config
This should've errored long ago, adopt is already gone since summer 2021
2025-03-30 05:08:53 +02:00
booky10 b367e1da91 Fix static mapped entity constructors 2025-03-30 05:03:41 +02:00
booky10 2808e35234 Add equipOnInteract field to equippable component 2025-03-30 04:59:41 +02:00
booky10 df7b69249b Correctly implement "EitherHolder" 2025-03-30 04:52:49 +02:00
booky10 6650ee5d64 Update tooltip show flag in remaining components 2025-03-30 04:23:03 +02:00
booky10 c75e137bd0 Add type parameter to EntityData
Yes, this is a compile-time breaking change
2025-03-30 04:15:31 +02:00
booky10 57d00aaa4e Update entity data serializers to 1.21.5 2025-03-30 04:11:11 +02:00
booky10 e8a95aeb8e Update wolf variant encoding to 1.21.5 2025-03-30 03:51:18 +02:00
booky10 2fcdce578d Fix wolf variant default registry 2025-03-30 03:46:09 +02:00
booky10 ac729a30e3 Implement cat variant registry 2025-03-30 03:43:34 +02:00
booky10 2b626d38b1 Fully implement pig, frog, cow and chicken variant registries 2025-03-30 03:41:02 +02:00
booky10 a5d3633088 Implement wolf sound variant registry 2025-03-30 03:17:05 +02:00
booky10 c79cea2b42 Add registry synchronization todos 2025-03-30 01:54:00 +01:00
booky10 9c4e438099 Add new 1.21.5 particle types 2025-03-30 01:51:19 +01:00
booky10 7572eeb5ca Add more new item components 2025-03-30 01:49:46 +01:00
booky10 b78f8369f4 Implement basic component matcher support for adventure predicate item component 2025-03-30 01:30:30 +01:00
booky10 881898d788 Add potion duration scale item component 2025-03-30 00:48:20 +01:00
booky10 c355dbf1fc Add blocks attack item component 2025-03-30 00:47:48 +01:00
booky10 17262757ce Add weapon component 2025-03-30 00:30:19 +01:00
booky10 e890fcd7e5 Add new tooltip display component 2025-03-30 00:23:25 +01:00
booky10 90ff84471f Update unbreakable data component 2025-03-30 00:12:26 +01:00
booky10 963643bdeb Update creative inventory item packet to 1.21.5 2025-03-30 00:00:30 +01:00
booky10 12c2c307eb Implement length-prefixed item data component serialization 2025-03-29 23:57:46 +01:00
booky10 a4fefad9e6 Refactor item stack serialization to separate class 2025-03-29 23:15:29 +01:00
booky10 9bb7b6e458 Update WrapperPlayClientClickWindow to 1.21.5 2025-03-29 22:44:27 +01:00
booky10 18ed3fb529 Add initial HashedStack structure 2025-03-29 22:44:21 +01:00
booky10 6c70181d77 Implement support for new heightmap encoding in 1.21.5 2025-03-29 22:16:19 +01:00
booky10 ed848d93d3 Add WrapperPlayServerTestInstanceBlockStatus 2025-03-29 21:58:22 +01:00
booky10 db30205fa6 Add WrapperPlayClientSetStructureBlock 2025-03-29 21:54:08 +01:00
booky10 d33cb38f15 Add new 1.21.5 block state properties 2025-03-29 21:38:04 +01:00
booky10 1371809b37 Update sound events to 1.21.5 2025-03-29 21:29:37 +01:00
booky10 3a24bed6fb Update item tags for 1.21.5 2025-03-29 21:24:52 +01:00
booky10 ab5f4ee049 Update block tags for 1.21.5 2025-03-29 21:24:48 +01:00
booky10 da8bdd9384 Add new 1.21.5 state type constants 2025-03-29 21:16:57 +01:00
booky10 7e398fe45a Add new 1.21.5 item type constants 2025-03-29 21:16:53 +01:00
booky10 1f6314a262 Update item type base components 2025-03-29 21:10:17 +01:00
booky10 2c238c251e Update block state mappings 2025-03-29 21:10:09 +01:00
booky10 0018d60f9c Merge branch '2.0' into feat/1.21.5-support 2025-03-29 20:36:56 +01:00
booky10andAmmo f9670a71b1 Update last seen messages to 1.21.5
Co-authored-by: Ammo <ammo@slne.dev>
2025-03-29 20:36:32 +01:00
booky10 bede82c866 Add some more javadoc comments regarding new 1.21.5 additions 2025-03-29 20:35:20 +01:00
Ammo d5cca6490f feat: Update clientbound player team packet to use enums for name tag visibility and collision rule 2025-03-29 20:31:12 +01:00
Ammo 8f920cd6cc feat: Validate selectedItemIndex in WrapperPlayClientSelectBundleItem 2025-03-29 20:26:39 +01:00
Ammo 06eb3f4b90 chore: Update Minecraft version to 1.21.5 in gradle.properties of fabric to have access to nms classes 2025-03-29 20:24:53 +01:00
booky10 e57002768b Finish WrapperPlayClientTestInstanceBlockAction 2025-03-29 20:23:39 +01:00
booky10 a85de1cef2 Small chat message read/write cleanup 2025-03-29 20:23:33 +01:00
Axionize 39d45d8d1f Remove usage of direct external/public static references to ProtocolManager.CHANNELS and ProtocolManager.USERS
Fields will remain accessible for backwards compatibility in the unlikely case of a developer meddling these values in their own code.

All usage of both these fields is now wrapped in interface methods which can be overwritten by other ProtocolManagers.
2025-03-29 03:56:34 -04:00
retrooper 1bb6268a62 feat: add support for 1.21.5 in chat message packet 2025-03-28 20:46:53 +01:00
retrooper 4c87f3fce1 feat: set test block wrapper added 2025-03-28 20:12:49 +01:00
retrooper 86358c3fe9 Merge pull request #1148 from booky10/feat/lazy-loaded-registries
Registry cleanup and lazy-loaded block state mappings
2025-03-28 19:33:33 +01:00
ManInMyVan 34846df85b fix suspicious gravel and sand requiresCorrectTool 2025-03-27 20:19:04 -06:00
booky10 5b214e4187 Add 1.21.5 resource_selector command argument parser 2025-03-25 21:03:35 +01:00
booky10 5280f26e00 Setup 1.21.5 packet ids 2025-03-25 21:00:31 +01:00
booky10 8226aed28e Add 1.21.5 client and server version constants 2025-03-25 20:39:05 +01:00
Axionize ec4496f837 Add EmbeddedChannel as a FakeChannel name
- This prevents Carpet mod players from not fully existing/being invisible
- EmbeddedChannel is a standard netty channel used to mock/simulate a netty channel, and isn't used for actual player connections on any platform
2025-03-23 03:54:36 -04:00
booky10 91730fdb46 Add javadoc to User#getConnectionState
See https://github.com/retrooper/packetevents/issues/1170
2025-03-19 20:18:19 +01:00
ytnoos c892a15c5a Fixed write for 1.7 WrapperPlayClientTabComplete 2025-03-16 14:15:39 +01:00
ytnoos 2fc6613df0 Added WrapperPlayClientEditBook setters 2025-03-16 14:15:11 +01:00
ytnoos cf0a3115f0 Merge remote-tracking branch 'upstream/2.0' into fix-wrappers 2025-03-16 14:12:42 +01:00
ManInMyVan 513b970c4d fix trial spawner requiresCorrectTool 2025-03-14 11:59:52 -06:00
Rubén 2b03bbce7c Fix recursive field lookup 2025-03-08 12:14:06 -06:00
spring-dependency-management 319568d92a oops 2025-03-06 19:10:27 +00:00
spring-dependency-management f666047ae5 Some missing oops 2025-03-06 16:56:13 +00:00
spring-dependency-management e86beec90f add interface 2025-03-06 16:55:55 +00:00
spring-dependency-management 3d416fc961 Add getWrapperClass() to packet type 2025-03-06 16:47:50 +00:00
spring-dependency-management 2cd2f5d7f9 Check classes before copying 2025-03-06 15:35:31 +00:00
booky10 688e32d9a6 Merge branch '2.0' into feat/lazy-loaded-registries 2025-03-02 19:01:45 +01:00
booky ef49276809 Merge pull request #1155 from booky10/fix/bungee-injection-v2
Support bungee's new combined compressor
2025-03-02 19:00:13 +01:00
booky a3116dc2a6 Merge pull request #1149 from Axionize/fix/fabric-call-user-login-event
Fire UserJoinEvent() on Fabric
2025-03-02 18:57:54 +01:00
booky 3fda55bc39 Merge pull request #1134 from Axionize/fix/painting-registry-id-mappigns
Make PE painting IDs consistent
2025-03-02 18:54:59 +01:00
booky f78294afb4 Merge pull request #1140 from ytnoos/exceptiong-handling
Improved exception handling
2025-03-02 18:47:42 +01:00
booky 0a30904217 Merge pull request #1138 from ytnoos/propagate-exception
Propagate exception while reading NBT
2025-03-02 18:42:10 +01:00
booky 8a1506ee53 Merge pull request #1135 from Axionize/feat/cache-values-of-direction-for-fast-int-to-enum
Add new methods to Direction Enum and optimize by caching values array
2025-03-02 18:39:25 +01:00
booky10 795798de41 Read any number tag as enchantment level
Previously, packetevents would have only parsed shorts as the enchantment level
2025-03-02 18:30:56 +01:00
booky10 fed7c147d8 Support bungee's new combined compressor
See: https://github.com/SpigotMC/BungeeCord/commit/774a6fd68c8fbbb99b6bbe8c0060820f8c3b059e

Bungee combined both the frame encoder and the compressor, which makes handling compression a lot easier
This should still support both the old and the new compression setup
2025-03-02 03:39:00 +01:00
booky10 5cdb80c002 Account for null in-flight connection in velocity
Fixes https://github.com/retrooper/packetevents/issues/1142
2025-02-28 22:46:29 +01:00
booky10 57add57796 Try to do less server version lookups
Every call to do a server version lookup will return an invalid value for proxy servers
2025-02-28 22:45:18 +01:00
Axionize f7a72713e1 Fire UserJoinEvent() on Fabric 2025-02-28 15:27:55 -05:00
booky10 2c0a5346f4 Fix error when trying to load mappings for invalid mapping version 2025-02-28 20:47:15 +01:00
booky10 3627cd4d5a Reset reader index before resetting writer index
The writer index can't be smaller than the reader index according to netty buffers
2025-02-28 20:03:48 +01:00
booky10 6f39702af7 Ensure mapping data gets unloaded from all registries via test 2025-02-28 20:01:23 +01:00
booky10 fe316a4368 Small refactor to ClassStructureTest 2025-02-28 19:49:27 +01:00
booky10 e026ef8181 Move anonymous map decoration type class implementation to outer class 2025-02-28 19:39:54 +01:00
booky10 d9e78b71a6 Convert hard-coded villager professions to a registry 2025-02-28 19:36:49 +01:00
booky10 92fc265333 Convert hard-coded score format types to a registry 2025-02-28 19:32:56 +01:00
booky10 d75137fe5f Convert hard-coded villager types to a registry 2025-02-28 17:55:38 +01:00
booky10 3d90acad8e Fix class structure of mapped entity implementations 2025-02-28 17:48:03 +01:00
booky10 dc3c168d84 Implement class structure test
This ensures consistent usage of annotations and common method/field names for registry-related stuff
2025-02-28 17:47:01 +01:00
booky10 8a5d4fc3e0 Use a single buffer for parsing an item component map 2025-02-28 16:35:02 +01:00
booky10 8cbfde0c3f Convert particle types to a registry 2025-02-28 16:26:20 +01:00
booky10 9dc5908c5e Fix mapping file names in remaining registries 2025-02-28 16:17:29 +01:00
booky10 3bdab06db4 Convert sound events to a registry 2025-02-28 16:15:56 +01:00
booky10 e08b5f69bf Convert legacy recipe serializers to a registry 2025-02-28 16:12:22 +01:00
booky10 f6e76b65b6 Convert potions to a registry 2025-02-28 16:08:39 +01:00
booky10 bbf8749f1e Convert position source types to a registry 2025-02-28 16:06:50 +01:00
booky10 d4f7f64fc6 Convert entity types to a registry
Also refactor entity type instance checking logic
2025-02-27 22:53:43 +01:00
booky10 4a9cd4b8aa Convert entity data types to a registry
Also refactor reader/writer handling logic
2025-02-27 21:08:13 +01:00
booky10 83ae030352 Convert state types to a registry 2025-02-27 19:00:54 +01:00
booky10 88b3b00c43 Convert command argument parsers to a registry 2025-02-27 18:51:19 +01:00
booky10 3b9c3632ad Implement new item base components storage format 2025-02-27 18:47:09 +01:00
booky10 e8a8f0d0a3 Implement new mappings storage format for data mappings 2025-02-27 18:37:52 +01:00
booky10 113b4a84c2 Refactor how mappings are stored
These changes were done to split the block state mappings up into multiple files to prevent lazy-loading having to skip over the entire file for modern versions and to align mapping file names with vanilla registry names

Additionally, this also splits item base components into multiple files to prepare for lazy loading them too, as they will probably also constantly grow in size with each new release
2025-02-27 18:27:03 +01:00
booky10 a9a6c11402 Move each mappings file to a separate directory 2025-02-27 16:41:38 +01:00
booky10 2cb427e06d Small refactor for state data cache map 2025-02-24 17:56:17 +01:00
booky10 22bea4e7b0 Ensure loading of WrappedBlockState on all platforms 2025-02-24 17:43:13 +01:00
booky10 6703db2528 Add system property to force eager loading of all block state mappings 2025-02-24 17:41:21 +01:00
booky10 44223018b0 Implement lazy loading of block state mappings 2025-02-24 17:30:34 +01:00
booky10 d7b677c4db Convert block state map-in-map to map-in-array 2025-02-24 15:56:42 +01:00
retrooper e531e434b6 updated velocity to 3.4.0-SNAPSHOT, fixing build errors 2025-02-17 11:33:27 +01:00
booky10 97dcbc606e Fix login packet fields being read in wrong order
Fixes #1086
2025-02-13 16:11:18 +01:00
Axionize 4d55df1569 Add getting method for VALUES array and makes it private 2025-02-13 07:51:17 -05:00
ytnoos a028653207 Invert handshaking state check 2025-02-12 14:36:50 +01:00
Axionize 0d92230183 Add new methods to Direction enum and optimize by caching values array 2025-02-12 08:34:47 -05:00
ytnoos 5c6c41e62f Improved excpetiong handling 2025-02-12 12:51:43 +01:00
ytnoos 88ff380bbd Fixed WrapperPlayClientEditBook for <1.17.1 2025-02-12 12:31:30 +01:00
ytnoos 8dd207ccec Fixed WrapperPlayClientTabComplete for 1.7 2025-02-12 12:24:26 +01:00
ytnoos 73426fb7bf Propagate exception while reading NBT 2025-02-12 12:23:09 +01:00
Axionize 3f13e4374a Make PE painting IDs consistent
Modern Minecraft sends paintings over the network with ids not representing registration order, but rather alphabetical order.

This commit reorders the painting mappings to all be done in alphabetical order so the index IDs match up with vanilla.
2025-02-10 17:48:44 -05:00
retrooper 478a3e56c3 Merge pull request #1128 from booky10/feat/more-packet-user-utils
Add missing send/write/receive packet utils to User
2025-01-31 23:52:31 +01:00
booky10 699594090a Add missing send/write/receive packet utils to User 2025-01-31 12:09:34 +01:00
booky10 2a137b0059 Fix potted eye blossom blocking/solid flags 2025-01-23 15:32:11 +01:00
booky10 81c53d3c4c Mark resin brick wall as "shape exceeds cube" 2025-01-23 15:30:37 +01:00
booky c824f9c835 Merge pull request #1108 from spring-dependency-management/fix-fence
Fix pale oak materials
2025-01-23 14:44:07 +01:00
booky10 e1df40710e Fix incorrect shadow color deserialization/serialization
Previously, packetevents expected shadow color to be serialized as a hex string
Vanilla serializes shadow colors as a single integer instead
2025-01-18 20:13:45 +01:00
booky 6507a73042 Merge pull request #1110 from AoElite/2.0
add method to user to write packets silently
2025-01-12 03:09:12 +01:00
AoElite 6a99936110 add method to user to write packets silently 2025-01-11 21:04:04 -05:00
spring-dependency-management 93441ece77 Fix sapling, hanging sign, button, and moss carpet 2025-01-07 23:56:34 +00:00
spring-dependency-management f5776682ce Fix pale oak hanging sign 2025-01-07 23:49:35 +00:00
spring-dependency-management be264f3d81 Fix pale oak wall sign 2025-01-07 23:48:07 +00:00
spring-dependency-management 8fcef1d834 Fix pale oak sign 2025-01-07 23:46:55 +00:00
spring-dependency-management 8210bb32da Sapling is of type plant, not wood 2025-01-07 23:43:30 +00:00
spring-dependency-management 8b3ddb7b47 Fix pale oak pressure plate 2025-01-07 23:39:02 +00:00
spring-dependency-management dcb3e5e1cd .isShapeExceedsCube(true) for pale oak 2025-01-07 23:35:05 +00:00
retrooper 3d2a872de1 Merge pull request #1105
Keep Alive Version Check from V_1_12 to V_1_12_2
2025-01-06 00:25:07 +01:00
retrooper 61f5158279 patch: version check correction in WrapperPlayServerKeepAlive 2025-01-06 00:21:45 +01:00
scienziato1pazzo ce481cfdb0 fixed keep alive 2025-01-04 00:01:55 +01:00
retrooper 3d5c294f64 update wiki vg link 2024-12-23 20:03:14 +01:00
retrooper 4f0678d782 Merge pull request #1098 from divinepablo/patch-1
Update protocol link
2024-12-23 20:02:07 +01:00
divine 9b1f7a372c Update protocol link
wiki.vg merged with minecraft.wiki
2024-12-23 12:33:31 -05:00
retrooper 9a1ee3d888 update to adventure 4.18.0 2024-12-23 10:34:20 +01:00
retrooper 4f20680d5b Revert "Temporarily revert shadow color support"
This reverts commit 0be838c58f.
2024-12-23 10:20:31 +01:00
retrooper dd5a25eb66 Merge pull request #1097 from HaHaWTH/fix/folia-scheduling 2024-12-23 00:20:29 +01:00
HaHaWTH 3a3f8c498c Use correct scheduler for tasks
In some rare cases, player may be teleported during join and kick will fail
2024-12-22 13:55:28 -08:00
booky f603b49a3e Merge pull request #1053 from Axionize/fix-legacy-grass-and-tallgrass-mappings
Fix legacy mappings for grass and tallgrass variants
2024-12-22 06:34:54 +01:00
booky 52e182e7f0 Merge pull request #1058 from ManInMyVan/player-digging-face-id
add faceid to WrapperPlayClientPlayerDigging
2024-12-22 06:29:59 +01:00
booky10 7cc925120e Add some missing entity type ids for 1.8 through 1.11 2024-12-22 05:57:15 +01:00
booky10 603cb07c27 Fix wrong skeleton entity type id for versions older than 1.11
Fixes #1068
2024-12-22 05:57:14 +01:00
booky 7b5019ba87 Merge pull request #1047 from Axionize/coral-tags
Extend coral plant blocktags
2024-12-22 05:21:26 +01:00
libraryaddictandbooky10 40f6b2fca4 Fix incorrect sound mappings for 1.19.4
Closes #1059

I didn't merge the original PR as it breaks sound mappings for 1.19.3

Co-authored-by: booky10 <boooky10@gmail.com>
2024-12-22 05:15:35 +01:00
booky10 1e50c5d6cb Fix jukebox playable item component reading/writing
Packetevents didn't account for a jukebox song referring to a registry entry and always assumed it was an inlined jukebox song

See https://github.com/GrimAnticheat/Grim/issues/1892
2024-12-18 20:44:44 +01:00
booky10 d46db268f8 Fix damage event packet wrapper not using network synchronized registries 2024-12-16 20:16:59 +01:00
retrooper 8f5b549b84 bump version up to 2.7.1 snapshot 2024-12-10 22:47:54 +01:00
retrooper 476c61ed47 bump version up to 2.7.0 release 2024-12-10 21:34:52 +01:00
retrooper 4b6bfbc08b Merge pull request #1085 from booky10/workaround/revert-shadow-color-support
Temporarily revert shadow color support
2024-12-10 20:52:44 +01:00
booky10 0be838c58f Temporarily revert shadow color support
Will be un-reverted when adventure v4.18.0 gets released
2024-12-10 20:32:19 +01:00
Axionize 770a9cd996 Fix CORAL_PLANTS blocktag and add new ALIVE_CORAL_PLANTS and DEAD_CORAL_PLANTS blocktags 2024-12-07 02:37:53 -05:00
Axionize 6afe377b55 Fix legacy mappings for shortgrass item returning tallgrass 2024-12-07 02:33:57 -05:00
Axionize fad73d2814 Fix legacy mappings for grass and tallgrass variants 2024-12-07 02:33:32 -05:00
booky10 d6c81f32cd Fix shadow color adventure support check 2024-12-04 18:03:46 +01:00
booky10 5d2104dd91 Merge pull request #1076 from mfnalex/feat/fix-npe-nbtinterpret
fix NPE for nbtInterpret
2024-12-04 18:00:55 +01:00
retrooper 969ce9d6a3 Merge pull request #1081 from Tecnio/2.0
bugfix: Added input validation for window click
2024-12-04 16:37:18 +01:00
Tecnio 55b456cb95 bugfix: Added input validation for window click 2024-12-04 18:34:40 +03:00
booky10 062ffc18f9 Merge pull request #1078 from AoElite/biomefix
fix npe if music tag isn't present on older versions
2024-12-04 12:32:42 +01:00
AoElite 95cbd40655 fix npe if music tag isn't present on older versions 2024-12-04 05:38:55 -05:00
retrooper 70d94137dd Merge pull request #1049 from booky10/feat/1.21.4-support
1.21.4 support
2024-12-03 22:50:55 +01:00
mfnalex bbea70d1db fix NPE for nbtInterpret 2024-12-03 20:23:31 +01:00
booky10 b5e5b752a4 Bump fabric version info 2024-12-03 18:42:39 +01:00
retrooper 28b4dd8e08 bump version up to 2.7.0 SNAPSHOT 2024-12-03 18:33:07 +01:00
retrooper 1ae92a8b9d correction to comments mistakenly referring to 1.21.5 2024-12-03 17:57:29 +01:00
booky10 00bbea33f6 Bump fabric minecraft version to 1.21.4-rc3 2024-12-02 23:10:59 +01:00
booky10 3fd3c397a6 Rename attribute constants to remove "type" prefix 2024-12-02 22:56:33 +01:00
booky10 f1f95a0aac Fix name of equipment asset mapping file reference 2024-12-02 22:20:25 +01:00
booky10 6e90a3e376 Update serverbound packet type mappings 2024-12-02 22:05:26 +01:00
booky10 41d51453a5 Update mappings for all changed registries 2024-12-02 22:01:06 +01:00
booky10andBeanes c74f8b2559 Add precision loss fix while writing, not while reading
This fixes *slightly* incorrect velocity values being provided in the wrapper, while still writing the correct short value

Co-authored-by: Beanes <sikyserver@gmail.com>
2024-12-02 21:45:35 +01:00
booky10 be2eb6a8ce Update generated block tags and item tags 2024-12-02 21:40:45 +01:00
Beanesandbooky10 9819db60cd Work around loss of precision when unpacking entity velocity
Solution was discussed on discord (https://discord.com/channels/721686193061888071/721686193515003966/1313231483225378946)

Closes #1074

Co-authored-by: booky10 <boooky10@gmail.com>
2024-12-02 21:26:55 +01:00
booky10 2a86e0d355 Update trim material structure to 1.21.4 2024-12-02 21:05:12 +01:00
booky10 4a209a342e Update biome music nbt structure to 1.21.4 2024-12-02 20:46:22 +01:00
booky10 33e5b58e3b Update custom model data component to 1.21.4 2024-12-02 20:21:21 +01:00
booky10 fd11bd24a9 Add new player loaded packet type and wrapper 2024-11-30 12:48:06 +01:00
booky10 8c1f14de57 Add wrappers for new pick item packets 2024-11-30 12:46:27 +01:00
booky10 bc615355c8 Add 1.21.4 serverbound packet type constants 2024-11-30 12:42:02 +01:00
booky10 28730806f9 Small javadoc notice for ParticleTrailData duration 2024-11-29 15:23:31 +01:00
booky10 4ec975fcd1 Update block state properties to 1.21.4 2024-11-29 15:20:55 +01:00
booky10 b6ce588e10 Add new item consumable use animation 2024-11-29 15:17:13 +01:00
booky10 a1510b5f6d Update equippable item component 2024-11-29 15:15:58 +01:00
booky10 913d527a64 Mark creaking transient entity type as obsolete 2024-11-29 15:13:51 +01:00
booky10 a1e250b521 Add new sound constants 2024-11-29 15:13:18 +01:00
booky10 887c107216 Add resin trim material constant 2024-11-29 15:12:15 +01:00
booky10 b6fb699a27 Add onground flag to WrapperPlayClientVehicleMove 2024-11-29 15:09:19 +01:00
booky10 575aa4619c Add initial support for shadow colors in component styles 2024-11-29 15:07:06 +01:00
booky10 3f787c0e35 Update particle types to 1.21.4 2024-11-29 14:41:37 +01:00
retrooper a0fc7f6978 Merge pull request #1065 from rafi67000/missingServerVersion
Add missing ServerVersion.V_1_9_1
2024-11-25 17:32:54 +01:00
rafi67000 2cd069ea72 Add missing ServerVersion.V_1_9_1 2024-11-24 22:13:00 +01:00
retrooper d4b4b24e3c WrapperPlayServerResourcePackSend#setPrompt added 2024-11-17 16:35:30 +01:00
retrooper dca7daec04 Merge pull request #1044 from ShreyasAyyengar/2.0
fix: NPC objects to have unique server team names.
2024-11-14 19:43:35 +01:00
booky10 b686eb467f Fix javadoc warnings 2024-11-13 15:16:01 +01:00
booky10 d1f0618c0e Merge branch '2.0' into feat/1.21.4-support 2024-11-13 14:28:59 +01:00
Shreyas Ayyengar ce06511b52 fix: initial team name not longer than 16 characters. 2024-11-11 14:41:56 -08:00
Shreyas Ayyengar a2b0c0f28e fix: truncate team name for versions older than V_1_18 2024-11-10 10:13:20 -08:00
ManInMyVan 0666097934 add faceid to WrapperPlayClientPlayerDigging 2024-11-08 16:52:35 -07:00
retrooper da71044fc4 rename BlockFace#getHorizontalId to adhere to naming convention 2024-11-08 14:47:41 +01:00
booky10 4167c949fe Merge pull request #1048 from Axionize/blockface-get-horizontal
add getHorizontalID
2024-11-07 16:02:57 +01:00
booky10 6f490a7e93 Merge pull request #1057 from booky10/fix/potion-contents-component
Fix potion contents item component for 1.21.2/1.21.3
2024-11-07 16:01:51 +01:00
booky10 b14dfc710a Fix potion contents item component for 1.21.2/1.21.3 2024-11-06 23:36:07 +01:00
You 1877bae091 add getHorizontalID 2024-11-04 22:27:29 -05:00
retrooper 4cf7069254 Bump version up to 2.6.1-SNAPSHOT 2024-11-03 21:31:26 +01:00
retrooper d4c89ebff0 Final javadoc update 2024-11-03 20:35:26 +01:00
retrooper f58005a412 Update javadoc overview 2024-11-03 20:34:07 +01:00
retrooper 382931f4f8 Merge pull request #1050 from booky10/fix/sponge-artifact-upload
Fix sponge artifacts not getting uploaded
2024-11-03 20:32:44 +01:00
booky10 7be5b84b5d Fix sponge artifacts not getting uploaded 2024-11-03 20:31:53 +01:00
retrooper 0db35d3bd7 Stable release of 2.6.0 2024-11-03 20:22:12 +01:00
booky10 6e2da40aa5 Update block and item tags for 24w44a 2024-11-03 18:37:18 +01:00
booky10 dae7c2e90b Update item types for 24w44a 2024-11-03 18:37:11 +01:00
booky10 04db0ba88d Update state types for 24w44a 2024-11-03 18:37:06 +01:00
retrooper 9680bc77b3 relocate bstats in shadowNoAdventure task. 2024-11-02 22:53:43 +01:00
retrooper 85c0d3d9d3 Merge pull request #1018 from AbhigyaKrishna/2.0
Introduce a jar task to build without adventure dependencies
2024-11-02 22:46:38 +01:00
booky10 b348af9581 Update WrapperPlayServerHeldItemChange to 24w44a 2024-10-30 15:23:16 +01:00
booky10 aedb43b487 Update WrapperPlayServerPlayerInfoUpdate to 24w44a 2024-10-30 15:21:07 +01:00
booky10 3b86806d8e Update WrapperPlayServerParticle to 24w44a 2024-10-30 15:17:18 +01:00
booky10 c4cc09d8e0 Add 1.21.4 version constants 2024-10-30 15:14:51 +01:00
Shreyas Ayyengar 1a3b2471b3 refactor: add get/set for teamName 2024-10-28 11:19:55 -07:00
ShreyasAyyengar 3a004572c1 fix: NPC objects to have unique server team names. 2024-10-29 01:59:16 +08:00
retrooper feabf561c5 Merge pull request #1043 from booky10/fix/block-state-mapping-indexes
Fix block state mapping indexes
2024-10-28 17:16:12 +01:00
retrooper 5247ccd129 Add support for 1.16.1 join game codec (fix error) 2024-10-28 17:03:05 +01:00
booky10 c77390b86c Implement more dynamic wrapped block state mapping indexes 2024-10-28 15:52:11 +01:00
booky10 8ecad1f93e Introduce static field for legacy mapping index 2024-10-28 15:41:26 +01:00
booky10 dae82c4d65 Fix legacy mapping index being broken 2024-10-28 15:40:17 +01:00
booky10 8f8cc8ac43 Removed left over debug code from fabric module refactor 2024-10-28 14:46:50 +01:00
retrooper f66626ae74 Merge pull request #1042 from booky10/fix/bstats-shadow-issues
Include relocated bstats classes in published shadow jar
2024-10-28 14:43:30 +01:00
booky10 4ffcbcad91 Include relocated bstats classes in published shadow jar
This moves bstats dependencies to a separate gradle dependency configuration, which is always shadowed and used in compile classpath
2024-10-28 14:41:31 +01:00
booky10 fc31b7de7b Merge pull request #1032 from booky10/fix/fabric-module
Fabric module refactor
2024-10-27 05:09:00 +01:00
booky10 c24f2d7849 Re-add deprecated FabricPacketEventsBuilder for some backwards compatibility 2024-10-27 03:04:21 +01:00
booky10 b316f54fd8 Simplify platform-specific pre launch entrypoint handler logic 2024-10-27 02:58:42 +01:00
booky10 2fda301027 Load packetevents api instance on prelaunch 2024-10-27 02:57:56 +01:00
booky10 9e6f3fbb2a Fix channel to user association in fabric module 2024-10-27 02:50:01 +02:00
booky10 980d306100 Bump fabric loom to v1.8.11 2024-10-27 01:46:15 +02:00
booky10 9d4a44b403 Merge branch '2.0' into fix/fabric-module 2024-10-27 01:46:04 +02:00
booky10 52d92e6c1a Merge pull request #975 from booky10/feat/1.21.2-update
1.21.2/1.21.3 update
2024-10-27 01:43:19 +02:00
booky10 0a96edb1bb Merge pull request #1034 from booky10/fix/slime-paper-support
Fix support for unsafe entity id getter on AdvancedSlimePaper
2024-10-27 01:37:04 +02:00
booky10 3ced349018 Merge pull request #1028 from Bram1903/feat/bStatsUpdate
[Feat] bStats Sponge Support
2024-10-27 00:49:16 +02:00
booky10 9649c99f90 Merge branch '2.0' into feat/bStatsUpdate 2024-10-27 00:49:01 +02:00
booky10 0b587d398d Merge pull request #1022 from rafi67000/gradleUpdate
Update gradle
2024-10-27 00:47:50 +02:00
booky10 47eaa1d1ca Add accesswidener to fabric.mod.json 2024-10-27 00:38:52 +02:00
booky10 cbd170729d Bump version up to 2.6.0-SNAPSHOT 2024-10-27 00:30:45 +02:00
rafi67000 6997bb4615 Revert "Update loom"
This reverts commit 76ea2aa665.
2024-10-25 19:55:17 +02:00
rafi67000 dc6db3cfaa Revert "Update SpongeGradle"
This reverts commit 72c337a68c.
2024-10-25 19:53:14 +02:00
rafi67000 72c337a68c Update SpongeGradle 2024-10-25 19:51:21 +02:00
rafi67000 a9d0389adf Merge pull request #13 from retrooper/2.0
Sponge
2024-10-25 19:48:42 +02:00
rafi67000 76ea2aa665 Update loom 2024-10-25 19:40:45 +02:00
booky10 672700afc5 Add 1.21.3 server version
Thanks mojang for fixing the salmon!
2024-10-23 18:14:45 +02:00
retrooper d8a44fe8b6 Merge pull request #1037 from booky10/fix/javadoc-link
Fix javadoc link in readme
2024-10-23 07:08:37 +02:00
booky10 2a777092d2 Fix javadoc link in readme 2024-10-23 01:14:01 +02:00
booky10 083a060371 Fix legacy attribute naming "remapping" 2024-10-22 18:18:56 +02:00
booky10 b1b5dee5f0 Fix NPE when copying WrapperPlayServerChunkData below 1.18 2024-10-22 18:14:23 +02:00
booky10 05dfea6da2 Fix classloading loop in SynchronizedRegistriesHandler 2024-10-22 18:07:27 +02:00
booky10 208d6911f0 Expose packet side in channel injector 2024-10-22 01:10:20 +02:00
booky10 07ca508df1 Change default value of legacy lookup to true 2024-10-21 21:53:48 +02:00
booky10 40ab1419c5 Fix support for unsafe entity id getter on AdvancedSlimePaper 2024-10-21 21:43:28 +02:00
booky10 cb48134548 Remove TODOs, tests were successful 2024-10-21 19:27:37 +02:00
booky10 ce287ad7db Fix writing packets on fabric client side 2024-10-21 19:20:55 +02:00
booky10 be1e743571 Invert protocol manager send/receive methods if in client environment 2024-10-21 18:34:03 +02:00
booky10 a57b911fd2 Skip injection of fabric channels on the wrong side 2024-10-21 18:10:16 +02:00
booky10 a3b7fc8908 Refactor handshake handling to support non-inet socket addresses 2024-10-21 17:58:46 +02:00
booky10 85717a84b7 Associate player instance with player connection channel
The behaviour of the fabric platform is a bit different here, as the player instance gets re-created on respawn
2024-10-21 03:55:57 +02:00
booky10 6a8e96382e Add method for creating packetevents instance 2024-10-21 03:31:35 +02:00
booky10 52b6cb6a71 Fix writing of WrapperPlayClientCraftRecipeRequest 2024-10-21 02:31:49 +02:00
booky10 eda7d9273f Fix serialization of SingleInputOptionDisplay 2024-10-21 02:31:48 +02:00
booky10 9391b16f50 Fix missing sealevel write in login packet 2024-10-21 02:31:47 +02:00
booky10 bd499550d8 Reuse entity position sync EntityPositionData in more places for 1.21.2 2024-10-21 02:31:46 +02:00
booky10 dd6eb173a0 Fix ENTITY_POSITION_SYNC packet id 2024-10-21 02:31:45 +02:00
booky10 78c994987f Update client settings packet wrapper to 1.21.2
Also refactors it's logic into a common class, as it was previously split in config and play state packets
2024-10-21 02:31:45 +02:00
booky10 d11a0bade5 Add tip and creaking block state properties for 1.21.2 2024-10-21 01:36:03 +02:00
booky10 e54035a683 Work around classloading loop only present on fabric 2024-10-21 01:32:17 +02:00
booky10 5ef51406eb Refactor clientbound and serverbound packet handling for same behaviour 2024-10-21 01:32:05 +02:00
booky10 9843e9fd68 Fix refcount issues with PacketEncoder 2024-10-21 01:32:04 +02:00
booky10 f3bdcbec83 Fix PacketDecoder handling of serverbound packets 2024-10-21 01:32:03 +02:00
booky10 a5d3cf5957 Fix wrong packetencoder side 2024-10-21 01:32:03 +02:00
booky10 aa87cf8032 Fix fabric logger level remapping 2024-10-21 01:32:02 +02:00
booky10 07137ddb26 Call correct packet events depending on packet side 2024-10-21 01:32:01 +02:00
booky10 92076e8559 Move fabric mod metadata to common sourceset 2024-10-21 01:32:00 +02:00
booky10 5356a011ec Refactor fabric network handlers
This removes compression handling from encoder, as vanilla compression setup does not interfere with packetevents
This also refactors the packet encoder to be based directly on the ChannelOutboundHandlerAdapter, instead of the MessageToByteEncoder

Requires testing - there could be a retain missing in the PacketEncoder
2024-10-20 06:03:00 +02:00
booky10 b72502b8a1 Implement support for fabric client again 2024-10-20 06:02:59 +02:00
booky10 20bee30f69 Refactor fabric packetevents builder to work on both server and client 2024-10-20 06:02:59 +02:00
booky10 4f29b8a2c9 Split fabric client and server sources 2024-10-20 06:02:58 +02:00
booky10 ef867acc36 Fix fabric mod icon 2024-10-20 06:02:58 +02:00
booky10 da37c4320e Remove fabric api dependency
It's not used by packetevents, there is no need to depend on it
2024-10-20 06:02:57 +02:00
booky10 6b2d3cbc7e Small cleanup of WrapperPlayServerExplosion
Didn't think I would have updated this already, but its already up-to-date! Yay!
2024-10-20 04:46:26 +02:00
booky10 397310df8b Update WrapperPlayServerDeclareRecipes to 1.21.2 2024-10-20 04:42:45 +02:00
booky10 04d444cc30 Update WrapperPlayServerEntityTeleport to 1.21.2 2024-10-20 03:32:36 +02:00
booky10 eb68151a73 Update WrapperPlayServerPlayerPositionAndLook to 1.21.2 2024-10-20 03:04:59 +02:00
booky10 a2fcc30fbb Update WrapperPlayServerCraftRecipeResponse to 1.21.2 2024-10-20 02:33:24 +02:00
booky10 6cdc535cbc Update WrapperPlayServerTimeUpdate to 1.21.2 2024-10-20 02:26:08 +02:00
booky10 095550e041 Update WrapperPlayClientCraftRecipeRequest to 1.21.2 2024-10-20 02:18:42 +02:00
booky10 3b4a0609e3 Update WrapperPlayClientSetDisplayedRecipe to 1.21.2 2024-10-20 02:08:17 +02:00
booky10 54fe6b0dbd Add player input packet wrapper 2024-10-20 02:05:12 +02:00
booky10 ff2b73e9b1 Update WrapperLoginServerLoginSuccess to 1.21.2 2024-10-20 01:51:30 +02:00
booky10 bb3630840d Update particle network and nbt serialization to 1.21.2 2024-10-20 01:39:21 +02:00
booky10 555aed78f3 Fix items without any overrides missing their default base components 2024-10-20 01:10:11 +02:00
booky10 1ed52f3f4e Fix versioned item type base components 2024-10-20 00:03:03 +02:00
booky10 72a44648cd Fix removed music disc tag causing tests to fail 2024-10-19 23:57:48 +02:00
booky10 2db8e75a66 Update sound registry to 1.21.2 2024-10-19 05:48:18 +02:00
booky10 e9064c4e87 Implement new trail and block crumble particles 2024-10-19 05:44:21 +02:00
booky10 680cbbf932 Fix item component mappings 2024-10-19 05:25:31 +02:00
booky10 7285af4481 Update damage type registry 2024-10-19 05:17:00 +02:00
booky10 bd4f5c2ecf Add 1.21.2 state type mappings 2024-10-19 05:14:10 +02:00
booky10 dd94a9a677 Refactor block entity types to registries 2024-10-19 05:13:24 +02:00
booky10 341c70f6dd Add creaking heart block entity type 2024-10-19 05:10:59 +02:00
booky10 41a8a47060 Add pale garden biome 2024-10-19 05:09:53 +02:00
booky10 881ad034a6 Refactor attributes to include default, minimum and maximum values
Also adds utility for calculating final attribute value
Additionally, strips "category" prefix for 1.21.2+
And adds the new attribute for 1.21.2
2024-10-19 05:02:06 +02:00
booky10 4a1c86cba3 Update block and item tags 2024-10-19 02:54:52 +02:00
booky10 56c9b73bcb Add new entity types for 1.21.2 2024-10-19 02:42:56 +02:00
booky10 93bac071ac Add new item types for 1.21.2 2024-10-19 02:34:29 +02:00
booky10 f88c9f027d Implement new item components for 1.21.2 2024-10-19 02:29:02 +02:00
booky10 1cb2219dbb Update FoodProperties serialization to 1.21.2 2024-10-19 02:09:40 +02:00
booky10 e00d5822f2 Fix serialization of ItemRecipes component type 2024-10-19 02:04:20 +02:00
booky10 f64846f339 Add initial logic for loading item base components from file 2024-10-19 01:58:42 +02:00
booky10 fd2480abbc Add item base component data for 1.20.5 to 1.21.2 2024-10-19 01:08:21 +02:00
booky10 4d820eef6d Add new state types for 1.21.2 2024-10-18 23:54:18 +02:00
booky10 6bddd197db Add block state mappings for 1.21.2 2024-10-18 23:54:07 +02:00
booky10 8439ca103c Fix modern block state mapping indices 2024-10-18 23:26:57 +02:00
booky10 60e546b075 Mark current recipe wrappers as obsolete 2024-10-18 18:11:21 +02:00
booky10 cfc0e5b260 Finish implementing serialization of new recipe data 2024-10-18 18:08:39 +02:00
booky10 3c11278949 Implement WrapperPlayServerRecipeBookSettings 2024-10-18 17:31:05 +02:00
booky10 8bde89d4ee Implement WrapperPlayServerRecipeBookRemove 2024-10-18 03:19:21 +02:00
booky10 a5ebc356ad Start implementing WrapperPlayServerRecipeBookAdd
Recipe display types are too much work for now, I'll do them later

Also, mojang has removed the ability for custom item recipes... for whatever reason?
2024-10-18 03:16:24 +02:00
booky10 aeb37c0a28 Implement WrapperPlayServerPlayerRotation 2024-10-18 02:37:58 +02:00
booky10 85106c8e59 Implement WrapperPlayServerEntityPositionSync 2024-10-18 02:36:42 +02:00
booky10 06d350bb1e Update packet mappings to rc1 2024-10-18 02:31:26 +02:00
booky10 a612ffeba1 Use mapped entity registry reading when reading modern ItemStacks 2024-10-18 02:12:52 +02:00
booky10 651051f136 Merge branch '2.0' into feat/1.21.2-update 2024-10-18 02:10:02 +02:00
Bram 3000d76272 Removed: Old bStats classes 2024-10-17 11:34:53 +02:00
retrooper e136327742 Update README text 2024-10-16 23:30:05 +02:00
Bram e1a22373d6 Re-added: Old Metric classes to prevent breaking changes, but marked the classes as deprecated 2024-10-15 16:10:57 +02:00
Bram b7f4375599 Fixed: Coding convention issue 2024-10-15 15:55:18 +02:00
Bram bf97a66dd7 Changed: Position of the plugin started message to outside the class constructor into the actual initiation event 2024-10-15 15:45:44 +02:00
Bram 9077e346f2 Removed: Internal bStats classes
Added: bStats as gradle dependency
Added: Sponge bStats Support
Changed: Velocity bStats initialisation, due to a reworked approach in a recent bStats update
Changed: Sponge Gradle Plugin version being specified in the build.gradle.kts rather than in the libs.versions.toml
2024-10-15 15:43:09 +02:00
retrooper 0031d6aae3 Merge pull request #670 from SamB440/feat/sponge
(WIP) Sponge support
2024-10-13 23:03:35 +02:00
SamB440 cec46d111b Don't store the ServerPlayer 2024-10-13 21:30:18 +01:00
SamB440 ef151757db Don't include non-nbt adventure 2024-10-13 21:30:18 +01:00
SamB440 fef29a0697 Update to new build logic 2024-10-13 21:30:17 +01:00
SamB440 b58b71a5b1 Fix ViaVersion compatibility (as via fixed injector) 2024-10-13 21:30:17 +01:00
SamB440 8a4fc799e4 Update to JDK 21 and support latest Sponge API 2024-10-13 21:30:17 +01:00
SamB440 979fc09e13 Sponge support 2024-10-13 21:30:17 +01:00
rafi67000 13fa3504bf Remove unused and deprecated import 2024-10-08 17:41:09 +02:00
rafi67000 adbaa5cfbc Update test libraries 2024-10-08 17:30:40 +02:00
rafi67000 1881336a14 Update runTask 2024-10-08 17:15:51 +02:00
rafi67000 100d02904e Update shadow 2024-10-08 17:15:45 +02:00
rafi67000 be8e15e087 Update gradle to 8.10.2 2024-10-08 17:15:38 +02:00
retrooper 487bcc3461 Merge pull request #1021 from booky10/fix/food-properties
Fix order of reading fields in food properties
2024-10-06 16:53:21 +02:00
booky10 1f86c651b8 Fix order of reading fields in food properties 2024-10-06 13:39:10 +02:00
AbhigyaKrishna 388001447f feat: jar task to produce jars without adventure 2024-10-04 17:17:59 +05:30
AbhigyaKrishna 13c59e2b5e refactor: make jar names consistent 2024-10-04 17:17:21 +05:30
AbhigyaKrishna 5c236bb4ed feat: configure javadoc plugin 2024-10-04 17:16:52 +05:30
booky10 fea6e90f12 Merge pull request #1015 from ManInMyVan/missing-breaks
add breaks in WrapperHandshakingClientHandshake::setNextConnectionState
2024-09-29 23:52:40 +02:00
ManInMyVan fb098bd169 add breaks in WrapperHandshakingClientHandshake::setNextConnectionState 2024-09-29 15:46:01 -06:00
booky10 612b2bb6cc Merge pull request #1014 from ManInMyVan/fix/legacy-rail-mappings
fix legacy rail mappings
2024-09-29 04:00:06 +02:00
ManInMyVan a145c10e5d fix detector rail id 2024-09-28 19:54:23 -06:00
ManInMyVan cb57f4fd6a fix legacy rail mappings 2024-09-28 17:43:31 -06:00
retrooper ed28da338a Merge pull request #1006 from booky10/fix/viaversion-map-deco-errors
Fix errors with viaversion and map decorations
2024-09-24 18:16:54 +02:00
retrooper 0d86b3b297 Merge pull request #1004 from booky10/fix/workaround-paper-library-loading-problems
Force usage of plugin classloader to lookup classes of other plugins
2024-09-24 18:16:22 +02:00
booky10 90bd1841f0 Revert unused import 2024-09-23 18:45:52 +02:00
booky10 be24877913 Merge pull request #1003 from booky10/fix/registry-element-equality
Fix registry element equality check
2024-09-23 18:43:57 +02:00
retrooper 7218c365e3 Merge pull request #1009 from booky10/fix/nbt-component-booleans
Allow any numbers when reading nbt booleans
2024-09-23 18:21:03 +02:00
booky10 33dd09362a Allow any numbers when reading nbt booleans
Vanilla accepts every number type and so should packetevents
2024-09-23 17:36:16 +02:00
booky10 4aae57075a Merge pull request #1005 from booky10/fix/more-bungee-injector-issues 2024-09-23 09:58:09 +02:00
booky10 d90240641e Convert MapDecorationTypes to proper registry 2024-09-21 16:50:01 +02:00
booky10 a5871befe6 Norm registry key input strings 2024-09-21 16:47:08 +02:00
booky10 fa56d226f3 Add ResourceLocation#normString utility
This prepends the vanilla key namespace to the specified input key, if no other namespace has been specified
2024-09-21 16:45:58 +02:00
booky10 a5ff4a9ad8 Only print component map patches for ItemStack#toString 2024-09-21 16:42:53 +02:00
booky10 d61c690075 Release buffers after recompression 2024-09-21 16:26:01 +02:00
booky10 873589bd7f Clear recyclable out list after usage 2024-09-21 16:25:47 +02:00
booky10 032f2ff228 Use proper logging for bungee instead of stdout 2024-09-21 16:25:19 +02:00
booky10 0c733b31a7 Force usage of plugin classloader to lookup classes of other plugins
Works around issues caused by some plugins loading packetevents through the library loader, which doesn't know about the classloader of plugins
2024-09-21 16:00:20 +02:00
booky10 2baaf18db6 Fix missing DeepComparableEntity interface
Caused by me just cherry-picking some commits from another branch
2024-09-21 15:26:53 +02:00
booky10 4d7314e2d8 Check for deep equals before using vanilla registry element
Could potentially solve #962, although I can't reproduce that issue

This may be caused by two different changes to packetevents:
1. We did a little memory optimization so only elements different to the vanilly registry get stored
2. We fixed an issue where some elements would not equal the "same" vanilla element

This could cause every custom element to just never be registered, so we now do explicit deep-equals checks before saving the vanilla element instead
2024-09-21 15:21:02 +02:00
booky10 f1f4ffe6b2 Implement DeepComparableEntity for all dynamic registry entries 2024-09-21 15:21:01 +02:00
retrooper 2fac9dc516 Bump version up to 2.5.1-SNAPSHOT 2024-09-20 23:37:15 +02:00
retrooper ab8faf358c 2.5.0 Release 2024-09-20 22:07:20 +02:00
retrooper 243ce3c5dd Merge pull request #990 from Elikill58/2.0
Add wrapper for BossBar packet
2024-09-20 21:57:25 +02:00
retrooper d4762195f9 adhere to packetevents' convention of capitalizing UUID in setters & getters 2024-09-20 21:53:46 +02:00
retrooper 121e1615b6 remove awkward comment break in PEVersion#toStringWithoutSnapshot docs 2024-09-20 21:49:46 +02:00
retrooper 350d33ae6f Merge remote-tracking branch 'origin/2.0' into 2.0 2024-09-20 21:47:15 +02:00
retrooper d4f7bced86 bstats metrics do not collect snapshot & commit, solely version is captured. 2024-09-20 21:46:18 +02:00
retrooper 8037e659a8 Merge pull request #1000 from booky10/fix/particle-data-again
Revert some fixes for particle data decoding/encoding
2024-09-20 21:12:04 +02:00
retrooper 28c7849252 Merge pull request #999 from booky10/fix/bungee-injection
Rework bungee injector to allow for packet cancellation
2024-09-20 21:07:09 +02:00
retrooper cb277bf16a Merge pull request #995 from booky10/fix/packet-sending-race-condition
Synchronize packet encoding
2024-09-20 21:04:50 +02:00
booky10 0612e1e188 Revert some fixes for particle data decoding/encoding
Mojang's codecs are confusing
2024-09-20 20:30:08 +02:00
booky10 7a9f83129e Fix incorrect list recycling usage 2024-09-20 20:11:05 +02:00
booky10 a17e5f13a7 Rework bungee injector to allow for packet cancellation 2024-09-20 20:04:29 +02:00
retrooper 02a565bf39 Merge pull request #996 from booky10/fix/bungee-injection
Fix support for new bungee compression
2024-09-20 19:44:01 +02:00
booky10 f1d7d5ac81 Merge pull request #992 from galacticwarrior9/add-biomeeffects-getters 2024-09-18 08:33:30 +02:00
retrooper a1663f5a03 Merge pull request #994 from booky10/fix/pre-1.20.5-registry-data-limit
Remove nbt reading limit in registry-data packet for pre 1.20.5
2024-09-17 23:22:28 +02:00
booky10 909492cfae Fix support for new bungee compression 2024-09-17 16:39:46 +02:00
booky10 a3b4cc21f5 Synchronize packet encoding
Resolves concurrency issues which may happen when sending the same packet wrapper to different players, concurrently

This is not a perfect solution, but the alternative would be refactoring the packetwrapper to be based on buffers passed during encoding as parameters, which would be too much effort and would require breaking changes
2024-09-17 16:29:30 +02:00
booky10 402ebd729e Remove nbt reading limit in registry-data packet for pre 1.20.5 2024-09-17 16:21:49 +02:00
galacticwarrior9 349b5dc110 Add missing getters to BiomeEffects 2024-09-17 13:43:07 +01:00
Elikill58 c778cc3368 Convert list to EnumSet 2024-09-16 23:03:43 +02:00
Elikill58 26e5aab84e Rename divison to overlay 2024-09-16 19:54:01 +02:00
Elikill58 79da4e1bc4 Convert flags 2024-09-16 19:50:29 +02:00
Elikill58 51b550ca5e Use adventure's enum 2024-09-16 11:29:37 +02:00
Elikill58 2877b74c42 Remove own config... 2024-09-15 19:54:08 +02:00
Elikill58 c67d1a86c5 Fix missing import 2024-09-15 19:41:28 +02:00
Elikill58 5cf9b34fd2 Add wrapper for BossBar packet 2024-09-15 19:24:59 +02:00
retrooper 99acbe4960 Merge pull request #980 from booky10/fix/javadoc-links
Update javadoc overview links
2024-09-02 22:27:53 +02:00
booky10 2bf64b6107 Update javadoc overview links 2024-09-02 22:26:07 +02:00
retrooper 4e86af8754 Add Javadocs URL 2024-09-02 22:22:44 +02:00
retrooper 6bf639f18a Update links to documentation. 2024-09-02 22:11:34 +02:00
retrooper 9a7bb17459 Merge pull request #978 from AoElite/2.0
fixed runAtFixedRate not using ticks when running on folia
2024-09-01 22:38:57 +02:00
AoElite 6b84c683ee fixed runAtFixedRate not using ticks when running on folia 2024-09-01 16:33:12 -04:00
booky10 1260aa1de5 Add some transformations for slot changes 2024-08-30 22:53:19 +02:00
booky10 bdccde4040 Fix compile issue with StaticConsumeEffectType 2024-08-30 21:44:45 +02:00
booky10 7cdb95116a Implement all new components 2024-08-30 21:21:06 +02:00
booky10 c9d42f8e8e Check for deep equals before using vanilla registry element
Could potentially solve #962, although I can't reproduce that issue

This may be caused by two different changes to packetevents:
1. We did a little memory optimization so only elements different to the vanilly registry get stored
2. We fixed an issue where some elements would not equal the "same" vanilla element

This could cause every custom element to just never be registered, so we now do explicit deep-equals checks before saving the vanilla element instead
2024-08-30 20:34:37 +02:00
booky10 1e738f038f Implement DeepComparableEntity for all dynamic registry entries 2024-08-30 20:31:32 +02:00
booky10 57fb06ca5f Implement dynamic instrument registry 2024-08-30 20:28:59 +02:00
booky10 83d925ead0 Implement most 1.21.2 packet wrapper changes 2024-08-30 20:14:00 +02:00
booky10 ce1baaad7a Setup new 1.21.2 packet types 2024-08-30 20:13:52 +02:00
booky10 a370f6e7b7 Setup 1.21.2 server version and client version constants 2024-08-30 20:13:42 +02:00
booky10 dc015dc457 Merge pull request #935 from rafi67000/gradleUpdate
Gradle, and shadow update
2024-08-29 22:34:52 +02:00
booky10 fd7bc84cd5 Merge pull request #972 from booky10/fix/workaround-spigot-item-conversion-issues
Use global synchronized registries as fallback
2024-08-29 17:46:19 +02:00
booky10 9fd5b3b912 Use global synchronized registries as fallback for spigot and fabric
Works around issues where plugins convert items to bukkit items, which doesn't preserve registry holder context, e.g. https://github.com/nulli0n/ExcellentEnchants-spigot/blob/8623159ca61b60e1d3cae22c77a99e82b15b9d5f/Core/src/main/java/su/nightexpress/excellentenchants/hook/impl/PacketEventsHook.java
2024-08-29 12:49:12 +02:00
rafi67000 a2d259af58 Update to Gradle 8.10 2024-08-27 20:29:28 +02:00
rafi67000 6cc21a6d98 Merge branch 'retrooper:2.0' into gradleUpdate 2024-08-27 20:13:20 +02:00
retrooper e105770dde Merge pull request #967 from KermanIsPretty/fix/join-game-data-codec-1.7
Fix 1.8< clients not having Reduced Debug Info.
2024-08-27 12:28:49 +02:00
booky10 68b7ee51dc Merge pull request #968 from ManInMyVan/tuff-walls
tuff walls exceed cube
2024-08-26 19:50:22 +02:00
ManInMyVan a4a375f411 tuff walls exceed cube 2024-08-26 11:19:35 -06:00
KermanIsPretty ae6b3d18a4 Fix 1.8< clients not having reducedDebugInfo. 2024-08-25 15:50:02 -05:00
booky10 8763b0e77f Merge pull request #966 from ManInMyVan/fix-inconsistency
Fix inconsistency in StateTypes
2024-08-25 10:55:44 +02:00
ManInMyVan 2440b64981 Fix inconsistency in StateTypes 2024-08-25 01:02:36 -06:00
retrooper ebe73587fe Merge pull request #959 from AoElite/2.0
API for checking if packetevents is terminated
2024-08-22 17:34:43 +02:00
AoElite 5b87ac4f61 unnecessary fix 2024-08-21 08:56:58 -04:00
AoElite d9a3f33199 implement for test 2024-08-21 08:29:16 -04:00
AoElite 9f44834514 don't forget netty one 2024-08-20 21:04:03 -04:00
AoElite 314d4a2813 option to kick on join if terminated & added API for checking if terminated 2024-08-20 21:02:39 -04:00
retrooper 97fee0c898 Merge pull request #956 from booky10/fix/particle-data-decoding-1.20.4
Fix particle data decoding and encoding for <1.20.5
2024-08-21 00:19:56 +02:00
booky10 bdc96a88cd Merge branch '2.0' into fix/particle-data-decoding-1.20.4 2024-08-20 19:33:29 +02:00
retrooper af1691e6e5 Merge pull request #957 from booky10/fix/bungeecord-resolving
Fix bungeecord artifact not resolving
2024-08-20 19:03:40 +02:00
booky10 e4058f7f15 Fix bungeecord artifact not resolving 2024-08-20 18:06:55 +02:00
booky10 7f0c922e10 Fix particle data decoding and encoding for <1.20.5 2024-08-20 17:57:54 +02:00
retrooper 453793eb60 Merge pull request #955 from booky10/fix/item-adventure-predicate-component-reading
Read item adventure predicate nbt and property matchers as optionals
2024-08-20 17:37:45 +02:00
booky10 015e7a4647 Read item adventure predicate nbt and property matchers as optionals 2024-08-20 16:59:17 +02:00
retrooper 45c0c580f7 Merge pull request #954 from booky10/fix/1.19-issues
Fix some 1.19 issues related to registries
2024-08-20 15:39:11 +02:00
booky10 1c12a868c8 Fix chattype decoding and encoding for 1.19 2024-08-20 15:20:54 +02:00
booky10 a3f22320d5 Fix error when handling empty legacy registries 2024-08-20 15:10:57 +02:00
retrooper f4bb1dd8fc kick players even if user is null & they throw an exception, kick user for exceptions also in encoder. 2024-08-18 07:11:01 +02:00
retrooper 5203b3a376 Merge pull request #943 from ManInMyVan/static-getByName
Make BlockTags::getByName static
2024-08-17 20:22:28 +02:00
retrooper fe66d743a9 Merge pull request #949 from booky10/fix/1.16.5-errors
Fix some errors related to old minecraft versions
2024-08-17 20:01:13 +02:00
retrooper 1d1cf84c60 Merge pull request #950 from booky10/fix/dynamic-registry-elements-equality
Don't do deep equals checks for dynamic registry entries
2024-08-17 19:57:02 +02:00
booky10 1c81aab994 Don't do deep equals checks for dynamic registry entries 2024-08-17 19:12:52 +02:00
booky10 52559f6fc8 Fix binary tag holder for adventure <4.10.0 2024-08-17 17:55:29 +02:00
booky10 06cc25bf23 Add workaround to make DimensionType#getId work for 1.16.2 to 1.18.2 2024-08-17 17:49:32 +02:00
booky10 86cf0d51ed Replace usages of translation fallback in ComponentSerializerImpl 2024-08-17 17:36:25 +02:00
booky10 5fbb052d6f Fix wrong recipe serializer definition key 2024-08-17 17:36:09 +02:00
booky10 b7021fcd1f Fix support for adventure <4.10
Replaces Index#valueToKey usages with alternative
Fixes error on join in 1.16.5
2024-08-17 17:22:22 +02:00
booky10 64db7f13c6 Fix support for adventure <4.11
Replaces Index#valueOrThrow usages with copied implementation
Fixes error on join in 1.16.5
2024-08-17 17:05:41 +02:00
retrooper 20c9fdf634 Merge pull request #947 from booky10/fix/dimension-type-npes
Handle null values correctly in StaticDimensionType#equals
2024-08-17 17:03:29 +02:00
booky10 a71035a157 Handle null values correctly in StaticDimensionType#equals 2024-08-17 16:19:56 +02:00
ManInMyVan b0002102e3 Make BlockTags::getByName static 2024-08-15 19:29:07 -06:00
retrooper a3e65cfcbe Merge pull request #939 from rexlManu/2.0
(Velocity) Avoid user if channel cannot be found
2024-08-14 09:35:48 +02:00
Emmanuel Lampe edd9c5ce3d Merge branch 'retrooper:2.0' into 2.0 2024-08-14 05:22:04 +02:00
retrooper e918e6b10a Merge remote-tracking branch 'origin/2.0' into 2.0 2024-08-13 21:04:18 +02:00
retrooper f6c309fd18 add copyright notice to Metrics 2024-08-13 21:03:20 +02:00
retrooper 322a99dbc4 final change in README 2024-08-13 17:50:54 +02:00
retrooper 6793dee0bc More fixes to README 2024-08-13 17:46:39 +02:00
retrooper d33751dbb0 fix BUILD STATUS in README 2024-08-13 17:41:26 +02:00
retrooper fa67de16a1 fixed issues in README 2024-08-13 17:40:10 +02:00
retrooper 57fc21f411 patch readme 2024-08-13 17:37:27 +02:00
retrooper 9999ee3b4a updated README for packetevents 2024-08-13 17:32:03 +02:00
retrooper 4a90cadeb1 Merge pull request #933 from booky10/fix/bungee-server-nullability
Account for null servers in bungee
2024-08-12 18:49:59 +02:00
retrooper 048903f33f Merge pull request #934 from booky10/fix/translation-fallback-adventure
Fix compatibility with adventure versions older than 4.13.0
2024-08-12 18:48:09 +02:00
retrooper 3fa5eaf2a3 Merge pull request #932 from booky10/fix/dimension-type-mappings
Fix dimension type mappings
2024-08-12 18:47:01 +02:00
rafi67000 93bd6d5ac9 Update wrapper 2024-08-12 17:24:04 +02:00
rafi67000 aa5535615c A little tweak... 2024-08-12 17:22:15 +02:00
booky10 9ccd85178d Fix compatibility with adventure versions older than 4.13.0
Translation fallback methods didn't exist before
2024-08-12 17:11:16 +02:00
rafi67000 14fd279c06 Update and switch to maintained shadow fork 2024-08-12 17:07:20 +02:00
rafi67000 6df845324b Update gradle to 8.9 2024-08-12 17:06:59 +02:00
booky10 c3f233ca61 Account for null servers in bungee 2024-08-12 16:47:52 +02:00
booky10 ed4f018b34 Fix dimension type mappings 2024-08-12 16:44:09 +02:00
retrooper ef4bc1c02e github sponsors added as funding option 2024-08-12 09:32:44 +02:00
retrooper ca725b68a5 fix: NPE error in DimensionType#decode 2024-08-12 09:09:02 +02:00
booky10 40f7463e93 Merge pull request #927 from AoElite/2.0
Fix sound exception on 1.21
2024-08-12 00:57:46 +02:00
AoElite 7778768c30 tweak 2024-08-11 18:55:09 -04:00
AoElite 6a6be44ab2 fix sound exception on 1.21 2024-08-11 15:57:12 -04:00
Abhigya fe67c23ad4 Merge pull request #926 from AoElite/2.0
Release item buffer regardless of exception
2024-08-11 23:45:40 +05:30
AoElite c09348d4f7 release item buffer regardless of exception 2024-08-11 13:55:17 -04:00
retrooper e04cd2108f Merge pull request #919 from libraryaddict/patch-2
Fix #916 via removing explicit type call of nbt get
2024-08-10 17:18:35 +02:00
retrooper 39f0dee9f1 Merge pull request #912 from booky10/feat/1.21.1-server-version
Add 1.21.1 version support
2024-08-10 17:16:20 +02:00
libraryaddict 9b9ae8d36c Fix #916 2024-08-10 22:47:03 +12:00
retrooper fc934195de Merge pull request #866 from booky10/feat/network-synced-registries
Network synced registries
2024-08-09 07:49:14 +02:00
retrooper 6c4db8029b chore: bump up version to 2.5.0-SNAPSHOT 2024-08-09 07:46:25 +02:00
retrooper c4ce7b7a87 packetevents version represented as string only provides snapshotCommit if it is a snapshot, not for stable releases. 2024-08-09 07:44:31 +02:00
booky10 b751c63625 Add 1.21.1 version support 2024-08-08 16:44:16 +02:00
retrooper 31ac149b42 Merge pull request #909 from booky10/feat/peversion-build-timestamp
Add build timestamp to PEVersions class
2024-08-06 19:08:17 +02:00
booky10 2f45e9e469 Add equality methods for all dynamic registry value classes 2024-08-06 17:55:27 +02:00
booky10 7b152ff264 Don't store exact copies of vanilla registry elements 2024-08-06 17:25:55 +02:00
booky10 e9eb441a1c Implement caching on bungee platform 2024-08-06 17:19:23 +02:00
booky10 55c1093783 Fix biome and enchantment type definitions on bungee 2024-08-06 17:17:05 +02:00
booky10 963ec4e978 Revert some debug changes which weren't meant to be pushed 2024-08-06 17:09:53 +02:00
booky10 26c30f46e7 Implement key-based registry caching and velocity proxy per-server caching
Bungee isn't finished yet
2024-08-06 17:06:55 +02:00
booky10 c2cdafb17f Add system property to force disable caching 2024-08-06 16:09:38 +02:00
booky10 22060a9889 Actually make caching work by not decoding registries when not needed 2024-08-06 16:08:55 +02:00
booky10 e1a54099a4 Add build timestamp to PEVersions class 2024-08-06 15:24:28 +02:00
retrooper 3fa6a0f69a fix: wrong tag name used in ParticleDustData 2024-08-05 22:48:26 +02:00
retrooper 676cb6c3ce feature: cache legacy registries 2024-08-05 22:34:54 +02:00
retrooper a3063f0bcb feature: cache registries globally on non-proxy servers
Each kind of registry has a VersionedRegistry. This VersionedRegistry now contains a SimpleRegistry as a cache. If the cache is not null, it will be used globally. This makes the usage of registries convenient for PacketEvents users as they no longer need to access them within each user instance. If the plugin is on proxy, we shall store all registries for each user. If the plugin is not on proxy, we shall only store the dimension type registry for each user and globally cache the rest.
2024-08-05 22:17:53 +02:00
retrooper c1520401b6 deletion: remove hard-coded 1.21 enchantment type mappings (as temporary fix) 2024-08-05 22:07:57 +02:00
booky10 d988d0c684 Fix backwards compatibility for dimension type codec 2024-08-04 23:00:46 +02:00
booky10 e2283d6f4e Fix backwards compatibility for encoding trim patterns 2024-08-04 22:39:25 +02:00
booky10 ea56cfde04 Add backwards compatibility support for chat types 2024-08-04 22:34:44 +02:00
booky10 16733e587e Add full legacy data support for biomes 2024-08-04 21:58:28 +02:00
booky10 b247807f0f Fix biome mapping test 2024-08-04 20:30:26 +02:00
booky10 679aea8181 Add even more biome mappings 2024-08-04 18:47:30 +02:00
booky10 f0d499a008 Add more biome mappings 2024-08-04 18:41:22 +02:00
booky10 b5320f2ae7 Fix data reading for biomes and enchantment types 2024-08-04 18:24:52 +02:00
retrooper 0fd0821a93 Merge pull request #907 from booky10/fix/fire-legacy-mappings
Map legacy block ids for fire block
2024-08-04 18:17:59 +02:00
booky10 c7c1b9da17 Map legacy block ids for fire block 2024-08-04 18:15:03 +02:00
retrooper d67d307788 Merge pull request #906 from booky10/fix/component-equality
Fix some component equality checking issues
2024-08-04 18:10:45 +02:00
booky10 c057f18914 Merge branch '2.0' into feat/network-synced-registries 2024-08-04 18:05:46 +02:00
booky10 7a5b425dbb Merge pull request #1 from libraryaddict/feat/network-synced-registries
Feat/network synced registries
2024-08-04 18:01:20 +02:00
booky10 9b22739977 Remove setters from jukebox song interface 2024-08-04 17:56:03 +02:00
booky10 12e0869e0a Fix JukeboxSongs#values javadoc 2024-08-04 17:55:22 +02:00
booky10 0039ab8704 Resolve small backwards compatibility issues 2024-08-04 17:55:12 +02:00
retrooper 7da389db14 feature: 1.21 enchantment mappings (ordered alphabetically) 2024-08-04 16:14:17 +02:00
libraryaddict 1f85797768 Merge pull request #1 from packetevents/2.0
Feature: Create Damage Event wrapper using new Damage Types
2024-08-04 23:49:55 +12:00
retrooper 3c55703718 feature: damage event wrapper using new damage types 2024-08-04 10:50:28 +02:00
booky10 e3734c2d94 Fix some component equality checking issues 2024-08-01 22:41:22 +02:00
Emmanuel Lampe afc571e331 fix(velocity): check for fake connections 2024-08-01 09:59:47 +02:00
libraryaddict 4549d07a6c IJukeboxSong 2024-07-31 17:36:11 +12:00
libraryaddict acc220729b Rename JukeboxSong and StaticJukeboxSong 2024-07-31 01:45:15 +12:00
libraryaddict b27f64c3b1 Missing license disclaimer thingy 2024-07-30 21:17:32 +12:00
libraryaddict 1f7a09a561 Current WIP, adds damage types and jukebox 2024-07-30 21:14:15 +12:00
retrooper f0b15c3f94 Merge pull request #900 from booky10/fix/number-issues-adventure-nbt-serializer
Allow item hover event count to be specified as any number
2024-07-27 11:32:31 +02:00
booky10 cc03d3029d Allow item hover event count to be specified as any number
Fixes compatibility with vanilla codec, as vanilla allows any number to be decoded within DFU
2024-07-23 17:57:46 +02:00
retrooper ef2d24c5ff Merge pull request #894 from booky10/fix/chunk-codec-issues
Fix chunk codec issues
2024-07-23 13:58:58 +02:00
retrooper 6a69d1bcb4 Generics usage in ProtocolPacketEvent for platform-dependent player 2024-07-22 18:50:35 +02:00
retrooper ea1e11d690 Merge pull request #874 from Bram1903/fix/LatestFabricSupport
Fabric 1.21 Support
2024-07-22 11:32:47 +02:00
retrooper 65b51fa6f5 Update javadocs link. 2024-07-19 17:27:25 +02:00
retrooper dae31cedf6 Fix fabric injection, packet listeners now work. 2024-07-19 17:21:32 +02:00
retrooper 6179f997c9 Update fabric version 2024-07-19 16:42:50 +02:00
retrooper 8cb083c29a Correction in PacketListenerPriority documentation, MONITOR should be avoided when modifying. 2024-07-19 13:21:57 +02:00
retrooper 7dd2434ea9 Modification of PacketEvents settings is now marked as internal API behavior. Generally, you are not advised to change the settings.
Unnecessary static in PacketEventsAPI fixed.
2024-07-19 13:17:34 +02:00
booky10 66ca952a1d Add getter/setter for light data in Chunk_v1_9 packet
Would otherwise be impossible to send new chunk layers for 1.9 to 1.13
2024-07-18 19:57:10 +02:00
booky10 d6fef1180f Don't read sky data in overworld dimension for 1.14 to 1.15.2
Sky data in overworld was only present before 1.14
2024-07-18 18:48:13 +02:00
booky10 32451165ba Don't allow usage of singleton palette before 1.18 2024-07-18 18:47:28 +02:00
Bram 2c806b2d4e Removed: foojay-resolver in favor of the foojay-resolver-convention 2024-07-14 11:17:40 +02:00
Bram a8dadfdfff Merge branch 'refs/heads/2.0' into fix/LatestFabricSupport
# Conflicts:
#	settings.gradle.kts
2024-07-14 11:16:32 +02:00
booky10 4524b4289c Merge pull request #883 from booky10/fix/1.21-item-attribute-modifiers-component
Fix reading/writing of item attribute modifier component in 1.21
2024-07-12 23:18:36 +02:00
retrooper 67010e8f11 Merge pull request #885 from booky10/feat/javadoc-publishing
Implement automatic javadoc publishing
2024-07-12 16:39:42 +02:00
retrooper 245ee7699a Merge pull request #890 from booky10/fix/null-material-types
Fix missing material types for vault and heavy core
2024-07-12 16:38:11 +02:00
booky10 25dfb3c5b9 Fix missing material types for vault and heavy core 2024-07-12 16:36:57 +02:00
booky10 52709f279b Update javadoc links 2024-07-11 17:43:23 +02:00
booky10 13d6437638 Remove javadoc pages deployment
Will be handled in different repo, see https://github.com/packetevents/packetevents.github.io
2024-07-11 16:51:46 +02:00
booky10 7a3505070e Restrict javadoc deployment for tag pushes 2024-07-11 01:27:31 +02:00
booky10 7d79603d08 Move api javadoc to pages root 2024-07-11 00:57:37 +02:00
booky10 7890a8ae97 Add javadoc overview 2024-07-11 00:55:54 +02:00
booky10 c73e149f43 Fix spigot javadoc jar generation 2024-07-11 00:24:13 +02:00
booky10 2f72766aac Fix wrong action name 2024-07-10 23:50:33 +02:00
booky10 43d915d09c Add id-token permission to javadoc extraction job 2024-07-10 23:49:47 +02:00
booky10 3444b07f6a Try if github pages upload action works 2024-07-10 23:46:23 +02:00
booky10 3cfb1c5b3e Add initial javadoc upload workflow
Designed to not work yet, just testing if it outputs correct stuff as act is broken for me
2024-07-10 23:15:39 +02:00
booky10 150736b170 Update github build workflow actions 2024-07-10 23:11:20 +02:00
booky10 1f325a36d6 Enable javadoc jar generation 2024-07-10 23:10:56 +02:00
booky10 bdc8f6ef82 Use jvm 21 for kotlin jvm toolchain in buildscript 2024-07-10 23:10:44 +02:00
booky10 d365e4b949 Add foojay resolver convention plugin
Allows automatic download of specified java toolchain jvm version
2024-07-10 23:10:25 +02:00
booky10 4f4a3ba87b Update gradle wrapper to v8.8 2024-07-10 23:06:44 +02:00
retrooper 7ceeaa5f3f Merge pull request #872 from ShadowOfHeaven-Me/2.0
Optimized the EventManager
2024-07-10 21:07:52 +02:00
retrooper 6f968275c1 Merge pull request #882 from KoutaChan/fix-pallet-shift
Fix: Palette index calculation error
2024-07-10 18:29:41 +02:00
booky10 245b7a0d2a Fix reading/writing of item attribute modifier component in 1.21 2024-07-10 16:29:36 +02:00
KoutaChan 13b1007c1c Fix: pallet bit 2024-07-10 23:26:15 +09:00
KoutaChan c164908aac Fix: bit shift error 2024-07-10 23:22:40 +09:00
KoutaChan 1dd28f124a Fix: Palette index calculation error 2024-07-10 23:02:53 +09:00
retrooper 149483ef21 Merge pull request #881 from booky10/fix/version-hash-publishing
Don't specify version hash in published maven pom
2024-07-10 15:49:32 +02:00
booky10 0a689564ce Don't specify version hash in published maven pom 2024-07-10 15:44:33 +02:00
retrooper facc6bc074 Merge pull request #877 from booky10/feat/versioning-commit-hash
Add current commit hash to project version
2024-07-09 22:57:14 +02:00
booky10 41224c9faf Fix snapshot commit for release versions 2024-07-09 22:54:15 +02:00
retrooper 14548f5679 Even more clarity, now LGTM 2024-07-09 22:47:50 +02:00
retrooper d31d0b2487 Correction and clarity to the PEVersion#snapshotCommit method documentation 2024-07-09 22:43:38 +02:00
retrooper 1366872acb Merge pull request #870 from AbhigyaKrishna/mappings-reading-optimization
Mappings reading optimization
2024-07-09 11:41:11 +02:00
retrooper 40fcd23d87 More clarity on the deprecation reason in PEVersion#asArray 2024-07-09 11:31:48 +02:00
retrooper ba7d09ee91 Correction in the documentation of PEVersion: Accuracy in the content and grammar whilst ensuring clarity. 2024-07-09 11:19:08 +02:00
booky10 b0fa4eb3b7 Don't include snapshot commit hash in file name 2024-07-09 01:54:40 +02:00
Bram a8bf163355 Fix: Left behind old shadow plugin convention 2024-07-08 19:00:31 +02:00
booky10 f81730c689 Add snapshot commit api to PEVersion 2024-07-08 15:18:07 +02:00
booky10 a830fe8b63 Adjust PEVersionTask regex to allow any commit hash length 2024-07-08 04:18:25 +02:00
booky10 05c116271e Add current commit hash to project version
Only added when version is a snapshot version
Disables itself if no git directory is found
2024-07-08 04:09:31 +02:00
booky10 a08f89813e Allow chat type decoration parameters to be defined directly 2024-07-08 03:47:39 +02:00
booky10 87fa35dea0 Fix enchantment registry not being able to be replaced
Caused by directly referencing static registry
2024-07-08 03:45:32 +02:00
booky10 4ed644313a Allow enchantment definition slots to be defined directly 2024-07-08 03:43:34 +02:00
booky10 9fdd1615bd Merge branch '2.0' into feat/network-synced-registries 2024-07-08 03:25:15 +02:00
booky10 4ab220f189 Make TrimMaterial override armor materials optional 2024-07-08 03:25:00 +02:00
booky10 adef187685 Fix MappedEntitySet codec 2024-07-08 03:24:21 +02:00
booky10 0e5a443e9b Fix various issues encountered on login 2024-07-08 03:01:45 +02:00
booky10 4961ad6e8d Add biome registry handling to SynchronizedRegistriesHandler
Seems like I forgot to add it there
2024-07-08 02:44:32 +02:00
booky10 e056f1ca0a Implement synchronized painting variant registries 2024-07-08 02:43:58 +02:00
retrooper 9d43fd7a35 Stop re-encoding by default on BungeeCord 2024-07-07 23:56:29 +02:00
AbhigyaKrishna 45bafb37fe feat: HashedByteArray -> BinaryNBTCompound 2024-07-05 22:52:16 +05:30
AbhigyaKrishna 3554f3c6ac feat: Read compound tags in binary format to save memory 2024-07-05 22:42:32 +05:30
AbhigyaKrishna 10d4cf4a9d feat: fabric adventure dependency fix 2024-07-05 20:17:04 +05:30
retrooper 7a1621aa37 Final correction for bungee injector. 2024-07-05 14:11:57 +02:00
retrooper 22a5e67c69 Another correction, but probably obsolete 2024-07-05 13:56:33 +02:00
retrooper 8737ba218a Correct decompress decode method on Bungee. Reflection error. 2024-07-05 13:51:47 +02:00
Bram 98e0a35f0c Removed: Unused Mod Properties in the Fabric module gradle.properties 2024-07-05 10:01:21 +02:00
Bram 21500f3cab Fixed: Another issue in the PacketEventsInjectorMixin 2024-07-04 23:58:13 +02:00
Bram 750d87937a Switched: johnrengelman shadow to googler's shadowjar for Java 21 support (See https://github.com/johnrengelman/shadow/issues/908) 2024-07-04 23:55:25 +02:00
Bram f78ffc9a5c Fixed: PacketEventsInjectorMixin 2024-07-04 23:33:10 +02:00
Bram 48b789d268 Added: foojay-resolver (fixes issues with the latest Fabric Loom dependency
Re-added: Parchment (mixed something up)
Fixed: Compile issue with removed class import
2024-07-04 23:29:29 +02:00
ShadowOfHeaven a765347cba Added a class description 2024-07-04 23:02:54 +02:00
ShadowOfHeaven 21fe4c920d Just a little sneak of my name there 2024-07-04 22:55:05 +02:00
Bram d35505b83a Updated: Fabric Loom 0.11-SNAPSHOT -> 1.7.2
Updated: Gradle Wrapper 8.5 -> 8.7 (Required by Fabric Loom)
Removed: parchmentmc (Fabric Loom provides native support for Parchment mappings as of version 0.9)
Changed: Fabric Dependency id from fabric -> fabric-api (see: https://fabricmc.net/2022/11/24/1193.html)
2024-07-04 21:36:50 +02:00
ShadowOfHeaven 930d1370ce Removed the User value association system. Another PR will be made 2024-07-04 09:45:25 +02:00
ShadowOfHeaven 4f01b9b2d6 Added a User value association system 2024-07-04 00:35:46 +02:00
ShadowOfHeaven 79ae548463 Optimized the EventManager v2 2024-07-03 19:59:41 +02:00
booky10 08120db4b4 Add small biome mapping test 2024-07-03 18:18:38 +02:00
booky10 11d2d979cc Fix biome mapping not being compressed and shadowed 2024-07-03 18:18:26 +02:00
booky10 3822609afe Implement most particle data codecs
Theoretically required for full support of biome data serialization
2024-07-03 18:15:25 +02:00
booky10 dd057ca20f Finish biome effects implementation 2024-07-03 15:16:32 +02:00
ShadowOfHeaven 42403c9f51 Optimized the EventManager 2024-07-03 00:37:35 +02:00
AbhigyaKrishna 9eb6b11fe0 fix: Statistics not being cached 2024-07-03 02:27:32 +05:30
booky10 8c02988330 Save dimension type as reference while decoding
Reference gets resolved when calling the getter, this allows legacy version registries to be swapped before resolving the new dimension type
2024-07-02 18:58:12 +02:00
AbhigyaKrishna fd7223a259 fix: Statistics reading 2024-07-02 15:37:16 +05:30
AbhigyaKrishna b22560852f chores: Update licence 2024-07-02 15:30:06 +05:30
AbhigyaKrishna 3498720e8c feat: Change SequentialNBTReader class design to resemble reader 2024-07-02 15:24:46 +05:30
AbhigyaKrishna 457aed221b fix: NBTEnd not being read when there is no data 2024-07-02 14:39:24 +05:30
AbhigyaKrishna d6fb68d8e7 chores: Update licence 2024-07-02 03:32:50 +05:30
AbhigyaKrishna 0e6c15eb8b feat: Diff load order 2024-07-02 03:30:00 +05:30
AbhigyaKrishna 485124bfef feat: change diff tags order
'removals' tags now come before 'additions' tag
Order: removals, additions, changes
2024-07-02 03:27:53 +05:30
AbhigyaKrishna 3517d1fd00 feat: Refactor SequentialNBTReader 2024-07-02 03:07:38 +05:30
AbhigyaKrishna 7d80f08e1c fix: nbt reading 2024-07-02 03:04:31 +05:30
AbhigyaKrishna ff0af88299 chores: Removed debug statements 2024-07-02 02:16:25 +05:30
booky10 ba08959d39 Add wolf_variant registry and start with biome registry
Biome registry is required for wolf variant registry to fully work
2024-07-01 22:41:13 +02:00
AbhigyaKrishna 050aab96f7 fix: SequentialNBTReader parsing 2024-07-02 02:11:00 +05:30
booky10 afcdfae5a1 Fix version being ignored in User#getMinWorldHeight 2024-07-01 21:13:46 +02:00
booky10 8908cce24f Implement enchantment effect component types 2024-07-01 21:08:49 +02:00
booky10 31447cb6cf Fix test errors 2024-07-01 20:21:02 +02:00
booky10 884ab800f5 Start working on enchantment registry 2024-07-01 19:11:32 +02:00
booky10 6e87103114 Move everything related to registries from InternalPacketListener to new class 2024-07-01 16:24:55 +02:00
booky10 c3b8c213d3 Implement trim_material as a synchronized registry 2024-07-01 16:22:14 +02:00
booky10 33f50a0eb9 Implement trim_pattern as a synchronized registry 2024-07-01 16:12:32 +02:00
booky10 3f309bc92d Migrate usages of chat types to new registry 2024-07-01 16:04:33 +02:00
booky10 8315b8d335 Implement chat_type as a synchronized registry 2024-07-01 15:59:15 +02:00
booky10 902c99aca2 Revert some now useless changes to MappedEntity#getId 2024-07-01 15:41:52 +02:00
booky10 f4fc20a1c8 Revert formatting changes in ChunkReader_v1_7 2024-07-01 15:36:50 +02:00
booky10 0690c45558 Add quality methods to StaticDimensionType 2024-07-01 15:35:11 +02:00
booky10 699fd9ac02 Finish migrating Dimension to DimensionType 2024-07-01 15:32:08 +02:00
booky10 b01db5ca2a Work on creating registries of sent registries 2024-07-01 12:39:13 +02:00
booky10 4fdc9c67ad Finish encode of DimensionType 2024-07-01 12:38:56 +02:00
AbhigyaKrishna 395ed0d58e fix: version mapper initialization 2024-07-01 10:03:17 +05:30
AbhigyaKrishna bcad08260c feat: Implement sequential reading for all mappings 2024-07-01 09:55:34 +05:30
AbhigyaKrishna 06be6d52b2 feat: Implement closeable on sequential reader 2024-07-01 09:55:05 +05:30
AbhigyaKrishna 7ec896b8b0 feat: Updated block mappings for easier access to v2 mapping deserializer 2024-07-01 09:37:39 +05:30
AbhigyaKrishna 2717a94db5 feat: Implement sequential reader in type builder 2024-07-01 09:08:19 +05:30
AbhigyaKrishna 2ea20e3d19 feat: Bump Compression Task version 2024-07-01 09:07:43 +05:30
AbhigyaKrishna 94d939ba67 feat: Changes to mappings format 2024-07-01 08:13:25 +05:30
AbhigyaKrishna 620af0aec0 feat: SequentialNBTReader 2024-07-01 07:15:07 +05:30
AbhigyaKrishna 2299d82b92 feat: Improved NBTSerializer class 2024-07-01 05:56:54 +05:30
AbhigyaKrishna 25dbe61f64 feat: NBTLimiter class rewrite
Rewritten NBTLimiter class with better approach for better extendability
2024-07-01 05:53:41 +05:30
retrooper ecd183156a * Bump version up to 2.4.1-SNAPSHOT
* Marked SpigotReflectionUtil.getEntityById as internal
2024-07-01 00:20:35 +02:00
booky10 3f0cb7e799 Start working on dimension type registry 2024-06-30 23:33:40 +02:00
retrooper 3400877958 Release of 2.4.0 2024-06-30 22:56:57 +02:00
booky10 7b209c9733 Revert changes to Dimension 2024-06-30 22:37:10 +02:00
booky10 dfd490afc8 Merge branch '2.0' into feat/network-synced-registries 2024-06-30 22:34:34 +02:00
retrooper b5a2c0ac29 Merge pull request #865 from cswhite2000/2.0
Switch EventManager listenerSet to CopyOnWriteArraySet
2024-06-30 09:40:48 +02:00
Christopher White c43dd6425a Switch EventManager listenerSet to CopyOnWriteArraySet 2024-06-29 23:21:34 -07:00
retrooper 8b643ae238 Small change of updater messages. 2024-06-30 08:07:55 +02:00
retrooper b07461340e Corrected latest chat type mappings to represent 1.20 2024-06-30 07:59:44 +02:00
retrooper 4cec8fe549 Correct the chat type mappings, temporarily assume that the 1.20.1 is referring to 1.20.2? 2024-06-30 07:56:23 +02:00
booky10 55ea059640 Merge pull request #864 from booky10/fix/sound-mappings-1.21
Fix missing/renamed sounds for 1.21
2024-06-30 05:09:09 +02:00
booky10 5429e80f66 Fix missing/renamed sounds for 1.21 2024-06-30 04:01:06 +02:00
retrooper 16c71fad14 Start working on WolfVariant in EntityMetadata packet. 2024-06-29 00:47:38 +02:00
retrooper d27a97c322 Bump version up to 2.4.0-SNAPSHOT! 2024-06-29 00:46:38 +02:00
retrooper 59ccfa89db Trying out PacketWrapper#writeVarInt optimization, written by Steinborn. 2024-06-29 00:26:55 +02:00
retrooper b6f25939be Correction in javadocs for SpigotConversionUtil 2024-06-29 00:10:23 +02:00
retrooper d19406edf4 Merge pull request #858 from Bram1903/chore/BlockDataMethodCleanup
Removed: Unnecessary 1.7.10 version check and improved JavaDocs
2024-06-29 00:04:29 +02:00
retrooper 0702ff3716 Merge pull request #852 from AbhigyaKrishna/2.0
feat: chat type mappings update
2024-06-29 00:00:22 +02:00
Bram 4577c5a948 Removed: Unnecessary 1.7.10 version check
Added: JavaDocs to SpigotConversionUtil#fromBukkitMaterialData and #toBukkitMaterialData
2024-06-28 16:32:11 +02:00
booky10 d073f716f9 Merge pull request #855 from dawon/bugfix/fix-new-potion-effects
Fix new potion effects
2024-06-27 23:56:06 +02:00
Jakub Zacek 5051c31bea Fix new potion effects 2024-06-27 23:48:47 +02:00
retrooper eb2d91745a Merge pull request #854 from booky10/fix/bungee-compat
Fix more bungee compatibility issues
2024-06-27 21:46:47 +02:00
booky10 9d40bc506e Disable debug mode in bungee plugin 2024-06-27 21:07:29 +02:00
booky10 0fa3be1ce2 Extract channel from player on login
Caused by login success being sent after the PostLoginEvent gets fired
2024-06-27 20:59:28 +02:00
booky10 acecdb57f4 Skip bungeecord query handler handler 2024-06-27 20:58:00 +02:00
retrooper 33d3a72d4d Fix bungee packetevents injector. 2024-06-27 20:18:10 +02:00
retrooper 2ce1fc1e79 Final change to this all 2024-06-27 19:08:56 +02:00
retrooper 63b9e27ebf More changes to the bungee pipeline injector? 2024-06-27 19:04:55 +02:00
retrooper 8093481f08 Last changes to the bungee pipeline injector? 2024-06-27 18:51:35 +02:00
AbhigyaKrishna 629871fcb5 fix: type naming 2024-06-27 21:15:13 +05:30
AbhigyaKrishna d2d9135c45 feat: chat type mappings update 2024-06-27 21:11:15 +05:30
retrooper bf5c3e90b3 Merge pull request #851 from booky10/fix/dimtype-reg-via-velocity
Fix errors on velocity when via is installed on backends
2024-06-27 16:58:01 +02:00
retrooper d100fd54de Delete .travis.yml
We no longer use Travis CI. The Jenkins builds are working again,
2024-06-27 16:54:46 +02:00
retrooper c8137956f1 Merge pull request #799 from booky10/fix/recipe-packet
Fix recipe packet writing/reading
2024-06-27 16:53:18 +02:00
booky10 e7739bac22 Remove MCProtocolLib credits from rewritten classes 2024-06-27 16:36:15 +02:00
booky10 5c9cfcb25d Merge branch '2.0' into fix/recipe-packet 2024-06-27 16:35:08 +02:00
booky10 4364d7a646 Check for dimension type registry name without vanilla namespace 2024-06-27 16:31:57 +02:00
booky10 0ba826f578 Work around missing dimension type registry causing join errors 2024-06-27 16:29:57 +02:00
booky10 92564a3a09 More WIP changes to networked registries 2024-06-27 16:10:20 +02:00
retrooper 3e21b7d384 Merge pull request #836 from ManInMyVan/#693
Add #693
2024-06-27 16:10:20 +02:00
retrooper b934d7361d Merge pull request #844 from booky10/fix/item-hover-component
Support reading components in show_item hover events
2024-06-27 15:55:59 +02:00
booky10 172cfceed7 WIP starting network synchronized registries 2024-06-25 20:47:01 +02:00
retrooper 4047bafc6a Merge pull request #848 from booky10/feat/itemstack-builder-utils
Add utility methods to ItemStack builder
2024-06-24 17:13:36 +02:00
booky10 27de28476e Add utility methods to ItemStack builder
Allows easier modification of components and nbt data
2024-06-24 15:01:29 +02:00
retrooper e5dfb84a53 Update DefaultNBTSerializer 2024-06-24 00:15:50 +02:00
retrooper 2b3c77b6b8 Update DefaultNBTSerializer to have limit for LONG_ARRAY 2024-06-24 00:15:31 +02:00
retrooper 16294ccc63 Merge pull request #847 from Bram1903/fix/NettyVersionResolving
Fix: Netty Version not being properly converted to an PEVersion
2024-06-23 23:56:50 +02:00
Bram 9ae2cd0538 Fix: Netty Version not being properly converted to an PEVersion due to not using semantic versioning 2024-06-23 23:44:13 +02:00
retrooper 30492a7b1f chores: Format the multi-line comment appropriately and clarify references to the generated PEVersions class 2024-06-23 12:10:29 +02:00
AbhigyaKrishna ecce9d8c4e chores: Added default comment to the generated file 2024-06-23 15:32:23 +05:30
AbhigyaKrishna 448f7be2ae fix: include generateVersionFile task in task graph 2024-06-23 02:49:43 +05:30
Abhigya 4e3c45bc7e Merge pull request #819 from Bram1903/feat/GlobalVersioning
Feat: Global Versioning
2024-06-23 00:46:09 +05:30
AbhigyaKrishna ccd3fd4b7b chores: following some code design 2024-06-22 21:35:47 +05:30
Bram 5003d578c7 Fix: toArray being mend to be called asArray 2024-06-22 17:18:15 +02:00
AbhigyaKrishna 881a66740f feat: Removed version resolution from manifest 2024-06-22 15:39:14 +05:30
AbhigyaKrishna c9ae98814c Merge branch 'feat/GlobalVersioning' of github.com:Bram1903/packetevents into Bram1903-feat/GlobalVersioning 2024-06-22 15:36:43 +05:30
AbhigyaKrishna ee2c562c9e feat: PEVersions file generation 2024-06-22 15:33:36 +05:30
Bram cbd38ea581 Reverted: Previously changed comparison method 2024-06-22 11:08:08 +02:00
Bram 983b27d071 Added: Old toArray method and marked it as deprecated to prevent breaking changes 2024-06-22 10:39:03 +02:00
Bram b2a827e97b Merge branch 'refs/heads/2.0' into feat/GlobalVersioning 2024-06-22 10:31:59 +02:00
AbhigyaKrishna a709e5f746 fix: Velocity adventure issue 2024-06-22 08:13:58 +05:30
AbhigyaKrishna c1f482dd35 feat: MappingCompression task to depend on mapping files 2024-06-22 08:13:31 +05:30
booky10 269ca7ad43 Fix support for adventure <4.17.0 2024-06-22 04:17:14 +02:00
booky10 594f8cdc6e Fix show item hover support for <1.20.3 2024-06-22 04:14:20 +02:00
booky10 187041bd47 Support reading components in show_item hover events 2024-06-22 03:29:55 +02:00
booky10 68eb537b66 Merge pull request #843 from booky10/fix/light-data-1.17-newer
Fix light data throwing errors for 1.17+
2024-06-22 01:56:48 +02:00
AbhigyaKrishna b18884a5b3 fix: manifest implementation version should be in shadowJar 2024-06-22 05:19:26 +05:30
AbhigyaKrishna 061d1c25e8 fix: Version comparison 2024-06-22 04:57:11 +05:30
booky10 b1a881bfab Fix light data throwing errors for 1.17+ 2024-06-22 01:26:48 +02:00
AbhigyaKrishna e68dbe4155 chore: method design pattern 2024-06-22 04:56:39 +05:30
AbhigyaKrishna 60e33ef0a3 Merge branch 'feat/GlobalVersioning' of github.com:Bram1903/packetevents into Bram1903-feat/GlobalVersioning 2024-06-22 04:12:04 +05:30
AbhigyaKrishna eac72687cb Merge branch 'Bram1903-feat/NativeFoliaSupport' into 2.0-pe 2024-06-22 04:03:03 +05:30
AbhigyaKrishna d205d83f61 chore: Property access from a global final isFolia variable
Accessing a global final variable is better than having a copy in every class
2024-06-22 04:01:03 +05:30
AbhigyaKrishna 61969bf9df chore: Work directory set to rootDir
Work directory now set to rootDir for easier navigation
2024-06-22 03:45:46 +05:30
AbhigyaKrishna ed9ff0c5da Merge branch 'feat/NativeFoliaSupport' of https://github.com/Bram1903/packetevents into Bram1903-feat/NativeFoliaSupport 2024-06-22 03:34:20 +05:30
Abhigya 371ec62571 Merge pull request #842 from AbhigyaKrishna/2.0
fix: Fixes NoSuchMethodError for GsonComponentSerializer on version 1.16.5
2024-06-22 03:19:31 +05:30
AbhigyaKrishna 4eaf000dea fix: Fixes NoSuchMethodError for GsonComponentSerializer on version 1.16.5
Fixed NoSuchMethodError in GsonComponentSerializer due to older version of abstract classes in version 1.16.5

Ticket: #832
2024-06-22 03:16:19 +05:30
retrooper 97ca0007fc Merge remote-tracking branch 'origin/2.0' into 2.0 2024-06-21 22:44:45 +02:00
retrooper ece10d66c1 Undo something I removed, sorry! 2024-06-21 22:44:30 +02:00
booky10 420a658b0a Merge pull request #835 from libraryaddict/2.0
Divide Color's int rgb by 255 when using for particle colors
2024-06-21 22:21:53 +02:00
booky10 48fbb745e0 Merge branch '2.0' into fix/recipe-packet 2024-06-21 22:15:42 +02:00
retrooper 24d78ef500 Merge remote-tracking branch 'origin/2.0' into 2.0 2024-06-21 22:13:05 +02:00
retrooper a1123cdf67 Fix Paper entity lookup code. 2024-06-21 22:12:33 +02:00
booky10 cd3d3b17b1 Merge pull request #760 from ShadowOfHeaven-Me/WrapperPlayServerMapData-added
Added the missing WrapperPlayServerMapData
2024-06-21 21:44:37 +02:00
booky10 1f2de8a566 Merge pull request #715 from LeeGodSRC/feat/update-light
Added WrapperPlayServerUpdateLight and LightData
2024-06-21 21:32:25 +02:00
LeeGodSRC 74f4d65356 fix: Suggested changes for chunk packets by booky10 2024-06-22 03:16:11 +08:00
retrooper 2be8692661 Fix attempt for conversion between packetevents and bukkit itemstacks. 2024-06-21 13:32:43 +02:00
retrooper 5021eebd55 Final fix for bungee injector. 2024-06-21 13:26:37 +02:00
retrooper 124e59ba70 Another fix for bungee injector. 2024-06-21 13:12:42 +02:00
retrooper 301adfb28f Fix paper entity lookup 2024-06-21 13:06:38 +02:00
retrooper 8d80725cf7 Does this fix the Bungee injector 2024-06-21 12:56:16 +02:00
retrooper 7aa429988b Fixing the BungeeCord injector and the server version detection. (Part 2) 2024-06-21 12:40:43 +02:00
Bram 1cbd15e797 Merge branch 'refs/heads/2.0' into feat/NativeFoliaSupport 2024-06-21 09:11:09 +02:00
Bram 802c707902 Merge branch 'refs/heads/2.0' into feat/GlobalVersioning 2024-06-21 09:10:36 +02:00
retrooper 17d5e3f711 Merge remote-tracking branch 'origin/2.0' into 2.0 2024-06-21 08:05:39 +02:00
retrooper 7a342a8c21 Fixing the BungeeCord injector and the server version detection. 2024-06-21 08:04:53 +02:00
retrooper a4e9a2cd06 Merge pull request #800 from booky10/fix/various-packet-wrapper-issues
Fix various packet wrapper issues
2024-06-21 00:13:02 +02:00
retrooper 4abc4a7403 Update copy method argument in WrapperPlayServerWorldBorderWarningReach (compilation error) 2024-06-21 00:12:38 +02:00
retrooper 2a364895cf Correct constructor naming 2024-06-21 00:07:52 +02:00
retrooper ff56e81136 Correct packet wrapper naming 2024-06-21 00:06:08 +02:00
retrooper 371fcff23a Merge pull request #691 from ytnoos/reencode-fix
Fix re-encode for new bytebufs that were bigger than the received one
2024-06-21 00:03:05 +02:00
retrooper abe5b9f75a Merge pull request #827 from dawon/bugfix/fix-missing-body-slot
Fix missing Equipment body slot
2024-06-20 23:53:44 +02:00
retrooper 2c36b5ad9f Variable naming issue fixed 2024-06-20 23:48:42 +02:00
retrooper 0436b8cb6a Account for client version in EquipmentSlot enum. 2024-06-20 23:42:24 +02:00
retrooper 2fb967ec04 Merge pull request #732 from booky10/dev/1.21
1.21 update
2024-06-20 21:39:43 +02:00
retrooper aafc45d70d No more chat type handling 2024-06-20 21:32:12 +02:00
retrooper 3e25fa641c Minor documentation error fixed 2024-06-18 22:07:15 +02:00
retrooper 3f3c6ba2e1 * ChatMessage_v1_19_1.ChatTypeBoundNetwork relocated to ChatType.Bound (with backwards compatibility)
* ChatMessage_v1_19_1#getChatType -> getChatFormatting
* ChatMessage_v1_19_3#getChatType -> getChatFormatting
* WrapperPlayServerDisguisedChat#getChatType -> getChatFormatting
* ChatTypeDecoration#decorate implemented
2024-06-18 22:03:14 +02:00
retrooper 3175ef85c4 Merge pull request #690 from ytnoos/nbt-limiter
Added NBT, ByteBuf, MessageSignature read limits
2024-06-17 21:40:28 +02:00
retrooper e876b1c95f First effort to network-synchronized registries regarding chat, but please look at TODOs. 2024-06-17 07:09:52 +02:00
retrooper be2094a21f Merge pull request #828 from booky10/fix/block-entity-data-wrapper
Fix block entity data packet wrapper
2024-06-17 06:42:23 +02:00
ManInMyVan 95fdebfb08 Add #693 2024-06-16 12:29:56 -06:00
booky10 5662c7ea9c Fix name of attribute modifiers being unused 2024-06-16 19:48:12 +02:00
booky10 b8587a2487 Support reading int/byte/long arrays when parsing translation arguments
Fixes #801
2024-06-16 16:40:39 +02:00
booky10 1411fd09b9 Fix invalid WrappedBlockState mappings index 2024-06-16 16:28:08 +02:00
booky10 604a48e2dd Make mappings compression task depend on changes to mappings input files 2024-06-16 16:24:14 +02:00
booky10 f091ab69bc Support reading string translation arguments 2024-06-16 16:23:42 +02:00
libraryaddict e22db21f72 Fix particledata color, divide Color's rgb's int by 255f 2024-06-16 21:27:10 +12:00
retrooper 24000fd837 Merge branch '2.0' into dev/1.21 2024-06-16 08:38:32 +02:00
retrooper 87275458bb Merge pull request #833 from booky10/fix/velocity-version-detection
Fix velocity version failing to be detected
2024-06-16 06:58:18 +02:00
booky10 faac9cd83d Mirror changes by user in name/uuid attribute modifier on change 2024-06-16 05:22:03 +02:00
booky10 887a9fa959 Look up private constructor of ResourceLocation
Was made private in 1.21, should normally now be constructed using static methods
2024-06-16 05:07:07 +02:00
booky10 d716309e34 Fix initialization of PacketType 2024-06-16 05:05:05 +02:00
booky10 92603a382b Update attribute modifier encoding
Not perfect but idk how to solve this any better
2024-06-16 04:54:48 +02:00
booky10 88c788f654 Update item type mappings
Something was re-ordered in 24w19a
2024-06-16 04:46:24 +02:00
booky10 bdb429a0b4 Implement jukebox_playable component added with 24w21a 2024-06-16 04:45:21 +02:00
booky10 0c2e09bc7b Implement wrappers for new packets added in 24w21a
Adds wrappers for minecraft:custom_report_details and minecraft:server_links
2024-06-16 04:32:16 +02:00
booky10 131a66220f Add new packet types added with 24w21a 2024-06-16 04:19:16 +02:00
booky10 7e2c6726e0 Merge branch '2.0' into dev/1.21 2024-06-16 04:09:17 +02:00
LeeGodSRC 882e7b57f9 fix: Suggested changes for chunk packets 2024-06-15 21:00:54 +08:00
LeeGodSRC 990a19585f Merge remote-tracking branch 'upstream/2.0' into feat/update-light 2024-06-15 21:00:49 +08:00
booky10 c2f7c92ed4 Fix ClientVersion#getById 2024-06-15 02:32:30 +02:00
booky10 08b420ffb4 Reverse iteration over velocity ProtocolVersion
Newest get chosen first now
2024-06-15 02:32:17 +02:00
booky10 d9a821e44e Fix velocity version failing to detect 2024-06-14 14:17:16 +02:00
Bram 2e39d61d53 Bumped Travis to use Java 21 2024-06-12 09:37:15 +02:00
Bram bb9bd91970 Fixed: Merge Conflicts 2024-06-12 09:30:25 +02:00
Bram a789d9ec83 Merge branch 'refs/heads/2.0' into feat/NativeFoliaSupport
# Conflicts:
#	velocity/build.gradle.kts
2024-06-12 09:28:28 +02:00
Bram 524cf896c3 Fixed: Breaking change by removing an old constructor method.
The method has been marked as deprecated.
2024-06-12 09:25:34 +02:00
Bram 5190d71bc8 Merge branch 'refs/heads/2.0' into feat/GlobalVersioning 2024-06-12 09:20:31 +02:00
retrooper 29dd1cdc03 Merge pull request #794 from IssueDescription/2.0
Add mojang mapped jar support
2024-06-11 23:04:24 +02:00
retrooper cbe517e994 Add shadowJar block 2024-06-11 22:56:54 +02:00
retrooper 5175ed9733 Add mojang mapping attribute 2024-06-11 22:54:43 +02:00
retrooper 26ddcfde2a Merge branch '2.0' of https://github.com/retrooper/packetevents into fork/IssueDescription/2.0 2024-06-11 22:39:35 +02:00
retrooper e17eb7987f Undo BuildScript changes to fix conflict 2024-06-11 22:38:35 +02:00
retrooper 6cc2ac81df Fix package location of ServerPlayer on remapped paper 2024-06-11 19:20:32 +02:00
AbhigyaKrishna 12d16144c0 Merge remote-tracking branch 'pe/2.0' into 2.0-pe 2024-06-11 02:29:38 +05:30
AbhigyaKrishna f4fc034d51 Publication group and artifact naming changes 2024-06-11 02:27:16 +05:30
booky10 42c6df480c Fix block entity data packet wrapper 2024-06-10 20:38:20 +02:00
Jakub Zacek c591335dd4 Fix missing Equipment body slot 2024-06-10 20:34:58 +02:00
retrooper d93e01cca1 Update .travis.yml JDK to 17 2024-06-10 20:30:16 +02:00
retrooper b666a1a62c Update .travis.yml to JDK 17 2024-06-10 20:25:28 +02:00
retrooper fcdac76ba9 Rename travis.yml to .travis.yml 2024-06-10 18:19:58 +02:00
retrooper 3e33d38518 Create travis.yml 2024-06-10 18:17:52 +02:00
AbhigyaKrishna 46dd4be1d3 Publishing group and module group are now consistent
We are probably going to change the naming convention of module and group in future update but this should work for now
2024-06-10 20:14:16 +05:30
AbhigyaKrishna 809517f04b Maven publication pom now have better structure 2024-06-10 03:42:17 +05:30
AbhigyaKrishna f53e73ed9a Try fixing publication dependency resolution 2024-06-09 23:54:47 +05:30
AbhigyaKrishna a7e1852af4 compileOnly -> shadow configuration for pom generation 2024-06-09 01:54:20 +05:30
AbhigyaKrishna 95ac9d8633 Maven Publication for shadow configuration 2024-06-09 01:45:14 +05:30
Bram 8034de3ec3 Improved: JavaDocs 2024-06-08 10:36:28 +02:00
Bram ee6aac43d4 Added: Overload constructor which defaults snapshot to false
Removed: Cloneable interface, and simply returns a new object with the same values.
Added: Getters for the class field (Using Java record naming conventions)
2024-06-08 10:28:14 +02:00
Bram 2fef51f3d4 Rewrote: PEVersion, now implementing Comparable and Cloneable 2024-06-08 00:24:44 +02:00
Bram f27ead56c7 Fixed: Making Gradle not use the cache when just changing version number. 2024-06-07 19:26:35 +02:00
Bram 317853fd8e Merge branch 'refs/heads/2.0' into feat/GlobalVersioning 2024-06-07 19:14:15 +02:00
Bram db8a4184f8 Merge branch 'refs/heads/2.0' into feat/NativeFoliaSupport
# Conflicts:
#	spigot/build.gradle.kts
2024-06-07 19:12:43 +02:00
AbhigyaKrishna 95543c7033 Publication for patch module 2024-06-07 05:03:38 +05:30
AbhigyaKrishna 306f1598e0 Publish configuration 2024-06-07 04:30:02 +05:30
Abhigya 5a26451880 Merge pull request #823 from AbhigyaKrishna/2.0
Publication consistency
2024-06-07 02:50:21 +05:30
AbhigyaKrishna 9384187f06 Publication consistency for with older convention 2024-06-07 02:49:32 +05:30
AbhigyaKrishna 5e414bae58 Revert "Patch for group name"
This reverts commit 990dfc279f.
2024-06-07 02:48:55 +05:30
retrooper 990dfc279f Patch for group name 2024-06-06 23:06:13 +02:00
retrooper 27ec0876cb Publishing patch 2024-06-06 22:50:58 +02:00
retrooper c3853614c5 Merge pull request #814 from AbhigyaKrishna/library-patching
Library patching
2024-06-06 22:36:05 +02:00
_ShadowOfHeaven_ 67855eda8a Merge pull request #1 from booky10/fix/map-data-wrapper-version-compat
Fix map data wrapper version compat
2024-06-06 21:57:17 +02:00
retrooper e2ed78e81d Merge pull request #822 from RaynLegends/2.0
Fix: WrapperPlayServerChunkDataBulk not initialized correctly when instantiated multiple times
2024-06-06 18:26:15 +02:00
RaynLegends 80ae2de524 Fix: WrapperPlayServerChunkDataBulk not initialized correctly when instantiated multiple times
Fixes retrooper/packetevents#821
2024-06-06 11:46:52 +02:00
AbhigyaKrishna af3c440526 Backward compatibility to AdventureNBTSerializer 2024-06-06 10:23:42 +05:30
Bram 8bac60f2db Fixed: Documentation typo 2024-06-05 11:17:48 +02:00
Bram 6d0d1df82e Improved: Version parsing from the manifest implementation by moving it to its own method 2024-06-05 11:10:13 +02:00
Bram 44eba1fbdc Fixed: Unit Tests failing because of not being able to access the jar manifest. 2024-06-05 09:44:10 +02:00
Bram 7ca7eaa346 Improved: Global Versioning 2024-06-05 09:30:44 +02:00
ytnoos fb93dde220 upstream 2024-06-04 21:11:18 +02:00
Abhigya 4f9f58f76f Merge pull request #811 from joshuaprince/fix-map-decoration
Fix map ItemStack decoding for rotation key
2024-06-04 21:00:20 +05:30
Abhigya 4c2ee57f8d Merge pull request #817 from booky10/fix/joingame-respawn-screen
Fix enforcesSecureChat not being read on login packet
2024-06-04 20:52:46 +05:30
booky10 345db7d3f6 Add recipe serializer mappings compression to new mappings task 2024-06-04 14:25:12 +02:00
booky10 ab6df11274 Merge branch '2.0' into fix/recipe-packet 2024-06-04 14:21:45 +02:00
booky10 71ed30e2a9 Fix enforcesSecureChat not being read 2024-06-04 08:53:18 +02:00
AbhigyaKrishna cbfccafce7 Unregister debug listener 2024-06-03 22:57:43 +05:30
AbhigyaKrishna 2888afa999 Update to publish configuration which now includes shadow publication 2024-06-03 22:56:57 +05:30
AbhigyaKrishna 9c4d7cb933 Adventure version resolution fix 2024-06-03 22:54:25 +05:30
AbhigyaKrishna baec4bdd00 MIT Licence 2024-06-03 22:54:11 +05:30
AbhigyaKrishna a00ae8f52c Fix argument parsing 2024-06-03 21:31:36 +05:30
AbhigyaKrishna b973820c59 Shadow configuration for patch module and gson inclusion 2024-06-03 21:08:42 +05:30
AbhigyaKrishna 5fbf597d20 Removed gradle daemon as we are having issues 2024-06-03 21:08:04 +05:30
AbhigyaKrishna cc8bb89ee5 TranslatableArgument patch 2024-06-03 20:51:27 +05:30
AbhigyaKrishna 1f0792f854 Patch ShowItemSerializer and ShowEntitySerializer 2024-06-03 19:51:58 +05:30
AbhigyaKrishna 6b7ebc2162 adventure version bump 2024-06-03 19:47:47 +05:30
AbhigyaKrishna 596a961b05 Rollback constants 2024-06-03 19:30:52 +05:30
AbhigyaKrishna 9586d8da29 Changed adventure library configuration 2024-06-03 17:33:42 +05:30
AbhigyaKrishna 8391c11a7f Parent build function to not include patch module jar 2024-06-03 17:32:52 +05:30
AbhigyaKrishna 51de60ab4f Gradle script update 2024-06-03 16:46:48 +05:30
AbhigyaKrishna 5d14703492 Removed legacy fixes and updated Adventure serializer 2024-06-03 16:46:20 +05:30
AbhigyaKrishna d3968b15db Grouping change for adventure bundle 2024-06-03 16:45:48 +05:30
AbhigyaKrishna 990cc38b67 Configuration update to conventions 2024-06-03 16:45:12 +05:30
AbhigyaKrishna df0d135a72 GsonComponentSerializer patch 2024-06-03 15:57:14 +05:30
AbhigyaKrishna 18ac4937b6 Adventure gson serializer patches 2024-06-03 15:35:43 +05:30
AbhigyaKrishna 531cef241a Configuration changes 2024-06-03 15:35:18 +05:30
AbhigyaKrishna e5353800e7 Patch module 2024-06-03 15:34:52 +05:30
AbhigyaKrishna 21dfaceb22 Custom library patching toolchain 2024-06-03 15:29:31 +05:30
Bram c13454a255 Removed: Unnecessary null initializer 2024-06-02 19:21:50 +02:00
Bram 4f4f5f0578 Fixed: Build workflow by updating the Java version 2024-06-02 14:38:44 +02:00
Bram 02544cd0f5 Greatly improved the TaskWrapper readability 2024-06-02 13:38:27 +02:00
Bram 3ed09a3834 Updated the old FoliaCompatUtil to prevent reflections where possible 2024-06-02 13:08:56 +02:00
Bram 28749faa44 Renamed: serverInitEventClass -> regionizedServerInitEventClass
Added: Documentation on why we are still using reflections for the runTaskOnInit method
2024-06-02 12:59:17 +02:00
Bram 2dbbdcc5d4 Reworked: RegionScheduler to use the RegionScheduler class provided by Paper instead of using reflections 2024-06-02 12:56:44 +02:00
Bram 291266c4bd Reworked: GlobalRegionScheduler to use the GlobalRegionScheduler class provided by Paper instead of using reflections 2024-06-02 12:54:14 +02:00
Bram 411693611a Reworked: EntityScheduler to use the EntityScheduler class provided by Paper instead of using reflections
Fixed: Some AsyncScheduler methods still re-getting the bukkit scheduler
2024-06-02 12:51:17 +02:00
Bram 98c36ff39f Reworked: AsyncScheduler to use the AsyncScheduler class provided by Paper instead of using reflections 2024-06-02 12:42:04 +02:00
Bram 1e69b33d4f Reworked: TaskWrapper to use the ScheduledTask instead of using reflections to access the class 2024-06-02 12:38:58 +02:00
Bram ae2c6cdc4b Added: Proper run paper/velocity tasks 2024-06-02 12:08:14 +02:00
Bram 3104885fb5 Switched: spigot-api -> paper-api 2024-06-02 11:59:13 +02:00
Joshua Prince 081868571b Fix map ItemStack decoding for rotation key
Fixes https://github.com/retrooper/packetevents/issues/810
2024-06-01 16:50:53 -07:00
retrooper 6a3b18aff9 Merge pull request #807 from Bram1903/patch/bStatsSettingRemoval
Removed: bStats Configuration Option
2024-06-01 23:53:03 +02:00
Bram c4caba57bd Merge branch 'refs/heads/2.0' into patch/bStatsSettingRemoval 2024-06-01 23:35:22 +02:00
retrooper c9f3eb32aa Merge pull request #790 from AbhigyaKrishna/gradle-kotlin-dsl
Gradle build chain rework with kotlin DSL
2024-06-01 23:32:55 +02:00
Bram 1dad678f98 Fixed: Saying "removing" instead of "disabling" 2024-05-31 14:11:05 +02:00
Bram 4f579f59c3 Removed: bStats Setting
Deprecated: PacketEventsSettings#bStats
Deprecated: PacketEventsSettings#isbStatsEnabled
2024-05-31 11:56:53 +02:00
retrooper 3352f25ede Merge pull request #805 from booky10/fix/legacy-attributes
Add legacy names for armor and luck attribute
2024-05-30 19:51:06 +02:00
booky10 0378141ac4 Add legacy names for armor and luck attribute
Wasn't present previously because mojang doesn't include them in their attribute rename patch
2024-05-30 17:35:24 +02:00
booky10 9dbb877455 Fix sound effect packet wrapper for <1.9 2024-05-29 20:37:43 +02:00
booky10 ee382176c5 Add missing ResourceLocation#hashCode 2024-05-29 20:27:29 +02:00
booky10 b3d9c1f10f Refactor tags packet wrapper
Also fix support for versions <1.17
2024-05-29 20:25:00 +02:00
booky10 a51ce059e5 Fix serialization of command argument nodes for <1.19 2024-05-29 19:03:53 +02:00
booky10 126bf406ce Add legacy command argument type parsers 2024-05-29 19:02:54 +02:00
booky10 b476d51910 Fix missing seed in entity sound packet wrapper 2024-05-29 17:56:52 +02:00
booky10 02e9f7f901 Fix nbt_compound_tag command argument parser 2024-05-28 22:02:34 +02:00
booky10 0cf411c4de Fix recipe packet writing/reading 2024-05-28 21:17:21 +02:00
booky10 37e2317a5f Fix various packet wrapper constructors 2024-05-28 17:12:22 +02:00
retrooper 415550b354 Merge pull request #789 from MemencioPerez/2.0
Clear the buffer if the packet send event is canceled in Velocity and BungeeCord
2024-05-26 19:14:36 +02:00
retrooper 3b5099f940 NPC#changeSkin properly re-spawns the player on all versions 2024-05-26 14:58:12 +02:00
retrooper 34605f3d72 Fix NPC#despawnAll not emptying channels after usage. 2024-05-26 13:17:39 +02:00
retrooper 8e5eab8bd1 Addition to ByteBufAllocationOperator, new methods declared for further control 2024-05-25 18:19:15 +02:00
retrooper 8cde415712 Merge pull request #795 from booky10/fix/item-stack-enchantments
Fix more issues with ItemStack enchantment components
2024-05-21 20:19:20 +02:00
booky10 c5189d2788 Fix more issues with ItemStack enchantment components
Caused by every item having a default enchantments component set with an empty value
2024-05-21 20:18:01 +02:00
issueDescription e550924b38 Add mojang mapped jar support 2024-05-21 16:48:51 +01:00
AbhigyaKrishna 27d7495f65 Spigot version bump 2024-05-21 01:22:01 +05:30
AbhigyaKrishna 7477483f15 Merge branch 'refs/heads/2.0' into gradle-kotlin-dsl
# Conflicts:
#	spigot/build.gradle
2024-05-21 01:03:25 +05:30
Abhigya 7e064f453a Merge pull request #783 from booky10/fix/spigot-particle-conversions
Fix spigot particle conversion
2024-05-21 00:56:33 +05:30
AbhigyaKrishna f7e58de863 Revert "Update gradle publish github workflow"
This reverts commit 7a135fe0f5.
2024-05-21 00:15:25 +05:30
AbhigyaKrishna 7a135fe0f5 Update gradle publish github workflow
Removed unwanted github workflow tasks
2024-05-21 00:05:24 +05:30
AbhigyaKrishna 8336f1c0ab Misc changes 2024-05-21 00:01:23 +05:30
AbhigyaKrishna 2648f8538d Mapping compression task in kotlin
Rewritten mapping compression task in kotlin
2024-05-20 22:36:26 +05:30
AbhigyaKrishna 6893216ed2 Root project build cycle and javadoc
* Added global jar out task to root project build
* Configured javadoc task to not log warnings
2024-05-19 14:41:22 +05:30
AbhigyaKrishna b6f944ad57 Minor changes and patches to build cycle 2024-05-19 14:25:01 +05:30
Memencio 969f032607 Clear the buffer if the packet send event is canceled in BungeeCord 2024-05-18 19:26:12 -04:00
AbhigyaKrishna daed712bf7 Version catalog for buildSrc
Included version catalog for buildSrc
2024-05-19 04:21:38 +05:30
AbhigyaKrishna 835952a7d2 Gradle convention plugin
Using gradle convention plugin strategy for managing common gradle scripts
2024-05-19 04:08:45 +05:30
AbhigyaKrishna d272f8d19e Gradle kotlin dsl migration
Migrated gradle dsl from groovy to kotlin for easier maintainability
2024-05-19 03:35:45 +05:30
Memencio 8cb8ad7388 Clear the buffer if the packet send event is canceled in Velocity 2024-05-18 16:47:59 -04:00
AbhigyaKrishna 6793fcb928 Versions Catalog
Implementation of version catalog for managing dependencies
2024-05-19 00:18:14 +05:30
retrooper 86ea24d3ee Merge pull request #787 from booky10/fix/paper-1.8-cache-chunk-maps-unload-packet
Account for zero chunk data on unload chunk packet
2024-05-18 18:36:30 +02:00
booky10 69f9c4f500 Account for zero chunk data on unload chunk packet
Sent by Paper 1.8 if cache-chunk-maps is enabled in the paper config
2024-05-18 16:58:59 +02:00
retrooper 3d869f7dfc Merge pull request #786 from booky10/feat/spawn-entity-head-yaw
Add head-yaw methods to spawn entity packet wrapper
2024-05-18 15:35:39 +02:00
booky10 92d716d78e Add head-yaw methods to spawn entity packet wrapper 2024-05-18 15:22:21 +02:00
booky10 8a7f086fdf Fix spigot particle conversion
Fixes #775
2024-05-17 15:23:10 +02:00
booky10 58f6a77287 Implement direct chattype reading 2024-05-15 17:31:46 +02:00
booky10 04110da6f1 Implement direct painting variant reading 2024-05-15 16:54:09 +02:00
booky10 81e5a50b8a Add yaw and pitch to use item packet wrapper 2024-05-15 16:41:05 +02:00
retrooper dfb6787322 Merge pull request #774 from booky10/fix/various-invalid-registry-id-getters
Fix invalid registry ids in various registries
2024-05-12 19:25:55 +02:00
booky10 6b03502307 Fix invalid registry id getting in various registries 2024-05-12 19:22:40 +02:00
retrooper 499d2eea6c Fix CRAFT_PARTICLE_PARTICLES_FIELD being null exception 2024-05-12 17:02:50 +02:00
retrooper fdf1942553 Merge pull request #761 from MemencioPerez/2.0
Fix Encryption Response packet wrapper write method for server versions between 1.19 and 1.19.2
2024-05-11 18:33:03 +02:00
retrooper 9e9b9abb14 Merge pull request #769 from booky10/fix/decorated-pots
Fix pot decorations causing NPEs
2024-05-11 17:08:44 +02:00
booky10 92397b2e4a Fix pot decorations causing NPEs
Now wraps null values in optionals
2024-05-11 17:01:30 +02:00
retrooper 154b789b48 Merge pull request #767 from ItzZisker/2.0
fixed entity id assign bug
2024-05-11 12:01:31 +02:00
ItzZisker 0cee676a69 fixed entity id assign bug 2024-05-11 05:36:35 +03:30
retrooper 387f4661e8 Add ICHUNKPROVIDER class to spigot reflection util 2024-05-10 23:42:37 +02:00
retrooper c261e1d467 Addition of some methods and classes and constructors in SpigotReflectionUtil 2024-05-10 22:32:21 +02:00
booky10 b43a76e682 Initial logic for reading CustomData from non-compounds, WIP 2024-05-10 18:15:49 +02:00
booky10 6efb6f59b1 Update FoodProperties for 1.21 2024-05-10 18:10:26 +02:00
booky10 9f27a49358 Fix flag parsing for <1.13 2024-05-10 18:00:09 +02:00
booky10 5001b21e7a Fix version compatibility for map data packet wrapper 2024-05-10 18:00:07 +02:00
retrooper 24446c61e0 Merge pull request #765 from booky10/fix/particle-mappings-typo
Fix typo in particle mappings for 1.12.2
2024-05-10 17:35:52 +02:00
booky10 d03ed48409 Fix typo in particle mappings for 1.12.2 2024-05-10 17:28:01 +02:00
booky10 840153bc98 Update WrapperPlayServerProjectilePower for 1.21 2024-05-10 16:01:54 +02:00
booky10 f3ee112a4e Merge branch '2.0' into dev/1.21 2024-05-10 15:52:41 +02:00
retrooper 1634eed6e7 Merge pull request #763 from AbhigyaKrishna/2.0
StateValue Map caching
2024-05-10 00:05:35 +02:00
retrooper 6e7dbf13e3 Typo fix 2024-05-10 00:04:09 +02:00
AbhigyaKrishna d60c661d3d StateValue Map caching
Caching and reusing StateValue data map for saving memory
2024-05-10 02:55:30 +05:30
Memencio cd0f1bb241 Fix Encryption Response packet wrapper write method for server versions between 1.19 and 1.19.2 2024-05-09 16:36:04 -04:00
retrooper dd46140147 Implement immutable views on the values within registries 2024-05-09 19:26:58 +02:00
retrooper 337d35f1d8 ReflectionObject#readObjectArray implemented 2024-05-09 18:38:32 +02:00
retrooper 6ad2d61dd3 WrapperPlayServerSoundEffect fixed for 1.8-1.9.4 2024-05-09 18:36:36 +02:00
retrooper 1d6e737611 Bump version up to 2.3.0-SNAPSHOT 2024-05-09 00:41:13 +02:00
retrooper a3739319af Release of PacketEvents 2.3.0 2024-05-08 23:35:28 +02:00
retrooper 5513c0f14b Merge pull request #759 from booky10/fix/joingame-1.16.1
Fix reading/writing of JoinGame packet on 1.16/1.16.1
2024-05-08 23:26:01 +02:00
retrooper 6869ac594f WrapperPlayServerSoundEffect fix attempt for 1.8 2024-05-08 23:24:50 +02:00
retrooper 1bad630ec1 Some fixes for block data conversions 2024-05-08 23:16:21 +02:00
AoElite ba21fa9a8b Merge pull request #756 from booky10/fix/spigot-dimension-conversion
Fix bukkit dimension conversion utility for 1.16 to 1.20.5
2024-05-07 19:35:25 -04:00
AoElite 7d01583cea Merge pull request #755 from booky10/fix/merchant-offers
Fix merchant offers packet wrapper for 1.19 to 1.20.5
2024-05-07 19:35:15 -04:00
_ShadowOfHeaven_ 01e161d37e Added the missing WrapperPlayServerMapData 2024-05-07 23:47:00 +02:00
booky10 90968ca195 Fix reading of JoinGame packet on 1.16/1.16.1 2024-05-07 21:10:51 +02:00
Abhigya 3e1cffee7e Merge pull request #758 from AbhigyaKrishna/2.0
fix: blockstate deserialization fix
2024-05-07 18:01:04 +05:30
AbhigyaKrishna d6564e6263 fix: blockstate deserialization fix 2024-05-07 17:59:26 +05:30
booky10 24b7b97c09 Fully fix bukkit dimension conversion for 1.16 to 1.20.5 2024-05-06 23:30:54 +02:00
booky10 bf0448ab15 Fix merchant offer reading/writing for 1.19 to 1.20.5 2024-05-06 18:36:46 +02:00
AoElite 6c3b66ef84 Merge pull request #754 from booky10/fix/itemstack-damageable-components
Check for components in ItemStack#isDamageableItem
2024-05-05 22:07:58 -04:00
AoElite 507281fd18 Merge pull request #753 from BlueTree242/2.0
Fix incorrect writing of Server Data packet 1.20.5+
2024-05-05 22:06:18 -04:00
booky10 c46c536ea9 Check for components in ItemStack#isDamageableItem 2024-05-05 23:27:27 +02:00
BlueTree242 fb15ac5742 Fix incorrect writing of Server Data packet 1.20.5+ 2024-05-05 22:28:03 +03:00
retrooper 427a305b61 Merge pull request #752 from booky10/fix/itemstack-enchanted
Fix ItemStack#isEnchanted check always returning true
2024-05-05 20:29:38 +02:00
retrooper ded4f5103f Prevent update checker from retrying. 2024-05-05 19:30:24 +02:00
booky10 004c1aadab Fix ItemStack#isEnchanted check always returning true 2024-05-05 18:53:02 +02:00
retrooper 2f0ffb163c Merge pull request #751 from booky10/feat/potion-definition-javadocs
Add definition javadocs to potions and potion types
2024-05-05 18:52:39 +02:00
booky10 be03ffe93f Add definition javadocs to potions and potion types 2024-05-05 18:49:40 +02:00
retrooper b943f195f3 Merge pull request #750 from booky10/fix/potion-types-pre1.20.5
Adjust potion type mappings so 1.20.1 and below works without manual adjustments
2024-05-05 18:45:22 +02:00
retrooper 31e7fba37d Merge pull request #744 from booky10/fix/nbt-component-types
Implement nbt-serialized component types
2024-05-05 18:39:48 +02:00
retrooper 14c75f19fb Merge pull request #749 from booky10/fix/1.20.5-particles
Update particle data to 1.20.5
2024-05-05 18:37:18 +02:00
booky10 3fef6fa51c Adjust potion type mappings so 1.20.1 and below works without manual adjustments 2024-05-05 18:20:32 +02:00
booky10 b6c62bb055 Clean up particle reading/writing 2024-05-05 17:31:51 +02:00
retrooper c3edd14b90 Fix ViaVersion errors when accessing protocol version. 2024-05-05 17:19:38 +02:00
booky10 7014999f65 Update particle data to 1.20.5
Also includes refactor to implement generics in particle type encoding/decoding
2024-05-05 16:41:46 +02:00
booky10 d3b32b4e22 Merge branch 'retrooper:2.0' into fix/nbt-component-types 2024-05-05 14:05:03 +02:00
retrooper b94a86e5fa PotionTypes mappings corrected on versions older than 1.20.2, and Bukkit potion type conversions fixed. 2024-05-05 08:12:31 +02:00
retrooper 9038fd149a Fix gradle-publish.yml indentation 2024-05-05 06:33:09 +02:00
retrooper 65cf7c0b92 Call user connect event on fabric 2024-05-05 06:18:50 +02:00
AoElite c1d2c6c049 Merge pull request #747 from booky10/workaround/known-world-heights
Work around 1.20.5 not sending known dimension types
2024-05-04 23:28:41 -04:00
booky10 b2a9b6a98c Work around 1.20.5 not sending known dimension types
The server no longer sends known registries to the vanilla client
This causes packetevents to no longer receive dimension type information, so fallback to vanilla defaults as a workaround
2024-05-05 05:10:07 +02:00
AoElite 1cf80df77a Merge pull request #746 from booky10/fix/state-type-mappings
Fix state type mappings
2024-05-04 22:42:28 -04:00
booky10 2606094a40 Also regenerate modern block mappings for 1.13 2024-05-05 04:41:28 +02:00
booky10 ddf014b852 Regenerate modern block mappings
All "false" boolean values were "true"
2024-05-05 04:35:44 +02:00
booky10 be2f392c91 Add state type id integrity tests 2024-05-05 04:35:43 +02:00
AoElite 91c370327b Merge pull request #745 from booky10/feat/itemstack-components-api
Implement components in more ItemStack methods
2024-05-04 22:13:57 -04:00
booky10 6dfdfc8363 Fallback to legacy max durability in ItemStack#getMaxDamage 2024-05-05 04:11:04 +02:00
booky10 e09c596020 Implement components in ItemStack#getMaxStackSize 2024-05-05 04:10:49 +02:00
AoElite 5bf7dba140 Merge pull request #743 from booky10/feat/itemstack-components-api
Add support for components in existing ItemStack nbt utilities
2024-05-04 22:01:03 -04:00
booky10 7d74474fde Limit damage to 0 in ItemStack#setDamageValue 2024-05-05 03:08:32 +02:00
booky10 14195de83e Fix relative compression path 2024-05-05 02:56:58 +02:00
booky10 8e16c5564d Implement nbt-serialized component types
Previously left unimplemented because I thought they weren't needed

Related to #741
2024-05-05 02:15:47 +02:00
booky10 803a50542c Add support for components in existing ItemStack nbt utilities
Includes damage, max damage and nbt

Also fixes ItemStack match/equals methods
2024-05-05 01:11:17 +02:00
AoElite 150acb64c3 Merge pull request #742 from booky10/fix/particles-packet
Fix particle packet for 1.20.5+
2024-05-04 18:55:09 -04:00
booky10 009f0a7c13 Fix particle packet for 1.20.5+
Fixes #740
2024-05-05 00:14:28 +02:00
retrooper db99d1f187 Update gradle publish 2024-05-04 00:56:25 +02:00
retrooper 6514b84adf Fix to netty injection on fabric 2024-05-04 00:54:04 +02:00
retrooper e40dfe35b8 Merge pull request #737 from booky10/fix/fabric-adventure-include
Include adventure dependency in fabric recursively
2024-05-04 00:31:30 +02:00
booky10 fee0ff6e26 Include adventure dependency in fabric recursively 2024-05-04 00:30:22 +02:00
retrooper 9ed447164a SpigotConversionUtil for MainHand 2024-05-04 00:27:08 +02:00
retrooper 6102208f45 SpigotConversionUtil#toBukkitPose and fromBukkitPose added 2024-05-04 00:14:06 +02:00
retrooper ec31fb0cbb Merge branch '2.0' of https://github.com/retrooper/packetevents into 2.0 2024-05-03 23:59:45 +02:00
retrooper c4660b4821 Remove random test code in fabric 2024-05-03 23:59:38 +02:00
retrooper 978be6bbcc Merge pull request #736 from booky10/fix/armadillo-state-metadata
Fix armadillo state metadata enum
2024-05-03 23:58:24 +02:00
booky10 ee8b1e9458 Fix armadillo state metadata enum
Fixes #735
2024-05-03 23:54:51 +02:00
retrooper 4fdd047026 Add Fabric to PacketEvents repo 2024-05-03 23:53:53 +02:00
retrooper 5c22920393 Fixing build task order 2024-05-03 19:44:59 +02:00
retrooper 8a18947fd2 Merge pull request #733 from booky10/fix/block-state-properties
Fix block state properties being left unparsed
2024-05-03 19:29:33 +02:00
booky10 bbb3e47a50 Add new attributes for 1.21 2024-05-03 19:27:46 +02:00
AoElite e903aa52e3 Merge pull request #734 from Bram1903/FoliaCompatUtilPatch
Fixed: Paper Schedulers 0 delay handling
2024-05-03 13:27:36 -04:00
Bram 9ff8cf30b4 Fixed: Some paper schedulers that do not allow a delay of 0 in either the initial or regular delay 2024-05-03 18:53:49 +02:00
retrooper 8092bbdb3b Revert "Fix shadowJar build issues"
This reverts commit bff9ef2f6b.
2024-05-03 18:51:42 +02:00
retrooper bff9ef2f6b Fix shadowJar build issues 2024-05-03 18:42:29 +02:00
AoElite cc1bd65841 fix runAtFixedRate tick conversion in AsyncScheduler 2024-05-03 11:54:06 -04:00
booky10 8a84b1fc15 Fix block state properties being left unparsed
Fixes #728
2024-05-03 17:50:45 +02:00
booky10 09ab2ff82b Revert legacy itemtypes being changed 2024-05-03 16:24:55 +02:00
booky10 a59a8e116c Update all itemtypes for 1.21 2024-05-03 16:17:47 +02:00
booky10 9adfa831bf Update block and item tags for 1.21 2024-05-03 16:13:56 +02:00
booky10 3a4daec265 Add item type mappings for 1.21 2024-05-03 16:13:47 +02:00
booky10 de87ca203e Implement painting variant registry 2024-05-03 16:07:04 +02:00
booky10 9957cb3de9 Add 1.21 banner patterns 2024-05-03 15:57:17 +02:00
booky10 2ac60d7055 Add 1.21 version constants 2024-05-03 15:55:07 +02:00
Abhigya 3015f40531 Merge pull request #731 from AbhigyaKrishna/2.0
Mapping generation fix and task upToDate check
2024-05-03 12:53:24 +05:30
AbhigyaKrishna f4e5dab1d8 feat: mapping task upToDate check 2024-05-03 12:51:20 +05:30
AbhigyaKrishna 2792dd4c78 fix: mappings generation issue 2024-05-03 12:50:54 +05:30
AbhigyaKrishna b4d45f0fba Merge remote-tracking branch 'origin/2.0' into 2.0 2024-05-03 03:50:25 +05:30
AoElite 3443a482b3 async runAtFixedRate fix 2024-05-02 18:12:57 -04:00
AbhigyaKrishna d89af56959 feat: mapping task upToDate check 2024-05-03 03:19:54 +05:30
AoElite 80d7c4a5a9 add runAtFixedRate specifically for ticks in AsyncScheduler 2024-05-02 17:36:36 -04:00
retrooper 810b205cfa Merge pull request #709 from Bram1903/FoliaCompatUtilPatch
Folia Compatibility Utility Rewrite
2024-05-02 23:00:48 +02:00
Bram 0c452ab842 Merge branch 'refs/heads/2.0' into FoliaCompatUtilPatch 2024-05-02 18:16:45 +02:00
Abhigya be414fceb6 Merge pull request #727 from AbhigyaKrishna/2.0
Added missing StateValue for 1.20.5
2024-05-02 21:10:27 +05:30
AbhigyaKrishna 95099e9763 feat: added missing StateValue 2024-05-02 21:09:27 +05:30
Bram f806773cbe Merge branch 'refs/heads/2.0' into FoliaCompatUtilPatch 2024-05-02 17:30:04 +02:00
retrooper 9af8bab57f Merge pull request #724 from LeeGodSRC/fix/cb-relocation
fix: Fixed CB Relocation on Paper 1.20.5+
2024-05-02 17:05:27 +02:00
Bram 20c5d9f28a Merge branch 'refs/heads/2.0' into FoliaCompatUtilPatch 2024-05-02 16:42:54 +02:00
Abhigya cbe474dafa Merge pull request #648 from AbhigyaKrishna/mapping-compression
Mapping compression
2024-05-02 19:21:18 +05:30
AbhigyaKrishna af90c6534b feat: updated license 2024-05-02 19:01:46 +05:30
AbhigyaKrishna 4130fcf172 fix: diff patching 2024-05-02 18:58:29 +05:30
AbhigyaKrishna e321a169c2 test: created mapping test 2024-05-02 18:58:01 +05:30
AbhigyaKrishna 54d4614600 feat: diff interface 2024-05-02 16:52:07 +05:30
AbhigyaKrishna 8fc10e8f62 feat: implement new diff system 2024-05-02 16:45:35 +05:30
AbhigyaKrishna e770a1c9ee feat: robust diff system 2024-05-02 16:45:13 +05:30
AbhigyaKrishna c999f3a810 feat: compression task update 2024-05-02 12:54:05 +05:30
leegod 8e070aac9a fix: Fixed CB Relocation on Paper 1.20.5+ 2024-05-02 13:50:30 +08:00
AbhigyaKrishna faecd9dd9c Updated all mapping to 1.20.5 2024-05-02 04:00:15 +05:30
AbhigyaKrishna e40d8c875f Updated code for new type builder system 2024-05-02 02:39:12 +05:30
Bram 10765058f8 Fixed: Another Return statement missing after scheduling a task on Bukkit rather than Folia 2024-05-01 22:42:44 +02:00
Bram c71d6da310 Fixed: GlobalRegionScheduler#Execute being marked as private
Fixed: Return statement missing after scheduling a task on Bukkit rather than Folia
2024-05-01 22:39:54 +02:00
AbhigyaKrishna 4ec106e36f Merge 2.0 into mapping-compression 2024-05-02 01:44:09 +05:30
Abhigya 66a7ef3ffa Merge pull request #658 from booky10/dev/1.20.5
1.20.5 update
2024-05-02 01:23:56 +05:30
booky10 3d858013e6 Merge branch '2.0' into dev/1.20.5 2024-05-01 17:47:06 +02:00
booky10 3c15e5409f Move general components to another package
Components could potentially be used for something other than items in the future
2024-04-29 18:27:44 +02:00
retrooper 206d484f27 Rename the new FoliaCompatUtil to FoliaScheduler 2024-04-28 23:36:56 +02:00
retrooper e2949ade16 Update copyright years 2024-04-28 23:35:00 +02:00
retrooper 896ed7ff07 Optimizations in event system. 2024-04-28 18:10:22 +02:00
retrooper 4ca682704a Fix finding minecraft server instance on 1.20.5 (atleast on paper) 2024-04-28 18:06:22 +02:00
booky10 2275091e76 Add 1.20.6 versions 2024-04-26 16:53:28 +02:00
booky10 dd71d9ae69 Fix SCUTE/GRASS item types being invalid 2024-04-25 18:21:30 +02:00
booky10 b2d3aee10e Add constants for commonly used tool attribute uuids 2024-04-25 18:18:53 +02:00
booky10 1891307753 Fix GENERIC_GRAVITY attribute key 2024-04-24 20:48:21 +02:00
booky10 399d831d04 Fix reading entity effect for 1.20.5 2024-04-24 19:08:43 +02:00
booky10 29ad41f42f Fix reading mapped entities being two ids offset 2024-04-24 18:55:26 +02:00
booky10 bab19e14bd Merge branch '2.0' into dev/1.20.5 2024-04-24 18:48:09 +02:00
booky10 286ea801d8 Fix explosion sound in WrapperPlayServerExplosion 2024-04-24 18:43:06 +02:00
booky10 6320cc314e Prevent NPE on missing world data
Caused by server not sending data the client already knows about
2024-04-24 18:33:42 +02:00
booky10 cb094f1af3 Fix WrapperConfigServerSelectKnownPacks constructor 2024-04-24 18:22:25 +02:00
booky10 d00d138a21 Fix User#getWorldNBT(Dimension) 2024-04-24 18:22:05 +02:00
booky10 8b86b3e48b Read world nbt from restructured registry data packet 2024-04-24 18:05:46 +02:00
booky10 3232c69a5a Implement dummy component type for components without content 2024-04-24 17:53:15 +02:00
retrooper 4ee24812f4 Merge remote-tracking branch 'origin/2.0' into 2.0 2024-04-24 17:38:07 +02:00
retrooper a2139718a5 Properly cleanup user on proxy 2024-04-24 17:37:42 +02:00
booky10 57e536b8b2 Fix itemstack conversion between bukkit and nms 2024-04-24 17:33:38 +02:00
booky10 ab0e4030c3 Add sound mappings for <1.20.5 2024-04-23 21:32:07 +02:00
booky10 89fe7f43a7 Fix component value writing 2024-04-23 19:15:04 +02:00
booky10 fffb4e08b8 Add tostring handling for components 2024-04-23 19:14:56 +02:00
booky10 1b071e6564 Adjust for new handler names on channel init 2024-04-23 18:58:33 +02:00
booky10 efb1b1e1eb Fix statetype registration 2024-04-19 22:11:31 +02:00
booky10 60421a6727 Fix serverbound configuration phase packets 2024-04-19 22:11:13 +02:00
booky10 7f7107a79a Fix NPE in StateTypes#getByName 2024-04-19 21:12:03 +02:00
booky10 94827892cc Fix attributes for <1.20.5 2024-04-19 16:03:08 +02:00
booky10 78d0d674b5 Implement 1.20.5-rc1 changes for WrapperLoginServerLoginSuccess 2024-04-18 23:25:41 +02:00
booky10 ed681fadd1 Fix sound packet wrappers for >= 1.19.3 when using unregistered sounds 2024-04-18 22:49:27 +02:00
booky10 35de72c331 Implement TrimMaterial and TrimPattern registries
Technically wrong as datapacks can add more stuff, but this works until packetevents actually tracks registry data sent on login
2024-04-18 22:35:19 +02:00
booky10 018d611b2b Small cleanup to component types definition logic 2024-04-18 14:12:49 +02:00
booky10 852d34cdcf Fix equality checks for all component values 2024-04-17 22:33:22 +02:00
booky10 d4fead85b8 Add all generated default components to items 2024-04-17 22:16:12 +02:00
Bram a8bbc97d00 Fixed: Wrong message applied upon detecting an invalid packet 2024-04-17 21:55:34 +02:00
Bram 94d77e94da Merge branch 'refs/heads/2.0' into FoliaCompatUtilPatch 2024-04-17 21:52:37 +02:00
booky10 b1e2a746e3 Implement directly encoded instruments
Also implements sound event registry which is required for this (currently only for 1.20.5)
2024-04-17 19:00:45 +02:00
booky10 1b8e23dcf5 Fix showintooltip empty state for ItemEnchantments component value 2024-04-16 23:35:25 +02:00
booky10 ecd87f2fc6 Finish support for setting components on item type definition 2024-04-16 22:33:35 +02:00
booky10 22453a2fac Implement static component map builder and add shared item type components 2024-04-16 22:22:16 +02:00
booky10 80c1413811 Wrap lore component 2024-04-16 22:21:59 +02:00
booky10 0fcd8d57c0 Implement registry for state types 2024-04-16 22:06:35 +02:00
booky10 750d8813f3 Finish making all components mutable 2024-04-16 21:01:51 +02:00
booky10 ca546a9e59 Start making all components mutable 2024-04-16 19:15:41 +02:00
booky10 29fd80865c Fix compile issues 2024-04-16 18:59:26 +02:00
booky10 ab253a0976 Add potion registry 2024-04-16 18:56:57 +02:00
booky10 5545de8886 Fix equality checks for newly added registries 2024-04-16 18:56:44 +02:00
booky10 637aecbf4b Add armor material registry 2024-04-16 18:39:04 +02:00
booky10 aaf6d41766 Add instrument registry 2024-04-16 18:38:52 +02:00
booky10 f814d0ecf8 Finish implement component type serializers 2024-04-16 18:28:17 +02:00
booky10 f20e8432b1 Finish banner patterns registry 2024-04-16 18:07:56 +02:00
booky10 0e558e4baf Implement even more component types 2024-04-16 17:44:15 +02:00
booky10 5eb7d5b3fc Implement more component types 2024-04-16 13:28:28 +02:00
leegod 87c2ca3c07 feat: Added getter and setter for LightData in WrapperPlayServerChunkData
chore: Added packet transformation for pre 1.18 (where light data and chunk data are sent separately)
2024-04-16 16:39:26 +08:00
leegod 1f1b1aabd1 feat: Added WrapperPlayServerUpdateLight
chore: Moved away LightData values from WrapperPlayServerChunkData
2024-04-16 16:27:53 +08:00
booky10 4a5382b14c Start implementing serializers for some component types
Mojang literally serializes half their entire codebase with these component types, this will take a while
2024-04-15 23:23:59 +02:00
booky10 c2b006ddab Add default component definition support to ItemTypes 2024-04-15 22:42:08 +02:00
booky10 e4b60d55f3 Re-generate all ItemTypes 2024-04-15 22:15:41 +02:00
booky10 4521ce8037 Make all ItemTypes final
187/1344 weren't before, idk why
2024-04-15 21:49:36 +02:00
booky10 73490b8ff6 Implement serialization for new itemstack component patches 2024-04-15 21:36:05 +02:00
AoElite 0549c8e486 Merge pull request #713 from booky10/fix/tab-complete-packet
Fix WrapperPlayClientTabComplete discarding certain fields
2024-04-15 14:51:55 -04:00
booky10 af7c0d346f Unload file mappings after PotionTypes creation 2024-04-15 20:26:25 +02:00
booky10 9a5da1bc9a Implement mappings for potion types 2024-04-15 20:18:51 +02:00
booky10 96a601da74 Fix WrapperPlayClientTabComplete discarding certain fields
Transaction id and assume command flag are lost as these fields get set after the constructor reads from the event
2024-04-15 19:57:44 +02:00
booky10 f29626311c Fix time argument parser for <1.19.4 2024-04-14 23:08:28 +02:00
booky10 ea0b9a497e Implement mappings for command argument parsers
Should also resolve #700, but needs testing
2024-04-14 22:51:31 +02:00
booky10 b11e76494e Implement mappings for block entity types 2024-04-14 22:22:15 +02:00
booky10 cb3a62cf71 Add block entity type mappings data 2024-04-14 22:13:49 +02:00
booky10 992d4855e7 Read unsigned short in creative inventory action packet 2024-04-14 21:55:28 +02:00
booky10 a684b56dc3 Use varints for amplifiers in entity effect wrapper 2024-04-14 21:50:09 +02:00
booky10 e6c86a7e4f Update dimension encoding/decoding 2024-04-14 21:49:58 +02:00
booky10 73e34d8f0b Update WrapperConfigServerRegistryData to 1.20.5-pre1 2024-04-14 21:37:21 +02:00
booky10 d006974e7b Add packet wrappers for all new packets 2024-04-14 21:22:27 +02:00
booky10 0742f24973 Add new potion types 2024-04-14 20:52:16 +02:00
booky10 76bde2568b Add new command argument parsers 2024-04-14 20:52:12 +02:00
booky10 40bd7d60d4 Update packet type ids 2024-04-14 20:51:20 +02:00
booky10 6d7718428a Fix BlockTags/ItemTags 2024-04-14 20:26:40 +02:00
booky10 92229a90e9 Fix WrapperCommonCookieResponse 2024-04-14 20:11:53 +02:00
booky10 7dd6fbd9af Update entity types to 1.20.5-pre1 2024-04-14 20:09:43 +02:00
booky10 2fa285ddde Update particle types to 1.20.5-pre1 2024-04-14 20:05:37 +02:00
booky10 8962c80495 Update some mappings and registries to 1.20.5-pre1 2024-04-14 19:17:46 +02:00
booky10 2dccce47bf Merge branch '2.0' into dev/1.20.5 2024-04-14 03:34:39 +02:00
Bram 6231e8c7d4 Fixed: AsyncScheduler now converts back the delay to ticks using the convertTimeToTicks method when using the Bukkit scheduler 2024-04-09 19:38:57 +02:00
Bram 5ba3080d00 Improved: InternalBukkitListener no longer unnecessarily uses the entity scheduler, but the region scheduler instead
Added: Chunk coordinates to region scheduler world methods
2024-04-09 19:17:54 +02:00
Bram a110c549be Fixed: EntityScheduler being wrongly invoked 2024-04-09 18:57:24 +02:00
Bram 021460ba08 Removed: Unnecessary comments 2024-04-09 09:17:54 +02:00
Bram 74d14166d5 Added: Proper deprecation annotations and documentation
Added: Copyright Notice
2024-04-08 21:42:17 +02:00
Bram f24add4246 Fixed: RegionScheduler being a protected class, instead of public (I only meant to make the constructor protected) 2024-04-08 19:09:03 +02:00
Bram acf631a54f Improved: Java docs 2024-04-06 19:30:48 +02:00
Bram a6b4087454 Fixed: Reflection method name mismatch in the AsyncScheduler and the GlobalRegionScheduler 2024-04-06 18:44:30 +02:00
Bram f392495474 Schedulers are now only able to be initialized from within the FoliaCompatUtil 2024-04-06 18:31:49 +02:00
Bram b8fdd74f96 Added: Paper Schedulers 2024-04-06 16:40:03 +02:00
Bram 9dba5d40ca Added: TaskWrapper
Improved: FoliaCompatUtil reflection caching
2024-04-05 21:30:08 +02:00
retrooper 78c7709add Recognition of SpigotConversionUtil#getEntityById 2024-03-31 01:21:58 +01:00
retrooper 7a0908faaf Fix SpigotConversionUtil#getEntityById for paper 2024-03-31 01:14:49 +01:00
retrooper 0624b1766f On legacy minecraft versions (older than 1.16), the colors are already "down-sampled" so the setting is redundant. On 1.16+, the downsampled setting is set to false by default, and will allows costumization of hex colors. 2024-03-30 23:49:12 +01:00
retrooper 651de583b6 Fix SpigotReflectionUtil#getEntityById for 1.17+ 2024-03-30 23:38:07 +01:00
retrooper c29847af02 Final change in exception handling of readUTF 2024-03-29 21:47:18 +01:00
retrooper 87c8147514 Merge remote-tracking branch 'origin/2.0' into 2.0 2024-03-29 19:48:33 +01:00
retrooper 57778b5eb3 Minor change in exception handling of readUTF 2024-03-29 19:48:11 +01:00
retrooper f2d136af0a Removed unused variable in Location 2024-03-26 18:46:45 +01:00
retrooper 22d568f30e Added direction functionality to location 2024-03-26 18:31:28 +01:00
retrooper 49a81fa4f7 Merge pull request #705 from Leymooo/2.0
Fix UUID serialization on < 1.20.3 servers with Adventure 4.15+
2024-03-24 16:45:27 +01:00
Leymooo 57f9a8fe3a Fix UUID serialization on < 1.20.3 servers with Adventure 4.15+ 2024-03-23 23:33:19 +02:00
retrooper 94c731afbf Merge pull request #704 from z7087/patch-3
Fix BlockFace.getBlockFaceByValue may return OTHER
2024-03-23 01:06:49 +01:00
z7087 98304cb41e Update BlockFace.java 2024-03-17 02:42:53 +08:00
AoElite 70d68d7860 Merge pull request #698 from Wekylend/fix/item-types-map
Fix ItemTypes ITEM_TYPE_MAP key loading
2024-03-16 01:55:30 -04:00
AoElite 5502c4a434 Merge pull request #692 from ytnoos/viaver-dev
Support for ViaVersion dev builds, Fixes #689
2024-03-16 01:45:59 -04:00
Wekylend f424b9bd66 Fix ITEM_TYPE_MAP key loading
This subsequently should fix the getByName method always returning null.
2024-03-09 01:24:29 +01:00
Abhigya c8d0733935 Merge pull request #697 from booky10/fix/missing-block-properties-api
Add missing blockstate property methods for dusted and flower_amount
2024-03-08 10:55:31 +05:30
Abhigya c2ba3304f7 Merge pull request #694 from hypemc-pl/2.0
Correct NBT component style serialization
2024-03-08 10:51:23 +05:30
booky10 510bf9301c Add missing blockstate property getters for dusted and flower_amount 2024-03-07 15:01:54 +01:00
Abhigya 8a64746b18 Merge pull request #695 from AbhigyaKrishna/2.0
Removed invalid function from NBTCodec
2024-03-04 13:45:27 +05:30
AbhigyaKrishna feab6ba0bd Removed invalid function from NBTCodec 2024-03-04 13:42:31 +05:30
Kamilkime f11a5dd31c Correct NBT component style serialization 2024-03-04 02:08:40 +01:00
ytnoos 5a3a4f6507 Support for ViaVersion dev builds 2024-03-02 11:11:11 +01:00
ytnoos e2865ce4be Fix re-encode for new bytebufs that were bigger than the received one 2024-03-02 10:47:52 +01:00
ytnoos f53f182090 MessageSignature limits 2024-03-02 10:34:35 +01:00
ytnoos 2ec7771a8a ByteBufInputStream limits 2024-03-02 10:32:17 +01:00
ytnoos 75320ef583 implemented NBT read limits following vanilla values 2024-03-02 10:29:02 +01:00
retrooper 40fa932d33 Merge pull request #683 from AbhigyaKrishna/2.0
AdventureNBTSerializer reworked
2024-03-01 21:33:57 +01:00
AbhigyaKrishna 1355ca6bdd Optimised imports 2024-02-29 12:46:56 +05:30
AoElite 5639c2b85e Merge pull request #687 from Syntellix/2.0
Implement settings for printing packet exception stacktraces and kicking the player for packet exceptions
2024-02-27 14:48:05 -05:00
AoElite baa8837987 Merge pull request #686 from SamB440/feat/read-only-block-data
Add methods for getting WrappedBlockStates without cloning
2024-02-27 13:48:03 -05:00
MachineBreaker 38f2783149 Apply requested changes 2024-02-27 14:17:17 -04:00
MachineBreaker 43a5e2c590 Add settings for full stacktrace and player kicking
Idea from AoElite
2024-02-27 13:59:41 -04:00
MachineBreaker 9a124b8e68 Don't print full stacktrace if debug is not enabled 2024-02-27 13:27:32 -04:00
SamB440 02b9e9260f Add methods for getting WrappedBlockStates without cloning 2024-02-27 16:29:57 +00:00
AbhigyaKrishna d109e9dd54 Reading text field from number and boolean 2024-02-25 13:24:13 +05:30
AbhigyaKrishna 2ea24250a0 Component serialization for boolean and number 2024-02-25 13:06:45 +05:30
AbhigyaKrishna 39d555f3ec Update license 2024-02-24 20:31:32 +05:30
AbhigyaKrishna 6e09ec2e2b Simplified decoration reading 2024-02-24 17:37:18 +05:30
AbhigyaKrishna f91de06044 AdventureNBTSerializer rework (minor patch) 2024-02-24 13:36:59 +05:30
AbhigyaKrishna 63e3563a1a Merge remote-tracking branch 'origin/2.0' into 2.0
# Conflicts:
#	api/src/main/java/com/github/retrooper/packetevents/util/adventure/AdventureNBTSerializer.java
2024-02-24 13:34:22 +05:30
AbhigyaKrishna 655d97c73a AdventureNBTSerializer rework 2024-02-24 13:33:58 +05:30
AbhigyaKrishna a7c8f21d31 AdventureNBTSerializer rework 2024-02-24 13:18:28 +05:30
AbhigyaKrishna f23ff3d421 pattern matching for excluding gson 2024-02-24 13:17:44 +05:30
AbhigyaKrishna 766f0c0a32 NBT toString implementation 2024-02-24 13:15:45 +05:30
retrooper e13d52a518 Attempted fixes at WrapperPlayServerDeclareCommands 2024-02-23 19:55:27 +01:00
AbhigyaKrishna 329b8adefa Removed debug statements 2024-02-12 02:51:22 +05:30
retrooper 5bb90aa0de Update PacketEvents version to 2.2.1 2024-02-11 22:20:55 +01:00
AbhigyaKrishna a7949eb096 Merge remote-tracking branch 'origin/mapping-compression' into mapping-compression 2024-02-12 02:50:11 +05:30
AbhigyaKrishna a4288ca29c Fixed loading of Block states 2024-02-12 02:49:51 +05:30
retrooper 9b1e92b555 Increase DEPTH_LIMIT of components to 512 2024-02-11 22:10:39 +01:00
retrooper 104615edb5 Increase AdventureNBTSerialization#DEPTH_LIMIT to 13 2024-02-11 21:54:43 +01:00
retrooper 9f54ca6843 Fixing metrics on velocity module 2024-02-11 21:52:50 +01:00
retrooper 46919017e1 Merge remote-tracking branch 'origin/2.0' into 2.0 2024-02-11 21:27:19 +01:00
retrooper 0a1ce38c7e Fix null player instance in event after reload. 2024-02-11 21:26:51 +01:00
retrooper f60d5230c3 Merge pull request #668 from honkling/2.0
Request signatures from Mojang API
2024-02-11 21:19:18 +01:00
retrooper 8034f5dc89 Merge remote-tracking branch 'origin/2.0' into 2.0 2024-02-11 21:14:19 +01:00
retrooper 265ade55d0 Credit to vytskalt: Limit objective display name to 32 characters (new commit created due to PR conflicts) 2024-02-11 21:13:53 +01:00
retrooper cffcbaf596 Merge pull request #655 from BlueTree242/2.0
Assume protocols higher or lower than the supported versions as closest protocol versions
2024-02-11 21:08:18 +01:00
retrooper 4dc90a2920 Deprecate ClientVersion#LOWER_THAN_SUPPORTED_VERSIONS
and ClientVersion#HIGHER_THAN_SUPPORTED_VERSIONS
2024-02-11 21:07:22 +01:00
retrooper e5b5845ebf Update copyright year on newly created files. 2024-02-11 19:56:36 +01:00
Abhigya b5f6a7f6b8 Merge pull request #676 from AbhigyaKrishna/2.0
Fixed adventure version detection
2024-02-09 00:26:11 +05:30
AbhigyaKrishna f916addda3 Fixed adventure version detection 2024-02-09 00:22:47 +05:30
retrooper d275fb8d8b Merge pull request #669 from booky10/fix/breeze-poses
Add missing entity poses for 1.20.4
2024-02-08 00:15:41 +01:00
retrooper 3ce8971215 Little comment on EntityPoses for clarity when looked at in the future 2024-02-08 00:15:25 +01:00
retrooper 5866e4ede1 Merge pull request #674 from gabber235/2.0
Added WrapperPlayServerSetActionBarText
2024-02-08 00:06:22 +01:00
retrooper a47040e18a Spacing change 2024-02-08 00:06:03 +01:00
retrooper 631b41d9d0 Some changes to WrapperPlayServerActionBar
Unfortunately we need to name it WrapperPlayServerActionBar, so that it aligns with the packet type enum constant. I like that you tried to use wiki.vg/Protocol naming, but packetevents needs to be consistent in its naming.
2024-02-08 00:05:28 +01:00
Gabber235 8b9cf0c283 Add Set Action Bar Text Wrapper 2024-02-07 18:52:21 +01:00
retrooper e7afd771f8 Merge pull request #672 from AbhigyaKrishna/2.0
Updated AdventureSerializer for adventure 4.15.0
2024-02-06 22:01:34 +01:00
AbhigyaKrishna 98446b5afc Changed improper variable name 2024-02-07 01:25:25 +05:30
AbhigyaKrishna 0fbfca81a1 Updated AdventureSerializer for adventure 4.15.0 2024-02-06 23:54:38 +05:30
booky10 33f1eab93b Add missing entity poses for 1.20.4 2024-02-03 17:44:12 +01:00
retrooper 38fcccd7c9 Merge pull request #651 from cheaterSK/2.0
Fix packet encoding on Velocity
2024-02-02 21:57:43 +01:00
honkling 053768ccfa Request signatures from Mojang API 2024-02-01 21:10:59 -06:00
AoElite d11a0406cb Merge pull request #661 from joshuaprince/vibration-particle-entity-height
Read and write entity eye height in Vibration particle wrapper
2024-02-01 15:13:52 -05:00
AoElite 5966ca1355 Merge pull request #660 from booky10/fix/scoreboard-packets
Fix scoreboard objective packet
2024-02-01 15:13:12 -05:00
AoElite 72944a00c0 add max durability to netherite armor itemtypes 2024-02-01 14:55:53 -05:00
retrooper 671c935134 Merge pull request #665 from booky10/fix/adventure-v4.15
Fix gson component serialization for adventure v4.15
2024-01-23 23:12:23 +01:00
booky10 c931974779 Fix gson component serialization for adventure v4.15 2024-01-23 19:52:18 +01:00
Joshua Prince 5e6d0bffde Read and write entity eye height in Vibration particle wrapper
Fixes https://github.com/joshuaprince/CoordinateOffset/issues/9

Vibration particle data for vibrations emitted by entities contains
an "entity eye height" field. The ParticleVibrationData wrapper for
WrapperPlayServerParticle did not read or write this field, so any
usage of this wrapper would corrupt the packet and cause players to
be kicked when they moved near an entity that can receive vibrations
(i.e. Wardens).

Tested on 1.19.4 and 1.20.4. This field has been present and unchanged
since 1.19's changes to the Vibration particle (which is also the
first fully-released version to add Wardens):
https://wiki.vg/index.php?title=Data_types&oldid=17608#Particle
2024-01-22 23:19:28 -08:00
retrooper c08719acc7 Merge pull request #663 from booky10/fix/villager-levels
Fix VillagerLevel being invalid
2024-01-22 18:22:07 +01:00
booky10 e76b00c880 Fix VillagerLevel being invalid 2024-01-22 13:38:38 +01:00
cheaterSK b30d56ed0b Merge branch 'retrooper:2.0' into 2.0 2024-01-20 22:43:44 +01:00
booky10 211b85a51b Add missing constructor parameter for ScoreFormat in WrapperPlayServerScoreboardObjective 2024-01-20 19:02:31 +01:00
booky10 f895ff0e0a Fix missing version check for scoreboard objective 2024-01-20 19:01:27 +01:00
booky10 3726f6629a Add common packet implementation for cookie responses 2024-01-19 20:12:38 +01:00
booky10 33aae65e35 Update particle type mappings for 24w03b 2024-01-19 18:05:07 +01:00
AoElite 6f0f6eaa24 Merge pull request #601 from mpc19/2.0
Updater updates
2024-01-18 22:24:32 -05:00
AoElite d6ee3b356e Merge pull request #657 from joshuaprince/sign-editor
Properly read isFrontText in sign edit wrappers
2024-01-18 22:20:22 -05:00
booky10 2d495b7570 Add backwards compatibility for sweeping edge renaming 2024-01-17 23:09:27 +01:00
booky10 5a8acfdffd Add packet wrapper for all new packets 2024-01-17 22:49:48 +01:00
booky10 1938f9f3bf Fix missing play PacketType 2024-01-17 22:39:35 +01:00
booky10 672b8e47fd Update login encryption request packet 2024-01-17 22:33:25 +01:00
booky10 846d0a893e Update secure chat enforcement fields 2024-01-17 22:33:14 +01:00
booky10 fb45b5b35a Update handshake packet for 24w03a 2024-01-17 22:27:31 +01:00
booky10 1205020451 Update block and item tags 2024-01-17 22:19:12 +01:00
booky10 3ed2735d0e Rename enchantment "sweeping" to "sweeping_edge" 2024-01-17 22:11:53 +01:00
booky10 5b3d6ae7a2 Update attribute mappings for 24w03a 2024-01-17 22:09:11 +01:00
booky10 e3d9638b47 Update packet types and ids for 24w03a 2024-01-17 21:58:02 +01:00
booky10 9ec6118159 Merge branch '2.0' into dev/1.20.5 2024-01-17 21:43:47 +01:00
Joshua Prince 7b800a9015 Properly read isFrontText in sign edit wrappers
Fixes https://github.com/retrooper/packetevents/issues/656

WrapperPlayServerOpenSignEditor and WrapperPlayClientUpdateSign
break editing the back of signs by simply calling the wrapper. The
initializers for these isFrontText fields to "true" ran AFTER the
wrappers' superclass constructor, which means that the initializers
would overwrite the value set by the "read" method.
2024-01-16 23:48:56 -08:00
BlueTree242 ba0feb31f0 Assume protocol versions below lowest supported versions 1.7.2, and above highest supported version to be 1.20.4 2024-01-15 09:56:29 +02:00
AoElite 36b73752f7 Merge pull request #649 from SamB440/fix/pack-send-prompt
Fix WrapperPlayServerResourcePackSend in 1.16
2024-01-14 15:23:22 -05:00
cheaterSK 6f0586ce23 Fix memory leak 2024-01-13 15:28:46 +01:00
cheaterSK 59159d47a0 Fix packet encoding on Velocity 2024-01-13 13:36:35 +01:00
retrooper 23c0fc9bff PacketWrapper#prepareForSend including proxy parameter created. 2024-01-12 23:05:12 +01:00
retrooper c34690197d Merge pull request #647 from Tofaa2/2.0
Implement misc missing protocol objects into packet events
2024-01-12 22:47:51 +01:00
TofaaandJulian c98425cb99 Update api/src/main/java/com/github/retrooper/packetevents/protocol/entity/villager/VillagerData.java
Co-authored-by: Julian <53055251+NoJokeFNA@users.noreply.github.com>
2024-01-11 13:03:09 +03:00
TofaaandJulian 55f4280ccb Update api/src/main/java/com/github/retrooper/packetevents/protocol/entity/villager/VillagerData.java
Co-authored-by: Julian <53055251+NoJokeFNA@users.noreply.github.com>
2024-01-11 13:01:36 +03:00
TofaaandJulian b9299dfa96 Update api/src/main/java/com/github/retrooper/packetevents/protocol/entity/villager/level/VillagerLevel.java
Co-authored-by: Julian <53055251+NoJokeFNA@users.noreply.github.com>
2024-01-11 13:01:23 +03:00
TofaaandJulian b1fb30163c Update api/src/main/java/com/github/retrooper/packetevents/protocol/world/Rotation.java
Co-authored-by: Julian <53055251+NoJokeFNA@users.noreply.github.com>
2024-01-11 13:01:18 +03:00
Tofaa 50b8776aa9 fix retrooper nitpick 2024-01-11 13:01:48 +03:00
Tofaa d47b450307 Add copyright headers 2024-01-09 05:32:58 +03:00
SamB440 1f41447a02 Fix WrapperPlayServerResourcePackSend in 1.16 2024-01-07 14:40:30 +00:00
AbhigyaKrishna af251d03b8 Use new mappings scheme 2024-01-07 15:48:35 +05:30
AbhigyaKrishna 1445057145 Mapping Compression Task 2024-01-07 15:47:45 +05:30
Tofaa a306ac26b9 add constructors to support the Color api 2024-01-06 03:24:32 +03:00
Tofaa df6a334a00 implement color api 2024-01-06 03:20:32 +03:00
Tofaa c43ea28f59 Create Rotation.java 2024-01-06 03:19:45 +03:00
Tofaa 596f1b57ce add villager level api 2024-01-06 03:15:44 +03:00
retrooper 386238aae8 Fix Vector3i#subtract 2024-01-05 12:00:31 +01:00
retrooper e7dcb4c96e Merge pull request #643 from booky10/fix/scoreboard-wrappers
Fix scoreboard wrappers for 1.20.3/1.20.4
2024-01-04 12:09:32 +01:00
retrooper 6049e37d87 Minor change to ScoreFormatType 2024-01-04 12:09:07 +01:00
booky10 a41e747da7 Fix objective name and score owner character limitation
Was removed by mojang in 1.18
2024-01-03 22:47:14 +01:00
booky10 c4c61dff3c Fix issues noticed while testing 2024-01-03 22:35:12 +01:00
booky10 84b85c8f00 Fix WrapperPlayServerScoreboardObjective and WrapperPlayServerUpdateScore on 1.20.3/1.20.4 2024-01-03 21:32:02 +01:00
AoElite f9b3786c16 fix exception if lvl nbt is missing from enchanted items 2024-01-03 13:46:14 -05:00
retrooper d2350ad383 Update README.md 2024-01-01 11:52:02 +01:00
MWHunter f6c554da02 fix reflection after paper update 2023-12-31 09:57:39 -06:00
booky10 721532ee44 Merge branch '2.0' into dev/1.20.5 2023-12-30 05:10:54 +01:00
AoElite 7ff8c40402 add equals & hashcode to statetype 2023-12-27 17:48:05 -05:00
retrooper df6d7fa741 Fix npc's not spawning on modern versions 2023-12-26 10:16:49 +01:00
booky10 c936c9da31 Merge branch '2.0' into dev/1.20.5 2023-12-26 03:56:11 +01:00
retrooper 3a5aa401f0 Merge pull request #634 from SamB440/fix/test-ci
v2: Fix tests for actions, bump gradle wrapper
2023-12-22 18:08:30 +01:00
SamB440 9c5263bf20 v2: Fix tests for actions, bump gradle wrapper 2023-12-22 15:00:13 +00:00
booky10 28cb480ac3 Merge branch '2.0' into dev/1.20.5 2023-12-22 02:49:37 +01:00
retrooper 838426e1bf Merge pull request #633 from retrooper/revert-629-fix/test-ci
Revert "Fix tests for actions, bump gradle wrapper"
2023-12-21 18:49:21 +01:00
retrooper d486863a64 Revert "Fix tests for actions, bump gradle wrapper" 2023-12-21 18:48:08 +01:00
retrooper cd98e8488b Merge pull request #629 from SamB440/fix/test-ci
Fix tests for actions, bump gradle wrapper
2023-12-21 18:44:34 +01:00
retrooper a7c6f88a11 Merge pull request #630 from SamB440/feat/better-tests
Fix ItemTags, improve testing
2023-12-21 18:44:10 +01:00
retrooper c15b88e77f Merge pull request #632 from booky10/fix/bits-overflow-global-palette
Fix bits overflowing when using global palette with bit storage
2023-12-21 18:42:59 +01:00
booky10 1a2d39d68f Fix bits overflowing when using global palette with bit storage 2023-12-21 01:53:11 +01:00
SamB440 fe8ca640cc Test ItemTags like BlockTags, add dummy API instance in tests, fix REPLACEABLE_PLANTS 2023-12-20 14:34:29 +00:00
booky10 26eee81455 Also add validity check to ItemTags 2023-12-19 21:42:56 +01:00
booky10 8c63a7c7b6 Update item tags to 23w51b 2023-12-19 21:38:44 +01:00
booky10 d221869491 Re-generate block-/item-tags
But this time with correct ordering
2023-12-19 21:36:46 +01:00
booky10 539b814a5a Update attributes update packet structure
Attributes are now encoded as id instead of writing their keys
2023-12-19 21:05:05 +01:00
booky10 d0da1d710b Add attribute mappings
Attributes are now encoded with their id in packets
2023-12-19 20:56:17 +01:00
booky10 2771959dd8 Update effect packet structure
Removes factor data
2023-12-19 20:43:34 +01:00
booky10 aa17d098c4 Update entity data type mappings 2023-12-19 20:40:15 +01:00
booky10 7a1f432652 Update item type mappings 2023-12-19 20:35:22 +01:00
booky10 bca60bfa19 Update entity type mappings 2023-12-19 20:35:17 +01:00
booky10 94e2dc0378 Add 1.20.5 version constants 2023-12-19 20:35:09 +01:00
SamB440 e8bdd02838 Gradle 8.5 2023-12-19 18:26:20 +00:00
SamB440 b962876dfd Use build task instead of shadowJar to support tests 2023-12-19 18:21:34 +00:00
retrooper f0135204e3 Merge pull request #626 from SamB440/fix/twenty-three-tags-2
Ensure order of block tags is correct
2023-12-15 22:35:08 +01:00
SamB440 5bedb44e11 Ensure order of block tags is correct 2023-12-15 21:24:46 +00:00
retrooper 4e3ada1bd8 Merge pull request #625 from SamB440/fix/twenty-three-tags
Fix 1.20.3/4 experimental block and item tags
2023-12-15 21:55:41 +01:00
SamB440 38d68418dc Fix 1.20.3/4 experimental block and item tags 2023-12-14 14:49:35 +00:00
retrooper 5f8efaaf0f Correction in documentation 2023-12-13 21:34:05 +01:00
retrooper 9b8de173e4 EntityMetadataProvider backwards compatibility 2023-12-13 21:30:24 +01:00
retrooper de4594fbdc EntityMetadataProvider abstraction has been completed (now provides a protocol version) 2023-12-13 21:26:09 +01:00
retrooper 5eae00ef0b Minor change to velocity module 2023-12-13 21:07:22 +01:00
retrooper 3c418473d8 Releasing 2.2.0
- Initialization Optimization on Spigot
- bStats support implemented for Velocity
- bStats support implemented for BungeeCord
2023-12-13 21:05:53 +01:00
retrooper 1e919053c6 Merge pull request #623 from booky10/dev/1.20.3
1.20.3/1.20.4 update
2023-12-12 22:39:15 +01:00
booky10 30ff648bad Add handling for unnamed simple components as serialized compounds 2023-12-09 00:57:17 +01:00
booky10 6c5d9beb76 Rewrite adventure nbt serialization
This will now skip building nbt objects and will directly build adventure components
2023-12-09 00:10:46 +01:00
retrooper 3e828ea9ee * Added 1.20.4 version constants
* GRASS -> SHORT_GRASS, but GRASS is deprecated.
* WrapperPlayServerTickingInfo -> WrapperPlayServerTickingState
* WrapperPlayServerTickingStep minor changes
2023-12-08 13:05:03 +01:00
booky10 4ef8b381d7 Fix NPE for adventure nbt deserialization if no translation args are present 2023-12-05 20:44:09 +01:00
booky10 24838cd7d9 Fix new particle type ids being ignored 2023-12-05 20:24:47 +01:00
booky10 e17b877b5f Add crafting and trial_spawner_state state values 2023-12-05 20:11:50 +01:00
booky10 8b85bc8d4d Some various fixes for packet wrappers 2023-12-05 20:03:35 +01:00
booky10 fca9ad22fe Fix wrong config packet type registration 2023-12-05 20:03:17 +01:00
retrooper 8f7ec3d38a PacketEvents 2.1.0 release 2023-11-27 19:18:01 +01:00
retrooper 41969994b2 EntityMetadataProvider has been added, to allow potential packetevents addons to add on to our metadata abstraction. 2023-11-27 19:01:12 +01:00
booky10 667652bfb8 Add new resourcepack status for 1.20.3-pre3 2023-11-27 17:29:40 +01:00
booky10 2da42185e8 Rename grass to short_grass for 1.20.3-pre1 2023-11-20 20:23:55 +01:00
booky10 fd1b918956 Update packet structures for 1.20.3-pre1 2023-11-20 20:22:53 +01:00
booky10 828013bf77 Update packet ids for 1.20.3-pre1 2023-11-20 20:22:37 +01:00
booky10 6e30fb393a Move new entitytypes to bottom 2023-11-17 19:13:52 +01:00
booky10 cbfca6c5fa Update block/item tags to 1.20.3
Also fixes incorrect ordering
2023-11-17 18:26:12 +01:00
booky10 945ca46491 Fix missing fields for state types 2023-11-17 16:47:26 +01:00
booky10 f7d5252bf0 WIP new state types 2023-11-16 23:24:07 +01:00
booky10 a624a76427 Add new item types 2023-11-16 22:57:27 +01:00
booky10 39f9ed008c Add new particle types 2023-11-16 22:36:31 +01:00
booky10 a0096b3032 Add breeze and wind charge entity types 2023-11-16 22:31:23 +01:00
booky10 ae1a0258fe Add new game state change "reasons" 2023-11-16 22:22:23 +01:00
booky10 f863ad026f Update explosion packet 2023-11-16 22:17:07 +01:00
booky10 abea90564f Update vibration particle data 2023-11-16 22:01:28 +01:00
booky10 3bdd110864 Fix blockstate registry index not being incremented 2023-11-16 21:47:00 +01:00
booky10 b2e47f48a5 Use nbt-based component read/write methods 2023-11-16 21:45:09 +01:00
booky10 513de88321 Update serverbound jigsaw block packet 2023-11-16 20:11:13 +01:00
retrooper 4a2146d16d Merge pull request #622 from rexlManu/2.0
Relocate only the gson and legacy
2023-11-16 20:02:18 +01:00
booky10 5a49cf2687 Implement packet wrappers for new serverbound packets 2023-11-16 18:49:29 +01:00
booky10 65fba0b83d Implement packet wrappers for new clientbound packets 2023-11-16 18:49:13 +01:00
booky10 5272557f58 Add dummy "style" command argument parser 2023-11-16 18:29:44 +01:00
booky10 51abf38d3f Fix names of command argument parsers 2023-11-16 18:28:55 +01:00
booky10 33abe17a2b Add block mappings for 1.20.3 2023-11-16 18:25:18 +01:00
booky10 593015dd0b Add new packet types 2023-11-16 18:21:29 +01:00
Emmanuel Lampe 079a2fcc53 Relocate kyori legacy and gson separate for bungeecord 2023-11-15 03:17:02 +01:00
Emmanuel Lampe b9d4ed6a60 Relocate kyori legacy and gson separate 2023-11-15 03:16:09 +01:00
retrooper aec45f19e4 Merge pull request #619 from KaspianDev/fix-merchantoffers
Fix merchant offers always being empty
2023-11-10 17:17:31 +01:00
KaspianDev 0aaa4f42b1 Fix merchant offers always being empty 2023-11-10 16:52:49 +01:00
retrooper 75dfc63d3b Merge pull request #618 from SoSeDiK/blockId
Expose block id to BaseChunk
2023-11-07 18:34:37 +01:00
retrooper ac501a26b2 Fix the way we access NetworkManager (recent server builds have changed it) 2023-11-04 23:03:23 +01:00
SoSeDiK 3ebf39d3bd Expose block id to BaseChunk 2023-11-03 21:17:20 +02:00
retrooper 363931875f Stop depending on funkemunky jars. 2023-11-01 11:11:55 +01:00
retrooper b1802fbc0c Merge pull request #613 from 4drian3d/velocity-changes
Some Velocity module improvements
2023-11-01 10:30:18 +01:00
retrooper 9f9cdca53a Fix connection state issues and casting issues with events 2023-11-01 10:29:27 +01:00
Adrian 00c85f3e41 Some Velocity module improvements
- Removed PostOrder LATE usage
- Use Injected PluginContainer
- Disabled debug mode by default
- Replace deprecated method
2023-10-17 10:36:18 -05:00
retrooper b48a91bcee PotionTypes.getById works now 2023-10-11 19:18:47 +02:00
retrooper 709edd8b21 Merge pull request #610 from AbhigyaKrishna/2.0
Retain backward compatibility with adventure 5.0.0
2023-10-11 18:57:45 +02:00
retrooper 90edf6002e PotionTypes now requires a version to work correctly. 2023-10-11 18:04:30 +02:00
retrooper 4e151f8dfb Pushing out 2.1.0 snapshot for 1.20.2 update 2023-10-07 17:14:07 +02:00
retrooper 0165e8a4ac Merge pull request #607 from booky10/dev/1.20.2
1.20.2 update
2023-10-06 23:48:39 +02:00
retrooper 385000b608 * Add full support for PacketConfigReceive & SendEvent
* WrapperConfigClientClientSettings renamed to WrapperConfigClientSettings
2023-10-06 23:42:54 +02:00
booky10 a1b7c947a0 Use ServerVersion instead of ClientVersion for potion effects 2023-10-03 14:58:31 +02:00
Abhigya ab5163bc66 Retain backward compatibility with adventure 5.0.0 2023-10-02 00:41:27 +05:30
booky10 38b25b6d48 Fix wrapper name for debug pong packet
It's not chunk related, just a copy-paste error
2023-09-27 22:42:25 +02:00
booky10 9d5d4858cf Fix blockstate mappings index 2023-09-23 00:48:32 +02:00
booky10 2e6c43ba06 Extract dimension information from registry data packet instead of login packet 2023-09-22 20:32:30 +02:00
booky10 f180a4a172 Fix packet wrapper constructor parameter types 2023-09-22 20:31:56 +02:00
booky10 5ce6b8bf9e Fix missing clientbound configuration packettype 2023-09-22 20:24:22 +02:00
booky10 b61602741b Rebase on latest changes 2023-09-22 20:24:08 +02:00
booky10 13ba9e7b81 Switch protocol after receiving signaling packet 2023-09-22 20:18:00 +02:00
booky10 d4c9444fd5 Separate encoder and decoder protocol state 2023-09-22 20:17:11 +02:00
booky10 b6c079af66 Add packet wrappers for nearly all new packets in 1.20.2
Only one missing is tags update, which already didn't have a wrapper before
2023-09-22 20:17:11 +02:00
booky10 a18d288079 Update packet structures for 1.20.2 2023-09-22 20:17:09 +02:00
booky10 c3d8f91e85 Update all mappings for 1.20.2 2023-09-22 20:16:37 +02:00
retrooper 0ca2f5c50a Minor tweaks to velocity (update api) 2023-09-22 15:21:47 +02:00
retrooper cdc7ed36e0 PacketEvents 2.0.2 update 2023-09-13 16:01:41 +02:00
retrooper 5d63308a22 Delete WrapperPlayServerChunkData default values 2023-09-13 15:36:20 +02:00
retrooper 214706dbb6 Fix update checker colors 2023-09-12 00:59:18 +02:00
retrooper fa3b563c70 2.0.1 release 2023-09-12 00:36:31 +02:00
retrooper 55e31483e7 Changes to naming of WrapperPlayServerHurtAnimation 2023-09-12 00:02:38 +02:00
retrooper aa34910468 Update User#getWorldNBT usages to handle a nullable value. 2023-09-11 23:35:11 +02:00
retrooper 5e44913a5e Sending packets on proxies is now supported!
* ChannelInjector#isProxy added to detect if our implementation is running on a proxy
2023-08-31 20:25:27 +02:00
retrooper b8dc964112 Add jenkins builds on README 2023-08-31 10:40:57 +02:00
retrooper 890844fb60 Fix broken link in README 2023-08-31 10:40:08 +02:00
retrooper fc57c9e077 Update README 2023-08-31 09:46:32 +02:00
retrooper f12ef113aa Fixed packet-modification on BungeeCord. 2023-08-26 22:35:29 +02:00
retrooper e8144ece97 Minor fix to 1.12 item type mappings. 2023-08-24 18:42:48 +02:00
retrooper b611ad5522 Update to 1.20 bungeecord API for packetevents 2.0.0 2023-08-22 19:47:15 +02:00
retrooper 53e1014c8d Cleanup to build.gradle for 2.0.0 rollout 2023-08-22 19:15:43 +02:00
retrooper 69f992a984 PacketEvents 2.0.0 release rollout 2023-08-22 19:12:53 +02:00
retrooper fde9db39b7 Update README 2023-08-22 18:19:26 +02:00
retrooper 6c6a2535c8 Don't think getEntityById is a function that can be fixed 2023-08-22 18:01:31 +02:00
retrooper 23d06075dd Fix BungeeCord injector, you may now listen to packets on proxies. 2023-08-22 17:39:19 +02:00
retrooper 926fd1ae50 Set default values for data inside ChunkData wrapper 2023-08-22 15:04:12 +02:00
AoElite 756add003f Catch exceptions not throwables for events 2023-08-17 18:48:14 -04:00
mpc19 aaf00bf167 Updater Update | Part 2 2023-08-05 12:25:28 +01:00
mpc19 d72c8df72c Updating the Updater
- Reduced amount of times it checks for update
- Remove error trace logs from console to prevent spam if it can't connect to github (firewalls, offline, etc)
- Removed random bracket in a message while making another follow the standard format used in previous messages.
- Replace some system print methods with LogManager methods
2023-08-04 23:37:16 +01:00
retrooper 800ffafb96 Update README.md 2023-07-15 19:16:11 +02:00
AoElite ba2d9ae9f0 Merge pull request #598 from clrxbl/fix/chest-block-attributes
Fix chest block attribute order
2023-07-04 18:20:33 -04:00
Michael 31d07e4a39 Fix chest block attribute order 2023-07-05 00:07:12 +02:00
retrooper ec36a5d1d8 Set reEncodeByDefault to true by default 2023-06-29 11:53:04 +02:00
retrooper 08ba59e1d9 Merge pull request #596 from SamB440/fix/mosaic
More block tag fixes
2023-06-28 19:47:51 +02:00
retrooper 851c74e827 Merge pull request #597 from SamB440/feat/item-tags-one-twenty
Update ItemTags to 1.20
2023-06-28 19:47:05 +02:00
SamB440 b31893e035 Update ItemTags to 1.20 2023-06-27 13:51:35 +01:00
SamB440 4718fb985d Might as well add all new 1.20 tags 2023-06-26 22:07:18 +01:00
SamB440 aed9bc14fa Add SWORD_EFFICIENT block tag 2023-06-26 21:56:30 +01:00
SamB440 1daad13da3 Mosaic + step sound blocks 2023-06-26 21:43:58 +01:00
retrooper 65a984e805 Fix NPC#updateTabPing 2023-06-26 22:15:30 +02:00
retrooper a923b950f6 Add getters for WrapperPlayServerBlockChange 2023-06-25 00:29:02 +02:00
retrooper ac5790411f MessageSignData is no longer an optional in chat message wrapper, but the signature bytes can be set to length 0, to indicate that it is not present, otherwise it is. 2023-06-25 00:25:07 +02:00
retrooper cd3449ade2 Newer chat message wrappers extend chat message_v_16 to simplify usage for users aiming 1.16+ 2023-06-23 20:27:25 +02:00
retrooper 75af221f77 Account for fake players that trigger onJoin event. 2023-06-19 17:48:36 +02:00
retrooper 6f9b2cf5e9 Deprecate ChatMessage_v1_19_3 2023-06-19 17:39:32 +02:00
retrooper 4b4dd492cf Fix ChatMessage_v1_19_3#setChatContent 2023-06-19 17:35:35 +02:00
retrooper 68471d32c8 Fix ChatMessage_v1_19_3#setChatContent to update the plainContent 2023-06-18 08:50:33 +02:00
retrooper b7d0ce9518 Make ChatMessage_v1_19_3#unsignedChatContent nullable, getter returns an optional 2023-06-17 23:35:46 +02:00
retrooper 58abfc0c1e Merge pull request #594 from AbhigyaKrishna/2.0
1.19.3 ChatMessage fix
2023-06-17 23:31:48 +02:00
AbhigyaKrishna a3f6adac2f More effective case check for 1.19.1 chat component 2023-06-18 02:53:39 +05:30
AbhigyaKrishna f0c9af4464 Revert "Fix ChatMessageProcessor_v1_19_3's unsignedChatContent being null"
This reverts commit f43fff899f.
2023-06-18 02:52:25 +05:30
retrooper f43fff899f Fix ChatMessageProcessor_v1_19_3's unsignedChatContent being null 2023-06-17 23:14:33 +02:00
AbhigyaKrishna 9291fd8953 1.19.3 ChatMessage fix 2023-06-18 02:34:48 +05:30
retrooper feb975010e Fix 1.19.3+ outgoing chat processing. LastSeenMessages -> LastSeenMessages.Packed 2023-06-16 22:47:15 +02:00
retrooper 5c34c8e6c3 Cleanup of Optional uses 2023-06-16 22:46:11 +02:00
retrooper 8aaf40fc74 Now able to detect 1.20.1 servers. 2023-06-14 23:21:10 +02:00
retrooper c6fcab2923 Merge remote-tracking branch 'origin/2.0' into 2.0 2023-06-14 17:55:27 +02:00
retrooper 64006b91a4 Fix particle importing on 1.8 2023-06-14 17:55:09 +02:00
DefineOutside 625a66f45a Merge pull request #592 from AoElite/2.0
Add cracked state value
2023-06-12 21:13:44 -05:00
AoElite 0c6208f931 add cracked state value 2023-06-12 22:11:37 -04:00
retrooper be32f464c5 Merge pull request #591 from SamB440/fix/block-tags
Fix missing block tag states
2023-06-12 22:13:12 +02:00
SamB440 3389baf40e More missing block tag states 2023-06-12 20:45:26 +01:00
retrooper edc85e68e8 Update copyright year 2023-06-12 20:14:05 +02:00
SamB440 3f9f093934 Fix missing block tag states 2023-06-12 19:09:25 +01:00
retrooper 31426cc69c Add WrapperPlayServerBundle wrapper. 2023-06-12 19:54:33 +02:00
retrooper cec8c9789f SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE fixed 2023-06-12 17:30:38 +02:00
retrooper f771e15ce0 * Added new StateTypes for 1.20 minecraft
* SUSPICIOUS_SAND now has an assigned tool(a shovel), and has been updated (since 1.20)
2023-06-12 17:04:28 +02:00
retrooper 68a3702cd6 ItemType key is always lowercased 2023-06-12 15:21:59 +02:00
retrooper 8f4f688fb8 Update WrappedBlockState mappings, still need to add new state types i believe 2023-06-12 00:35:54 +02:00
retrooper 0a380344c5 Updated particle type mappings to 1.20 minecraft 2023-06-11 23:16:46 +02:00
retrooper ab458ded62 Rename "var_long" to "long" in EntityDataTypes 2023-06-11 22:50:12 +02:00
retrooper 3bc78c1aec ItemType mappings updated, new item types added to API 2023-06-11 22:22:39 +02:00
retrooper 0feebb6819 Fix chat wrapper for 1.19.3+ 2023-06-11 12:34:52 +02:00
retrooper cdb48e0ab6 Fix chat & encryption wrapper (salt signature processing) 2023-06-11 12:20:41 +02:00
retrooper 85e819d72f Fix AdventureReflectionUtil 2023-06-11 10:50:10 +02:00
retrooper 10d44fe3cb Update adventure to 4.14.0 2023-06-11 10:31:34 +02:00
retrooper 6b5ada3c5d Update all wrappers for 1.20 minecraft 2023-06-11 10:08:45 +02:00
retrooper 2f0861c7b7 Update build.gradle to spigot 1.20 2023-06-11 09:45:17 +02:00
DefineOutside abc8695a29 Merge pull request #590 from AoElite/2.0
Add 1.20 protocol
2023-06-08 08:01:42 -05:00
AoElite c6577646ce remove _0 2023-06-08 07:50:12 -04:00
AoElite a6c68b2d0e minimal 1.20 update 2023-06-07 18:12:59 -04:00
DefineOutside 23e0861192 Merge pull request #585 from ammodev/2.0
fix: Block State 1.19.4
2023-06-01 08:49:51 -05:00
MWHunter 7539aa345c add better debug to entity metadata 2023-05-29 18:52:30 -05:00
Simon 2a076a61a0 fix: Accidental code deletion
Due to me not wanting to push my own sorting for imports and stuff I accidentally deleted some lines of code. Now fixed.
2023-05-27 00:54:12 +02:00
Simon bf0ec04cec fix: Block State 1.19.4
Fixed a bug in which the block state could not be mapped. Used in the new BlockDisplays
2023-05-27 00:47:55 +02:00
DefineOutside fea687bba9 Merge pull request #584 from Offenderify/fix/block_data_packet
Fix block entity data packet
2023-05-23 20:34:55 -05:00
DefineOutside 25e83d6181 Merge pull request #579 from minus1ms/2.0
Add WrapperPlayServerDeclareCommands
2023-05-23 20:32:53 -05:00
Offenderify 95a91bb1f2 fix: block entity data packet 2023-05-20 15:10:58 +03:00
MWHunter e1e057eabb fix some 1.8 errors and exceptions 2023-05-14 16:36:47 -05:00
retrooper f81120f8ed Merge pull request #575 from Aseeef/2.0
Added a Conversion Util to convert to/from PacketEvents to Bukkit Particles
2023-05-13 20:31:26 +02:00
minus1ms e44ad5edc2 better name of method
read is more self-explaining than get
2023-05-01 18:10:06 +02:00
minus1ms c35d0854bc Added nullable annotation where it should be 2023-05-01 18:01:47 +02:00
minus1ms 47dbb5e9c0 Add WrapperPlayServerDeclareCommands
added WrapperPlayServerDeclareCommands

im not sure if i did Parsers and Node in good way and im not sure if these are in good packages, everything works as intended
2023-04-30 18:47:55 +02:00
Aseeef 702894dd07 Merge branch 'retrooper:2.0' into 2.0 2023-04-26 17:05:54 -04:00
MWHunter 4801196942 move adventure serializer to adventure util package 2023-04-24 10:24:47 -05:00
retrooper c88a9c412c Ignore modern spoofed players 2023-04-23 22:42:13 +02:00
retrooper 4012472404 Merge pull request #564 from cheaterSK/2.0
Fix WrapperPlayClientChatCommand and WrapperPlayClientChatMessage
2023-04-23 22:39:03 +02:00
retrooper 54f3f3c221 Minor fixes to WrapperPlayClientChatCommand 2023-04-23 22:37:55 +02:00
cheaterSK 873557151b Merge branch 'retrooper:2.0' into 2.0 2023-04-23 17:34:10 +02:00
MWHunter 32e96f3f51 include other included non-latest gson versions 2023-04-22 18:09:41 -05:00
MWHunter cdffd10999 Update adventure to support new chat components 2023-04-22 17:49:38 -05:00
aseef 1524a546d8 Merge remote-tracking branch 'origin/2.0' into 2.0
# Conflicts:
#	spigot/src/main/java/io/github/retrooper/packetevents/util/SpigotReflectionUtil.java
2023-04-15 15:06:58 -04:00
aseef 40d7be6236 * added a conversion util to convert between bukkit and packet events particles 2023-04-15 15:03:08 -04:00
retrooper 98b2b7b631 Fix exceptions on Spigot 2023-04-09 07:21:49 +02:00
retrooper 54704811b3 Fix code duplication in spigot encoder 2023-04-07 20:02:53 +02:00
retrooper 54241497b5 fix imports 2023-04-07 19:41:27 +02:00
retrooper 99637743f5 I've made a severe and continuous lapse of my judgment. and I don't expect to be forgiven. I'm simply here to apologize. so what we came across that day in the woods was obviously unplanned.2 Jan 2018 2023-04-07 19:39:56 +02:00
retrooper 702452c3a1 Final fix for missing imports. 2023-04-07 19:38:11 +02:00
retrooper 7e424cd46b Bruh 2023-04-07 19:36:01 +02:00
retrooper 58401fc18e Fix import errors again.. 2023-04-07 19:34:41 +02:00
retrooper 7285eeff5a Fix missing import in PacketEventsImplHelper
Sorry, I'm editing this in GitHub website cause I'm working on different branches in parallel
2023-04-07 19:31:01 +02:00
retrooper cfb57e7a99 Add handleClientBoundPacket to PacketEventsImplHelper
This helps reduce code duplication when implementing encoders and decoders that have similar functionality on other platforms.
2023-04-07 19:27:22 +02:00
MWHunter 93cd6f39f9 fix isReplaceable() 2023-04-04 20:26:42 -05:00
MWHunter 9975706ba8 update statetypes, itemtypes, block tags to experimental datapack 2023-04-02 13:13:23 -05:00
retrooper 9b88a9ef98 Minor correction to EntityDataTypes 2023-04-02 18:55:33 +02:00
retrooper 548c6183a4 Added the EntityDataType registries, added in 1.19.4 2023-04-02 18:50:12 +02:00
DefineOutside 19d271881c Merge pull request #510 from UserNugget/1.20-experimental-features
'1.20 experimental features' support
2023-04-02 10:19:51 -05:00
MWHunter a64978cb0a delete unmaintained classes 2023-04-02 10:15:28 -05:00
MWHunter 527beda70f allow users to flag events as needing re-encoding, for performance reasons 2023-04-02 10:14:07 -05:00
MWHunter 127421a1d2 add sniffer 2023-04-02 09:53:34 -05:00
MWHunter 4a188bd116 don't eat exceptions 2023-04-02 09:50:59 -05:00
MWHunter cd6db40a0d add runTask() functionality to folia compat utils 2023-04-01 15:16:11 -05:00
MWHunter d050c10eab make isFolia() public 2023-04-01 15:09:57 -05:00
MWHunter 82e5b68119 update folia compat utility 2023-04-01 15:03:40 -05:00
MWHunter 3f00e1d817 more folia support utils 2023-04-01 14:50:47 -05:00
MWHunter 7296072bcb folia support 2023-04-01 14:41:39 -05:00
DefineOutside 132ae43496 Merge pull request #565 from LemonCaramel/fix/server-data
fix WrapperPlayServerData issue in 1.19.4
2023-03-28 08:38:49 -05:00
LemonCaramel 2465ba9306 fix WrapperPlayServerData issue in 1.19.4 2023-03-27 09:24:39 +09:00
cheaterSK 2e10b151c9 Fix WrapperPlayClientChatCommand and WrapperPlayClientChatMessage for 1.19 2023-03-26 17:12:22 +02:00
cheaterSK 9a338cd897 Fix WrapperPlayClientChatCommand 2023-03-26 16:32:12 +02:00
retrooper 7c0bac33df Fix WrapperLoginClientLoginStart for 1.19.4 2023-03-21 22:56:50 +01:00
MWHunter db8c4ce08d register new entity mappings 2023-03-18 21:10:03 -04:00
MWHunter af52640237 fix entity mappings 2023-03-18 20:59:42 -04:00
MWHunter b6d71a79a1 mark default block states 2023-03-17 19:26:02 -05:00
DefineOutside 407257c2ce Merge pull request #558 from MachineBreaker/pooled-bytebuffers
Use Pooled ByteBuffer in SpigotReflectionUtil for decoding/encoding ItemStacks
2023-03-17 17:44:30 -05:00
Alejandro Martinez 19e7bc6190 Use Pooled ByteBuffers in decodeBukkitItemStack & encodeBukkitItemStack 2023-03-17 16:15:23 -06:00
retrooper e0beccff4d Merge remote-tracking branch 'origin/2.0' into 2.0 2023-03-17 21:57:31 +01:00
retrooper 1728e667ea Push 2023-03-17 21:57:03 +01:00
retrooper c2cce6fac7 Merge pull request #550 from AbhigyaKrishna/2.0
Adventure Backward Compatibility (<4.9.0) support
2023-03-17 19:07:08 +01:00
retrooper 9cf38bc325 Merge pull request #556 from maximbreitman/2.0
Add accessors to WrapperPlayServerPlayerInfoUpdate.PlayerInfo
2023-03-17 19:06:00 +01:00
maximbreitman c0522d7836 Add accessors to WrapperPlayServerPlayerInfoUpdate.PlayerInfo 2023-03-17 17:31:47 +03:00
DefineOutside dc1ac3beb3 Merge pull request #555 from MachineBreaker/patch-2
Log getDefaultState in Config Level
2023-03-16 16:34:48 -05:00
MachineBreaker d59a11a340 Log getDefaultState in Config Level
Prevent spamming the console with:
[ac.grim.grimac.shaded.com.github.retrooper.packetevents.PacketEventsAPI] Default state for lantern is null. Returning AIR
2023-03-16 15:29:36 -06:00
MWHunter a8e95c23ac initial 1.19.4 support 2023-03-15 22:31:29 -05:00
DefineOutside 607b8dde56 Update LegacyFlexibleStorage.java 2023-03-14 12:06:06 -05:00
Abhigya a0ccfb4875 Legacy Adventure (<4.9.0) support 2023-03-13 16:02:35 +05:30
retrooper afcf98e2c8 Merge pull request #549 from Aseeef/2.0
Fixed Adventure API & Build Issues
2023-03-12 18:41:25 +01:00
aseef 51d74ae7ea * relocated adventure api
* fixed velocity repo url
2023-03-12 13:33:13 -04:00
retrooper 7b6308c4e0 Merge pull request #546 from jtJava/2.0
Expose NPC channels and remove unnecessary parameters
2023-03-09 22:14:50 +01:00
jtJava cdbe0df0f3 Expose NPC channels and remove unnecessary parameters 2023-03-08 16:29:58 -06:00
DefineOutside d799ba7190 Merge pull request #543 from Aseeef/2.0
Marker interfaces to packet types
2023-03-01 20:25:43 -06:00
aseef 8c03d2e3a0 Merge remote-tracking branch 'origin/2.0' into 2.0 2023-03-01 21:19:19 -05:00
aseef 7c2994e54d PacketTypes now implement a marker interface indicating whether the packets are client bound or server bound 2023-03-01 21:19:03 -05:00
aseef e1e61feebf reverted an accidental change 2023-03-01 21:18:46 -05:00
aseef e6fb117182 PacketTypes now implement a marker interface indicating whether the packets are client bound or server bound 2023-03-01 21:16:44 -05:00
retrooper a7aa3eae68 Merge pull request #540 from cheaterSK/2.0
feat: Add option in settings to disable color downsampling + fix actions/upgrade gradle
2023-02-20 16:20:20 +01:00
cheaterSK d38089a46a Upgrade gradle to 8.0.1, fix issues that came with it + freeze the version with ./gradlew in actions to avoid issues in future 2023-02-19 11:06:25 +01:00
cheaterSK e2a980adde Fix backwards compatibility 2023-02-18 10:09:09 +01:00
cheaterSK a4e116d34f Merge remote-tracking branch 'origin/2.0' into 2.0
# Conflicts:
#	api/src/main/java/com/github/retrooper/packetevents/wrapper/play/server/WrapperPlayServerPlayerInfo.java
2023-02-18 10:02:37 +01:00
retrooper 6b61682fe4 Merge pull request #538 from Aseeef/2.0
NPE + ConcurrentModification Exception Fix
2023-02-15 23:37:53 +01:00
MWHunter 0c4709ac57 fix exception when mojang sends DISCONNECT in STATUS state, for some reason 2023-02-13 12:09:23 -06:00
DefineOutside c6a542d206 Merge pull request #529 from ammodev/2.0
Version not being chosen correctly
2023-02-13 11:58:48 -06:00
MWHunter d67028f568 don't enable debug by default 2023-02-12 17:08:39 -06:00
aseef af48ee3938 Now creating a set using concurrenthashmap 2023-02-12 13:00:48 -05:00
aseef 945919c1e0 Merge remote-tracking branch 'origin/2.0' into 2.0 2023-02-12 08:32:04 -05:00
aseef 38de7a4b94 should fix concurrent modification exception 2023-02-12 08:30:32 -05:00
Aseeef 419232a075 Merge branch 'retrooper:2.0' into 2.0 2023-02-12 07:47:12 -05:00
aseef e705b2725d fixed a npe 2023-02-12 07:46:10 -05:00
MWHunter 004702f642 remove more unused internal methods 2023-02-11 16:24:13 -06:00
MWHunter 4c29d39292 clean up unused internal methods 2023-02-11 16:11:46 -06:00
MWHunter 24e8ff4fb4 fix fix setting components in EntityDataProvider 2023-02-03 12:59:05 -06:00
MWHunter cf61f74ade fix setting components in EntityDataProvider 2023-02-03 09:13:19 -06:00
MWHunter 72ab24b419 disable debug listener and reset the class 2023-02-02 22:11:14 -06:00
MWHunter 8c8357bfbc avoid modifying backing array 2023-02-02 16:53:16 -06:00
MWHunter 59d36b6e55 Revert "ensure we have recovery logic for missing transition to PLAY state"
This reverts commit 647c05fe98.
2023-02-02 13:25:09 -06:00
MWHunter decf5579a3 reverse lists sanely 2023-02-01 21:18:22 -06:00
MWHunter 187f5a54c6 Why do we not set protocol to GAME state if client version is unknown??? 2023-02-01 20:54:46 -06:00
MWHunter 647c05fe98 ensure we have recovery logic for missing transition to PLAY state 2023-02-01 20:50:46 -06:00
MWHunter a089b98f6d warn instead of debug on late injection 2023-02-01 20:45:43 -06:00
MWHunter 9d21b834cc reverting bc356c6d - not setting to GAME state if client version unknown? what is retrooper doing? 2023-02-01 20:43:38 -06:00
MWHunter 069e872204 print more exceptions? 2023-02-01 20:39:02 -06:00
Simon e945c9c56f Update build.gradle
Revert the changes on the version to fit current standards
2023-01-31 22:09:12 +01:00
SimonandJulian b8058b57d8 Update bungeecord/src/main/java/io/github/retrooper/packetevents/bungee/factory/BungeePacketEventsBuilder.java
Updated code style

Co-authored-by: Julian <53055251+NoJokeFNA@users.noreply.github.com>
2023-01-31 09:33:17 +01:00
retrooper 7ce167157a Merge pull request #442 from NoJokeFNA/feat/bungeecord
Cleaned up BungeeCord module
2023-01-30 19:47:05 +01:00
DefineOutside 0503e99c50 Merge pull request #530 from DietrichPaul/patch-1
fixed 1.7 block placement
2023-01-30 12:04:17 -06:00
MWHunter 413d5e1eb5 add toString for StateType 2023-01-29 17:47:55 -06:00
MWHunter 51ebbb7914 ignore more types of invalid handshakes with the server 2023-01-29 12:36:47 -06:00
Paul Dietrich 2b98d5c90b fixed 1.7 block placement 2023-01-29 11:05:28 +01:00
MWHunter 099ea9b7e9 fix race condition when sending packets to multiple people 2023-01-28 17:53:05 -06:00
Simon ce703febc3 Fixed a bug where the version would not be chosen correctly 2023-01-29 00:16:00 +01:00
Simon dce59f99fd Changed git ignore to include vscode files 2023-01-29 00:09:03 +01:00
UserNugget 5ff498b6f0 1.20 experimental blocks/items/tags 2023-01-28 11:21:07 +03:00
MWHunter 32b85dce18 add more methods to avoid forcing people to use clientVersion 2023-01-27 23:13:57 -06:00
MWHunter 89b8d823c4 avoid forcing people to specify clientversions for block data 2023-01-27 23:11:53 -06:00
MWHunter fc0f1eec68 default block state to server version 2023-01-27 22:36:05 -06:00
MWHunter 765fb79321 add modern conversions for WrappedBlockState 2023-01-27 22:34:55 -06:00
MWHunter eb42c1b473 warn instead of error if someone else removes our handlers on reloads/shutdowns 2023-01-27 20:58:02 -06:00
MWHunter ce484ecac5 support reloads 2023-01-27 20:20:44 -06:00
MWHunter cb3e4d33a7 properly handle sending -1 (survival) gamemode in player info 2023-01-27 19:43:34 -06:00
MWHunter 12c01eb2fa update chat wrappers to 1.19.3 2023-01-27 19:25:31 -06:00
MWHunter c4b8a17437 fix project setup by not setting java source and target compat in the base build.gradle 2023-01-27 17:13:24 -06:00
MWHunter 5dde544e07 correct gradle specifying submodules 2023-01-27 16:19:39 -06:00
MWHunter d16ad2154d hack around bungeecord's inability to process empty buffers 2023-01-27 13:31:01 -06:00
MWHunter 245da7a870 ignore handshaking exceptions 2023-01-27 12:55:08 -06:00
MWHunter 2a0b217718 revert last change 2023-01-27 12:23:17 -06:00
MWHunter 582cfa7b57 fix cancelling outbound packet kicking people on bungeecord 2023-01-27 12:18:11 -06:00
retrooper 1b295dc827 Merge pull request #486 from vytskalt/2.0
Safely limit team display name, prefix and suffix to appropriate lengths
2023-01-11 19:31:42 +01:00
retrooper a83248f70d Correctly limit all data in the wrapper differently depending on the protocol version. 2023-01-11 19:29:28 +01:00
retrooper 42a1375c00 Merge pull request #516 from RotMC/2.0
Fix NPE caused by attempting to initialize user before channel
2023-01-11 18:32:30 +01:00
Ryan Jones fbe89306f5 Merge branch 'retrooper:2.0' into 2.0 2023-01-09 11:40:31 -05:00
retrooper faeb2f55d3 * Update NPC API for 1.19.3
* Improve WrapperPlayServerPlayerInfoUpdate & WrapperPlayServerPlayerInfoRemove for easier use
2023-01-08 00:27:58 +01:00
DefineOutside 239cc09c9f fix headYaw not being sent 2023-01-05 16:41:28 -06:00
retrooper 6aac1faac4 Merge pull request #517 from iTzLucky28/2.0
Add Itemstack to WrapperPlayClientPlayerBlockPlacement constructor and replace Optional by regular objects
2023-01-03 22:54:20 +01:00
iTz_Lucky ea4ab05bff Add Itemstack to constructor and replace Optional by regular objects
Also less error prone, especially if they send null as Optional instead of Optional containing null
2023-01-02 08:13:29 +01:00
wordandahalf d53f39bbc7 Fix NPE caused by attempting to initialize user before channel 2023-01-01 16:50:55 -05:00
cheaterSK 8f28b71ee2 Merge branch 'retrooper:2.0' into 2.0 2022-12-31 17:28:36 +01:00
DefineOutside 58df1fcc91 Merge pull request #512 from epserv/2.0
Add SITTING pose to EntityPose
2022-12-29 20:39:32 -06:00
l_MrBoom_l 060b919fa3 Add SITTING pose to EntityPose 2022-12-24 23:07:33 +05:00
MWHunter 7d0d4aa672 fix weird spigot 1.8 bug 2022-12-21 16:57:49 -06:00
MWHunter e3cde54ab2 Simplify encoder/decoder, avoid bytebuf allocations 2022-12-21 16:20:59 -06:00
MWHunter d681345e41 Fix optional component serializers 2022-12-15 14:54:08 -06:00
MWHunter 3939b534ad make entity json data lazy 2022-12-15 13:53:57 -06:00
MWHunter a8afbd2a0b pool bytebufs 2022-12-15 13:34:41 -06:00
MWHunter 7d7cbb4445 Don't annotate non-sharable encoders/decoders as sharable 2022-12-14 17:54:58 -06:00
MWHunter 1c5dceb47d Update explosion packet to 1.19.3 2022-12-14 14:59:58 -06:00
MWHunter 876fbf6fbf Fix creating a new NBT tag which can desync inventory 2022-12-13 14:00:23 -06:00
MWHunter b469ce2a69 fix compilation 2022-12-13 00:31:14 -06:00
MWHunter 6f7823e8cb Use pipeline instead of address for tracking connections 2022-12-13 00:21:00 -06:00
MWHunter 2619a4398d Clean up previous attempts to try to fix race condition 2022-12-12 20:23:27 -06:00
MWHunter d411fe44fe Fix race condition due to ProtocolLib wrapping a Channel screwing with our hashmaps 2022-12-12 20:19:07 -06:00
MWHunter 67af517510 Try synchronization to fix weird race condition 2022-12-12 19:41:39 -06:00
MWHunter cce862bc57 Refactor methods dealing with Bukkit and Users 2022-12-12 18:20:48 -06:00
MWHunter 319750e3f9 Fix tag matches for empty tags 2022-12-12 16:42:20 -06:00
MWHunter 78ccd8b2d5 fix last commit 2022-12-12 14:07:11 -06:00
MWHunter 50ef62f4fb Fix some reflection methods on some shitty MCM jar 2022-12-12 14:06:42 -06:00
MWHunter 05a5b5284b More debug 2022-12-12 12:41:48 -06:00
MWHunter 8c6865405d actually fix bad ordering (not race condition!) of post send tasks 2022-12-11 19:29:14 -06:00
retrooper a204b5d521 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-12-11 09:10:47 +01:00
retrooper da0128b330 Fixed user state transitioning to remain in sync with minecraft which should fix a bunch of errors where we do not recognize the packet id or properly read data of a packet, because our connection state is behind. We need to update the state as soon as we get the packet. 2022-12-11 09:10:15 +01:00
MWHunter 84b005a3b0 Handle vanilla now reading a fixed amount of bytes 2022-12-11 00:15:06 -06:00
MWHunter 38fd7eae6d Fix 1.19.3 chat messages not reading/writing chat type 2022-12-11 00:02:19 -06:00
MWHunter e3d08fa0de Try adding partial 1.19.3 chat packet support 2022-12-10 23:49:13 -06:00
retrooper 0da59c3585 Merge pull request #494 from iTzLucky28/2.0
Add getter/setter for WrapperPlayClientClickWindow
2022-12-11 00:31:35 +01:00
retrooper b4145fda44 Remove ClassUtil's unnecessary class simple name caching 2022-12-11 00:29:02 +01:00
retrooper 5df58a116d Fix race-condition in transitioning to PLAY state.
Post-tasks now run right after all listeners have processed the packet.

Tasks-after-send (only for outgoing packets) run after a packet has been sent

There's a difference so please make sure you're using the right one.
2022-12-10 21:21:22 +01:00
retrooper 7899d8cb46 Fix NBTCodec#nbtToJson 2022-12-10 21:03:51 +01:00
MWHunter b47e0f20ef More gracefully handle unknown block types 2022-12-09 18:16:28 -06:00
MWHunter 63a7121653 Update some mappings to 1.19.3 (Not everything is complete!) 2022-12-09 18:03:15 -06:00
MWHunter 7927c89ba2 Create a new bytebuf due to weird 1.8 bytebuf behavior 2022-12-09 15:10:08 -06:00
MWHunter db5c97a324 Protect against empty bytebuffers, remove large amount of decoder code 2022-12-09 00:35:44 -06:00
MWHunter d4b919430f Ignore via API if it returns -1 as player version 2022-12-08 19:16:39 -06:00
MWHunter d52df749fa Prevent bots scraping the internet from causing PE 2.0 error 2022-12-08 16:54:59 -06:00
MWHunter 63eac8f0f6 Prevent failed injection with multiple PacketEvents 2.0 plugins 2022-12-08 16:21:17 -06:00
cheaterSK 0d7a618d87 Merge branch 'retrooper:2.0' into 2.0 2022-12-08 22:38:15 +01:00
retrooper 7a8d440475 * Added WrapperPlayServerPlayerInfoUpdate (for minecraft 1.19.3+ versions)
* Minor optimization to WrapperPlayServerPlayerInfo (minecraft 1.19.2 and older can use this wrapper)
2022-12-08 19:27:41 +01:00
retrooper 89b63802ac Add WrapperPlayClientChatSessionUpdate 2022-12-08 18:24:27 +01:00
retrooper 17e8b51205 Add WrapperPlayServerUpdateEnabledFeatures 2022-12-08 17:11:51 +01:00
retrooper 8bb12b6913 Add WrapperPlayServerPlayerInfoRemove 2022-12-08 17:07:18 +01:00
retrooper 8a194d1ff6 Add WrapperPlayServerDisguisedChat (1.19.3 packet) 2022-12-08 17:01:31 +01:00
retrooper 45bc1e3d80 Map global 1.19.3 packet types 2022-12-08 16:54:10 +01:00
retrooper a812e22312 Map 1.19.3 packet types 2022-12-08 16:37:20 +01:00
DefineOutside b7c9015b39 Merge pull request #496 from ytnoos/2.0
Fix ViaVersion version check
2022-12-08 09:06:08 -06:00
Ytnoos 98c7c0d49c Fix ViaVersion version check 2022-12-08 11:35:56 +01:00
MWHunter dc10e3cca6 Support ViaBackwards on Paper servers 2022-12-07 17:01:48 -06:00
retrooper 54ae21fd5d Set autoProtocolTranslation to true 2022-12-07 23:45:21 +01:00
retrooper 5d851e849a Merge remote-tracking branch 'origin/2.0' into 2.0 2022-12-07 23:44:42 +01:00
retrooper 09ef7c2e80 Fix server-version detection issues & compression handling 2022-12-07 23:44:14 +01:00
MWHunter e8d7fc30a5 Don't try auto translating spigot protocol 2022-12-07 16:06:25 -06:00
MWHunter 5fbb6d7349 Refactor post tasks 2022-12-07 14:59:41 -06:00
MWHunter 28b67601c1 Fix concurrent modification exception 2022-12-07 14:47:26 -06:00
MWHunter ba02780727 Fix receive packet methods 2022-12-07 14:16:32 -06:00
MWHunter 2c756925a1 Injector rewrite for ViaVersion 4.5.0 2022-12-07 13:56:21 -06:00
iTz_Lucky ac37b708c0 Update WrapperPlayClientClickWindow
Getter and Setter for actionNumber in  WrapperPlayClientClickWindow
2022-12-03 04:03:25 +01:00
retrooper 6b92403dea Optimize ProtocolSupportUtil 2022-12-01 20:05:21 +01:00
cheaterSK f63da3d3d2 Fix Teams packet gamemode sometimes resulting in -1 2022-11-26 11:41:30 +01:00
cheaterSK de763c948c Fix legacy component parser 2022-11-26 10:52:55 +01:00
cheaterSK 4469b93ed9 feat: Add option in settings to disable color downsampling 2022-11-26 10:19:36 +01:00
DefineOutside 873c09d224 Merge pull request #474 from caoli5288/patch/user-dimension
Use User.dimension to improve ChunkReader_v1_9
2022-11-16 12:20:08 -06:00
DefineOutside 646b0a1050 Merge pull request #488 from AoElite/2.0
Allow NPC gamemode to be changable
2022-11-16 12:19:38 -06:00
AoElite 470975ca77 add method to update gamemode 2022-11-15 22:24:28 -05:00
AoElite 2005daa11f allow the gamemode of the npc to be changeable 2022-11-15 22:17:30 -05:00
VytskaLT e28f4e3993 Limit team display name, prefix and suffix to 16 characters 2022-11-06 18:11:19 +02:00
MWHunter 7509ecb971 Fix legacy blocks mappings 2022-10-27 15:03:17 -05:00
retrooper 738309506d Merge pull request #484 from wordandahalf/2.0
Ensure dimension's attributes is initialized to a non-null value
2022-10-09 11:04:41 +02:00
wordandahalf 5243d9f17d Initialize attributes in constructors 2022-10-06 17:43:31 -04:00
wordandahalf bd91ef1be1 Ensure dimension's attributes is initialized to a non-null value 2022-10-06 16:39:49 -04:00
retrooper 8a9338ae46 Merge pull request #482 from LeeGodSRC/bugfix/packet-teams
Fixed WrapperPlayServerTeams send incorrect color post 1.17
2022-10-05 21:43:32 +02:00
retrooper 9aa27103a0 Fix WrapperPlayServerBlockEntityData constructor 2022-10-05 21:41:13 +02:00
leegod af105f4add Fixed WrapperPlayServerTeams send incorrect color post 1.17 2022-10-05 11:22:37 +08:00
retrooper d2d3d84cbf Merge remote-tracking branch 'origin/2.0' into 2.0 2022-10-03 20:29:06 +02:00
retrooper e9a5c9315c receivePacket works fully with ViaVersion;
receivePacketSilently works with ViaVersion if there is only one packetevents instance (until ViaVersion fixes their injector)
2022-10-03 20:22:09 +02:00
Souvlakis 3a93098804 Forcibly close unhandled connections
* Forcibly close unhandled connections
2022-09-29 15:01:56 +02:00
Julian 0b404d04cd Added all combat wrapper classes (#379)
* feat: added WrapperPlayServerEndCombatEvent, WrapperPlayServerEnterCombatEvent, WrapperPlayServerDeathCombatEvent, WrapperPlayServerCombatEvent
Co-authored-by: retrooper <retrooperdev@gmail.com>
2022-09-11 22:04:43 +02:00
retrooper f7b6fc476f When server sends chat messages to large, it used to kick players instead of just throwing an error. We fixed that. 2022-09-11 20:23:54 +02:00
Souvlakis 0bcf58cf80 Added the ability to set a custom resourceProvider, which is used to retrieve files such as block mappings. (#477) 2022-09-11 19:02:13 +02:00
caoli5288 f9390aa69d fix #472 2022-08-26 20:27:26 +08:00
caoli5288 3f6bb1a03d Merge remote-tracking branch 'upstream/2.0' into patch/user-dimension 2022-08-26 20:26:23 +08:00
caoli5288 67eaa91252 Fix 1.12.2 chunk issues
* fix #472
2022-08-26 10:36:16 +02:00
caoli5288 911dffccc2 fix #472 2022-08-24 13:51:54 +08:00
caoli5288 3368b7fcc5 fix #472 2022-08-24 13:33:34 +08:00
Abhigya 1ad7cae303 Added WrapperPlayServerBlockEntityData, Dimension conversion fixes, Particle data fixes, EntityDataTypes fix
* Added WrapperPlayServerBlockEntityData and Dimension conversion
* Fixed serialization for Scoreboard Objective
* Updated Particle data system
* Updated EntityDataTypes for Particle and GlobalPos
Co-authored-by: retrooper
2022-08-23 18:36:57 +02:00
hinoobers b7d04384fb Fix for JSON -> NBT
Handle LazilyParsedNumber
2022-08-23 18:16:06 +02:00
retrooper ea32d28d0b Allow broken spigot forks not allowing us to detect server versions to load packetevents and assume server version is 1.8.8 (more common on older forks) 2022-08-23 18:10:32 +02:00
retrooper ad70e4b996 Correct WrapperStatusClientRequest constructor 2022-08-17 21:25:17 +02:00
retrooper c320ebce86 Update usage of blockface in digging wrapper 2022-08-17 21:24:43 +02:00
retrooper 01c81f5a0b Remove duplicate getter and setter in WrapperPlayClientPlayerDigging 2022-08-17 21:19:18 +02:00
retrooper 66c722ec00 We correctly handle users trying to run packetevents on server versions not yet supported. Sort of a hotfix for now 2022-08-17 18:08:25 +02:00
retrooper af38857d07 Correct link in error when loading with outdated ProtocolSupport 2022-08-17 17:53:14 +02:00
retrooper 5a1a02d212 Attempted to implement a NBTCodec.nbtToJson & NBTCodec.jsonToNBT 2022-08-17 10:41:41 +02:00
retrooper bc96b5cd3e remove 2022-08-16 21:19:30 +02:00
retrooper c44e834c01 WrapperPlayServerEntityProperties -> WrapperPlayServerUpdateAttributes
ENTITY_PROPERTIES -> UPDATE_ATTRIBUTES

Attempted to fix issues on legacy versions where keys are too long for some reason
2022-08-16 21:05:00 +02:00
retrooper 4273bf6587 Fix WrapperPlayClientTabComplete for 1.9->1.12.2 2022-08-16 20:30:20 +02:00
retrooper 3329a544a4 WrapperPlayServerTradeList -> WrapperPlayServerMerchantOffers
TRADE_LIST -> MERCHANT_OFFERS

Breaking changes to merchant offers wrapper and fixed bugs on 1.19+
2022-08-16 18:56:29 +02:00
retrooper 075784498c Update copyright year in files. 2022-08-16 17:48:35 +02:00
MWHunter 03b68a7f6f Fix 1.7 BlockFace exception 2022-08-07 17:36:17 -05:00
MWHunter dc614c96c3 Partially revert eae3d091f8 2022-08-07 16:16:10 -05:00
MWHunter f77f705942 Refactor ServerVersion 2022-08-06 18:13:26 -05:00
retrooper aa9cc58b49 1.19.2 support is ready. 2022-08-05 17:05:23 +02:00
retrooper 9de4dcf4b1 Fixed EntityMetadata 2022-08-05 15:24:49 +02:00
retrooper eae3d091f8 More optimizations to entitydatatypes 2022-08-05 13:24:26 +02:00
retrooper 5f499123df Some optimizing to EntityDataTypes 2022-08-05 13:04:18 +02:00
retrooper a6c16ab45a Preparing for 1.19.2 update. 2022-08-04 18:28:11 +02:00
retrooper c060a55740 Removed debugs. 2022-08-03 23:54:09 +02:00
retrooper 8447998ce6 Transformed ChatType from an enum to a registry. Use ChatTypes.CHAT for example;
Removed weird exception supression, working on seperating user exceptions and internal packet api exceptions.
2022-08-03 23:53:20 +02:00
retrooper 99bc0ffcb6 Hopefully fixed some decoder issues? 2022-08-03 20:23:05 +02:00
retrooper dea5feaa1e Added proper exceptions again, still looking for a better way to handle exceptions. 2022-08-03 20:19:07 +02:00
DefineOutside ebea88f60f Update entity_data_type_mappings.json 2022-08-03 09:51:23 -05:00
retrooper 5717b6050e User#sendPacketSilently added 2022-08-01 21:19:30 +02:00
retrooper 8eb60e9398 Exclude GSON from being shaded when shading adventure on the spigot module. 2022-08-01 20:33:05 +02:00
retrooper 4db2dc0592 SELECT_ADVANCEMENT_TAB renamed to SELECT_ADVANCEMENTS_TAB;
ADVANCEMENTS renamed to UPDATE_ADVANCEMENTS;
2022-08-01 20:32:24 +02:00
retrooper ba1daa4b17 Micro optimization to EntityDataTypes and its mappings. 2022-08-01 20:30:49 +02:00
retrooper 69700bce2a Fixed exception handling entirely. 2022-07-30 19:09:54 +02:00
retrooper 9dc0db4eae Minor fix attempt to exception handling. 2022-07-30 16:20:18 +02:00
retrooper 8aeef01bd4 Fixed packet type mappings for 1.19.1;
Fixed constructor event for WrapperPlayServerCustomChatCompletions & WrapperPlayServerPlayerChatHeader
2022-07-29 20:51:41 +02:00
retrooper 3fff3925b2 Remove debugs. 2022-07-28 19:18:54 +02:00
retrooper 72c0ecbc5d WrapperPlayClientPlayerDigging reads readByte() instead of readUnsignedByte() 2022-07-28 19:11:11 +02:00
retrooper 785c8056f9 WrapperPlayClientEntityAction now has 1.7.10 support 2022-07-28 18:50:02 +02:00
retrooper 48ef856d02 Fixed BlockFace index out of bounds 2022-07-28 18:35:44 +02:00
Julianandretrooper c052ecf8c0 1.19.1 Update (#448)
* feat: updated ClientVersion and ServerVersion

* feat updated WrapperPlayServerSystemChatMessage

* feat: WrapperLoginClientLoginStart

* feat: use our new methods

* WrapperPlayServerSystemChatMessage completed & fixed.

ClientVersion fixed HIGHER_THAN_SUPPORTED_VERSIONS field.

* change: fixed code-style

* fix: fixed `overlay` getter as it doesn't match its default getter

* * Updated ChatType as some constants were removed on 1.19.1

* Updated ChatMessage and SystemChatMessage again

* Updated User#sendMessage to work on 1.19.1

* feat: updated ChatType to 1.19.1-pre3
      -> `MSG_COMMAND` got replaced by `MSG_COMMAND_INCOMING` and `MSG_COMMAND_OUTGOING`
feat: added `CUSTOM_CHAT_COMPLETIONS` enum to new `ClientboundPacketType_1_19_1` class
feat: added WrapperPlayClientCustomChatCompletions & ChatCompletionAction classes

* feat: added `DELETE_CHAT` and `PLAYER_CHAT_HEADER` enums to `ClientboundPacketType_1_19_1` class
feat: added WrapperPlayClientDeleteChat & WrapperPlayClientPlayerChatHeader classes
change:
remove: removed unused import in WrapperPlayServerChatMessage

* change: change String[] to List<>

* remove: removed @Experimental annotation from readList and writeList method
change: renamed readVarIntList to readList and writeVarIntList to writeList
change: used our readList and writeList methods in WrapperPlayClientCustomChatCompletions

* feat: use our Writer and Reader functions instead of plain generic types

* Removed blanked line

* Update ChatType.java

* feat: improved readMap (especially for modern versions currently)

* Add ClientVersion.V_1_19_1 as a version map to allow it to use 1.19.1 clientbound packet mappings

* change: changed some naming stuff

* Fixed WrapperLoginClientLoginStart's SignatureData encoding.

* Fixed DeleteChat wrapper and mappings.

* Fixed WrapperPlayServerPlayerChatHeader for 1.19.1

* Fix WrapperPlayServerCustomChatCompletions

* Update api/src/main/java/com/github/retrooper/packetevents/protocol/packettype/PacketType.java

* feat: added `$readSignatureData` and `$writeSignatureData`

* fix: fix `$writeOptional` usage

* feat: first pre-5 update

* feat: some more progress

* feat: even more progress (might break some wrappers ATM)

* fix: fixed errors

* feat: pre-5 changes for ChatType

* change: changed `query` to `queryId`

* feat: *optimized* ChatType handling for modern versions (HashMap)

* * Removed write methods in LastSeenMessages and its inner classes.

* PacketWrapper#readLastSeenMessages and PacketWrapper#writeLastSeenMessages created.

WrapperPlayClientChatAck & WrapperPlayClientChatCommand & WrapperPlayClientChatMessage now use last seen messages.

Removed LastSeenMessagesTracker & LastSeenMessagesValidator, I don't see the need for it and we don't use it anywhere. Maybe later we might implement it ourself with inspiration from mojang but not just copy paste.

* remove: removed useless whitespace

* feat: improved docs in WrapperPlayServerChatMessage for `$getChatContent` and `$setChatContent`

* feat: added `EQUALS` to MultiVersion enum
  affected classes due to import changes:
   - PacketWrapper, ServerVersion, WrapperPlayWorldBorderWarningDelay

* change: changed copy order in WrapperPlayServerSystemChatMessage, it's not big of a deal, just looks cleaner this way

* feat: added rc-2 change; `boolean enforceSecureChat` has been added to WrapperPlayServerServerData
feat: created constructor for legacy versions in WrapperPlayServerServerData

* feat: added missing copyright text to WrapperPlayServerServerData

* feat: rc-2 -> added missing `enforceSecureChat` field to WrapperStatusServerResponse - thanks @derklaro

* remove: reverted WrapperStatusServerResponse as it just got added into the JSON message and not as a separate parameter

* feat: added pre6 change; the `chatContent` itself got changed from Component to a plain String, though we still provide the Component usage and just migrate it automatically to a String depends on the server version

* remove: removed TODO comment from WrapperPlayClientChatCommand and fixed `@Nullable` usage

* fix: fixed `@Nullable` usage in WrapperPlayClientChatMessage

* fix: fixed raw generic usage

* feat: added ClientVersion$is(MultiVersion version, ClientVersion target)

* fix: fixed JavaDocs for ServerVersion$is and ClientVersion$is

* feat: fixed code-style in ServerVersion

* feat: added missing DARKNESS PotionType

* feat: added missing EARTH, WIND, WATER and FIRE enums in PaintingType class
feat: added width and height values to PaintingType class

* feat: DARKNESS PotionType should use id 33 and not 32

* feat: renamed `MultiVersion` to `VersionComparison` as it's easier to understand this way

* feat: added missing JavaDoc to `setPreviousSignature` in `WrapperPlayServerPlayerChatHeader`

* WrapperPlayServerChatMessage had a lot of changes in 1.19.1 that we missed. Considering another way as it won't be too easy to abstract this all. Considering a similar approach to our chunk readers.

* To summarize this push, we rewrote the outgoing chat wrapper.

PacketWrapper appropriately named methods that have to do with readLastSeenMessages and added the true readLastSeenMessages;

WrapperPlayServerChatMessage had many changes in 1.19.1 so we decided to go with a different approach of implementing it and decided to go with a recode.
We have chat processors (readers & writers) which implement readers and writers for various versions. We have a chatmessage class which contains fields available on every single version and has subclasses which contain fields for their own version. Cast the chat message to get fields for specific versions. (Kinda like how BaseChunks are implemented)

* getMotd() -> getMOTD(), its sort of a convention to capitalize abbreviations here. Same we do for getUUID() and other stuff.

Also why not make the motd getter nullable, atleast as a response to the issue that complained about optionals?

* Little comment added to chat message, just to remind myself if I look back at it.

* Comment added to PaintingType to change it to a registry in the future.

* feat: cleaned up ChatMessage and its classes + ChatMessageProcessor and its implemented classes

* feat: added `getType` and `setType` and just removed the `@Deprecated` annotation

* Added missing FilterMask in 1.19.1 chat processor

* Minor additions to FilterMask

Co-authored-by: retrooper <retrooperdev@gmail.com>
2022-07-28 01:35:55 +02:00
retrooper 64ae9bfe27 Merge pull request #375 from NoJokeFNA/feat/update-jigsaw-block-wrapper
Added WrapperPlayClientUpdateJigsawBlock
2022-07-28 00:39:40 +02:00
retrooper 7b028f61d6 Optimized WrapperPlayClientUpdateJigsawBlock. It was added in 1.14, no point accounting for 1.7 protocol specialities? 2022-07-28 00:37:30 +02:00
retrooper 5d3f2105f0 Remove small debug 2022-07-27 16:13:05 +02:00
retrooper a4c57cf41c Made packetevents a snapshot version on nexus 2022-07-27 08:56:28 +02:00
retrooper e8fa6d793f Minor fix 2022-07-26 22:36:10 +02:00
retrooper 8fa6c3ad1e Don't use nexus snapshot repo I guess? 2022-07-26 22:30:34 +02:00
retrooper 2044657fb6 Last nexus fix xd 2022-07-26 22:25:37 +02:00
retrooper 8c216d0aa6 Apparently we cannot publish twice. 2022-07-26 22:24:06 +02:00
retrooper b80f22bf08 Another nexus fix 2022-07-26 22:22:09 +02:00
retrooper 4b0414c61b Fixes for nexus repo 2022-07-26 22:18:42 +02:00
retrooper 3c43382148 Attempting rebuild for Nexus repository 2022-07-26 22:03:55 +02:00
retrooper 00e081fcad ProtocolPacketEvent#getFullBufferClone to assist users attempting to delay packets. 2022-07-26 18:13:24 +02:00
retrooper 8cc8e5f171 Minor change to terminate. 2022-07-26 16:51:23 +02:00
retrooper b449205b6f Unregister listeners on termination to avoid duplicate packet listeners. 2022-07-26 16:32:09 +02:00
retrooper bbe88eba3d Attempting nexus repo fixes. 2022-07-25 19:33:56 +02:00
retrooper f271778905 Properly publish dependencies to Nexus repository. 2022-07-25 19:25:04 +02:00
retrooper fdefa91208 Minor changes 2022-07-25 19:09:44 +02:00
retrooper 909eb7cde3 Don't minimize jar to allow jenkins builds to contain all wrappers(even unused ones). 2022-07-25 19:08:30 +02:00
retrooper 1b3598182b Fix WrapperPlayServerChatMessage for versions below 1.16. 2022-07-25 18:45:38 +02:00
MWHunter 031d190da2 Make shulker boxes exceed full cube 2022-07-24 18:47:53 -05:00
MWHunter 744cb05253 Follow vanilla restrictions on plugin messages 2022-07-22 17:45:21 -05:00
MWHunter b1b2b10ee5 Try fixing edge case of velocity being off by 1 2022-07-21 18:30:46 -05:00
MWHunter 6efb6aebdf Set mud brick wall as exceeding cube 2022-07-20 18:25:09 -05:00
MWHunter a633c2558a Fix mapping inconsistencies in 1.12 2022-07-20 18:22:14 -05:00
retrooper 88cd3bea89 Remove PublicKey from being stored in User. 2022-07-18 11:57:57 +02:00
retrooper 1ec83d1398 Optimize WrapperLoginServerLoginSuccess 2022-07-18 11:14:08 +02:00
retrooper adf46aaeca I think this should fix SpoofMC bots? 2022-07-18 08:26:40 +02:00
retrooper 43669d3652 Support connections that aren't necessarily Epoll or Nio. (there is your IO_URING fix) 2022-07-18 08:23:23 +02:00
retrooper bc356c6daf Improved exception handling. 2022-07-14 10:51:06 +02:00
MWHunter b090424510 Fix explosion packet being off by one in negative coordinates pre-1.14 2022-07-11 21:33:05 -05:00
MWHunter 3fd2b883de Fix ItemTypes capitalization 2022-07-10 12:54:09 -05:00
retrooper e3e29ed79b Deprecate legacy Dimension constructor. 2022-07-06 22:38:53 +02:00
retrooper be4e820c0a Fixes to WrapperPlayServerRespawn for 1.15-1.16? 2022-07-06 22:36:37 +02:00
retrooper d7e1aa2161 Hopefully this breaks nothing but we need to load packet type mappings before the injector injects. As a rare scenario where the main-thread (when the plugin enables) and the netty threads both notice the mappings aren't loaded, they load them simultaneously which isn't handled well. 2022-07-06 21:29:13 +02:00
retrooper f214cc54c6 Fix WrapperPlayServerParticle for 1.19 2022-07-06 15:22:24 +02:00
MWHunter 31157da8bb Add hashcode functions to Vector3 2022-07-05 19:44:56 -05:00
retrooper d54baa4293 Hopefully all works now. 2022-07-03 06:49:58 +02:00
retrooper e3e4ac027f Merge pull request #446 from retrooper/revert-439-feat/improvements
Revert "Cleaned up and improved some wrappers"
2022-07-03 06:48:38 +02:00
retrooper c8023cd828 Revert "Cleaned up and improved some wrappers" 2022-07-03 06:47:53 +02:00
retrooper 9770948c45 Fixed PacketTransformationUtil 2022-07-01 22:10:35 +02:00
retrooper 6b62e2152f EquipmentSlot renamed some enum constats to make more sense. 2022-07-01 22:05:27 +02:00
retrooper 88a223e2d9 Merge pull request #439 from NoJokeFNA/feat/improvements
Cleaned up and improved some wrappers
2022-07-01 22:02:33 +02:00
Julian 74f28ad610 feat: improved EquipmentSlot 2022-07-01 11:00:56 +02:00
Julian 085b37b2ed remove: removed debug 2022-06-30 22:51:12 +02:00
NoJokeFNA ea273ba4b6 feat: some more cleanup 2022-06-29 13:07:32 +02:00
NoJokeFNA f3b14030b1 feat: some cleanup 2022-06-28 11:33:04 +02:00
Julian c565d94d41 Merge branch '2.0' into feat/improvements 2022-06-27 21:58:10 +02:00
retrooper d054164a4b User#sendMessage doesn't look awkward on 1.19 anymore and few minor optimizations or fixes? 2022-06-27 19:44:16 +02:00
Julian cd0679c3b2 Merge remote-tracking branch 'origin/feat/improvements' into feat/improvements 2022-06-27 19:18:59 +02:00
Julian 1be60149f9 feat: added missing data 2022-06-27 19:18:52 +02:00
Julian b48e271ced Merge branch '2.0' into feat/improvements 2022-06-27 19:15:21 +02:00
retrooper 2bcb1dcb90 Fix WrapperPlayClientPluginMessage 2022-06-27 18:55:12 +02:00
retrooper c8d472beb7 Removed WrapperPlayClientPluginMessage generics, channel name always string. 2022-06-27 18:22:11 +02:00
retrooper 18689e4f00 Fixed WrapperPlayServerJoinGame 2022-06-27 18:09:20 +02:00
retrooper 440c73431e Fixed WrapperPlayServerRespawn for 1.19, my bad but i wonder why it doesn't work? 2022-06-27 17:59:21 +02:00
retrooper de634687fa Fixed WrapperPlayServerRespawn for 1.19. 2022-06-27 17:52:02 +02:00
retrooper 6d0a753d2d Remove debugs. 2022-06-27 17:45:10 +02:00
retrooper c43b24c0db Attach public key to user handle for us to verify chat messages. (I hope this is the right key as our message verifier doesn't work rn) 2022-06-27 17:42:00 +02:00
retrooper 7df7ffcc69 Some cleanup to the component wrappers, use the abstraction we have to avoid code duplication. 2022-06-27 17:27:55 +02:00
MWHunter cca73eabe0 Don't do synchronous web requests on join event 2022-06-26 23:14:28 -05:00
MWHunter db7f8d9cbd allow plugins to exceed server address max length 2022-06-25 19:14:32 -05:00
Julian a53ff85a66 change: cleaned up a little more 2022-06-23 19:20:32 +02:00
NoJokeFNA 46a7f39be6 change: improved JavaDocs a bit 2022-06-23 14:24:25 +02:00
NoJokeFNA 89801adc76 fix: fixed compilation errors 2022-06-23 11:06:30 +02:00
Julian a405880a89 feat: cleaned up WrapperPlayClientEntityAction and WrapperPlayClientInteractEntity 2022-06-23 09:04:56 +02:00
Julian bd5c4207bc feat: cleaned up WrapperPlayClientAnimation 2022-06-23 09:02:12 +02:00
Julian 3564bc56e4 fix: fixed WrapperPlayServerParticle on higher server versions 2022-06-22 21:47:54 +02:00
Julian 6f18f867c0 feat: cleaned up and improved wrappers 2022-06-22 18:42:19 +02:00
retrooper 1ae1b5abf1 Merge pull request #353 from NoJokeFNA/feat/recipe-wrappers
Added WrapperPlayClientCraftRecipeRequest & WrapperPlayServerCraftRecipeResponse created
2022-06-22 14:59:27 +02:00
MWHunter f8a920a2cb Fix compilation 2022-06-21 20:31:12 -05:00
Julian b497efc0c1 Merge branch '2.0' into feat/improvements 2022-06-21 22:37:12 +02:00
Julian dfb36a48f9 feat: cleaned up WrapperPlayServerTabComplete 2022-06-21 22:33:34 +02:00
retrooper 0e471c665d Merge pull request #428 from NoJokeFNA/fix/sound-wrappers
[1.19] Fix sound wrappers
2022-06-21 22:23:16 +02:00
Julian f76b2f7c72 Merge branch '2.0' into fix/sound-wrappers 2022-06-21 22:18:20 +02:00
retrooper 4915d7d4a3 Merge pull request #433 from NoJokeFNA/change/cleanup
Refactored WrapperPlayServerChatMessage and cleaned up some classes
2022-06-21 22:12:27 +02:00
Julian 16e3861b41 change: changed signedChatContent to chatContent 2022-06-21 21:51:19 +02:00
NoJokeFNA b57855b6ba remove: removed $multiOptional as it was useless 2022-06-21 20:19:03 +02:00
MWHunter 6edd19e416 Mark mangrove fences as exceeds full cube 2022-06-20 18:43:16 -05:00
Julian 4ef61c71bf Merge remote-tracking branch 'origin/feat/recipe-wrappers' into feat/recipe-wrappers 2022-06-19 19:44:41 +02:00
Julian 6a5f0d3e50 change: cleaned up code 2022-06-19 19:44:34 +02:00
Julian 9b20221587 Merge branch '2.0' into feat/recipe-wrappers 2022-06-19 19:36:40 +02:00
NoJokeFNA 70b540e67f feat: added WrapperPlayClientUpdateJigsawBlock 2022-06-19 18:24:32 +02:00
Julian f76b26e5d7 remove: removed OptionalLong usage 2022-06-19 18:04:48 +02:00
DefineOutside 19b6d3c999 Update BlockTags.java 2022-06-18 16:24:05 -05:00
Julian 49955e2dc8 Merge remote-tracking branch 'origin/change/cleanup' into change/cleanup 2022-06-16 18:22:23 +02:00
Julian cd6a4d0cd2 feat: cleaned up a little more 2022-06-16 18:22:00 +02:00
Julian 4f1cd6c8bc Merge branch '2.0' into change/cleanup 2022-06-16 14:06:01 +02:00
retrooper 29fe12ef57 Merge pull request #427 from NoJokeFNA/fix/set-breacon-effect-wrapper
[1.19] Fixed WrapperPlayClientSetBeaconEffect
2022-06-16 07:48:53 +02:00
retrooper 5116d62488 Merge pull request #359 from NoJokeFNA/feat/set-recipe-book-state-wrapper
Added WrapperPlayClientSetRecipeBookState
2022-06-16 07:47:30 +02:00
retrooper 6387309f01 WrapperPlayClientChatMessage fix message data optional being null. 2022-06-16 07:41:06 +02:00
MWHunter bb27307e25 Fix via mappings weirdness for modern block mappings 2022-06-15 21:01:37 -05:00
MWHunter 0ad3baeea4 Add mangrove logs to block tags 2022-06-14 23:22:41 -05:00
MWHunter 635d0f2a7c comment out debug listener 2022-06-14 23:03:20 -05:00
Julian 5f49f63e8f feat: refactored all Wrappers
feat: recoded WrapperPlayServerScoreboardObjective
feat: added little TODO
2022-06-14 03:34:10 +02:00
Julian 45dd54dfb3 change: changed read-/writeEffect to read-/writeOptionalEffect 2022-06-14 03:23:49 +02:00
Julian bcf35813d8 fixed: fixed WrapperPlayServerEntitySoundEffect and WrapperPlayServerSoundEffect 2022-06-12 04:18:14 +02:00
DefineOutside 327b514216 Merge pull request #431 from NoJokeFNA/feat/new-wrappers
[1.19] Added new Chat Preview-/, Server Data-/ and Chat Command Wrappers
2022-06-11 18:24:57 -05:00
Julian 96f67109fe feat: added new Chat Preview-/, Server Data-/ and Chat Command Wrappers
feat: added `$readOptional(S value, Consumer<S> writeValue)` and `$writeOptional(S value, Consumer<S> writeValue)`
2022-06-12 01:19:15 +02:00
terrarier2111 50d42f9fc9 Merge pull request #387 from NoJokeFNA/feat/spawn-weather-entity
Added WrapperPlayServerSpawnWeatherEntity
2022-06-11 23:37:45 +02:00
NoJokeFNA e248a47a1f feat: added WrapperPlayServerSpawnWeatherEntity
feat: added WrapperPlayServerSpawnWeatherEntity
2022-06-11 23:36:18 +02:00
MWHunter 5d3e4bd0f8 Refactor dimension code 2022-06-11 16:14:43 -05:00
MWHunter 3b3f0a84be Track world height because it is required for world reader 2022-06-11 15:24:26 -05:00
Julian 9b55e982b3 change: improved readability 2022-06-11 21:42:11 +02:00
MWHunter 712f1013f4 mangrove doors are not stairs 2022-06-11 14:41:56 -05:00
Julian eb4bab70d1 fix: fixed WrapperPlayClientSetBeaconEffect for 1.19 2022-06-11 20:38:46 +02:00
MWHunter d970c4e020 Fix error writing bytes 2022-06-11 12:07:38 -05:00
MWHunter 825157f998 Fix 1.19 entity effect and player info packet 2022-06-11 11:49:04 -05:00
MWHunter c41f1797e8 join game readability improvements 2022-06-10 20:38:06 -05:00
MWHunter f871e71823 Fix respawn packet 2022-06-10 20:36:08 -05:00
MWHunter a270b515d2 Fix player digging packet on 1.19 2022-06-10 19:38:05 -05:00
MWHunter b90920e63a Fix 1.13 entity metadata mappings 2022-06-10 19:22:50 -05:00
retrooper 4def9c7ab1 Fix user sendmessage on 1.19 (use system chat message wrapper packet)
Fix WrapperPlayServerRespawn for 1.19.
2022-06-10 21:04:12 +02:00
retrooper 79f102ecc5 Compilation error fix 2022-06-10 20:10:32 +02:00
retrooper 1bdc56d251 Fix WrapperLoginClientLoginStart on 1.19. 2022-06-10 20:07:55 +02:00
retrooper d1d793f9e7 SpigotDataHelper -> SpigotConversionUtil
WrapperPlayServerChatMessage completed,
WrapperPlayServerSystemChatMessage created,
Minor bug fixes to other component wrappers.
2022-06-10 20:00:08 +02:00
MWHunter 1c661f0a5d Merge remote-tracking branch 'origin/dev/1.19' into 2.0 2022-06-10 00:40:14 -05:00
MWHunter 9db70222c0 Merge branch 'dev/1.19' into 2.0
# Conflicts:
#	api/src/main/java/com/github/retrooper/packetevents/wrapper/play/server/WrapperPlayServerJoinGame.java
2022-06-10 00:14:39 -05:00
MWHunter 42b16f1fbd Don't write empty buffers 2022-06-09 21:33:30 -05:00
MWHunter 34d4fac6e8 actually fix 1.19 item type mappings 2022-06-09 20:39:42 -05:00
MWHunter f63a290d34 minor optimization 2022-06-09 20:38:34 -05:00
MWHunter 68867c135d Fix item types for 1.19 2022-06-09 20:09:58 -05:00
retrooper 7ae55731fb Minor changes, but still cant verify messages :c 2022-06-09 20:20:55 +02:00
retrooper cd24067ce7 Added 1.19 entity poses. 2022-06-09 19:13:58 +02:00
retrooper 3f1f65e4a3 Merge remote-tracking branch 'origin/2.0' into dev/1.19
# Conflicts:
#	api/src/main/java/com/github/retrooper/packetevents/wrapper/play/server/WrapperPlayServerJoinGame.java
2022-06-09 19:08:45 +02:00
MWHunter 0095487773 Fix swapped blocking and solid on 1.19 blocks 2022-06-08 22:11:54 -05:00
MWHunter 7d2e67b95d Fix 1.19 entity type mappings 2022-06-08 22:00:54 -05:00
MWHunter b0db7045f4 Data is a varint in 1.19 2022-06-08 21:47:10 -05:00
MWHunter bfdab3a518 1.19 spawn entity packet support 2022-06-08 21:10:18 -05:00
MWHunter fc49c374bf 1.19 join game packet support 2022-06-08 20:58:58 -05:00
MWHunter 4b776ca7bf Register 1.19 entity data types 2022-06-08 20:38:41 -05:00
MWHunter 0f58efa3cc Support for 1.19 block data type values 2022-06-08 20:37:21 -05:00
MWHunter 0d3a8e5410 1.19 entity data types 2022-06-08 19:53:54 -05:00
MWHunter c6d3d72ce9 Add missing MANGROVE_STAIRS state 2022-06-08 19:39:26 -05:00
MWHunter fc651c65ad Add support for sequences in existing wrappers, add WrapperPlayServerAcknowledgeBlockChanges 2022-06-08 19:12:51 -05:00
MWHunter 9b86427884 1.19 SpigotReflectionUtil support 2022-06-08 19:03:29 -05:00
retrooper 849713eaea Unable to verify messages? 2022-06-08 23:54:06 +02:00
retrooper 52db6d7b6a Working on cryptography additions in 1.19 update for the secure chat system.
Debugs enabled and join game needs to be updated for 1.19 support so some parts are commented out.

Chat messages cause problems.
2022-06-08 22:52:39 +02:00
retrooper 0434cd6bf8 Fix packet type mappings for CHAT_MESSAGE. 2022-06-08 17:57:36 +02:00
MWHunter dbab8591bf Add bloom to block data types 2022-06-07 21:52:32 -05:00
MWHunter 065649d1df Try fixing trying to log in 2022-06-07 21:49:31 -05:00
MWHunter 2d2e0cdfeb Add swift sneak enchantment 2022-06-07 21:46:33 -05:00
MWHunter c3e8f307b7 Fix 1.19 block mappings 2022-06-07 21:33:15 -05:00
MWHunter e03f1ef713 Update BlockTags and add a few missing StateTypes 2022-06-07 21:10:31 -05:00
MWHunter eb4f73b582 ItemTypes and StateTypes variables and data 2022-06-07 20:48:53 -05:00
MWHunter 1609d1c2b0 1.19 entity types mappings 2022-06-07 19:53:45 -05:00
MWHunter 3480620eca 1.19 particle type mappings 2022-06-07 19:42:05 -05:00
MWHunter e694af304e Fix enchantment type mappings on 1.19 2022-06-07 19:33:39 -05:00
MWHunter 581c04e66e 1.19 enchantment types 2022-06-07 19:30:51 -05:00
MWHunter 2e737288ef 1.19 wrapped block state 2022-06-07 19:27:55 -05:00
retrooper 18a1d51c19 Fix number format exception when parsing very outdated protocolsupport build versions. 2022-06-07 23:14:45 +02:00
retrooper db7ec7fe95 Fixed compilation errors. 2022-06-07 23:10:26 +02:00
retrooper d619546735 Reverting the rename of WrapperPlayServerChatMessage. Fixes for some packet type mappings. CHAT_MESSAGE changed and SYSTEM_MESSAGE is a new packet. 2022-06-07 23:09:08 +02:00
retrooper b78b449895 1.19 packet id mappings fixed/complete and now used. 2022-06-07 22:59:41 +02:00
retrooper f53198aec5 Remove duplicate license notice. 2022-06-07 22:46:44 +02:00
retrooper fa1728210a Correct packet ids mappings. 2022-06-07 22:44:27 +02:00
retrooper 90674cefc4 Ordinary CHAT_MESSAGE -> SYSTEM_CHAT_MESSAGE. Please use that if you want the ordinary messages that don't have any cryptography. On new versions those are the system message only but they still have no cryptography. 2022-06-07 19:01:48 +02:00
retrooper 24d4a21007 Working on 1.19 support, need to work on wrappers. 2022-06-07 18:30:42 +02:00
retrooper b4ad4e831d Minor changes. 2022-06-06 11:49:55 +02:00
retrooper 886d872241 Some cleanup in ProtocolManager 2022-06-06 11:44:46 +02:00
retrooper 0ef01b868e Allow packet wrappers to truly be reused. 2022-06-06 11:36:24 +02:00
retrooper 46f89771a5 Remove unnecessary async send/receive methods in our API. 2022-06-06 11:34:09 +02:00
MWHunter 055f473964 expose getEnchantmentsTagName 2022-06-05 19:26:30 -05:00
MWHunter f3850dab24 Fix incomplete client settings copy method 2022-06-05 11:23:10 -05:00
MWHunter 86870c40a5 Fix 1.8 chunk reader exception 2022-06-05 10:58:40 -05:00
MWHunter dbc33f9fe4 Fix leak with multiple packetevents 2.0 instances 2022-06-05 10:47:52 -05:00
threadexception 1f95fda03c Cleanup many enums 2022-06-04 11:18:06 +02:00
MWHunter 1724f54b12 Fix https://github.com/retrooper/packetevents/issues/416 2022-06-03 11:43:55 -05:00
threadexception 4b0132ed90 Rewrite SkinSection 2022-06-02 18:19:42 +02:00
retrooper d219faafd0 Enforce ProtocolSupport 1.18.1-1 or newer. 2022-06-01 21:25:24 +02:00
retrooper 6d19f60049 Add little comment. 2022-06-01 20:38:23 +02:00
retrooper a8f1b23769 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-06-01 20:33:53 +02:00
retrooper 89cb93be67 Remove paper injector. (Not needed anymore)
Injector changes depending on netty version instead of server version.
2022-06-01 20:33:31 +02:00
MWHunter bfe9aba3a8 PacketEncoder/Decoder -> PacketEventsEncoder/Decoder 2022-05-31 15:52:13 -05:00
MWHunter 5265ddd27c Remove duplicate Vector3i code 2022-05-31 15:46:39 -05:00
retrooper 5e118f5e17 Remove debugs? 2022-05-31 21:36:19 +02:00
Julian a522e8262a Fixed code-style 2022-05-31 21:30:54 +02:00
retrooper 028bfd8ada Merge pull request #400 from NoJokeFNA/fix/code-style
Fixed code-style
2022-05-31 21:16:50 +02:00
NoJokeFNA d1ba1b8831 remove: removed @Nullable from UUID as it can't be null any longer 2022-05-31 09:18:52 +02:00
NoJokeFNA 2a7c79235d feat: applied retrooper changes 2022-05-31 09:14:47 +02:00
MWHunter ebaf94a5ec expose internal fields in DataPalette 2022-05-30 18:08:44 -05:00
retrooper 5c9b930737 Merge pull request #368 from NoJokeFNA/feat/spawn-experience-orb-wrapper
Added WrapperPlayServerSpawnExperienceOrb
2022-05-29 14:10:05 +02:00
retrooper 9483582479 Merge pull request #360 from NoJokeFNA/feat/set-displayed-recipe-wrapper
Added WrapperPlayClientSetDisplayedRecipe
2022-05-29 14:08:01 +02:00
retrooper cd7b23a537 Merge pull request #392 from NoJokeFNA/feat/update-entity-nbt
Added WrapperPlayServerUpdateEntityNBT
2022-05-29 14:04:39 +02:00
retrooper 97609976e4 Update README.md 2022-05-29 13:51:03 +02:00
retrooper 4262f1f9cd More changes to README. 2022-05-29 13:45:18 +02:00
retrooper eb6237d913 Minor changes to README. 2022-05-29 13:35:12 +02:00
retrooper fcf2edefe8 Merge pull request #409 from AbhigyaKrishna/2.0
Adventure legacy serialization patches
2022-05-29 13:18:20 +02:00
Abhigya a7a9ef52f0 Adventure Legacy serialization patches 2022-05-29 14:47:23 +05:30
retrooper d8ad50fcf8 Progress on bungee support. 2022-05-26 14:42:12 +02:00
retrooper 3a974ab51f Merge pull request #372 from NoJokeFNA/feat/entity-sound-effect-wrapper
Added WrapperPlayServerEntitySoundEffect
2022-05-26 11:12:33 +02:00
retrooper 9834830bda Remove redundant bytebuf import. 2022-05-25 22:18:26 +02:00
retrooper e673558179 ByteBufHelper.capacity methods added. So people using netty directly just for that can use our api. 2022-05-25 22:16:01 +02:00
retrooper bd17353576 Merge pull request #401 from NoJokeFNA/feat/select-advancement-tab-wrapper
Added WrapperPlayServerSelectAdvancementTab
2022-05-24 21:40:42 +02:00
NoJokeFNA 4f0403d315 remove: removed hasId getter and setter 2022-05-24 19:15:06 +02:00
MWHunter 0232e7b212 Automatically replace minecraft: in getByString 2022-05-24 10:36:15 -05:00
retrooper 68655dd92b Merge pull request #385 from NoJokeFNA/feat/set-compression-wrapper
Added WrapperPlayServerSetCompression
2022-05-24 17:33:25 +02:00
retrooper 28ffd08fbd Merge pull request #369 from NoJokeFNA/feat/update-view-position-wrapper
Added WrapperPlayServerUpdateViewPosition
2022-05-24 17:31:09 +02:00
MWHunter 4b92eb7912 init internal bukkit listener 2022-05-22 22:54:29 -05:00
MWHunter 6f76822785 InternalBukkitListener 2022-05-22 22:54:11 -05:00
MWHunter 165bc85dfa Revert "Fix memory leak"
This reverts commit fdcb42caf2.
2022-05-22 22:25:46 -05:00
MWHunter fdcb42caf2 Fix memory leak 2022-05-22 22:09:53 -05:00
NoJokeFNA 7d5fcb22a8 change: changed String to ResourceLocation (identifier) 2022-05-22 14:41:25 +02:00
NoJokeFNA c2beac9bfa remove: removed useless version check as it got introduced in 1.14 2022-05-22 14:40:20 +02:00
MWHunter 49344d0f3c Revert "Make PacketEvents 2.0 see its own existing decoder"
This reverts commit 18b6ddca70.
2022-05-22 05:37:08 -05:00
MWHunter 18b6ddca70 Make PacketEvents 2.0 see its own existing decoder 2022-05-21 20:21:25 -05:00
MWHunter e901b5dd64 Fix 1.8 chunk reader 2022-05-21 19:49:55 -05:00
MWHunter bf11a02d44 Remove unnecessary code dealing with removing players 2022-05-21 19:19:06 -05:00
MWHunter 15f0295142 Revert 5bf2daa7 2022-05-21 19:13:43 -05:00
MWHunter 5c665053d2 100 MB -> 1 MB idle memory usage in WrappedBlockState 2022-05-21 18:56:07 -05:00
MWHunter cddf378b51 Unload file mappings when done initializing classes 2022-05-21 17:14:47 -05:00
DefineOutside 96bfb98c87 Merge pull request #389 from NoJokeFNA/feat/nbt-query-response-wrapper
Added WrapperPlayServerNBTQueryResponse
2022-05-21 16:35:52 -05:00
DefineOutside d0f85d69ab Merge pull request #363 from NoJokeFNA/feat/update-command-block-wrapper
Added WrapperPlayClientUpdateCommandBlock and WrapperPlayClientUpdateCommandBlockMinecart
2022-05-21 16:29:53 -05:00
MWHunter 3374827e66 Fix createUniversalPacketWrapper 2022-05-21 16:08:37 -05:00
MWHunter 96d8fc6d21 Fix rare race condition memory leak 2022-05-21 12:39:40 -05:00
MWHunter 1fd19db0f2 289 KB jar reduction 2022-05-21 10:43:20 -05:00
MWHunter 2ef717cd72 Unflip logic in PlayerManager 2022-05-20 23:10:26 -05:00
MWHunter 1868cee073 Fix memory leak with storing channels 2022-05-20 23:04:29 -05:00
MWHunter 351742e88e Clean up PlayerManagerImpl, fix memory leak 2022-05-20 22:55:06 -05:00
MWHunter bd67caaeb8 Prevent memory leak when sending packet to a closed channel 2022-05-20 22:33:06 -05:00
MWHunter 0f39521750 Prevent sending packets that don't exist in a version 2022-05-20 22:32:32 -05:00
MWHunter 7fde4a379a Vector3d, f, i utility method to add BlockFace 2022-05-20 22:18:47 -05:00
MWHunter 5cc7e6f2bc Improve WrapperPlayClientClickWindow naming 2022-05-20 22:06:01 -05:00
MWHunter f2f4a8d62b Convert ProtocolManager to using UUID's 2022-05-20 21:50:35 -05:00
MWHunter 16f9eb32c9 Lazily allocate packet wrapper buffers, reusable wrappers 2022-05-20 21:38:15 -05:00
NoJokeFNA 3567b7d735 feat: added WrapperPlayServerSelectAdvancementTab 2022-05-20 17:39:39 +02:00
NoJokeFNA 23a181c33a fix: code-style... gosh 2022-05-20 14:56:39 +02:00
NoJokeFNA 74b6bfca28 fix: fixed WrapperPlayServerSpawnPainting 2022-05-20 14:55:54 +02:00
NoJokeFNA ef1074e7ba fix: fixed PaintingType class 2022-05-20 14:53:37 +02:00
NoJokeFNA b02d7a3df2 Merge branch '2.0' into fix/code-style
# Conflicts:
#	api/src/main/java/com/github/retrooper/packetevents/protocol/world/PaintingType.java
#	api/src/main/java/com/github/retrooper/packetevents/wrapper/play/server/WrapperPlayServerSpawnPainting.java
2022-05-20 14:50:18 +02:00
NoJokeFNA 6c3d6f25ac fix: code-style 2022-05-20 14:48:32 +02:00
Julian de4b9887b7 Update WrapperPlayServerUpdateEntityNBT.java 2022-05-20 12:02:53 +02:00
retrooper b7c9eabf8f Merge pull request #396 from NoJokeFNA/feat/time-update-wrapper
Fixed code-style
2022-05-19 23:00:03 +02:00
NoJokeFNA ed43c51428 fix: fixed code-style 2022-05-19 19:10:32 +02:00
NoJokeFNA 69bc454cc0 fix: fixed code-style 2022-05-19 19:02:00 +02:00
NoJokeFNA 83b87cf9cb fix: fixed code-style 2022-05-19 18:59:33 +02:00
MWHunter 0f061764e6 Fix another memory leak 2022-05-19 11:19:26 -05:00
NoJokeFNA 77a6b8152e fix: fixed code-style 2022-05-19 18:17:39 +02:00
NoJokeFNA 6a5e76512f fix: fixed code-style 2022-05-19 18:17:06 +02:00
NoJokeFNA 24bad668bd fix: fixed code-style 2022-05-19 18:11:56 +02:00
MWHunter a670961b99 Reliably call disconnect event using netty API 2022-05-19 00:14:05 -05:00
retrooper f3896d3c78 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-05-18 19:45:29 +02:00
retrooper 04e9e57dad Fixed WrapperPlayServerJoinGame for 1.14.4 2022-05-18 19:45:09 +02:00
MWHunter 2bccff6ae6 Fix player info wrapper 2022-05-15 22:50:53 -05:00
NoJokeFNA 3afa857965 change: correct Optional usage (for now) -> reduce overhead for plain fields 2022-05-15 18:00:05 +02:00
NoJokeFNA 3441da2bd5 change: reformatted code with current code-style 2022-05-15 17:56:23 +02:00
NoJokeFNA 898972d040 change: use MathUtils#floor instead of Math#floor 2022-05-15 17:55:46 +02:00
NoJokeFNA b0d0f18da2 change: reformatted code with current code-style 2022-05-15 17:54:24 +02:00
NoJokeFNA 1d3a828f55 feat: added WrapperPlayServerUpdateEntityNBT 2022-05-15 16:24:24 +02:00
NoJokeFNA 310bb1ea10 remove: removed $toString as it was only used for debugging 2022-05-15 15:48:09 +02:00
NoJokeFNA 7f8deb280a feat: added WrapperPlayServerNBTQueryResponse 2022-05-15 15:47:17 +02:00
retrooper 3204527b6f Paper injector won't be used if ProtocolSupport is on the server. 2022-05-15 13:11:38 +02:00
NoJokeFNA 0354e2b5fc change: use MathUtils class instead of creating own methods 2022-05-13 20:31:51 +02:00
NoJokeFNA 07dac7c20e change: code-style 2022-05-13 20:30:07 +02:00
NoJokeFNA bf09ad27b9 feat: added WrapperPlayServerSetCompression 2022-05-13 20:29:19 +02:00
NoJokeFNA af3bbb3db8 change: cleaned up WrapperLoginServerSetCompression 2022-05-13 20:29:02 +02:00
retrooper f520af9250 Few comments. 2022-05-13 17:39:53 +02:00
Julian df590b7083 Merge branch '2.0' into feat/recipe-wrappers 2022-05-13 17:36:06 +02:00
retrooper 9ec7b8d776 Merge pull request #381 from NoJokeFNA/feat/entity-movement-wrapper
Added WrapperPlayServerEntityMovement
2022-05-13 17:34:07 +02:00
retrooper 18580ced5a Check for updates by default. 2022-05-13 17:32:47 +02:00
retrooper 8dc6b1be29 Add more license notices wherever missing. 2022-05-13 16:36:22 +02:00
retrooper 649839c539 Improve WrapperPlayServerSpawnPainting and bring the type into one form. the old string form is not necessary and complicates the usage of the wrapper. 2022-05-13 16:35:24 +02:00
retrooper 7401b9bbb0 Merge pull request #357 from NoJokeFNA/feat/open-sign-editor-wrapper
Added WrapperPlayServerOpenSignEditor
2022-05-12 22:12:10 +02:00
retrooper 068967fd74 Merge pull request #356 from NoJokeFNA/fix/entity-patch
Fix SpigotDataHelper#fromBukkitEntityType returning null on modern versions
2022-05-12 22:11:41 +02:00
retrooper 20c07143aa Merge pull request #366 from NoJokeFNA/feat/camera-wrapper
Added WrapperPlayServerCamera
2022-05-12 22:11:16 +02:00
retrooper fafa6e5191 Merge pull request #367 from NoJokeFNA/feat/spawn-painting-wrapper
Added WrapperPlayServerSpawnPainting
2022-05-12 22:10:02 +02:00
retrooper 327a986944 Merge pull request #371 from NoJokeFNA/feat/spawn-position
Added WrapperPlayServerSpawnPosition
2022-05-12 22:07:25 +02:00
NoJokeFNA 666cc8f81b change: hopefully resolve soon merge-conflict 2022-05-12 15:11:46 +02:00
NoJokeFNA 7c81ae2fa4 fix: fixed 1.7.x support 2022-05-12 12:44:45 +02:00
NoJokeFNA 8224019e23 change: code-style 2022-05-12 12:42:01 +02:00
NoJokeFNA b334d82e76 remove: removed legacy code 2022-05-12 12:24:32 +02:00
NoJokeFNA e28f416746 fix: fixed 1.7.x support (again) 2022-05-12 12:21:32 +02:00
NoJokeFNA cd821c3d86 fix: fixed 1.7.x support 2022-05-12 12:19:39 +02:00
NoJokeFNA 42fd096ac3 fix: fixed 1.7.x support 2022-05-12 12:10:46 +02:00
NoJokeFNA bff4a10355 change: replaced nullabilities with Optionals 2022-05-11 20:57:03 +02:00
NoJokeFNA bd52a7856d change: replaced nullabilities with Optionals 2022-05-11 20:54:45 +02:00
NoJokeFNA 01fb89f378 change: changed possible nullabilities to Optionals 2022-05-11 20:40:18 +02:00
NoJokeFNA 4abe76816d feat: added WrapperPlayServerEntityMovement 2022-05-11 17:06:46 +02:00
NoJokeFNA e19283e387 remove: removed $toString method as it was only used for debug purposes 2022-05-11 13:42:42 +02:00
NoJokeFNA 03286746a0 remove: removed $toString method as it was only used for debug purposes 2022-05-11 13:42:18 +02:00
NoJokeFNA e7ce4dddec feat: added WrapperPlayServerEntitySoundEffect
change: improved code by a bit
2022-05-11 02:53:10 +02:00
NoJokeFNA cd9829bcae feat: added WrapperPlayServerSpawnPosition 2022-05-11 02:36:50 +02:00
NoJokeFNA 132f8d53a9 remove: removed $toString method as it was only used for debug purposes 2022-05-11 02:05:46 +02:00
NoJokeFNA abb74ab2cf feat: added WrapperPlayServerUpdateViewPosition 2022-05-11 02:04:43 +02:00
NoJokeFNA 3d97cd1aa0 feat: added WrapperPlayServerSpawnExperienceOrb 2022-05-11 01:54:27 +02:00
NoJokeFNA 809f712e80 feat: added WrapperPlayServerSpawnPainting, as well as two other classes which might be helpful for the future for other classes 2022-05-11 01:25:12 +02:00
NoJokeFNA 88877c7874 feat: added WrapperPlayServerCamera 2022-05-11 00:44:10 +02:00
DefineOutside 749f17efbe Merge pull request #362 from NoJokeFNA/fix/missing-constructor-edit-book
Missing constructor in WrapperPlayClientEditBook
2022-05-10 17:39:09 -05:00
DefineOutside 3ef1b424b1 Merge pull request #365 from NoJokeFNA/feat/time-update-wrapper
Added WrapperPlayServerTimeUpdate
2022-05-10 17:38:40 -05:00
NoJokeFNA bd0185f825 feat: added WrapperPlayServerTimeUpdate 2022-05-11 00:36:15 +02:00
NoJokeFNA f86ed401b2 fix: added WrapperPlayClientUpdateCommandBlock and WrapperPlayClientUpdateCommandBlockMinecart 2022-05-10 23:45:55 +02:00
NoJokeFNA b9d01eb9d8 fix: added missing constructor as it was missing 2022-05-10 22:57:54 +02:00
NoJokeFNA 08a0d108b0 feat: added WrapperPlayClientSetDisplayedRecipe wrapper class 2022-05-10 01:21:52 +02:00
NoJokeFNA 30b3c20c80 feat: added WrapperPlayClientSetRecipeBookState wrapper class 2022-05-10 01:13:16 +02:00
NoJokeFNA d56885c3f9 feat: added WrapperPlayServerOpenSignEditor wrapper class 2022-05-09 23:47:35 +02:00
NoJokeFNA 822a52b5b8 fix: fixed e.g. SpigotDataHelper.fromBukkitEntityType(EntityType.ZOMBIE) always returning null on modern (1.13.x) server versions
Tested Server-Versions: 1.8.8, 1.13, 1.13.2, 1.14, 1.14.4, 1.15.2, 1.18.2
2022-05-09 23:25:48 +02:00
NoJokeFNA d8eb1d07f2 change: finished changes 2022-05-09 22:38:51 +02:00
NoJokeFNA 34956af6a2 change: removed the listener registration 2022-05-09 22:01:19 +02:00
NoJokeFNA 1f15d0ba20 feat: added WrapperPlayClientCraftRecipeRequest and WrapperPlayServerCraftRecipeResponse wrapper classes
With this pull request users can use two new wrappers that work fine - I think there is nothing more to explain.
It was tested with the server versions: 1.8.8, 1.12.2, 1.13, 1.13.2, 1.14.4, 1.15.2, 1.16.5 and 1.18.2
Client-Versions: 1.18.2, 1.16.5, 1.13
2022-05-09 21:54:10 +02:00
MWHunter c4798df9dc Fix WrappedBlockState on 1.16.3-1.16.5 2022-05-08 20:47:04 -05:00
retrooper a1fdc00a01 Remove further debug. 2022-05-08 23:04:37 +02:00
retrooper d85e7a2b0f Removed bad compression util (recreating minecraft compression).
Removed debugs.
2022-05-08 23:04:00 +02:00
MWHunter c78727f15f Heavily optimize WrappedBlockState air 2022-05-08 10:29:45 -05:00
MWHunter dd1d85e3e4 WrappedBlockState performance improvements 2022-05-08 10:14:49 -05:00
retrooper e29c907188 Fixed WrapperStatusServerResponse constructor. 2022-05-08 11:45:32 +02:00
retrooper 450aec3191 Add license notice to all wrappers missing it. 2022-05-08 10:40:29 +02:00
MWHunter c672086b8f Add getters and setters to the two new wrappers 2022-05-07 11:23:28 -05:00
MWHunter ae3a3a795d WrapperPlayClientEditBook 2022-05-07 11:14:02 -05:00
MWHunter 2fa200b347 WrapperPlayServerOpenBook 2022-05-07 11:00:24 -05:00
MWHunter 7d750a42ab Fix copying over WrapperPlayClientBlockPlacement itemstack 2022-05-05 22:12:35 -05:00
retrooper f61f93a85d gramr 2022-04-27 19:50:06 +02:00
retrooper e0c38b59c1 Little documenting. 2022-04-27 19:19:27 +02:00
retrooper 198034ae67 Fixed post tasks for outgoing packets. They are now executed once the outgoing packet is successfully sent. 2022-04-27 19:17:48 +02:00
MWHunter 10107a14fc Fix last used wrapper breaking when wrappers are used more than 2 times 2022-04-24 17:27:15 -05:00
retrooper 0e18040bee Fixed sending packets while ProtocolSupport is present. 2022-04-24 23:19:29 +02:00
retrooper ab92d8bdd3 Fixed ProtocolSupport support 2022-04-24 23:00:22 +02:00
retrooper 6bf70f5b47 Fixed reloads on modern paper versions. 2022-04-24 22:56:16 +02:00
MWHunter 59dfa9fabb world border centerY -> centerZ 2022-04-22 20:07:49 -05:00
MWHunter f4a48d5326 Let world border packet be read 2022-04-22 20:02:41 -05:00
MWHunter af5f0d9f85 add getDiameter() and setDiameter() to world border size packet 2022-04-22 20:00:45 -05:00
retrooper ab6fa602cc Update README.md 2022-04-22 22:24:44 +02:00
retrooper a15b0c7cc8 Updated licensing logo 2022-04-22 22:24:20 +02:00
MWHunter 86bffa503c remove debug 2022-04-20 18:15:13 -05:00
MWHunter 511b331735 Play with the injector 2022-04-20 18:03:51 -05:00
MWHunter 78d101dd80 Fix ViaVersionUtil exception 2022-04-20 17:35:23 -05:00
MWHunter 70dc93cd09 Add PacketHandshakeSendEvent to fix null event 2022-04-19 21:44:23 -05:00
MWHunter fed8b95199 Fix early injection on 1.8, fix ViaVersionUtil returning wrong value 2022-04-19 18:43:51 -05:00
retrooper e8d8fb5af8 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-04-19 22:56:34 +02:00
retrooper d98038ecf7 Renamings in AdventureSerializer and PacketWrapper#readComponent works properly again. 2022-04-19 22:54:43 +02:00
MWHunter 5ea3713a22 Revert component change 2022-04-19 15:26:06 -05:00
retrooper 0d4cc8a505 Attempt to bug fix REMOVE_LISTENER_METHOD in paper injector (when cleaning up) 2022-04-19 21:03:59 +02:00
MWHunter 9d0dc9f06d Fix leash always being true 2022-04-18 13:45:23 -05:00
retrooper 261b89792b Confirmed that NPC api works on 1.8. 2022-04-18 20:08:26 +02:00
retrooper 089f0b0e18 Improved error message when using 4.8.0 ProtocolLib 2022-04-18 19:45:50 +02:00
retrooper 53e7fbed0e User#getName & User#getUUID methods, which internally access the profile. It just makes things easier. 2022-04-18 19:34:19 +02:00
retrooper 988d118478 Throw an exception when you try to load PacketEvents with a ProtocolLib version older than 5.0.0 2022-04-18 19:28:05 +02:00
MWHunter df7be9b51f Parse adventure, not component. 2022-04-17 22:56:29 -05:00
MWHunter dead95adad Fix netherite pickaxe not being considered a pickaxe 2022-04-17 21:30:00 -05:00
MWHunter d69ad9ef9a Include mappingsIndex in WrappedBlockState constructor 2022-04-17 20:58:10 -05:00
retrooper b65bbb03a8 Some more changes. 2022-04-17 22:40:38 +02:00
retrooper 83d3ca01fe Removed some non-existing pages and shifted some things around. 2022-04-17 22:39:35 +02:00
retrooper e7732b03f8 Redundant changes 2022-04-17 22:38:04 +02:00
retrooper b742335ffb Little PacketWrapper code optimization 2022-04-17 16:12:38 +02:00
retrooper 262a17659b Merge pull request #331 from AbhigyaKrishna/2.0
Title fix for Open Window Packet
2022-04-17 11:24:53 +02:00
DefineOutside 191e24398a Merge pull request #332 from Jaren8r/2.0
Add .with[XYZ] to vectors
2022-04-17 00:29:01 -05:00
Jaren Knodel ae2a23f0aa Add .with[XYZ] to vectors 2022-04-16 11:32:08 -04:00
Abhigya 59944eadf4 Title fix for Open Window Packet 2022-04-16 12:36:28 +05:30
retrooper 5208b090dd Merge pull request #329 from Jaren8r/2.0
Make vectors immutable
2022-04-15 17:26:55 +02:00
Jaren Knodel c14b18d24e Fix build 2022-04-15 10:52:58 -04:00
Jaren Knodel 01e2e6a19d Make vectors immutable 2022-04-15 10:45:31 -04:00
retrooper 71ca117931 Completing the vector change
Improve vectors (pt. 2)
2022-04-15 14:36:00 +02:00
Jaren Knodel bee7fef71a dot 2022-04-15 03:50:57 -04:00
Jaren Knodel 24b8105dcb crossProduct 2022-04-15 03:44:55 -04:00
retrooper a01e066dae Merge pull request #327 from Jaren8r/2.0
Multiply function to vectors
2022-04-15 09:43:19 +02:00
Jaren Knodel e93f94f87c Add multiple(value) to multiple everything by it 2022-04-15 03:35:43 -04:00
Jaren Knodel eb052cca32 Make setXYZ return itself to remain consistant with add/subtract/multiply 2022-04-15 03:28:49 -04:00
Jaren Knodel b4c1b8c954 Add multiply to vectors 2022-04-15 03:17:03 -04:00
MWHunter 5d1b6a7d2a Cache toClientVersion() and toServerVersion() 2022-04-14 22:02:21 -05:00
MWHunter 12bd685fe7 Rework ItemStack constructor and fix enchantment tags for books 2022-04-14 21:45:54 -05:00
retrooper 3616a18286 Minor change 2022-04-14 23:30:07 +02:00
retrooper db6b3489de Merge pull request #319 from Jaren8r/2.0
Don't clone on vector add/subtract (Changed usage of vectors)
2022-04-14 21:06:03 +02:00
MWHunter 049f5f4123 Fix enchantments on pre-1.13 2022-04-14 00:05:22 -05:00
MWHunter b553f29b71 IdentityHashMap -> HashMap 2022-04-13 18:08:08 -05:00
MWHunter ea6e8ee74e Remove client version cache temporarily due to a memory leak 2022-04-13 13:32:30 -05:00
MWHunter 6559603147 Server response is Json not component 2022-04-12 16:04:35 -05:00
MWHunter ab8839c07f WrapperPlayServerOpenWindow optimization and WrapperStatusServerResponse refactor 2022-04-12 16:01:52 -05:00
MWHunter 2c83f6e5a5 Fix spawn player packet attempt 2 2022-04-11 23:37:33 -05:00
MWHunter fa4a4a0ca0 Revert previous commit 2022-04-11 23:35:52 -05:00
MWHunter e9f0e1d7af Fix WrapperPlayServerSpawnPlayer 2022-04-11 23:26:29 -05:00
Jaren Knodel c9cf4f8c9b Don't clone on vector add/subtract 2022-04-11 19:28:12 -04:00
DefineOutside 89e20ef82a Merge pull request #315 from FairyProject/2.0
Fixed WrapperPlayServerScoreboardObjective again
2022-04-11 13:28:45 -05:00
MWHunter bab579f6f9 Convert item type mappings to be more consistent with other mappings 2022-04-11 12:40:15 -05:00
MWHunter e26b1dac22 Try fixing writing air itemstacks on 1.13.2+ 2022-04-11 12:08:16 -05:00
LeeGod 23d9c77305 Fixed WrapperPlayServerScoreboardObjective again 2022-04-11 19:17:55 +07:00
retrooper 8e49b4b400 Minor change. 2022-04-11 12:15:04 +02:00
retrooper e434e5df76 Little comment added. 2022-04-08 23:29:48 +02:00
retrooper f9136dbf42 All 1.7.10 injector/nms code removed.
PacketEventsSettings#fallbackVersion removed

Added an injector specific for paper, which should be more efficient on their platform and adds NachoSpigot support.

Some refactoring/renaming in our spigot injector
2022-04-08 23:28:35 +02:00
retrooper f144f66e88 Merge branch 'version-dynamic' into 2.0
# Conflicts:
#	api/src/main/java/com/github/retrooper/packetevents/protocol/item/ItemStack.java
#	api/src/main/java/com/github/retrooper/packetevents/protocol/item/type/ItemTypes.java
#	api/src/main/java/com/github/retrooper/packetevents/wrapper/play/server/WrapperPlayServerScoreboardObjective.java
2022-04-07 23:00:53 +02:00
retrooper 58f6cf5411 Cut off 1.7.10 injector. We still support 1.7.10 protocol, just not 1.7.10 server software!!!
Attempted reload support again. (Tested on 1.8.8)

PacketSide#getOpposite added
2022-04-07 22:59:38 +02:00
retrooper d966013b69 On Spigot, we now are behind Via & PS again! 2022-04-07 21:27:49 +02:00
retrooper 8261d95a4b Fixed incorrect HealthDisplay data in ScoreboardObjective wrapper by @LeeGodSRC 2022-04-07 20:33:45 +02:00
retrooper 0ec7cbdd64 Merge pull request #311 from FairyProject/bugfix/teams
Teams packet wrapper team name read/write with 16 max characters
2022-04-07 20:31:31 +02:00
DefineOutside ab37570e9b Merge pull request #311 from FairyProject/bugfix/teams
Teams packet wrapper team name read/write with 16 max characters
2022-04-07 11:39:48 -05:00
LeeGod 7a61bb6cdc Teams packet wrapper team name read/write with 16 max characters 2022-04-07 23:08:48 +07:00
DefineOutside 5cf920c78e Merge pull request #310 from FairyProject/bugfix/objective
Fixed incorrect HealthDisplay data in ScoreboardObjective wrapper
2022-04-07 10:45:23 -05:00
LeeGod f1a5ca14bc Fixed incorrect HealthDisplay data in ScoreboardObjective wrapper 2022-04-07 20:07:27 +07:00
retrooper 01aef56066 Fixed Empty NBT from being added to ItemStacks leading to a desync. (DefineOutside) 2022-04-06 22:47:05 +02:00
retrooper a1ca6e68bc Fix 1.8-1.12 entity type mappings
(DefineOutside)
2022-04-06 22:40:28 +02:00
MWHunter e08e4645b1 Fix 1.8-1.12 entity type mappings 2022-04-03 19:15:21 -05:00
MWHunter 1452b65879 Fix PacketEvents adding NBT to items, causing desync 2022-04-03 18:45:03 -05:00
retrooper bd2ae75b08 Fixed duplicate UserLoginEvent calls. 2022-04-03 23:28:36 +02:00
retrooper ed9cd05619 Spigot debug listener unregistered. 2022-04-03 20:43:55 +02:00
retrooper fdbe47a061 PacketListenerReflect removed;
PlayerInjectEvent removed, its replacement is UserLoginEvent
2022-04-03 20:42:18 +02:00
retrooper a4b326cd44 Velocity hopefully working on all versions. 2022-04-03 20:12:36 +02:00
retrooper 7e2c66a82e Optimized WrapperLoginServerLoginSuccess and progress on velocity? 2022-04-03 19:52:22 +02:00
retrooper 0913057d0d Fixed item type mappings on 1.16.2 2022-04-03 18:10:24 +02:00
MWHunter 85cb8a72ca Fix using 1.16 instead of 1.16.2 item type mappings 2022-04-03 11:00:34 -05:00
retrooper 9d75d537cc Merge remote-tracking branch 'origin/version-dynamic' into version-dynamic 2022-04-01 21:30:28 +02:00
retrooper c1a2d05803 Outgoing packets must be in format of server, not client. 2022-04-01 21:30:18 +02:00
retrooper a0e05bb588 Updated our README 2022-04-01 21:19:20 +02:00
retrooper d8d3b77d5f Minor change to README. 2022-04-01 21:14:46 +02:00
retrooper ab4dce2af3 Trying to make protocol translation optional! On proxies we do not want it. 2022-04-01 21:12:11 +02:00
retrooper f0588eed10 Made WrappedBlockState and StateTypes more version dynamic. Now packetevents should hopefully be able to operate before via. 2022-04-01 19:52:57 +02:00
retrooper 99d6ee3554 Merge branch '2.0' into version-dynamic
# Conflicts:
#	spigot/src/main/java/io/github/retrooper/packetevents/injector/latest/connection/ServerConnectionInitializerLatest.java
2022-04-01 17:58:24 +02:00
retrooper 3e00a40918 PlayerManagerImpl in spigot module now reads game profile in players and will pass them into our User class.
User#sendTitle with strings added.
2022-04-01 17:45:06 +02:00
retrooper 1d97510869 Little comment added. 2022-03-31 22:54:39 +02:00
retrooper db3a804d15 NPE for optional in BlockPlacement wrapper fixed;
Decoder handler duplication on reloads fixed on 1.8+ servers
2022-03-31 22:44:27 +02:00
retrooper c83613ab04 Bug fixes for WrapperPlayServerSetTitleText & SetTitleSubtitle HANDLE_JSON should be true by default. 2022-03-28 22:43:59 +02:00
retrooper 42b7bb02c2 Packet type mappings per client version work.
We can process incoming packets ahead of via & protocolsupport successfully, ignoring world packets cause of wrappedblockstate.
2022-03-27 00:20:44 +01:00
retrooper c18739e057 Removed debugs. 2022-03-26 22:34:34 +01:00
retrooper 4ea4bf43e5 PacketType enums are version dynamic. You can get id by version and get the constant by id depending on version. It is beautiful. 2022-03-26 22:32:01 +01:00
retrooper 417571fe8d Bug fix for PotionTypes#getById 2022-03-25 22:23:46 +01:00
retrooper 24a2527fb2 Lots of progress on getting our mapped abstraction more version dynamic. 2022-03-25 22:22:56 +01:00
retrooper c8b94ec829 Optimization to PotionTypes. We removed the mappings and hard-code the IDs statically. EntityEffect & RemoveEntityEffect deprecated constructors removed. 2022-03-23 22:26:45 +01:00
retrooper 8dfbda5e35 We now have more meaningful stacktraces. For example when a packet has no content or fail to read a packet id or map a packet id to a packet type constant. 2022-03-23 22:11:16 +01:00
retrooper a9fb68223a Our netty handlers now produce exceptions in our wrappers and internal api.
WrapperPlayServerMultiBlockChange NPE fixed.
2022-03-23 21:37:14 +01:00
retrooper 9d69afaa81 Updated bug report template. 2022-03-22 23:04:15 +01:00
retrooper 5e1ff9b88a Minor change to namings. 2022-03-22 21:09:50 +01:00
retrooper 9bb6d9326c User#sendTitle implemented.
Implemented all title wrappers.
2022-03-22 20:46:46 +01:00
retrooper b00389f19f Added TimeStampMode setting to allow you to specify details about the timing in our events. You can even disable logging the time if you don't need it. 2022-03-22 19:46:45 +01:00
retrooper a4eb8cbece Minor changes. 2022-03-18 22:36:32 +01:00
retrooper 9463a07e9d PostPlayerInjectEvent removed
Replaced with better UserLoginEvent which also contains the User instance along with the Player instance on the platform.
2022-03-18 22:28:14 +01:00
retrooper 763a6c5d78 readOnly in listeners removed.
Its now a global setting in PacketEventsSettings#readOnlyListeners
2022-03-18 20:21:58 +01:00
retrooper b89ad2e128 Making some helpers in our api module so we don't duplicate lots of code in our implementations(modules)
Added UserConnectEvent & UserDisconnectEvent

threadSafe in PacketListeners removed.
2022-03-18 18:26:33 +01:00
retrooper 747a1a73c4 User references actually get destroyed when they disconnect.
User#getEntityId added.

PacketTransformationUtil memory leaks fixed.
2022-03-16 22:54:21 +01:00
retrooper ab99da9e7a Tryna fix some early packet handling. 2022-03-16 20:18:30 +01:00
retrooper 8969742139 Added few comments. 2022-03-16 16:41:41 +01:00
retrooper c5002778c9 Fixed memory leaks when converting Packetevents itemstack to bukkit and vice versa. 2022-03-16 16:35:42 +01:00
retrooper 97b7e81908 New EntityTypes added.
SpigotDataHelper#fromBukkitEntityType tested to work on 1.8.8
2022-03-13 22:35:23 +01:00
retrooper 323d553d5e Fixed velocity module netty dependency 2022-03-13 19:25:42 +01:00
retrooper fe13d021c1 Improvement to build.gradle 2022-03-13 19:09:12 +01:00
retrooper aa11d7e42e Last minor improvements to ResourcePackSend wrapper. 2022-03-13 18:49:31 +01:00
retrooper 8bca8d1cb5 Code optimization to WrapperPlayServerResourcePackSend. Now accepts a nullable prompt. 2022-03-13 18:43:33 +01:00
retrooper ca5021d090 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-03-13 18:34:04 +01:00
retrooper cbd899983e Cleaned up our build system. Adventure issues fixed. 2022-03-13 18:33:49 +01:00
retrooper 7529499f30 Fixed legacy adventure serializer. 2022-03-13 18:02:49 +01:00
retrooper b69fe1bdc1 Relocating sections of adventure. 2022-03-13 17:57:40 +01:00
MWHunter 424f18e52b Support invalid protocol with 1.8 biome data 2022-03-12 20:22:59 -06:00
retrooper 3a53fa88cb Adventure dependencies are now implementation, not api. 2022-03-13 00:01:20 +01:00
retrooper a1a2275794 Bump up adventure version. 2022-03-13 00:00:10 +01:00
retrooper 354596bc3d Cleaned up weird adventure stuff. We now properly relocate it I hope. 2022-03-12 23:54:13 +01:00
DefineOutside b9b34a4bbe Merge pull request #284 from amnoah/2.0
WrapperPlayServerResourcePackSend
2022-03-12 16:53:33 -06:00
Spiriten 8e8a2a114c Minor issue fix 2022-03-12 17:17:21 -05:00
Spiriten b6667f2fb8 Fixed Define's Points 2022-03-12 17:14:40 -05:00
retrooper ef6a36d5e2 We relocate adventure in Spigot, Velocity & BungeeCord manually. 2022-03-12 22:58:17 +01:00
retrooper 70e385e892 Added "adventure-gson" module.
We now relocate adventure.
2022-03-12 19:41:14 +01:00
Spiriten a74a6b0d0f WrapperPlayServerResourcePackSend
I think I did it correctly, please let me know if anything is wrong.

Basically copied from MCProtocolLib
2022-03-11 23:41:27 -05:00
retrooper 998b950f6f Renaming of methods in PacketWrapper
PacketWrapper#readData() -> read()
PacketWrapper#readData(PacketWrapper) -> copy(PacketWrapper)
PacketWrapper#writeData() -> write()
2022-03-11 23:21:00 +01:00
retrooper 9e54e4f296 Bump adventure api version down. 2022-03-11 23:10:58 +01:00
retrooper 1fb65d2628 Removed redundant .zip extension to builds. 2022-03-11 22:24:30 +01:00
retrooper a7811cd10f Little improvement to github actions. Automatically build all modules. 2022-03-11 22:23:59 +01:00
retrooper 9e3c36d48c Now publish velocity in github actions. Builds are now in .zips cause they are zips 2022-03-11 22:19:14 +01:00
retrooper 57db7d3936 The build names are now normal and not just "spigot" or "bungeecord". 2022-03-11 22:13:52 +01:00
retrooper 98dfccce1a We want the jars to have proper names. Lets see if jitpack can work with these. 2022-03-11 21:58:45 +01:00
retrooper 2eb0959215 Minor change to build.gradle 2022-03-11 21:41:20 +01:00
retrooper 64f1535ae4 Last cleanup/improvement I swear 2022-03-11 17:02:38 +01:00
retrooper 1665fe9ec0 We don't redeclare shadow plugin in each module. 2022-03-11 16:49:59 +01:00
retrooper ac054bee35 Further optimizations to build.gradles. Less code repetition, more coming! 2022-03-11 16:29:41 +01:00
retrooper 92c7c64a19 Cleaning up build.gradles to avoid code repetition. 2022-03-11 16:24:56 +01:00
retrooper 16c4c749e9 Hopefully fixed legacy adventure implementation 2022-03-11 16:17:31 +01:00
retrooper 8dddd3c519 Made sure we bumped the adventure version everywhere. 2022-03-10 22:52:33 +01:00
retrooper f48ba98c22 Our adventure module also bumped up adventure version. 2022-03-10 22:30:55 +01:00
retrooper 9a86f800c7 No debugs 2022-03-10 22:05:04 +01:00
retrooper 3a2e636f1f Cleanup build.gradle files in modules. 2022-03-10 22:04:44 +01:00
retrooper d87439cf0a Optimized/Fixed writePacket implementation on Spigot. 2022-03-10 18:43:10 +01:00
retrooper 0d637e0a2c Bumped jetbrains annotations version. 2022-03-10 17:56:07 +01:00
retrooper 153b751738 Merge pull request #277 from AbhigyaKrishna/2.0
Fix llegacy hover serializer & Update adventure
2022-03-10 17:45:16 +01:00
Abhigya bb6cc79c80 Adventure version bump and Legacy hover serializer 2022-03-10 17:16:19 +05:30
retrooper e67bfb55fe Removed debugs. 2022-03-09 20:57:09 +01:00
retrooper c0212f937e Minor fix in WrapperPlayServerUpdateScore 2022-03-09 19:58:48 +01:00
retrooper e448928194 SpigotDataHelper#fromBukkitItemMaterial probably works now. 2022-03-09 18:24:29 +01:00
retrooper 7c6b6a02a0 Working on converting bukkit material to our data types. 2022-03-09 18:14:23 +01:00
retrooper 79f6903a7d Cleaned up ViaVersionUtil, removed unused methods. 2022-03-09 16:14:16 +01:00
retrooper 800881fec8 Added WrapperStatusClientRequest wrapper (even though it has no fields) 2022-03-08 21:58:12 +01:00
retrooper d47bc0ea29 Removed debugs. 2022-03-08 20:36:47 +01:00
retrooper a9876a0cec Fixed & cleaned up our injector. Optimizations to our handlers. 2022-03-08 20:33:23 +01:00
retrooper 064ceb6c12 Merge branch '2.0' into protocollib_compat 2022-03-08 20:08:50 +01:00
retrooper f6bce0d41b Minor cleanup. 2022-03-08 20:08:11 +01:00
retrooper 31d572a8b6 Fixed update checker. 2022-03-08 20:04:20 +01:00
retrooper 354112c8b3 Again.. 2022-03-06 22:10:50 +01:00
retrooper cc561a6586 Confused, tryna fix jitpack stuff 2022-03-06 22:07:43 +01:00
retrooper 8cbb30711f Trying to fix jitpack? 2022-03-06 22:01:01 +01:00
retrooper ed1d88b1c8 More progress on velocity injector. We just need to support the compression handlers being added. 2022-03-06 20:19:41 +01:00
retrooper ed37c60257 Bug fix in ServerConnectionInitializerLatest#destroyChannel when multiple packetevents instances are present. 2022-03-06 14:24:41 +01:00
retrooper ae2a99a645 We clear our channel cache as soon as the connection closes. 2022-03-06 14:22:18 +01:00
retrooper 88c24308b2 Resolved conflicts. 2022-03-06 14:21:03 +01:00
retrooper 8a86a92504 Merge branch '2.0' into protocollib_compat
# Conflicts:
#	spigot/src/main/java/io/github/retrooper/packetevents/bukkit/InternalBukkitListener.java
2022-03-06 14:20:17 +01:00
retrooper 7d87114d69 Removed ProtocolManager#clearUserData, but we still are vulnerable to memory leaks in our channel caching. Will be fixed in protocollib_compat branch. 2022-03-06 14:16:41 +01:00
retrooper 4c76588493 Minor changes. 2022-03-06 14:03:18 +01:00
retrooper 3a6778eee7 Fixed PlayerDigging status reading, as it's an unsigned byte, not signed.
Fixed WindowConfirmation, OpenHorseWindow, WindowConfirmation window id reading as it's an unsigned byte, not signed.
2022-03-06 13:25:49 +01:00
retrooper 474a2c9e2e Working on Velocity support. 2022-03-06 12:19:01 +01:00
retrooper fdf36cfb62 Merge branch '2.0' into protocollib_compat 2022-03-06 11:35:27 +01:00
retrooper 7ee8799b3d Fixed PostPlayerInjectEvent#getClientVersion 2022-03-06 11:02:41 +01:00
retrooper 8f03460821 Merged "2.0-gradle". Basically cleaning up our gradle stuff. 2022-03-06 10:56:27 +01:00
retrooper 275638339f Make sure we are ideally the last to intercept connecting clients. Not first. 2022-03-05 23:53:37 +01:00
retrooper e86e946463 Merge branch '2.0' into protocollib_compat 2022-03-05 23:51:48 +01:00
retrooper 4d77af307c Merge branch '2.0' into 2.0-gradle 2022-03-05 23:50:39 +01:00
retrooper ec6f947379 Memory usage of mappings already improved, further improvements coming. 2022-03-05 23:49:58 +01:00
retrooper 5b977bb0b9 Added adventure module which does not ship with gson. 2022-03-05 22:02:39 +01:00
retrooper 535a95b199 Attempt to not automatically shade adventure & gson. Allow platforms such as fabric to not include gson. 2022-03-05 21:06:00 +01:00
retrooper 775ebc5de4 PacketCompressionUtil relocated 2022-03-05 18:20:52 +01:00
retrooper b756faf83c Merge branch '2.0' into protocollib_compat
# Conflicts:
#	spigot/src/main/java/io/github/retrooper/packetevents/PacketEventsPlugin.java
2022-03-05 18:16:08 +01:00
retrooper 269df338e4 Debugs removed. 2022-03-05 18:10:10 +01:00
retrooper 2827bef4b9 1.18.2 bug fixes. 2022-03-05 17:53:17 +01:00
retrooper 3d0e7b86b7 Cleaned up mess with using flying and its sub wrappers. Issues fixed. 2022-03-03 23:26:56 +01:00
retrooper 5c5fb9c8c8 Minor change 2022-03-03 22:47:54 +01:00
retrooper 8ae7b30df8 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-03-03 22:02:25 +01:00
retrooper 52d201ac93 Renames of NPC methods 2022-03-03 22:00:09 +01:00
MWHunter 326b3bfe62 WrapperPlayServerWorldBorder 2022-03-03 14:48:22 -06:00
MWHunter 98d037890e World border wrappers 2022-03-03 14:40:33 -06:00
retrooper 6146ef6ac3 NPCManager removed.
NPC class that can be used independently.
2022-03-03 18:21:15 +01:00
MWHunter 117328caf7 Fix multi block change for pre-1.16 servers 2022-03-01 14:22:13 -06:00
retrooper 06b4607769 Added async methods for sending and receiving and writing packets. 2022-03-01 21:18:09 +01:00
retrooper 6d2ffc59da Reverting to older version of packetevents where building worked? 2022-03-01 20:47:32 +01:00
retrooper e91984a2d6 We now relocate the libraries we shade(adventure and gson) 2022-03-01 20:16:05 +01:00
retrooper 9f657bf2ab We really fixed our gradle stuff, we don't unnecessary shade things when we don't need them. Hopefully can get fabric support working sooner than you'd think. 2022-03-01 19:41:39 +01:00
retrooper 0c9475afaf Working on allowing optional adventure & gson shading? Hopefully this works? 2022-03-01 18:48:36 +01:00
retrooper 675fa06ba9 Stop publishing "packetevents" module, only the sub modules. 2022-03-01 18:08:14 +01:00
retrooper 65bc4e18b0 Updated to adventure 4.10.0 2022-03-01 06:41:26 +01:00
retrooper 9d4ecfe283 Added 1.18.2 support. 2022-02-28 22:32:33 +01:00
retrooper b2a664dbd0 WrapperPlayServerEntityHeadLook & WrapperPlayServerEntityRelativeMoveAndRotation & WrapperPlayServerEntityRotation now use floats. 2022-02-27 19:55:09 +01:00
retrooper e80793c71b Cleaned up Spigot injector.
Forgot to commit PacketEncoderLatest
2022-02-27 17:02:00 +01:00
retrooper f3f02fbc28 Cleaned up Spigot injector.
Refactored spigot util classes.
2022-02-27 17:01:25 +01:00
retrooper b469fddae5 Pull optimizations from 2.0, this is a branch where we work on cleaning up the injector. 2022-02-27 14:00:18 +01:00
retrooper 550904f64a Minor change to BungeePipelineInjector 2022-02-27 13:57:22 +01:00
retrooper 6fd8a4c957 Minor optimizations to NetworkChunkData 2022-02-27 10:10:48 +01:00
retrooper e0f5ab6d6d Fixed WrapperPlayClientPlayerDigging for 1.8 2022-02-27 09:54:14 +01:00
retrooper bb8e96da34 User#closeConnection added 2022-02-27 09:27:19 +01:00
retrooper 2a47fa25dd Writing packets is faster now. 2022-02-27 09:16:14 +01:00
retrooper 3a78329fba Removed debug. 2022-02-26 22:44:39 +01:00
retrooper 51879a5003 Removed debug. 2022-02-26 22:16:05 +01:00
retrooper 3b9646436f Reverted back to old encoder system, shoudl work with experimental protocollib builds. 2022-02-26 21:26:39 +01:00
retrooper 0de0042591 Optimizations to utilities 2022-02-25 22:13:10 +01:00
retrooper 4b57de43be Merge remote-tracking branch 'origin/2.0' into 2.0 2022-02-25 16:52:54 +01:00
retrooper f7846f6bc6 Updated to 1.18.2 ahead of time? 2022-02-25 16:51:48 +01:00
MWHunter cc92d8ab69 Flag byte masks are being read wrong 2022-02-24 21:28:37 -06:00
retrooper 62ac36d436 Added support for thread-safe packet listeners(processing packets when not on netty-threads) 2022-02-24 22:13:59 +01:00
MWHunter afe5bed6fc Stop console spam with ProtocolLib + ViaVersion 2022-02-24 13:37:32 -06:00
retrooper a3c956bf04 I don't think we handle cancelling right yet... 2022-02-23 22:46:43 +01:00
retrooper 17d703bf56 Another attempt to fix viaversion cancelling packets.
User#closeInventory added
2022-02-23 21:02:28 +01:00
retrooper 87b58f2ab8 Support ViaVersion cancelling packets. 2022-02-23 20:50:54 +01:00
retrooper 2e660714aa Fixed buffer memory leak in PacketEncoderModern 2022-02-23 20:17:18 +01:00
retrooper 5d983eebf0 Think we support colors now in User#sendMessage(String) 2022-02-23 19:52:07 +01:00
retrooper 2639c615e8 Fixed cancelling outgoing packets. 2022-02-23 19:45:49 +01:00
retrooper e92f1c8e16 Only inject real players. NPCs from plugins such as Citizens will not be injected. 2022-02-23 19:18:17 +01:00
retrooper 6bc8274e2d Removed debugs 2022-02-23 18:48:24 +01:00
retrooper a26b59a233 Trying to fix possibility of null event! 2022-02-23 18:47:38 +01:00
retrooper 6505738fbf Minor change. 2022-02-22 22:21:08 +01:00
retrooper 10c11e3c56 Minor change. 2022-02-22 21:19:36 +01:00
retrooper 4aacdf3a37 Fixed error when closing servers without ViaVersion. 2022-02-22 20:30:47 +01:00
retrooper 6a4cbd5c97 Bug fix on closing servers without viaversion. 2022-02-22 19:54:31 +01:00
retrooper 0f907d9f99 Many bug fixes in spigot injector (1.8+)
Includes stopping server with ViaVersion, attempted to prevent the possibility of null events)
Client version abstraction cleaned up a bit hopefully and implementation.
2022-02-22 19:49:06 +01:00
retrooper 8409bd7d93 Some more features to ChannelHelper and ByteBufHelper (closing channels, copying byte array of buffer without modifying reader index) 2022-02-21 22:34:35 +01:00
retrooper 6123ae9744 Fixed redundant synchronization 2022-02-21 21:32:55 +01:00
retrooper 74751c77c6 Adding more debugs to our server connection initializer, to help catch issues where handlers don't exist for some reason? 2022-02-21 21:26:48 +01:00
retrooper bd5a681a2b Bug fixes in our injector when viaversion is present. 2022-02-21 21:19:10 +01:00
retrooper c2aa0d15cc Removed PacketSendEvent#getPromisedTasks as it was redundant.
Added User#flushPackets
2022-02-21 21:08:32 +01:00
retrooper 9bcc0bb175 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-02-21 20:52:13 +01:00
retrooper dd1c35dfb3 Fixed ProtocolManagerImpl#writePacket on Spigot. 2022-02-21 20:51:29 +01:00
MWHunter 003416e324 Revert gradle upgrade to try to fix jitpack 2022-02-20 16:35:16 -06:00
retrooper 05a44984a3 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-02-20 22:44:14 +01:00
retrooper 03a5f8ec90 Fixed ProtocolLib & Via combination causing an incompatibility. I really hate to have to do this kind of an injector for spigot, but we have to. We will also wrap the vanilla encoder like Via does, and it seems like ProtocolLib caused this mess. 2022-02-20 22:43:54 +01:00
MWHunter b632778c62 Make user versions more resilient 2022-02-20 15:38:49 -06:00
MWHunter 0eb4940cd3 Add debugs for setting client version 2022-02-20 14:34:05 -06:00
MWHunter b964913af0 Bump gradle version 2022-02-19 14:33:17 -06:00
MWHunter 31e12c31ed Add ability to write packets without flushing 2022-02-19 14:32:21 -06:00
retrooper e65c125e01 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-02-18 22:33:35 +01:00
retrooper f08bd9310d Working on PLIB compatibility 2022-02-18 22:33:17 +01:00
DefineOutside 7517493b07 Merge pull request #251 from AbhigyaKrishna/2.0
Created WrapperPlayServerWindowProperty
2022-02-18 12:15:29 -06:00
Abhigya 898f1d86a9 Fixed constructor to PacketSendEvent 2022-02-18 23:43:34 +05:30
MWHunter 873cd20dba Add useful methods to Chunk_v1_18 2022-02-18 10:48:33 -06:00
Abhigya 982a984ad4 Create WrapperPlayServerWindowProperty 2022-02-18 17:26:28 +05:30
MWHunter 8ba3ef0d7f Add method for creating empty chunks 2022-02-17 23:10:41 -06:00
MWHunter 94b8642eec Add WrapperPlayServerUseBed 2022-02-17 21:15:05 -06:00
retrooper 43ed8bcf49 WrapperHandshakingClientHandshake stackoverflow fixed 2022-02-17 22:49:10 +01:00
retrooper 95a6a8ee1f No debugs. 2022-02-17 21:39:20 +01:00
retrooper 444eff637b Nevermind, we were just discarding exceptions which isn't great. 2022-02-17 21:29:53 +01:00
retrooper d2e230c0cb Fixed many exceptions in exceptionCaught method in our netty handlers. Including ClosedChannelException 2022-02-17 21:25:03 +01:00
retrooper 195f3326fc Removed many injector/implementation classes that are no longer needed. File size hopefully gone down by a lot now. 2022-02-17 21:00:41 +01:00
retrooper fefbddcc92 Massive changes to the way netty methods are declared and implemented. 2022-02-17 20:47:37 +01:00
MWHunter bb2e9902c9 Legacy doors have no powered variable 2022-02-15 13:34:00 -06:00
MWHunter 555786d906 Add difficulty to correctly be copied for WrapperPlayServerJoinGame 2022-02-15 09:36:38 -06:00
MWHunter c5926e71ab Even more block mapping bug fixes 2022-02-14 23:15:31 -06:00
MWHunter 0e0d68e6d2 Activator rail was missing from legacy mappings 2022-02-14 23:09:36 -06:00
MWHunter cc3658591c Add warning just in case mappings are wrong 2022-02-14 23:03:47 -06:00
MWHunter 8b9030bda6 Fix some type mappings 2022-02-14 23:00:44 -06:00
MWHunter fe1a718926 Fix some type mappings 2022-02-14 22:52:25 -06:00
MWHunter 4cbc67683d Remove EntityTypes equal method 2022-02-14 22:37:40 -06:00
DefineOutside c308742582 Merge pull request #241 from RohanGoyalDev/2.0
Added MerchantRecipeData and WrapperPlayServerOpenWindowMerchant
2022-02-14 21:20:16 -06:00
RGoyalmc 029b568f5c Changed the name to avoid confusion 2022-02-15 01:14:37 +05:30
RGoyalmc 4bfe3ab62d Fixes for WrapperPlayServerOpenWindow 2022-02-15 00:58:06 +05:30
RGoyalmc 377e2a9c79 Added MerchantRecipeData and WrapperPlayServerOpenWindowMerchant 2022-02-15 00:57:53 +05:30
MWHunter f0192b3d4f pre-1.13 block mappings fixes 2022-02-14 12:19:42 -06:00
retrooper b7a15692d5 ByteBufAllocationHandler created. 2022-02-14 18:11:41 +01:00
retrooper cac05219b4 Added a ByteBufHelper which uses the bytebufhandler methods for us. 2022-02-14 17:56:33 +01:00
retrooper 5732f9e15d Added write buffer methods to ByteBufHandler 2022-02-14 17:36:11 +01:00
retrooper 8378b9265a Working on reducing memory usage with changing our netty declarations (implemented by each platform) 2022-02-14 17:22:37 +01:00
MWHunter 0ba2121283 1.13-1.16 default block states 2022-02-13 23:06:30 -06:00
retrooper ec78edcd7a Forgot to execute build commands for bungee and netty-common in gradle-publish.yml 2022-02-13 19:50:26 +01:00
retrooper de1b368ae8 Updated github gradle publish file. 2022-02-13 19:46:21 +01:00
retrooper 0bc3ab989b netty-common publishing fixed. sorry for all the past down-times. 2022-02-13 19:42:09 +01:00
retrooper b3a23fe9c0 Forgot to publish netty-common. 2022-02-13 19:34:44 +01:00
retrooper b53c9ac6fd Bug fixes in netty-common build script. 2022-02-13 16:53:07 +01:00
retrooper 5de39dd131 Update BungeePacketEventsBuilder to see if jitpack updates their caches? 2022-02-13 16:46:01 +01:00
retrooper 7a08005e53 Looking into why ProtocolLib & ViaVersion and our plugin just aren't compatible. 2022-02-13 11:29:59 +01:00
retrooper 6f3ce820d3 Forgot netty-common's build gradle 2022-02-13 10:30:56 +01:00
retrooper cc9cd837b3 netty-common module created. 2022-02-13 10:30:26 +01:00
MWHunter 170175a4cb 1.7-1.12 items final bug fixes 2022-02-12 22:13:30 -06:00
MWHunter 95cb1fcdfa 1.7-1.12 items bug fixes 2022-02-12 21:45:04 -06:00
MWHunter 81489a70a2 Convert 1.7-1.12 items to use the 1.18 names 2022-02-12 21:26:45 -06:00
MWHunter ea7f455ca7 1.13-1.18 item type bug fixes. pre-1.13 still broken 2022-02-12 18:43:25 -06:00
MWHunter 0056a2c2c7 Replace legacy item type mappings 2022-02-12 18:43:25 -06:00
retrooper 6c6bbca60f Fixed BungeePacketEventsBuilder and updated to latest packetevents-netty-impl. 2022-02-12 21:49:55 +01:00
MWHunter de7ff0439b Fix entity type mappings on legacy versions 2022-02-12 14:29:16 -06:00
retrooper 930f491b3f Made a ProtocolManager with protocol utilities, that don't require a platform-dependent object. Just ChannelAbstracts and User objects usually.
Many deprecations in PlayerManager and ServerManager

ClientVersion minor optimization.

potion_type_mappings.json are now in the potion folder, instead of item(i don't know why they were there in the first place)
2022-02-12 21:08:44 +01:00
MWHunter 8fde01c50f Fix tracking world height 2022-02-11 21:26:06 -06:00
MWHunter c144955530 Fix 1.17/1.18 extended world chunk reading 2022-02-11 21:09:11 -06:00
MWHunter 176161be01 Respawn previous gamemode can be null 2022-02-11 20:05:27 -06:00
MWHunter 0fdc0bf7ce Revert to using spigot-api 1.18 instead of 1.18.1 2022-02-11 14:36:17 -06:00
retrooper ca72e0cbfb Working on more helpful errors. 2022-02-11 20:02:08 +01:00
MWHunter e5212aa687 Check isEmpty() instead of getAmount == -1 2022-02-11 11:59:37 -06:00
MWHunter 959e494b1c Merge ItemStack.AIR into ItemStack.EMPTY to try to fix 1.8 items 2022-02-11 11:59:37 -06:00
retrooper 6cf2e0407e Attempting to fix build.gradle in api module. 2022-02-11 09:02:25 +01:00
retrooper 77d31e32ce Relocated BungeePacketEventsBuilder 2022-02-11 08:09:24 +01:00
MWHunter 0176344bf8 Fix 1.16.2-1.16.5 support 2022-02-10 20:38:59 -06:00
MWHunter f311b0e0c3 bump spigot-api version to 1.18.1 2022-02-10 20:00:22 -06:00
retrooper 9b631a3e21 Actually register the internal bungee processor. 2022-02-10 19:16:48 +01:00
retrooper c43922bdc1 Removed debugs. 2022-02-10 14:41:05 +01:00
retrooper 3fdc992846 Optimizations. 2022-02-10 13:58:33 +01:00
retrooper 30a2e935fd Managed to get compression & decompression issues out the way. Issue is when a client connects to the proxy, the packets are in the format of the client. (Unless ViaVersion is inbetween) 2022-02-10 11:44:36 +01:00
retrooper d432fa0664 More progress on bungee packetevents, can't get passed the PLAY state at the moment. 2022-02-09 23:14:44 +01:00
retrooper e11cc9d9f0 Attempting to fix gradle for jitpack. 2022-02-09 21:09:40 +01:00
retrooper ed2d16d775 Added copyright notices in some files where it was missing.
Progress on bungee.
2022-02-09 21:00:13 +01:00
retrooper 96c1321772 Small changes to bungee 2022-02-09 19:38:36 +01:00
retrooper 1d9ba33b21 Removed IDE config file 2022-02-09 18:00:34 +01:00
retrooper b6766cbaa6 Changes in build configuration files. 2022-02-09 17:58:10 +01:00
retrooper 215ef2a20d Working on BungeeCord support. 2022-02-09 17:55:37 +01:00
retrooper 7efc5b3174 Update .gitignore 2022-02-09 15:54:30 +01:00
retrooper 9f3ca243e2 Removed debugs. 2022-02-09 15:54:16 +01:00
retrooper 0b3746454e Add spigot build.gradle and .gitignore 2022-02-09 15:43:39 +01:00
retrooper c64115661c Back to a gradle multi-module project. 2022-02-09 15:41:06 +01:00
MWHunter 9c5fea1656 Fix isKnownEmpty(), rename to isEmpty() 2022-02-06 16:18:09 -06:00
MWHunter c6f7d4d4f9 Fix negative block position support 2022-02-06 15:48:42 -06:00
MWHunter 8ab1f82e29 Fix WrapperPlayServerJoinGame on 1.17 2022-02-06 14:55:47 -06:00
retrooper f947fd8fdf Merge remote-tracking branch 'origin/api' into api 2022-02-06 21:32:06 +01:00
retrooper 7f460f243c Bug fix in WrapperPlayServerScoreboardObjective 2022-02-06 21:31:50 +01:00
MWHunter 1ffbda71f7 WrapperPlayServerChunkDataBulk for 1.8, in-progress 1.7 2022-02-06 13:34:37 -06:00
retrooper 52a001d7cd Compilation error fixed and PacketListenerCommon is publicly accessible. 2022-02-06 17:20:28 +01:00
retrooper c80d2c094e Fixed WrapperPlayServerWindowItems 2022-02-06 17:15:51 +01:00
retrooper abba5d8870 Updated annotations. 2022-02-06 15:51:47 +01:00
retrooper cf69381c32 Fixed shadowJar(last time) 2022-02-06 11:20:46 +01:00
retrooper 597dd3123d Fixed shadowJar(last time) 2022-02-06 11:19:38 +01:00
retrooper 342da1e039 Added shadowJar to api module. 2022-02-06 11:13:59 +01:00
retrooper dfe0bd5825 Fixed github actions. 2022-02-06 10:38:13 +01:00
retrooper 40b9474896 Must work now. 2022-02-06 10:36:30 +01:00
retrooper 64ddc54325 Eliminated shadowJar. 2022-02-06 10:35:18 +01:00
retrooper 9d2ed8fd9a No longer minimize shadowJar? 2022-02-06 10:11:21 +01:00
retrooper b0740e7af7 Still tryna fix publishing. 2022-02-06 09:55:14 +01:00
retrooper ec5abbe2cb Trying to fix jitpack publishing. 2022-02-06 09:49:25 +01:00
retrooper 7ee7e9897e Added shadowJar plugin to api. 2022-02-06 09:26:04 +01:00
retrooper 91d35cb671 PEVersion is now stored in PacketEventsAPI 2022-02-06 09:01:29 +01:00
retrooper 0064517e99 This is the API branch, removed other modules. 2022-02-06 08:57:39 +01:00
MWHunter e05aa69674 In-progress 1.7 chunk wrapper support 2022-02-05 22:53:20 -06:00
MWHunter e9ffe18674 Port chunk wrapper to 1.8 (for 1.8 - 1.18 support) 2022-02-05 22:10:52 -06:00
MWHunter 3f0bce90ea Port chunk wrapper to 1.12 2022-02-05 21:06:44 -06:00
MWHunter d220a17679 Clean up legacy block mappings 2022-02-05 20:51:53 -06:00
MWHunter a310347420 Port WrappedBlockState to pre-flattening 2022-02-05 18:56:49 -06:00
MWHunter a7096b876f Port chunk wrapper back to 1.13 2022-02-05 17:59:39 -06:00
MWHunter 184e846592 Port chunk wrapper back to 1.14 2022-02-05 17:36:51 -06:00
MWHunter 88b02b60a4 Port chunk wrapper back to 1.15 for 1.15-1.18 support 2022-02-05 17:06:47 -06:00
retrooper 87f8af7977 Changes to PacketEventsAPI. It is now an abstract class, not every method must be implemented! Removed some unused classes. 2022-02-04 21:19:41 +01:00
retrooper 388619661b Merge remote-tracking branch 'origin/2.0' into 2.0 2022-02-04 21:12:39 +01:00
retrooper f9326359af Changes to PacketEventsAPI. It is now an abstract class, not every method must be implemented! 2022-02-04 21:12:01 +01:00
MWHunter f5693273a6 Fix enchantments being reset 2022-02-04 13:43:07 -06:00
retrooper 1b237b5615 Removed debug. 2022-02-04 19:15:54 +01:00
retrooper 8eaea5feb1 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-02-04 19:14:59 +01:00
retrooper 7aa624c8ed In our decoder, we don't process empty buffers anymore. 2022-02-04 19:14:23 +01:00
MWHunter ed866810d6 Fix explosion packet off by 1 generating ghost blocks 2022-02-04 11:39:28 -06:00
retrooper 4fde212445 WrapperPlayServerWindowItems fixed for server versions lower than 1.7.10. Attempted GeyserUtil 2.0 API support, but untested. Cleaned up build.gradle 2022-02-04 18:09:40 +01:00
retrooper a11e013668 Merge pull request #221 from retrooper/revert-220-2.0
Revert "find field in superclass"
2022-02-04 17:41:37 +01:00
retrooper 4bab379986 Revert "find field in superclass" 2022-02-04 17:41:19 +01:00
retrooper 71b3089ae6 Merge pull request #218 from AbhigyaKrishna/2.0
Fixes for legacy mappings
2022-02-04 16:39:26 +01:00
retrooper 7e81bcb5be Merge pull request #220 from huanmeng-qwq/2.0
find field in superclass
2022-02-04 16:30:39 +01:00
huanmeng_qwq 2496b7c2c5 Update ReflectionObject.java 2022-02-03 23:07:04 +08:00
huanmeng_qwq 9aeb148ea9 find field in superclass 2022-02-03 22:53:49 +08:00
Abhigya 8e7c4f2b2c Typo fixes in mapping 2022-02-02 19:18:09 +05:30
Abhigya 60201b4ac3 Spawn entity packet mapping fix 2022-02-02 18:51:35 +05:30
Abhigya 169a7fd064 Mappings for 1.8 items 2022-02-02 18:49:08 +05:30
Abhigya bfba14106e Made the enums public 2022-02-02 18:48:33 +05:30
retrooper f6b22f0ff2 Minor change to javadocs 2022-02-01 23:43:09 +01:00
retrooper 313d2f956c Last bug fix in join game wrapper. 2022-02-01 23:13:59 +01:00
retrooper a0ae5e7dcf Bug fixes for JoinGame wrapper. 2022-02-01 23:02:20 +01:00
retrooper 30c070a60c PlayerManager#clearUserData bug fixes 2022-02-01 22:47:29 +01:00
retrooper 5bf2daa734 Set default values for chunk data wrapper lighting attributes. 2022-02-01 22:33:10 +01:00
retrooper af0faf6436 WrapperPlayServerJoinGame created 2022-02-01 20:08:38 +01:00
retrooper 0333aad4fb PlayerManager#clearUserData method created 2022-01-31 17:34:29 +01:00
retrooper abee3e2cf2 Removed debugs. 2022-01-31 16:56:46 +01:00
retrooper 86fc6bb452 Fixed decoder when ViaVersion isn't present. 2022-01-31 16:44:23 +01:00
retrooper b1681772b0 WrapperPlayServerTeams constructor with sendevent exists. WrapperStatusServerResponse created. 2022-01-30 22:51:07 +01:00
retrooper 6aef8a7b14 Post-tasks in ProtocolPacketEvents now are also called when the event is cancelled! 2022-01-30 22:33:04 +01:00
retrooper 5306c090c0 PacketSendEvent#hasPromisedTasks created 2022-01-30 22:28:30 +01:00
retrooper 248799229d All in all, particle packets are working on 1.8. 1.7.10 still needs some work, and 1.8 a few tweaks.
Fixed issue where JOIN_GAME packet type just wouldn't get called in our listener.
2022-01-30 22:05:06 +01:00
retrooper d84d258d5c PacketSendEvent#getPromisedTasks added to distinct from post-tasks (in receive and send events). 2022-01-30 20:57:47 +01:00
retrooper 751c4f3ce8 Forgot to document that we added post-tasks to receive-events too. 2022-01-30 20:34:56 +01:00
retrooper b52f8d5ce9 Fixed viaversion support, because we misplaced our encoder. 2022-01-30 19:52:07 +01:00
retrooper 94823b93cd Removed debugs. 2022-01-30 19:24:07 +01:00
retrooper b2039f5741 SimplePacketListenerAbstract created. Relocation of so many event classes. Fixed late injectors on reload not updating UserProfile. 2022-01-30 18:52:35 +01:00
retrooper 0fd0c62c96 Working on bug fixes in the injector, worked on ViaVersion bug fixes, but isn't perfect(atleast not on 1.8) 2022-01-29 23:49:29 +01:00
retrooper ce66fa1aa6 Attempt on 1.7 support for particle wrapper. 2022-01-29 15:52:47 +01:00
retrooper a955b85620 Fixed comression issues. Fixed WrapperPlayClientPlayerBlockPlacement for 1.8 and 1.7.10 2022-01-29 07:51:37 +01:00
retrooper 0c3908de28 Minor optimization in ProtocolPacketEvent 2022-01-28 23:21:55 +01:00
retrooper aed27d6fc4 Fixed bug in Spigot Packet encoders! 2022-01-28 23:12:59 +01:00
retrooper f2e232d6cf Optimized build.gradle? 2022-01-28 21:06:19 +01:00
retrooper 5311189ec2 Minor changes 2022-01-28 20:49:33 +01:00
retrooper 719ad602ce All debugs eliminated 2022-01-26 20:49:36 +01:00
retrooper 66831ca814 Fixed login success being play state. Fixed post tasks. 2022-01-26 20:37:09 +01:00
retrooper 323ae164f2 LoginSuccess is allegedly in play state for some packet listeners. 2022-01-26 20:23:11 +01:00
retrooper 082924fe82 Removed debugs 2022-01-26 19:27:37 +01:00
retrooper 86b8d6d7e7 Made encoders more memory efficient and reduced memory leaks. ItemStack items aren't always enchanted now. 2022-01-26 19:26:57 +01:00
retrooper dafc082838 Working on making our decoders more memory efficient and reduce potential memory leaks. 2022-01-26 19:09:43 +01:00
retrooper f0128e0f5d ProtocolPacketEvent#getSocketAddress optimization 2022-01-25 23:24:20 +01:00
retrooper c04322c3a0 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-25 23:21:44 +01:00
retrooper b1463a6d5b Attempted optimizations, we now store clientversion and connectionstate in our user instance. Hopefully reduced map calls. 2022-01-25 23:21:27 +01:00
MWHunter 13a532eed0 Fix null pointer when setting invalid block data 2022-01-25 10:13:00 -06:00
MWHunter 625f74fbc5 Fix explosion for 1.17+ 2022-01-24 17:27:06 -06:00
retrooper d23efe4154 Attached good-looking credit to various projects
We might have not credited every single external project out there, I'll look deeply soon.
2022-01-23 23:20:13 +01:00
retrooper 0ef56aab3a Removed debugs 2022-01-23 18:08:50 +01:00
retrooper e2f1415820 ProtocolPacketEvent#getUser finally implemented properly.
GlobalChannelInjector -> SpigotChannelInjector.
 User#sendPacket added.
 We really try ensure getUser never returns null.
2022-01-23 18:07:12 +01:00
retrooper d17747490f PacketEvents.getAPI().getPlayerManager().getUser created. Renamed GameProfile to UserProfile and made a User class 2022-01-23 14:56:20 +01:00
retrooper 1866de2908 DiggingAction is no longer a subclass,
WrapperPlayServerAcknowledgePlayerDigging created
2022-01-23 10:24:10 +01:00
retrooper ffd5ce2f90 Removed debug in flying wrapper 2022-01-23 09:38:38 +01:00
retrooper 83624452a4 Fixed WrapperPlayClientPlayerFlying 2022-01-23 09:22:10 +01:00
retrooper b7b35c3ea1 Merge pull request #201 from AbhigyaKrishna/2.0
Fix for WrapperPlayServerEntityTeleport on 1.8
2022-01-22 20:10:36 +01:00
retrooper fe5c5bf6fa WrapperPlayServerParticle created, still might need some little finishing on versions before 1.13. And particle types doesnt have legacy particles 2022-01-22 20:09:47 +01:00
retrooper 705e2759dc Particle abstraction added 2022-01-22 19:04:38 +01:00
Abhigya 4a6e8cada0 Fixed packet reading for WrapperPlayServerEntityTeleport 2022-01-22 21:29:37 +05:30
Abhigya dcb30a19e4 Fix for WrapperPlayServerEntityTeleport again 2022-01-22 21:19:28 +05:30
retrooper 6e846705ec Merge pull request #199 from RohanGoyalDev/2.0
Added unregisterListeners methods
2022-01-22 15:43:19 +01:00
retrooper 9d018e0886 Added unregisterListener method for single listener, remove unregisterListeners with priority
Priorities are already attached to packetlistenerabstracts. No need to additionally attach a priority.
2022-01-22 15:43:11 +01:00
retrooper c4f6ea71b4 PacketSendEvent#getPostTasks now working 2022-01-21 22:41:43 +01:00
retrooper 4549b8305e No more relocating of libraries, as it causes issues with API users 2022-01-21 21:42:19 +01:00
retrooper ed10be50ea Fixed WrapperPlayServerSpawnPlayer and WrapperPlayServerEntityTeleport for 1.8 & 1.7.10 by AbhigyaKrishna
Fixed WrapperPlayServerSpawnPlayer and WrapperPlayServerEntityTeleport for 1.8 & 1.7.10
2022-01-21 21:39:55 +01:00
retrooper 3a6f0c4c7b Fixed WrapperPlayServerEntityTeleport for 1.8, and fixed 1.7 support broken in this PR 2022-01-21 19:58:58 +01:00
retrooper 1ea32c79e3 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-21 19:33:13 +01:00
retrooper 3612d96029 Removed debug listener 2022-01-21 19:32:14 +01:00
Abhigya cd4e5a21f6 Fix for writing entityId in WrapperPlayServerEntityTeleport for 1.8 2022-01-21 21:10:11 +05:30
RGoyalmc aaf3c915bc Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-21 20:28:22 +05:30
RGoyalmc 3bd9014b5a registerListener returns PacketListenerAbstract to allow unregistering later 2022-01-21 20:28:10 +05:30
Abhigya ab209d950b Removed relocation 2022-01-21 19:14:45 +05:30
Abhigya e92413a53d WrapperPlayServerSpawnPlayer fix for 1.8 and lower 2022-01-21 19:11:11 +05:30
RG fb74a7f99b Merge branch 'retrooper:2.0' into 2.0 2022-01-21 14:02:00 +05:30
RGoyalmc 96b9442c29 Added unregisterListeners methods 2022-01-21 14:00:52 +05:30
MWHunter 7db5ff25f0 Correct Optional_Integer entity data type 2022-01-20 16:55:19 -06:00
retrooper a20d067d62 NPC API additions, custom prefix and suffixes, colored name feature. 2022-01-20 21:15:25 +01:00
retrooper c85b5dce14 Merge pull request #198 from RohanGoyalDev/2.0
Added WrapperPlayServerScoreboardObjective and WrapperPlayServerTeams
2022-01-20 18:35:37 +01:00
retrooper 70ab66889b Removed some examples 2022-01-20 18:30:35 +01:00
RGoyalmc 3acf776efe Added WrapperPlayServerScoreboardObjective and WrapperPlayServerTeams 2022-01-20 22:53:21 +05:30
retrooper 0430a94f31 Moved AdventureSerializer to util package 2022-01-19 22:46:21 +01:00
retrooper 044c3b186d Deleted our chat component abstraction and
migrated to Kyori Adventure
2022-01-19 22:45:34 +01:00
retrooper 620a63f09c Correctly relocate adventure, might do some changes 2022-01-19 22:12:09 +01:00
retrooper b76933f26d Merge pull request #197 from AbhigyaKrishna/2.0
Adventure implementation
2022-01-19 20:52:09 +01:00
Abhigya 3d94e6fb75 Adventure implementation 2022-01-19 23:00:18 +05:30
retrooper 925f9a3c3e Vector3d, Vector3f, Vector3i#zero created 2022-01-17 22:22:40 +01:00
retrooper 1fae8ad4d6 Removed debug 2022-01-17 22:20:51 +01:00
retrooper 1860de9529 WrapperPlayServerCloseWindow default constructor created;
ServerManager#receivePacket and
ServerManager#receivePacketSilently created
2022-01-17 22:20:28 +01:00
retrooper 3dcce9ea5d Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-17 21:03:48 +01:00
retrooper 4809c8db27 Some optimizations/simplifying to the current netty abstraction implementation of packetevents 2022-01-17 21:03:21 +01:00
MWHunter c14297aa51 WrapperPlayServerCloseWindow 2022-01-17 13:30:32 -06:00
retrooper 0ccfdc6ef4 Minor change to a comment 2022-01-17 19:49:05 +01:00
retrooper 45ad93778d Fixed compatibility with ProtocolSupport 2022-01-17 19:48:01 +01:00
retrooper f1d683abb0 Compilation error fixed!! 2022-01-16 22:04:10 +01:00
retrooper 8fad01156b We now collect our packetevents version with bStats;
SpigotDataHelper.fromBukkitItemStack bug fix
2022-01-16 21:59:26 +01:00
retrooper b1c7f2a3c5 Update bStats notice 2022-01-16 21:11:44 +01:00
retrooper f2c0468487 Vector3d#ZERO created;
Vector3f#ZERO created;
Vector3i#ZERO created
2022-01-15 18:10:13 +01:00
retrooper 89110b21f1 Minor changes 2022-01-13 22:19:22 +01:00
retrooper 79f176221a Equipment and EquipmentSlot now have their own class;
ItemStack#AIR added;
NPC#getMainHand, getOffHand, getHelmet, getChestPlate, getLeggings, getBoots added;
NPCManager#updateEquipment;

PlayerManager#sendPacket works again
2022-01-13 22:03:26 +01:00
retrooper 56ebeffda1 WrapperPlayServerCollectItem created;
ItemStack#Builder default amount is 1;
Vector3d#toVector3i created;
Vector3i#toVector3d created;
2022-01-09 21:54:33 +01:00
retrooper 0fe5d63220 Add WrapperPlayServerEntityEquipment 2022-01-09 19:34:01 +01:00
retrooper 43d18cd6f2 Added WrapperPlayServerEntityEquipment 2022-01-09 19:00:47 +01:00
retrooper ffcb91ef05 Removed preProcessed feature in listeners 2022-01-08 17:36:41 +01:00
retrooper d42de7d96a Removed redundant duplication when sending packet bytebufs 2022-01-07 18:34:37 +01:00
retrooper 04cf207105 Change to debug listener 2022-01-07 17:30:28 +01:00
retrooper b404274e26 Removed debugs 2022-01-07 17:02:34 +01:00
retrooper 011d52a246 Last attempt to support pre processed listener and "cloned" event instances 2022-01-07 16:57:33 +01:00
retrooper 2e01f71e95 Redundant code removed from PacketWrapper 2022-01-07 16:26:10 +01:00
retrooper 17aa045349 Added small debug 2022-01-07 16:14:59 +01:00
retrooper 264e6e5e81 Pre processed events are working 2022-01-07 16:01:44 +01:00
retrooper b5a15cbbbb 2nd Attempt to fix pre processed events 2022-01-07 15:51:57 +01:00
retrooper a8ee5ee79a Attempt to fix pre processed events 2022-01-07 15:34:47 +01:00
retrooper d7be938767 You should now be able to read the same event multiple times with many wrappers. 2022-01-07 15:18:58 +01:00
retrooper 00ecb18efb Compilation error fixed 2022-01-07 14:59:04 +01:00
retrooper 0880664a58 PacketListener and PacketListenerReflect can now be preProcessed. This means the buffer is cached and you can safely read the data in the packet on a separate thread or later. 2022-01-07 14:53:01 +01:00
retrooper a5641ee557 PacketListenerAbstract#isPreProcessed added;
WrapperPlayClientBlockPlacement renamed to WrapperPlayClientPlayerBlockPlacement
2022-01-07 14:36:31 +01:00
retrooper ac4d9601d9 Packet wrapper objects can be sent multiple times now 2022-01-07 12:07:09 +01:00
retrooper 597cd2462c PlayerManager#sendPacketSilently defined;
PlayerManagerImpl#sendPacketSilently implements it
2022-01-07 12:03:04 +01:00
retrooper a4aabcfbcc WrapperPlayServerFacePlayer created 2022-01-06 22:22:48 +01:00
retrooper 58839ae503 WrapperPlayServerPlayerPositionAndLook.java additions;
WrapperPlayClientPlayerFlying#hasPositionChanged and hasRotationChanged now accessible
2022-01-06 21:27:37 +01:00
retrooper 85a0edc131 Set default values for player data providers 2022-01-06 19:09:45 +01:00
retrooper 8aedcff494 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-06 18:59:54 +01:00
retrooper 78581d99ae Set default values for entity data providers 2022-01-06 18:58:11 +01:00
MWHunter 8cf6e07a6b WrapperPlayServerOpenHorseWindow 2022-01-06 10:46:47 -06:00
retrooper 7f44343ec7 Attempt to fix WrapperPlayServerPlayerPositionAndLook and RelativeFlags;
SkinSection improvements;

WrapperPlayClientSettings#isSkinSectionVisible, setSkinSectionVisible added
2022-01-06 15:50:47 +01:00
retrooper bb78cfcaf6 Attempt to transform destroy entities packet into multiple when needed;
SpigotDataHelper created, which helps for converting Bukkit data types into packetevents data types
2022-01-06 12:35:01 +01:00
retrooper 3464fa8ea7 Many comments removed, we instead made GitHub issues 2022-01-06 12:07:24 +01:00
retrooper 23c427944f Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-06 11:49:25 +01:00
retrooper b0943da09f Attempted to complete the entity data provider builders, not entirely perfectbut should work. 2022-01-06 11:49:11 +01:00
retrooper dd20f0c7c7 Credit bStats metrics class owner 2022-01-06 00:24:10 +01:00
retrooper 4093a23fb3 SkinSections refactored;
WrapperPlayClientPlayerFlying can now parse its sub packets;

Working on builders for entity data providers.(player one is left)
2022-01-05 23:27:10 +01:00
retrooper c5c9d6e1fd Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-05 13:30:05 +01:00
retrooper 3c88c64cac LivingEntityDataProvider created;
PlayerDataProvider also created, now time to test
2022-01-05 13:29:26 +01:00
MWHunter 55dacc62dc Fix MCProtocolLib bug 2022-01-04 21:16:31 -06:00
MWHunter 0056adae8e Fix equals and hashcode comparison for WrappedBlockState 2022-01-04 19:19:41 -06:00
MWHunter 7c9dd702c4 Fix yet another WrappedBlockState corruption method 2022-01-04 18:58:32 -06:00
MWHunter 8e73755566 Fix another WrappedBlockState corruption method 2022-01-04 18:40:47 -06:00
MWHunter 21da5c8be8 Don't let WrappedBlockState become corrupted 2022-01-04 17:50:19 -06:00
DefineOutside 8900e613b2 Fix compilation 2022-01-04 17:34:53 -06:00
retrooper 6e37546336 EntityDataProvider done;
Working on LivingEntityDataProvider
2022-01-04 22:56:12 +01:00
retrooper 4b4aec1e32 Attempting to fix a connection handler issue 2022-01-04 19:30:57 +01:00
retrooper b356696d1e Removed debugs and debug listener 2022-01-04 18:19:25 +01:00
retrooper 3dd75fc51e Attempted to fix PacketEncoderLegacy for 1.7 servers 2022-01-04 18:18:25 +01:00
retrooper d6a0823d57 Some bug fixes, skins now work again! 2022-01-04 17:47:46 +01:00
retrooper eb7e8752ed Fixed encoder issues with sending packets 2022-01-04 17:09:54 +01:00
retrooper 201666365f Fixed encoder issues when cancelling packets;
Improved ViaVersion support(optimizations)
2022-01-04 17:00:25 +01:00
retrooper 04ba2c29dd Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-04 16:39:11 +01:00
retrooper 8b2750389d Before we try change our encoder system. 2022-01-04 16:38:54 +01:00
MWHunter 586657d973 Fix 1.17+ support for EntityPose 2022-01-03 19:09:08 -06:00
retrooper 7e0f491a73 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-03 22:08:29 +01:00
retrooper 8e62e6a6a3 CustomPipelineUtil should now work on 1.7.10 2022-01-03 22:08:06 +01:00
MWHunter 45ab932d3c Fix WrapperPlayClientBlockPlacement and add WrapperPlayClientUseItem 2022-01-03 15:00:55 -06:00
retrooper eb295e16e9 PlayerManagerImpl#sendPacket now calls our send event when Via isn't present 2022-01-03 21:07:14 +01:00
retrooper deec409f02 Fixed compilation error. 2022-01-03 11:33:37 +01:00
retrooper 246c5c4c55 Trying to add plugin.yml 2022-01-03 11:25:58 +01:00
retrooper 352750a247 Relocation of ResourceLocation 2022-01-03 08:44:27 +01:00
retrooper 4abb66f06a Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-03 08:37:09 +01:00
retrooper 7840391061 Finally we handle Villager data in the entity metadata packet! 2022-01-03 08:36:59 +01:00
MWHunter 5cf2d24098 Fix isReplaceable() 2022-01-02 21:51:12 -06:00
MWHunter 14781b3f7b Fix isSolid() for StateTypes 2022-01-02 17:24:53 -06:00
MWHunter 04beb32199 Fix WrappedBlockState 2022-01-02 15:29:02 -06:00
MWHunter 57c3f00f1d Fix BlockTags + ItemTags and rearrange their code 2022-01-02 14:57:02 -06:00
MWHunter f021974c73 Fix WrapperPlayServerUpdateHealth 2022-01-02 11:05:45 -06:00
MWHunter b97ab7c054 Fix entity metadata writing 2022-01-02 10:45:40 -06:00
MWHunter a930af9656 Fix entity type mappings for 1.16+ 2022-01-01 18:21:15 -06:00
MWHunter b74d0bce71 Try fixing EntityMetadata packet 2022-01-01 17:47:22 -06:00
retrooper 0a5f73d2a6 Finally got NPCManager#changeNPCSkin kind of working;
Removed debug listener
2022-01-02 00:00:13 +01:00
retrooper 94d02606f6 Bug fixes to MojangAPIUtil 2022-01-01 22:33:12 +01:00
retrooper 274618b899 MojangAPIUtil and UUIDUtil created 2022-01-01 22:22:27 +01:00
retrooper e77d23e908 Removed some things to prevent compilation 2022-01-01 21:59:17 +01:00
retrooper db878badae Fixed PacketWrapper#readEntityMetadata and writeEntityMetadata for 1.10+ 2022-01-01 21:58:30 +01:00
retrooper c723bee425 Merge remote-tracking branch 'origin/2.0' into 2.0 2022-01-01 21:50:02 +01:00
retrooper 6cf055501b Fixed WrapperPlayServerEntityProperties on 1.16+;
WrapperPlayServerSpawnPlayer minor addition;

NPCManager#updateNPCSkin and NPCManager#updateNPCDisplayPing added
2022-01-01 21:49:37 +01:00
MWHunter 7152615e3c Allow getting all valid item types and state types 2022-01-01 13:05:16 -06:00
retrooper b7bbdfa3e3 SpigotPacketEventsBuilder#clearBuildCache added 2022-01-01 18:50:44 +01:00
retrooper 1262855d05 SpigotReflectionUtil#getEntityById created 2021-12-31 21:37:14 +01:00
retrooper 1cea4d9766 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-31 20:41:37 +01:00
retrooper 627c23ec15 Removed tab completion thing 2021-12-31 20:41:24 +01:00
MWHunter d6d447c6bf Restore getEnchantmentLevel 2021-12-31 13:36:15 -06:00
MWHunter 1852c48e93 ItemStack clean up duplicate code 2021-12-31 13:28:22 -06:00
MWHunter 78f8a6b7db Fix compilation on java 8 2021-12-31 12:48:07 -06:00
MWHunter 63f7d1aac5 ItemTypes <---> StateTypes when placeable 2021-12-31 12:31:01 -06:00
MWHunter c5a1bfdd62 Remove commented out code from ItemTypes 2021-12-31 11:59:18 -06:00
MWHunter 13627a83cf Rewrite ItemTypes to use a design pattern instead of 5 constructors 2021-12-31 11:57:08 -06:00
MWHunter 88023852b3 Add default block states for 1.17/1.18 2021-12-30 16:08:47 -06:00
retrooper 5adb6378e2 Change in one wrapper 2021-12-30 20:35:57 +01:00
retrooper 619cc77823 Minor fixes 2021-12-30 20:25:19 +01:00
retrooper fab8cdde35 Implemented a utility method NettyManager#asByteArray 2021-12-30 20:21:34 +01:00
retrooper 730eda864f Trying to fix game-profile failing to cache. 2021-12-30 20:14:02 +01:00
retrooper 1309c77f3c Minor changes 2021-12-30 13:17:21 +01:00
retrooper 35e503a2ae We can now build all the components officially with the API. 2021-12-30 12:41:59 +01:00
retrooper a82951f85e Removed debug and debug listener 2021-12-30 12:26:43 +01:00
retrooper 5ef782a04b Minor bug fix in translatable component, need to look into hover event 2021-12-30 12:11:00 +01:00
retrooper 78d1bf814f Lots of bug fixes in the chat component API 2021-12-30 12:03:09 +01:00
retrooper 4dcc33f7b7 Removed debug listener 2021-12-29 23:39:22 +01:00
retrooper 79514e0a51 Lots of code repetition fixed, working on fixing translatable components 2021-12-29 23:38:31 +01:00
retrooper f2c78c794a More progress on component serializer 2021-12-29 23:09:05 +01:00
retrooper 435e27d02c Addition to NBT components 2021-12-29 22:56:43 +01:00
retrooper b4640aecb0 Addition to NBT components 2021-12-29 22:47:21 +01:00
retrooper 6915c97a51 More progress on chat component api, working on nbt components 2021-12-29 22:45:26 +01:00
retrooper 7e6996813a Attempted getEnchantments in ItemStack;
Relocated EnchantmentType/s;

MappedEntity#getIdentifier -> MappedEntity#getName(For ItemType, PotionType, EnchantmentType)
2021-12-27 22:42:56 +01:00
MWHunter fd787fd3fb Migrate to ViaVersion block mappings 2021-12-26 19:59:18 -06:00
MWHunter 17aadda1c5 Initial ItemTags implementation 2021-12-26 16:49:18 -06:00
MWHunter 68335024ea Utility methods to WrapperPlayServerBlockAction.java 2021-12-25 17:12:48 -06:00
MWHunter c5cf140961 Add sword, shovel, axe, pickaxe, and hoe to ItemAttributes 2021-12-25 17:04:53 -06:00
retrooper 6764c39bfb Despawn NPC correctly 2021-12-25 18:51:05 +01:00
retrooper 59c6f58e77 Bukkit module -> Spigot module;
Read only listener bug fixes
2021-12-25 17:51:26 +01:00
retrooper 6a6a9f5a9e BukkitPacketEventsBuilder -> SpigotPacketEventsBuilder 2021-12-25 17:25:49 +01:00
retrooper 697f65c07e Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-25 17:23:13 +01:00
retrooper f59a2e5144 Packet listeners can now be readable only(which means the wrappers won't modify the packet being listened to, this can help optimize your usage of wrappers. 2021-12-25 17:23:02 +01:00
MWHunter f161ba5718 Utility methods to BlockFace 2021-12-24 21:21:21 -06:00
retrooper 467d5e596d Minor bug fix with getNPCManager() method 2021-12-24 22:43:00 +01:00
retrooper b66cf34975 Attempted to fix NPC head rotation 2021-12-24 22:33:09 +01:00
retrooper 528a7ec7e5 Renamed MinecraftReflectionUtil in bukkit module to SpigotReflectionUtil (considering renaming module to "spigot") 2021-12-24 22:20:16 +01:00
retrooper 3cee15aef0 Minor changes 2021-12-24 21:58:47 +01:00
MWHunter 677e2739a6 Finish missed boolean getX() and fix a statetype 2021-12-24 14:30:06 -06:00
MWHunter 79bf0f674c boolean getX() -> boolean isX() 2021-12-24 14:25:40 -06:00
MWHunter 8376abcfaa Add Attachment to wrapped block state 2021-12-24 14:18:37 -06:00
MWHunter 14201f8747 Add WrapperPlayServerDeclareRecipes 2021-12-24 14:08:49 -06:00
MWHunter c34d26670f Replace Facing enum with BlockFace enum 2021-12-23 21:53:56 -06:00
MWHunter 3c669c6e93 Add East state to WrappedBlockState 2021-12-23 21:49:41 -06:00
MWHunter e7896f9ec2 Make StateType in WrappedBlockState accessible
A bit of an oversight
2021-12-23 21:22:04 -06:00
MWHunter 1a17587d3a Working MultiBlockChange wrapper for 1.17+ 2021-12-23 20:39:46 -06:00
retrooper c23e066d63 WrapperPlayServerEntityRelativeMove had wrong packet type 2021-12-23 22:44:35 +01:00
retrooper aee4bfd240 Merge pull request #178 from Izibane/patch-1
すごい
2021-12-23 22:18:40 +01:00
retrooper 2ca0a14dfd despawn NPC bug fix 2021-12-23 22:17:09 +01:00
retrooper c9afbbc573 Location#clone added 2021-12-23 22:14:51 +01:00
retrooper 6967092a39 Minor bug fixes in NPCManager, now IT SHOULD BE WORKING 2021-12-23 22:03:09 +01:00
Izibane 2fc17edfd1 すごい
Super Idol的笑容 都没你的甜 八月正午的阳光 都没你耀眼 热爱 105 °C的你 滴滴清纯的蒸馏水
2021-12-23 21:00:45 +00:00
retrooper e5f04b9dd8 Another bug fix in NPCManager#updateNPCLocation 2021-12-23 21:59:35 +01:00
retrooper 72cea36b4c Another bug fix in NPCManager#updateNPCLocation 2021-12-23 21:58:29 +01:00
retrooper cb3dc07da4 Bug fix with NPCManager#updateNPCRotation 2021-12-23 21:46:00 +01:00
retrooper 7a6adba398 Optimization to NPCManager#updateNPCRotation 2021-12-23 21:28:01 +01:00
retrooper 52ac010d6f Redundant import removed 2021-12-23 20:23:29 +01:00
retrooper 285085ab14 Renaming in entity relative move PacketType EntityLook -> EntityRotation (like on wiki.vg) and in Wrapper names;
WrapperPlayServerSpawnPlayer final touches;
Location created and applied in a few wrappers.
2021-12-23 20:18:32 +01:00
MWHunter ed088c2d8e Working chunk data wrapper for 1.17 2021-12-22 21:39:53 -06:00
MWHunter 4e33c323df Working chunk data wrapper for 1.18! 2021-12-22 19:45:32 -06:00
MWHunter e4f1492744 Clean up multi-version chunk wrappers 2021-12-22 17:44:07 -06:00
MWHunter 922d234c45 Convert (untested) chunks to using the WrappedBlockState 2021-12-21 17:50:03 -06:00
MWHunter 05edb94249 Add extra utilities for block tags 2021-12-21 16:32:41 -06:00
retrooper f6de2e066e Some renaming of wrappers. 2021-12-21 21:06:40 +01:00
MWHunter 8204c5d631 Add shapeExceedsCube to StateType 2021-12-20 19:45:54 -06:00
MWHunter 4d9ce8419d Fix Java 8 support 2021-12-20 18:12:07 -06:00
MWHunter f47ddb5330 Expose item type attributes 2021-12-20 17:57:27 -06:00
MWHunter 1fab6e5396 Add Fuel to ItemType attributes 2021-12-20 17:51:03 -06:00
MWHunter f77b370ee9 More ItemStack utilities 2021-12-20 17:20:57 -06:00
MWHunter 30e46ef672 Add some utility methods to ItemStack 2021-12-20 16:02:10 -06:00
retrooper bdeab22d57 Compilation error fixed in EntityDataTypes 2021-12-19 21:41:05 +01:00
retrooper 982ad348a4 Hopefully fixed WrapperPlayServerEntityMetadata,
And created EntityData and EntityDataType/s,
all metadata stuff should be working, just need to test;

Refactored some item categorized mappings;
WrapperPlayServerBlockChange bug fix;
2021-12-19 21:26:40 +01:00
retrooper 296d3a8330 Fixed some more bugs in WatchableObject 2021-12-19 11:08:29 +01:00
retrooper 1ad13506f8 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-19 10:44:20 +01:00
retrooper 8887fdf227 Fixed some bugs in WatchableObject 2021-12-19 10:43:54 +01:00
DefineOutside 8ac94578cb Add BlockTags class 2021-12-18 14:22:46 -06:00
DefineOutside adcf8f9b0d Add speed to state types 2021-12-18 13:54:28 -06:00
DefineOutside 6b7f08d27b Initial working WrappedBlockState for 1.18 with WrappedPlayServerBlockChange 2021-12-18 12:09:11 -06:00
DefineOutside 14fa2a7e5f Fix some wrapped block state enums 2021-12-18 11:49:13 -06:00
DefineOutside f9d1f8ad39 Add globalID to wrapped block state to allow reversion with bad modifications 2021-12-18 10:56:07 -06:00
DefineOutside 86fb8f57da Efficiency improvements for packet block states 2021-12-17 20:41:09 -06:00
DefineOutside 84d87ba5bc Prototype for packet based representations of 1.7 through 1.18 blocks 2021-12-17 19:06:30 -06:00
DefineOutside 922b1e783b Prototype for turning strings into enums and stuff 2021-12-17 18:28:29 -06:00
DefineOutside a1e68ea71f Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-17 15:29:27 -06:00
DefineOutside af025bb76b Prototype for universal state types 2021-12-17 15:29:17 -06:00
retrooper 16f2d66b82 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-17 21:37:08 +01:00
retrooper b5205e10aa Client-bound keep alive packet created 2021-12-17 21:36:44 +01:00
DefineOutside c53ca172ef Add push reaction to state types 2021-12-17 13:27:07 -06:00
DefineOutside 4cdf42a6d8 don't commit debug 2021-12-17 13:01:28 -06:00
DefineOutside bdae6431b7 Add WrapperPlayServerTags 2021-12-17 13:00:54 -06:00
retrooper a8e1e7c09f Minor change/fix component 2021-12-17 19:29:20 +01:00
retrooper 1e4bbaa979 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-17 18:53:33 +01:00
retrooper b00f28399b WrapperPlayServerPlayerInfo bug fixes attempt.
PacketWrapper#readComponent created
2021-12-17 18:53:17 +01:00
retrooper 232c668a45 Merge pull request #176 from AlessioGr/2.0
PLS NO SYSTEM.OUT.PRINTLN
2021-12-17 18:09:20 +01:00
Alessio Gravili 242435a0af Merge pull request #2 from AlessioGr/retrooper-2.0
Retrooper 2.0
2021-12-17 17:42:07 +01:00
AlessioGr 5e093dbac8 Merge branch '2.0' of https://github.com/retrooper/packetevents into retrooper-2.0
Signed-off-by: AlessioGr <alessio@gravili.de>

# Conflicts:
#	bukkit/src/main/java/io/github/retrooper/packetevents/handlers/modern/PacketDecoderModern.java
2021-12-17 17:41:24 +01:00
retrooper e84c299d77 Removed a few debugs;
WrapperPlayServerDifficulty added
2021-12-17 17:26:42 +01:00
AlessioGr 680511621c PLS NO SYSTEM.OUT.PRINTLN
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-17 17:25:40 +01:00
AlessioGr a4a44f735f PLS NO SYSTEM.OUT.PRINTLN
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-17 17:24:24 +01:00
DefineOutside bbfc4f2e20 In-progress block state types 2021-12-16 22:55:22 -06:00
DefineOutside 6498ef9d25 Add durability and tool tiers to ItemType 2021-12-16 15:58:12 -06:00
DefineOutside c833196faa Fix compilation 2021-12-16 14:55:34 -06:00
DefineOutside 0f84b1fd9f Add CraftRemainder to item type 2021-12-16 14:38:51 -06:00
DefineOutside ad39ca31b2 Add ItemAttribute.FIRE_RESISTANT 2021-12-16 14:21:50 -06:00
retrooper 9bccd08531 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-16 21:20:08 +01:00
retrooper db1ca78fbb Strip away colors from log manager if we are not on Bukkit. Colors must be handled by the implementation and cannot be cross-platform. Everything remains white on other platforms or unknown implementations, unless they implement it correctly. 2021-12-16 21:19:55 +01:00
DefineOutside 70e2484d99 Corrections to max stack size 2021-12-16 14:18:11 -06:00
DefineOutside 4f81138bde Add edible to item types 2021-12-16 14:12:20 -06:00
retrooper a16cc34f8d Attempted some bug fixes in decoder for legacy versions such as 1.8 2021-12-16 20:58:38 +01:00
retrooper 69cffe5b3d Updated position and look constructor 2021-12-16 17:50:25 +01:00
retrooper 4c53c6fe56 We now use GameProfile in LoginSuccess packet. 2021-12-16 16:35:03 +01:00
retrooper 87748980ea Minor fix in HumanoidArm 2021-12-16 16:14:07 +01:00
retrooper 9bc6a15581 Minor documentation fix 2021-12-16 16:11:37 +01:00
retrooper 3e4eb458d3 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-16 16:07:31 +01:00
retrooper 8d643fddcf EntityType should work for all supported server versions now.
ItemTypes#getById can never be null, it returns AIR if not found in the map.
2021-12-16 16:07:18 +01:00
DefineOutside 67da1c6184 Air stacks to 64 not 1 2021-12-15 23:18:05 -06:00
DefineOutside 1957fc0b77 Add CARTESIAN_VALUES to BlockFace 2021-12-15 19:27:06 -06:00
DefineOutside baebf06dc0 Add utility methods to BlockFace 2021-12-15 19:19:42 -06:00
DefineOutside 078aa4ab88 Add WrapperPlayClientSteerVehicle 2021-12-15 17:30:32 -06:00
DefineOutside 97d82994cc Fix compilation error due to PacketEventsPlugin.java 2021-12-15 16:59:45 -06:00
DefineOutside 0f2d7c05a9 Separate main hand vs interaction hand 2021-12-15 16:54:38 -06:00
DefineOutside 2ad01ba158 Make clientbound/serverbound window confirmations consistent 2021-12-15 16:43:55 -06:00
DefineOutside 4c454f3793 Add constructors to WrapperPlayServerOpenWindow 2021-12-15 16:40:38 -06:00
retrooper 987fb97fad Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-15 23:08:21 +01:00
retrooper 104bdf0e37 Added entity type mappings for 1.14 till 1.18 2021-12-15 23:08:11 +01:00
DefineOutside 9846133f97 Initial WrapperPlayServerOpenWindow 2021-12-15 14:44:30 -06:00
retrooper fa087ca733 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-15 16:40:30 +01:00
retrooper 9cb661df86 Improvements to ClientVersion and ServerVersion, we added the getReleaseName to both;
InternalPacketListener should be cross-platform, and is no longer in the bukkit module, implementations must register it;
We now cache the game profiles with channels instead of player usernames.
2021-12-15 16:40:05 +01:00
DefineOutside 6a20277b7e Add the parent type to EntityType 2021-12-14 22:19:45 -06:00
DefineOutside 46e54fb8db Force GeyserUtil safety 2021-12-14 20:28:47 -06:00
DefineOutside b0fc8aa0a3 WrapperPlayServerWindowItems 2021-12-14 19:59:12 -06:00
retrooper 6caa434cd0 Merge pull request #175 from AlessioGr/fixlogs
Fix missing color in Bukkit log manager implementation
2021-12-14 21:12:16 +01:00
AlessioGr c85cffbed1 Fix missing color in bukkit log manager implementation
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-14 15:39:34 +01:00
retrooper 2377ca8e02 Minor improvements to cross-platform log manager. 2021-12-13 07:21:12 +01:00
retrooper 5a90d2fd19 Some changes to GameProfile and some cleanups. 2021-12-12 22:27:23 +01:00
retrooper 9ca4606cf5 Progress on EntityTypes;
Some refactoring of some protocol data types;
2021-12-12 22:06:47 +01:00
retrooper 4b648ac0d0 Improvements to WrapperPlayServerEntityEffect 2021-12-12 21:11:07 +01:00
retrooper d3ae9e5c35 Cleanup to logger manager. 2021-12-12 20:55:28 +01:00
retrooper 584452adc9 Merge pull request #173 from AlessioGr/2.0
Add LogManager
2021-12-12 18:10:40 +01:00
retrooper 8303a6f8a5 Some corrections to WrapperLoginClientEncryptionResponse and minor changes to MinecraftEncryptionUtil 2021-12-12 15:34:18 +01:00
retrooper a107493942 Minor fixes to MinecraftEncryptionUtil 2021-12-12 15:20:35 +01:00
retrooper 0c79206e62 Merge pull request #174 from TRGReal/patch-1
Add vanilla MinecraftEncryptionUtil.
2021-12-12 14:40:14 +01:00
TRGReal 6fbd8843e8 Add vanilla MinecraftEncryptionUtil.
Allows you to easily encrypt/decrypt using Minecraft-like RSA/AES in PE util.
2021-12-12 21:39:22 +08:00
retrooper f6ac6d8c60 Removed decrypt and encrypt methods 2021-12-12 14:37:50 +01:00
retrooper 03768c587c Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-12 13:56:04 +01:00
retrooper 04be4cad57 Minor corrections to WrapperLoginClientEncryptionResponse 2021-12-12 13:55:51 +01:00
AlessioGr 5ad0284c92 Finalize logmanager
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-11 23:19:28 +01:00
AlessioGr 8471ae512b Disable plugin.yml.dis
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-11 23:18:56 +01:00
AlessioGr 388fd05e90 Improvements
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-11 23:13:34 +01:00
AlessioGr 7aac404238 Add LogManager
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-11 22:58:02 +01:00
retrooper faf6bff61b Merge pull request #172 from AlessioGr/2.0
Update gradle shadow & add github actions to 2.0
2021-12-11 22:38:19 +01:00
retrooper b644f8d4aa Comments added 2021-12-11 21:57:40 +01:00
retrooper d091f169ad Minor correction in comment 2021-12-11 21:26:42 +01:00
retrooper a1e9aef5dc Attempted to add Geyser/Floodgate support 2021-12-11 21:02:29 +01:00
retrooper 94bd45a1f9 Fixed WrapperPlayClientUpdateSign,
Added 1.18.1 support,
Fixed mappings when being parsed.
2021-12-10 22:47:21 +01:00
retrooper aa00273a97 Updated to support 1.18.1 2021-12-10 20:58:06 +01:00
retrooper 077db29072 Item mappings should work for 1.17 and below 2021-12-10 16:06:48 +01:00
retrooper 266702d3ff We have switched to ViaVersion's mappings, these are much easier to use, especially in our case, still need to complete the mappings for server versions older than 1.18. 2021-12-09 22:58:46 +01:00
retrooper bdfcfed7fe Pre mappings fix/switch 2021-12-09 21:41:13 +01:00
retrooper 0513511b4b Updated build.gradle to use Spigot 1.18 API 2021-12-09 20:13:34 +01:00
retrooper 6dba94e69d Lots of cleanup in PlayerManager and ServerManager. You don't need to implement as many methods anymore. 2021-12-08 22:55:30 +01:00
retrooper c088dfbf64 Minor changes to GameMode 2021-12-08 17:20:39 +01:00
retrooper 8a95ba99ac Removed PlayerManager#sendMessage 2021-12-08 14:41:20 +01:00
retrooper 9abaa18ba0 Add GameMode;
Add PlayerManager#sendMessage (will be removed next commit)
2021-12-08 14:39:47 +01:00
retrooper 16d57cead7 Minor changes 2021-12-05 11:21:52 +01:00
retrooper bccad0fe6e Minor bug fixes in chunk data(progress) 2021-12-05 11:03:08 +01:00
retrooper 31bbd66497 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-05 10:50:02 +01:00
retrooper 2d38f37be7 Working on decoding/encoding watchable objects. 2021-12-05 10:49:51 +01:00
DefineOutside ebb48c5a6d In-progress chunk wrappers 2021-12-04 16:56:55 -06:00
DefineOutside 5de377d535 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-04 16:09:03 -06:00
DefineOutside 719dedeebf In-progress chunk wrappers 2021-12-04 16:08:54 -06:00
retrooper 9567ab2aab ItemTypes mapping correction attempt,
WrapperPlayServerEntityEffect new constructor added
2021-12-04 20:06:30 +01:00
retrooper b9077e5112 Many corrections to wrappers. 2021-12-04 19:48:15 +01:00
retrooper b9fac2d6c9 Some bug fixes on more wrappers. 2021-12-04 19:25:55 +01:00
retrooper 5fa664b59f Fixed WrapperPlayServerAttachEntity and WrapperPlayServerSetCooldown 2021-12-04 19:21:31 +01:00
retrooper 307cc62a6a Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-04 19:19:41 +01:00
retrooper ab3bfa3018 Trying to fix ItemTypes mappings, what went wrong? 2021-12-04 19:19:15 +01:00
DefineOutside 480cee7fec Player teleport wrapper 2021-12-04 11:40:44 -06:00
DefineOutside 924b0c2b24 WrapperPlayServerSetCooldown 2021-12-04 11:09:43 -06:00
DefineOutside 5db3c59ff0 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-04 10:58:33 -06:00
DefineOutside ff8b593438 Attach entity wrapper 2021-12-04 10:58:28 -06:00
retrooper 0f9197a1f0 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-12-04 17:44:50 +01:00
retrooper ac6bda02de Updated item type mappings to 1.18 2021-12-04 17:43:39 +01:00
DefineOutside eef49aa7c3 Entity effect, remove entity effect, set passengers wrappers 2021-12-04 10:23:04 -06:00
retrooper 2b84919759 Temporarily disabled debugs. 2021-12-03 22:38:00 +01:00
retrooper 7b56fbd453 Created WrapperPlayServerUpdateSimulationDistance 2021-12-03 22:16:26 +01:00
retrooper b62ac638f8 Updated debugs. 2021-12-03 22:13:52 +01:00
retrooper 074004d57f Re-added debugs in a rather smarter way. 2021-12-03 22:01:27 +01:00
retrooper d36a93b050 Added support for 1.18 regarding packet types.
Working on fixing injector issues.
2021-12-03 21:41:53 +01:00
retrooper 4abffd87f8 Some optimizations by removing redundant packet processing in my internal listener 2021-12-02 18:26:02 +01:00
Alessio Gravili a6b83d7e58 Merge branch 'retrooper:2.0' into 2.0 2021-12-02 18:20:22 +01:00
retrooper 679dda68ea Last debug removed! 2021-12-02 18:09:28 +01:00
retrooper 4952487937 Removed chat message debugs. 2021-12-02 17:33:33 +01:00
Alessio Gravili d7a52e797e Merge branch 'retrooper:2.0' into 2.0 2021-12-02 17:21:41 +01:00
retrooper 23e5282b0f Minor fix 2021-12-02 17:19:36 +01:00
Alessio Gravili 978f0382b9 Merge branch 'retrooper:2.0' into 2.0 2021-12-02 17:19:32 +01:00
retrooper b598384f22 Fixed WrapperPlayServerPluginMessage and WrapperPlayClientPluginMessage;
Removed one more debug
2021-12-02 17:17:00 +01:00
AlessioGr fb9d69e191 JDK 8
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-02 17:03:39 +01:00
AlessioGr 2125d3cd49 Update gradle wrapper from 7.3 to 7.3.1
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-02 11:49:14 +01:00
Alessio Gravili 348e400be3 Create gradle-publish.yml 2021-12-02 10:28:17 +01:00
AlessioGr a236e24b25 Update shadow version
Signed-off-by: AlessioGr <alessio@gravili.de>
2021-12-02 10:15:49 +01:00
retrooper 4eae63c898 Removed debugs 2021-12-01 23:07:52 +01:00
retrooper 9cd931225d Small comments added 2021-12-01 23:05:44 +01:00
retrooper 65232f6c47 Chat components reworked and mostly working, just need to work on Hover event show item and show entity, cause their values are strings and NOT json objects. 2021-12-01 23:04:59 +01:00
retrooper c82895612b Working on ScoreComponent 2021-12-01 19:27:08 +01:00
retrooper e50feeb9cd Some more adjustments to gradle. 2021-12-01 18:12:59 +01:00
retrooper d10f91538f Added some info to maven publishing. 2021-12-01 18:11:54 +01:00
retrooper 2327997910 Updated to latest gradle version, to add support for later java versions. 2021-12-01 18:02:28 +01:00
retrooper 469e610c15 Some bug fixes in client settings. 2021-12-01 17:21:38 +01:00
retrooper 7ab59f3cbe Officially supporting 1.18. 2021-11-30 18:09:45 +01:00
retrooper 8eb8a7ea2d ClientVersion#getLatest added;
ClientVersion#getOldest added;
PlayerManager#getClientVersion(ChannelAbstract) bukkit impl improved
2021-11-29 19:55:37 +01:00
retrooper 1d014a5848 Updated WrapperPlayClientSettings to support 1.18 2021-11-28 23:03:31 +01:00
retrooper a29a0f9e20 Working on 1.18 support 2021-11-28 22:27:31 +01:00
retrooper 4b866d2d72 Yes 2021-11-28 18:09:03 +01:00
retrooper 76024f5ddd Fixed issues in WrapperLoginClientEncryptionResponse, WrapperLoginServerEncryptionRequest,
WrapperPlayClientPluginMessage,
WrapperPlayServerPluginMessage
2021-11-28 17:30:47 +01:00
retrooper d20673cc3e PacketTypeCommon optimized; 2021-11-28 17:01:50 +01:00
retrooper e68f960928 Minor changes to WrapperPlayClientInteractEntity 2021-11-28 16:52:23 +01:00
retrooper 68586850f4 Minor change 2021-11-28 14:24:49 +01:00
retrooper 7c8845e425 Minor remapping optimizations/cleanups 2021-11-28 12:06:01 +01:00
retrooper 66ad7be601 You can now dynamically change a wrapper's version, basically allowing you to transform it to a format of a different version. 2021-11-28 11:30:18 +01:00
retrooper ecfd39825f ItemTypes is fully functioning for all versions. 2021-11-28 11:27:37 +01:00
retrooper 3028b0c0ba Small API changes 2021-11-26 22:24:29 +01:00
retrooper dad68786ce Minor injector bug fixes 2021-11-26 18:24:10 +01:00
retrooper feb94a3982 Fixed issues when you left the server on legacy versions such as 1.8 2021-11-26 17:55:18 +01:00
retrooper 13e0c45b03 Minor fix to injector, still need to work on users leaving while server is running. 2021-11-25 22:33:31 +01:00
retrooper 6078046efa WrapperPlayClientInteractEntity fixed for 1.8.8 servers;
Progress on fixing the ItemType mappings to get it cross version, still working on getting a few items such as MUTTON working
2021-11-25 22:27:18 +01:00
retrooper 0c27a8e793 We fixed ItemStack bugs on older versions 2021-11-25 20:09:12 +01:00
retrooper 27d71dc05d I think we managed to fix item types for versions older than 1.13 2021-11-25 19:47:57 +01:00
retrooper b078b66db9 Removed a few debugs 2021-11-23 21:36:34 +01:00
retrooper bb20f92af8 PacketWrapper#readIdentifier and writeIdentifier created 2021-11-22 20:12:55 +01:00
retrooper 616a4142d2 ComponentSerializer should work on 1.8 2021-11-22 15:38:38 +01:00
retrooper 6e47bbbff6 Trying to have the mapped IDs equivalent to the server version, and not always the IDs of latest server version(1.17.1) 2021-11-21 14:03:03 +01:00
retrooper 01fab2b75e Working on fixing reload issues. 2021-11-20 21:08:10 +01:00
retrooper 09182267c9 We changed some naming conventions, setEntityID -> setEntityId for example;
We now successfully shade and relocate GSON.
2021-11-20 18:51:29 +01:00
retrooper 6b88c08796 Working on supporting transforming item types IDs. Currently not as efficient. 2021-11-19 22:37:28 +01:00
retrooper 485bfbc093 Small bug fixes for hoverEvent 2021-11-19 20:43:26 +01:00
retrooper 82367dd6d6 Fixed HoverEvent and BaseComponent API 2021-11-19 19:09:13 +01:00
retrooper 5bc3597c70 PotionTypes created 2021-11-18 23:01:03 +01:00
retrooper 06113b1cee EntityTypes & EntityType created 2021-11-18 22:15:53 +01:00
retrooper 93c2e4fcd0 Fixed issues when you sent the same wrapper twice. 2021-11-18 19:49:16 +01:00
retrooper c2129f98bb Fixed Plugin message wrappers for 1.12.2 and below 2021-11-18 18:15:10 +01:00
retrooper 896d760236 Small doc changes 2021-11-18 07:10:15 +01:00
retrooper d5adae6be2 Corrected ClientVersion referencing documentation. 2021-11-17 22:10:34 +01:00
retrooper be681c7005 Switched over to GSON JSON API, but still running into some issues 2021-11-15 22:52:44 +01:00
retrooper c9aa7223f0 Corrected max counts of the music disc ItemTypes, added ItemType#isMusicDisc 2021-11-15 12:05:11 +01:00
retrooper 6520e39814 ClientVersion and ServerVersion enum constants now follow java enum conventions and are capitalized. 2021-11-15 00:29:01 +01:00
retrooper 5944174c24 Trying to fix component serialization errors. 2021-11-15 00:18:40 +01:00
retrooper c6202f2a4c Cross version PacketWrapper#readItemStack and PacketWrapper#writeItemStack 2021-11-14 23:50:05 +01:00
retrooper 6c4331a97f All ItemTypes should have the correct maxCount 2021-11-14 23:29:55 +01:00
retrooper 710ace21e4 Updated more maxCounts of ItemTypes, reached ACACIA_SLAB 2021-11-14 23:04:46 +01:00
retrooper dd8119105c Updated more maxCounts of ItemTypes, reached BIRCH_LEAVES 2021-11-14 15:07:53 +01:00
retrooper ecfd5d46f9 Updated more maxCounts of ItemTypes, reached BIRCH_LEAVES 2021-11-14 08:22:21 +01:00
retrooper f88455c011 Updated maxCounts in many ItemTypes, currently at SMOOTH_SANDSTONE_SLAB 2021-11-12 23:17:38 +01:00
retrooper 8250a06d90 Removed debugs 2021-11-12 00:13:49 +01:00
retrooper 710d23dece All ItemTypes added, just need to correct all max amounts!
WrapperPlayServerSetSlot created, but NOT working!
2021-11-12 00:07:42 +01:00
retrooper d23cf6ac1b Commit modified mappings from ProtocolSupport 2021-11-11 18:26:57 +01:00
retrooper 0f1798c7ce We work to support more than just arrays in hover event action values. 2021-11-11 17:07:38 +01:00
retrooper 1e2362aa56 We've got more progress on hover event and click event, many bug fixes, and works better. 2021-11-10 23:04:45 +01:00
retrooper 0a054b88a7 We can successfully send the chat message packet. 2021-11-10 07:17:53 +01:00
retrooper ee8af858b2 Merge remote-tracking branch 'origin/2.0' into 2.0
# Conflicts:
#	bukkit/src/main/java/io/github/retrooper/packetevents/processor/InternalPacketListener.java
2021-11-09 06:57:54 +01:00
retrooper 86f8a440f3 Reverted our wrapper on json.simple;
Testing components
2021-11-09 06:57:34 +01:00
retrooper 4b3069bed9 Fixed JSON stuff 2021-11-08 20:06:26 +01:00
retrooper 4953a7f855 UpdateChecker cleaned up;
Added mapping files
2021-11-08 17:01:00 +01:00
retrooper 2471baf5af NPE bug fix for PacketWrapper#readItemStack usage 2021-11-07 23:43:19 +01:00
retrooper 2f59c0523a Some progress on ItemStack, ItemType and ItemTypes;
Some API refactoring, lots of getIDs converted to getIds
2021-11-07 23:10:51 +01:00
retrooper 88b81b7d51 WrapperPlayServerSpawnPlayer,
WrapperPlayServerVehicleMove created
2021-11-07 21:50:06 +01:00
retrooper 05e445a934 WrapperPlayServerEntityRelativeMove,
WrapperPlayServerEntityLook created
2021-11-07 20:45:54 +01:00
retrooper fa66721f81 WrapperPlayServerEntityRelativeMoveAndLook created 2021-11-07 18:14:35 +01:00
retrooper cfd63c2c1d WrapperPlayServerEntityTeleport,
WrapperPlayServerUpdateViewDistance created
2021-11-07 16:29:36 +01:00
retrooper 4e1b960a06 Removed debugs 2021-11-06 20:36:26 +01:00
retrooper de8ebbdfd0 WrapperPlayServerTabComplete created;
Player attribute system created;
2021-11-06 20:26:31 +01:00
retrooper a4ddf8e3e9 Progress on tab complete 2021-11-05 22:19:07 +01:00
retrooper b47286f947 Working on WrapperPlayServerTabComplete 2021-11-04 22:39:13 +01:00
retrooper af4a9ea590 WrapperPlayServerRespawn optimized; 2021-11-04 07:00:08 +01:00
retrooper c7f25d0c9d WrapperPlayServerRespawn completed, hasn't been tested yet. 2021-11-03 22:50:46 +01:00
retrooper 50aa821110 WrapperPlayServerRespawn almost done 2021-11-02 11:52:56 +01:00
retrooper a35139fddb Progress with WrapperPlayServerRespawn 2021-11-01 15:57:16 +01:00
retrooper be7715fe42 WrapperPlayServerRespawn progress 2021-10-31 23:09:52 +01:00
retrooper 3d9df2118b WrapperPlayServerRespawn created, but no support for older versions than 1.17.1 yet 2021-10-31 22:56:53 +01:00
retrooper 3e3ac32159 WrapperPlayServerPlayerListHeaderAndFooter created 2021-10-31 20:07:15 +01:00
retrooper d089e9dbb0 Some refactoring of a lot of protocol related classes;
WrapperPlayServerSoundEffect created
2021-10-31 19:16:16 +01:00
retrooper e20578b4b7 WrapperPlayServerDisconnect now parses the json message reason! 2021-10-31 10:34:31 +01:00
retrooper 779427702d PacketEvents#build -> PacketEvents#setAPI 2021-10-31 10:18:10 +01:00
retrooper 0a523a93ba WrapperPlayServerEntityHeadLook created;
Color#getByName improved
2021-10-31 10:13:47 +01:00
retrooper 5f3ededf9a Should have fixed all issues in WrapperPlayServerChatMessage;
Color naming issues fixed
2021-10-30 23:06:53 +02:00
retrooper fee52d8931 WrapperPlayServerChatMessage some optimizations 2021-10-30 22:02:50 +02:00
retrooper 3f98b5dc15 We have completed WrapperPlayServerChatMessage and TextComponent and BaseComponent, we might need to look out for errors. 2021-10-30 20:06:04 +02:00
retrooper 5dad71b935 Corrected chat message packet from using a base component to a text component 2021-10-30 18:07:02 +02:00
retrooper e235fe1f46 Fixed a class cast exception when parsing json messages 2021-10-30 17:51:00 +02:00
retrooper c1f99063dd Finished click events. 2021-10-30 17:44:10 +02:00
retrooper 2bb0677cef Color#toString works, ClickEvents progress 2021-10-30 08:25:01 +02:00
retrooper caa004756d ClickEvent class created, not used yet 2021-10-30 07:25:03 +02:00
retrooper 6653fba315 More progress to parsing chat message packet 2021-10-29 22:37:55 +02:00
retrooper 67f64b406c Added missing constructor arguments for some wrappers 2021-10-27 14:42:13 +02:00
retrooper 56f46a1e9e WrapperPlayClientQueryBlockNBT created;
WrapperPlayClientQueryEntityNBT created;
2021-10-27 11:54:39 +02:00
retrooper 348acdedcc Progress on processing chunks on most versions, still need to test lower than 1.16.3 and 1.17+;
Flying packet mappings corrected;
2021-10-27 10:54:47 +02:00
retrooper c6442cdab8 Corrected many incorrect license notices 2021-10-26 22:51:47 +02:00
retrooper 0568ea0c72 Forgot to add license notice to some moroe files. 2021-10-26 22:46:23 +02:00
retrooper 5ba2440a70 Forgot to add license notice to some files. 2021-10-26 22:41:09 +02:00
retrooper 4564ce65e8 Small modification to WrapperPlayClientFlying 2021-10-26 20:26:06 +02:00
retrooper 21585033d9 Flying packets published 2021-10-20 23:06:38 +02:00
retrooper 3cb55fe3ef Flying packets created, some naming and mapping changes of the flying packets; 2021-10-20 23:01:03 +02:00
retrooper d459403bb5 WrapperPlayServerDisplayScoreboard, WrapperPlayServerUpdateScore created 2021-10-17 12:16:38 +02:00
retrooper 47b4b7caa2 Some small cleanup 2021-10-16 23:31:10 +02:00
retrooper 53717ae948 WrapperPlayClientUseItem created;
Direction -> BlockFace
2021-10-15 23:10:58 +02:00
retrooper 8b555c0dbe Fixed NPE with getConnectionState 2021-10-12 16:58:55 +02:00
retrooper 81c1280c20 Fixed getDecoder in early injector with multiple packetevents instances 2021-10-12 16:03:34 +02:00
retrooper 93bb3a6040 We now don't duplicate packetevents APIs 2021-10-12 15:54:38 +02:00
retrooper 67aeae5717 Attempt on supporting multiple packetevents instances 2021-10-12 15:38:06 +02:00
retrooper a1eb97dbe7 Removed all debugs! ViaVersion support added! 2021-10-11 22:34:47 +02:00
retrooper f9ee1e1f87 Got a working encoder with via 2021-10-11 22:28:21 +02:00
retrooper 47580f01a7 Decoder working, we need to call the mc decoder via reflection when Via is present, now time to work on Encoder 2021-10-11 22:08:02 +02:00
retrooper 105e52d5ac Added Via support for decoder, still need to fix encoder. 2021-10-11 19:18:10 +02:00
retrooper d60e7d9e0b Remove redundant method 2021-10-10 21:23:50 +02:00
retrooper 9b9af06f53 Attempt to get a working CustomBukkitEncodeHandlerModern, but we can't ;c, viaversion, why do you have to be so CURSED!!!!111 2021-10-10 21:20:08 +02:00
retrooper 1abf538ecd Publish api module, to allow jitpack to detect it as a sub-module 2021-10-10 18:48:10 +02:00
retrooper 473bb3a1c3 WrapperPlayServerEntityVelocity created 2021-10-10 18:32:41 +02:00
retrooper 49b9b139f2 Maybe fixed build scripts pt.2 2021-10-10 17:58:47 +02:00
retrooper e34e806cad Maybe fixed build scripts? 2021-10-10 17:25:28 +02:00
retrooper 565220fc99 Small changes to build scripts 2021-10-10 17:05:42 +02:00
retrooper b5aaf2fddb Test 2021-10-10 12:30:12 +02:00
retrooper 9df5da312e Removed redundant info in the buildscripts of all subprojects 2021-10-10 11:40:40 +02:00
retrooper 3c3cc88042 Properly generated gradle wrapper 2021-10-10 11:30:28 +02:00
retrooper 397f133751 Wrapper task specified? 2021-10-10 11:21:31 +02:00
retrooper e110acd59c Removed most debug code;
PEVersion#clone fixed
2021-10-10 08:35:46 +02:00
retrooper 4ed541d65d Some project cleanup 2021-10-09 23:12:08 +02:00
retrooper baf1466ee2 Sadly can't use generics to assume Player type at compile time in listeners. 2021-10-09 23:01:18 +02:00
retrooper abf447f5da Updated some links 2021-10-09 20:43:37 +02:00
retrooper c68ae24807 Small correction 2021-10-09 20:35:21 +02:00
retrooper 7b121172fe Tested bukkit implementation, and it works! 2021-10-08 22:18:05 +02:00
retrooper c9eff0f745 Added to gitignore 2021-10-08 21:44:27 +02:00
retrooper 0ae72246c3 More progress on implementing the API in bukkit module 2021-10-08 21:38:57 +02:00
retrooper c1401f0eac Fixed all known errors. Bukkit module fully implemented the api module, now time to test. 2021-10-08 21:21:19 +02:00
retrooper 8ea0c75081 PacketEventsBuilder progress 2021-10-08 18:11:45 +02:00
retrooper e0a101c8db More progress on multi-module project, made bukkit packetevents api builder 2021-10-08 15:36:54 +02:00
retrooper 3162ec6864 Some progress on the multi-module project, bukkit module doesn't compile yet though 2021-10-07 22:08:38 +02:00
retrooper b7a1bfb072 Merge pull request #168 from Conclure/2.0
Fix :D
2021-10-07 20:57:20 +02:00
Conclure c6d8af9024 Fix :D 2021-10-07 20:54:40 +02:00
retrooper 6157ca9e3b Push forgotten files 2021-10-07 20:28:26 +02:00
retrooper 1cde4e16cb Attempting to split project up into modules 2021-10-07 20:25:47 +02:00
retrooper 4bc2d08017 WrapperPlayServerSpawnEntity created;
Redundant comments removed;
2021-10-04 21:53:54 +02:00
retrooper 2511b7f850 WrapperPlayServerEntityStatus created 2021-10-04 18:11:50 +02:00
retrooper 8e283e6a1c Much more WrapperPlayServerEntityMetadata progress 2021-10-03 22:21:09 +02:00
retrooper c29146ee25 Progress on WrapperPlayServerEntityMetadata 2021-10-03 17:22:43 +02:00
retrooper 2840cf3146 WrapperPlayServerEntityProperties created;
WrapperPlayServerPlayerInfo.java bug fix
2021-10-03 15:45:13 +02:00
retrooper 98440415c4 Renamed BlockPosition.java to Vector3i.java 2021-10-03 15:05:13 +02:00
retrooper 44622140af WrapperPlayServerExplosion created 2021-10-03 14:30:59 +02:00
retrooper 463c0920db WrapperPlayServerBlockAction bug fixes and small changes;
WrapperPlayServerBlockBreakAnimation created
2021-10-03 12:57:12 +02:00
retrooper 272f27625e Small corrections for WrapperPlayServerBlockAction;
WrapperPlayServerPlayerInfo finished, but untested;
2021-10-03 12:45:31 +02:00
retrooper 962cb6cd82 More progress on game profile utilities 2021-10-02 20:05:06 +02:00
retrooper 62f60ec815 Merge remote-tracking branch 'origin/2.0' into 2.0 2021-10-02 19:52:18 +02:00
retrooper eaf0a7226f GameProfile utilities completed? 2021-10-02 19:52:00 +02:00
DefineOutside 7585420593 Fix cloning vectors 2021-09-29 13:49:39 -05:00
retrooper 68fe3e214a Still figuring out how to fix our via decoder 2021-09-28 18:35:46 +02:00
retrooper fa43163386 ProtocolSupport works again 2021-09-28 18:03:15 +02:00
retrooper 96625be5b1 Debugs removed 2021-09-27 21:58:46 +02:00
retrooper df3eb01bc6 WrapperPlayClientSettings created;
Hand enum improved
2021-09-27 21:33:05 +02:00
retrooper 7a4092db32 WrapperPlayServerChangeGameState created;
WrapperPlayServerUpdateHealth created
2021-09-27 20:24:52 +02:00
retrooper edda3adead WrapperPlayServerDestroyEntities created;
WrapperPlayServerSetExperience created
2021-09-26 22:17:25 +02:00
retrooper cf6321de5c WrapperPlayServerEntityAnimation created;
Small wrapper API change;
2021-09-26 21:08:53 +02:00
retrooper 2a44f3c0e2 WrapperPlayClientPlayerDigging created 2021-09-26 20:59:57 +02:00
retrooper 500eb55aa7 Some API refactoring;
PacketTypeCommon#getID created;
2021-09-26 19:28:40 +02:00
retrooper e10d5a17c4 Trying to add 1.16.5 support with chunk data packet :c 2021-09-26 15:48:27 +02:00
retrooper f36d1f32b1 Almost finished WrapperPlayServerChunkData 2021-09-26 13:03:29 +02:00
retrooper 0256dc416c Progress with WrapperPlayServerChunkData 2021-09-26 09:11:47 +02:00
retrooper e77e428ba3 Project cleanup with IDE 2021-09-26 00:26:08 +02:00
retrooper 3ad9a75284 Progress for WrapperPlayServerChunkData 2021-09-26 00:24:37 +02:00
retrooper 3355b1c5ab Clientbound packet type mappings for 1.16.2 fixed;
Progress on WrapperPlayServerChunkData;

API refactoring/cleanup
2021-09-25 23:14:34 +02:00
retrooper 9ad33aac0f Progress on via encoder support 2021-09-23 21:25:10 +02:00
retrooper d9ad6bc684 About to start working on supporting ViaVersion with a custom encoder. 2021-09-23 20:58:00 +02:00
retrooper 043dfb5a8b Some API refactoring 2021-09-23 19:55:37 +02:00
retrooper c2a218f067 WrapperPlayServerChunkData is being recoded;
1.17 PacketType server-sided mappings corrected
2021-09-23 18:46:35 +02:00
retrooper 2aefd88e5e WrapperPlayServerChunkData is being recoded;
1.17 PacketType server-sided mappings corrected
2021-09-23 18:33:38 +02:00
retrooper 87223f8df1 Many methods in ServerManager now static 2021-09-22 21:19:49 +02:00
retrooper 794ad6b042 Progress on WrapperPlayServerChunkData 2021-09-22 20:40:24 +02:00
retrooper 0105d466bb PacketWrapper#writeTag created 2021-09-22 18:39:11 +02:00
retrooper 9e28502620 More progress on WrapperPlayServerChunkData 2021-09-22 18:20:17 +02:00
DefineOutside c958999476 Make ServerManager.getVersion() static 2021-09-21 17:29:23 -05:00
DefineOutside 903e0bdc3d Replace PacketWrapperUtil 2021-09-21 17:23:35 -05:00
DefineOutside 408d35b25b Fix block action ID 2021-09-21 16:31:42 -05:00
DefineOutside 01cf822f67 Block action wrapper 2021-09-21 16:18:46 -05:00
DefineOutside 055750e49e Unload chunk wrapper 2021-09-21 15:57:41 -05:00
DefineOutside 088aa9b81b Remove duplicate serverbound window confirmation packet 2021-09-21 15:52:58 -05:00
DefineOutside 1008f88f23 Merge remote-tracking branch 'origin/2.0' into 2.0
# Conflicts:
#	src/main/java/io/github/retrooper/packetevents/wrapper/play/client/WrappedGameClientWindowConfirmation.java
#	src/main/java/io/github/retrooper/packetevents/wrapper/play/server/WrappedGameServerWindowConfirmation.java
2021-09-21 15:43:23 -05:00
DefineOutside 0e4ca3554e Add the window confirmation packet 2021-09-21 15:43:06 -05:00
DefineOutside 221b901a81 Optimize ServerVersion 2021-09-21 15:09:44 -05:00
retrooper 3b3e0ad377 Progress on WrapperPlayServerChunkData, but not near done 2021-09-21 19:53:03 +02:00
retrooper 2b3145f497 WrapperPlayClientAdvancementTab created 2021-09-20 23:02:50 +02:00
retrooper 32bc08b986 WrapperPlayClientPickItem created 2021-09-20 22:47:06 +02:00
retrooper 834adb48eb WrapperPlayClientWindowConfirmation created 2021-09-20 22:36:05 +02:00
retrooper 5403ce9d44 WrapperPlayClientTabComplete, WrapperPlayClientPlayerAbilities created 2021-09-20 22:24:23 +02:00
retrooper 80910efb00 WrapperPlayClientTeleportConfirm, WrapperPlayClientLockDifficulty created 2021-09-19 22:27:41 +02:00
retrooper 5cadf1224f WrapperPlayClientNameItem created 2021-09-19 22:09:36 +02:00
retrooper fa804557ed ClientVersion#isResolved typo fixed 2021-09-19 22:03:35 +02:00
retrooper dbd6efc987 ClientVersion never resolving issue fixed 2021-09-19 21:59:25 +02:00
retrooper 03f02079d8 WrapperPlayClientEntityAction created 2021-09-19 21:57:50 +02:00
retrooper 54ef96eaa1 Got some progress on our legacy handlers. 2021-09-19 19:53:08 +02:00
retrooper 7343cf757b Now supporting legacy ViaVersion releases 2021-09-19 19:33:53 +02:00
retrooper fb69f34821 Removed debugs 2021-09-19 18:33:29 +02:00
retrooper f50464956b WrapperPlayClientCloseWindow, WrapperPlayClientSelectTrade, WrapperPlayClientSetDifficulty created 2021-09-19 18:33:05 +02:00
retrooper 71886b503e WrapperPlayClientSteerBoat and WrapperPlayClientVehicleMove created 2021-09-19 16:14:42 +02:00
retrooper 7606445e1e WrapperPlayClientClickWindow created 2021-09-19 16:03:13 +02:00
retrooper 774a48103b Stopped following vanilla mapping namings and started following wiki.vg's packet namings. 2021-09-19 13:36:15 +02:00
retrooper a9469fed78 WrapperGameClientClientStatus created 2021-09-18 22:13:58 +02:00
retrooper 6e5787a9e1 Removed debugs 2021-09-18 21:45:36 +02:00
retrooper 0654796f82 Removed ProtocolLib redundant dependency in build.gradle 2021-09-18 21:43:33 +02:00
retrooper 63ddd56507 ProtocolSupport support added 2021-09-18 21:10:12 +02:00
retrooper ac12d94448 Paper injector removed. 2021-09-18 20:56:15 +02:00
retrooper 9f845173de ProtocolLib support added!!!!! 2021-09-18 20:49:29 +02:00
retrooper 1aa9bde676 Second attempt at ProtocolLib hook, but we get spammed with errors 2021-09-18 20:42:48 +02:00
retrooper 8c06f24cf4 Attempt at ProtocolLib hook, but we get an illegal access error :O 2021-09-18 18:54:47 +02:00
retrooper a6625b0325 Got stuff working, but we face a ProtocolLib incompatibility 2021-09-18 14:00:18 +02:00
retrooper 106b74d901 Removed ProtocolLib stuff 2021-09-18 13:32:33 +02:00
retrooper 7b7d51dcee PacketReceiveEvent and PacketSendEvent support constructors with ConnectionState specified to optimize always looking them up in the map 2021-09-18 13:29:26 +02:00
retrooper 53012ee386 Third attempt to support Via, need to figure out why CustomBukkitDecodeHandler isn't receiving any bytebufs? 2021-09-18 13:23:09 +02:00
retrooper dcf1b7a6d8 Revert "Attempt to support ViaVersion, obviously not complete, working on fixing issues."
This reverts commit b2294d405e.
2021-09-18 13:05:23 +02:00
retrooper 49cdc7bf79 Revert "Second attempt to support Via, packets still end up being larger than the server expects?"
This reverts commit 8abf92420a.
2021-09-18 13:05:15 +02:00
retrooper 8abf92420a Second attempt to support Via, packets still end up being larger than the server expects? 2021-09-17 22:04:06 +02:00
retrooper b2294d405e Attempt to support ViaVersion, obviously not complete, working on fixing issues. 2021-09-17 19:27:23 +02:00
retrooper 5d708e3195 Add NBT abstraction (not used yet) 2021-09-14 21:49:16 +02:00
retrooper dde3a49925 We came this far, when leaving the server an exception is thrown, ProtocolLib just floods us with errors, this caused more issues than before, we might have to go with the Via like approach if via is available. 2021-09-14 21:45:47 +02:00
retrooper 639abb53ff Cleanup 2021-09-14 21:02:12 +02:00
retrooper 7a511eec7c Fixed issues with all wrappers. 2021-09-14 20:16:06 +02:00
retrooper 05e7b33376 ProtocolLib incompatibilities partially fixed, we still need to handle disconnection index out of bounds errors and ViaVersion's attempt at PLIB support 2021-09-14 17:51:18 +02:00
retrooper 2d8b10888d Our decoder is finally behind ViaVersion, just facing ProtocolLib incompatibilities 2021-09-14 17:23:29 +02:00
retrooper 4fdaece1df PacketWrapper#readItemStack progress, but not done, it only supports clients that have same protocol version as the server 2021-09-10 23:00:52 +02:00
retrooper 6bce3cc847 Some changes (lazy to document) 2021-09-07 17:44:57 +02:00
retrooper b8c9760275 Lots of refactoring;
Documented some wrappers;
Working on PacketWrapper#readItemStack;
Import optimization;
Code cleanup
2021-09-06 13:34:21 +02:00
retrooper 7c0c845a3d WrapperGameClientResourcePackStatus created 2021-09-04 01:19:47 +02:00
retrooper 678adda106 WrapperGameClientHeldItemChange created 2021-09-04 01:01:39 +02:00
retrooper 180a7cd505 WrapperGameServerDisconnect created 2021-09-04 00:54:57 +02:00
retrooper 68f0053b9b WrapperGameServerSpawnLivingEntity created, but incomplete, We need to make our own EntityType enum. (and map all ids per version);
Small fixing in PacketTypes, cleaned up some duplicate types.
2021-09-04 00:39:38 +02:00
retrooper 5139f8a38f Removed debugs. 2021-09-03 19:16:33 +02:00
retrooper 68ff049691 ServerManager#receivePacket works better now. 2021-09-03 19:13:55 +02:00
retrooper 30836c6714 ServerManager#receivePacket works, but has a performance cost. 2021-09-03 18:53:56 +02:00
retrooper 1ce86f7e63 Realized the build issue was jitpack's fault 2021-09-03 17:23:31 +02:00
retrooper ec4f44f215 Trying to fix build issues for jitpack pt. 4 2021-09-03 17:19:29 +02:00
retrooper 3b48c18e9a Trying to fix build issues for jitpack pt. 3 2021-09-03 17:17:02 +02:00
retrooper db3a6e3076 Trying to fix build issues for jitpack pt. 3 2021-09-03 17:16:48 +02:00
retrooper 4848a4c078 Trying to fix build issues for jitpack pt. 2 2021-09-03 17:15:13 +02:00
retrooper 8f550a67d6 Trying to fix build issues for jitpack 2021-09-03 17:12:45 +02:00
retrooper fb01545c1b All wrappers from now on must be sendable.
Still need to work on sending client-sided packets.
2021-09-03 15:49:12 +02:00
retrooper 2f572dc3ac Made the client-side wrappers sendable. 2021-09-03 15:19:31 +02:00
retrooper da8126d62e Small cleanup 2021-09-03 14:33:40 +02:00
retrooper c3993c3e6e PacketEventsSettings#lock removed; 2021-09-03 14:30:49 +02:00
retrooper 587fb09f4d All wrappers can now modify data. Created setters for all current wrappers. 2021-09-03 14:18:10 +02:00
retrooper dc6b457e2d PacketSendEvent#getPostTask created 2021-09-01 15:07:47 +02:00
retrooper 64606f5cb8 Worked on 1.7.10 handlers. Still need to test them. 2021-08-31 22:53:05 +02:00
retrooper eca616f9a9 Added required license notices for each file. 2021-08-31 22:41:07 +02:00
retrooper 4f25bfcde3 PacketSendEvent actually gets cancelled in our modern encoder. 2021-08-31 22:07:02 +02:00
retrooper 03a437fb7f Corrected the credit. We give credit to all projects that help build up our cross-version injector. 2021-08-31 20:40:47 +02:00
retrooper 9e4a56e936 Optimize all imports. 2021-08-31 20:26:41 +02:00
retrooper b39f3daf97 PlayerManager#sendPacket now works with ProtocolSupport;
PacketListener and PacketListenerReflect exist;
2021-08-31 20:23:51 +02:00
retrooper 158d2a9ea9 WrapperGameClientChatMessage#setMessage created, not efficient, but works for now;
WrapperGameServerChatMessage bug fix;
2021-08-31 10:55:38 +02:00
retrooper 96c53be358 Injector fixed for 1.11.2 server versions and lower. 2021-08-29 14:20:35 +02:00
retrooper 56459dcf5a We are having issues on 1.9 with our injector. About to do changes.
WrapperGameClientSetBeaconEffect created;
2021-08-29 13:30:40 +02:00
retrooper 5c370d13ae Small cleanup; 2021-08-29 11:34:07 +02:00
retrooper ed61e4f968 PacketWrapper#readString cleanups 2021-08-29 11:02:37 +02:00
retrooper e23fdc09b9 Wrappers support a constructor taking in an event. 2021-08-29 10:57:17 +02:00
retrooper f6ca0e0ec4 WrapperGameServerChatMessage created; 2021-08-28 23:04:53 +02:00
retrooper bec616d924 Worked on sendable wrapper abstraction;
ByteBufAbstract#writeBytes(byte[]) created;

WrapperGameServerHeldItemChange created;

All other clientbound wrappers are now sendable.
2021-08-28 20:38:52 +02:00
retrooper 1b03192d09 We now support processing packets while ProtocolSupport is present. Sending packets while ProtocolSupport is present doesn't seem to work. 2021-08-28 18:18:00 +02:00
retrooper 9b455654c7 Reverted to a working commit. 2021-08-27 09:40:33 +02:00
retrooper 1af9dde7bb Working on supporting sending packets. We currently get a decoderexception. 2021-08-27 09:34:07 +02:00
retrooper fcb607399d Revert "ProtocolSupport support added, but we are still behind protocolsupport until we receive the handshake packet unfortunately, would be great if we could always be before them."
This reverts commit dae2419cef.
2021-08-27 09:25:07 +02:00
retrooper d181269171 Revert "Working on supporting sending packets. We currently get a decoderexception."
This reverts commit 130d711640.
2021-08-26 23:08:39 +02:00
retrooper cb6d7d96b3 Revert "Added some debugs to our injector, considering changing our injection approach."
This reverts commit 3ffdc6aa79.
2021-08-26 23:08:12 +02:00
retrooper 3ffdc6aa79 Added some debugs to our injector, considering changing our injection approach. 2021-08-26 10:46:36 +02:00
retrooper 130d711640 Working on supporting sending packets. We currently get a decoderexception. 2021-08-25 22:36:29 +02:00
retrooper dae2419cef ProtocolSupport support added, but we are still behind protocolsupport until we receive the handshake packet unfortunately, would be great if we could always be before them. 2021-08-25 21:06:34 +02:00
retrooper b4e2eb76b5 Encoder bug fix. 2021-08-25 17:09:56 +02:00
retrooper e4768096b2 Project code cleanup with IDE (Optimize imports, etc);
Added legacy netty import (1.7.10 spigots) support to our decoders and encoders.
2021-08-25 17:01:52 +02:00
retrooper 505531f8e5 Created lots of netty abstraction. 2021-08-25 16:04:09 +02:00
retrooper 47f5768474 EventManager cleanup;
GlobalChannelInjector fixed;
2021-08-25 10:40:38 +02:00
retrooper 898c4a1a40 WrapperGameClientInteractEntity created;
Some debugs removed;
compatInjector setting removed;
2021-08-25 10:22:35 +02:00
retrooper 57e6beb904 Our encoder and decoder are officially working. 2021-08-25 09:07:37 +02:00
retrooper e09080436b Working on some stuff. 2021-08-24 22:13:30 +02:00
retrooper 6862cda387 Some progress on supporting the decompressor with our decoder. 2021-08-24 19:58:24 +02:00
retrooper 5c4ac0a0fa Small cleanup 2021-08-24 16:40:54 +02:00
retrooper 8e577eedf0 Sort of reverted the encoder and decoder to their initial form. 2021-08-24 15:42:19 +02:00
retrooper 442d171cfc Encoder pretty empty 2021-08-24 15:16:45 +02:00
retrooper df85c00175 Did some testing, did not manage to complete encoder, reverting some stuff. 2021-08-24 13:39:26 +02:00
retrooper 3af610bb73 Progress on encoder, we can finally successfully switch to the game state, now we need to work on processing game packets, some are compressed, some aren't. 2021-08-24 12:38:26 +02:00
retrooper 2708f00556 Working on our decoder and encoder, many changes, this is not stable. Just a progress/safety commit. 2021-08-23 22:25:59 +02:00
retrooper 510a5a8d09 Corrections 2021-08-23 21:14:47 +02:00
retrooper 2b184e6ce7 Small change. 2021-08-23 14:39:43 +02:00
retrooper a68df54ffe Some bug fixing. 2021-08-23 14:33:09 +02:00
retrooper a8233b492a Worked on fixing our decoder, still working on fixing our encoder. 2021-08-22 22:22:22 +02:00
retrooper 20cbdef83c PacketType.Game.Server optimized 2021-08-22 13:46:52 +02:00
retrooper 13a1ae1069 Small build.gradle cleanup 2021-08-22 10:22:16 +02:00
retrooper 7fd63d30c9 PacketListenerPriority renamed to Priority 2021-08-22 09:18:43 +02:00
retrooper 6396545364 PacketType abstraction reverted and modified. This is the better approach. 2021-08-22 09:16:29 +02:00
retrooper d7b03dd947 Revert "PacketType abstraction improved, still need to test."
This reverts commit a1d20a7b7c.
2021-08-22 09:14:56 +02:00
retrooper a1d20a7b7c PacketType abstraction improved, still need to test. 2021-08-22 00:12:10 +02:00
retrooper 433c49e6be Some small cleanup 2021-08-22 00:02:01 +02:00
retrooper 3eea564cba Hopefully got rid of the IDE specific files and gradle build files. 2021-08-21 23:49:31 +02:00
retrooper a6b6ade573 MinecraftReflection cleanup 2021-08-21 22:35:41 +02:00
retrooper 70658b952c PacketType.Handshaking.Client.LEGACY_SERVER_LIST_PING created 2021-08-21 22:33:15 +02:00
retrooper 2b8130d2e7 Event abstraction cleanup;
PacketListenerPriority refactored;
2021-08-21 21:51:34 +02:00
retrooper 969d218519 Documented more wrappers. 2021-08-21 20:47:31 +02:00
retrooper af7f7baa57 Started documenting some server-bound game wrappers. 2021-08-20 22:15:41 +02:00
retrooper 387e521019 Cleaned up MinecraftReflection; Deleted some unneeded classes 2021-08-20 21:55:12 +02:00
retrooper 0da5ddbe6c Progress on encoder, only status packets can be listened to, made some samples and some corrections to our code. 2021-08-20 16:56:52 +02:00
retrooper cfa1c4c076 All wrapper's constructors are now consistent;
PacketType#Play -> PacketType#Game;
PacketState#PLAY -> PacketState#GAME
2021-08-17 08:13:44 +02:00
retrooper 9460812be5 WrapperGameClientAnimation corrected; 2021-08-16 22:53:34 +02:00
retrooper a2c4ffc1a9 WrapperGameClientAnimation created;
WrapperGameClientClickWindowButton created;
WrapperGameClientGenerateStructure created;

WrapperLoginClientEncryptionResponse fixed;
WrapperLoginClientPluginResponse fixed;
2021-08-16 22:45:34 +02:00
retrooper 260c67ba8d Merge remote-tracking branch 'origin/2.0' into 2.0 2021-08-16 21:55:17 +02:00
retrooper 8c41a24bb7 Added missing ClientboundPacketType_1_12 2021-08-16 21:54:19 +02:00
retrooper 60399cfb01 Corrected credit in README 2021-08-16 08:47:45 +00:00
retrooper 3294495bda Merge branch '2.0' of https://github.com/retrooper/packetevents into 2.0 2021-08-14 20:53:08 +02:00
retrooper 1583b1e0a3 New attempt at encoder. 2021-08-14 20:51:44 +02:00
retrooper 7f635d46e1 Update README.md 2021-08-14 14:14:06 +02:00
retrooper 55b38b499a Finished client-bound packet types. Still need to test. 2021-08-13 21:18:50 +02:00
retrooper 8b13cd2dad Calling via's decoder doesn't work? 2021-08-12 12:18:57 +02:00
retrooper fa824c9ebd Attempt at encoder, does not work, trying something else. 2021-08-12 11:38:44 +02:00
retrooper c418ddfd1c Lots of project cleanup. 2021-08-11 20:26:30 +02:00
retrooper c753839df7 Progress to server-bound packet types. 2021-08-11 19:23:17 +02:00
retrooper ae1df7e2a1 Fixed some PacketType confusion. 2021-08-11 14:33:11 +02:00
retrooper b341df4098 Small cleanup, still some confusion with 1.16.5 and 1.16.4 having some different packet ids? 2021-08-11 13:56:49 +02:00
retrooper 9339bdb428 More cleanup to PacketTypes 2021-08-11 13:40:22 +02:00
retrooper 8d79248c0b All serverbound packet types finished. Need to work on clientbound PLAY ones. 2021-08-11 13:34:13 +02:00
retrooper 140b432364 PacketType abstraction and cleanup, still need to test 2021-08-11 12:12:53 +02:00
retrooper 75e45dbc52 Removed some gradle files hopefully 2021-08-11 11:48:26 +02:00
retrooper 63c6207d71 PacketType bug fix;
Add .gradle to gitignore
2021-08-11 11:46:58 +02:00
retrooper b6dd3e0e82 Remove .idea files 2021-08-11 11:04:09 +02:00
retrooper dca5fc6a4b Custom decoder should now work on 1.7.10 too. 2021-08-11 11:02:57 +02:00
retrooper a0765b7169 Merge remote-tracking branch 'abhi289/dev' into 2.0
# Conflicts:
#	.gradle/7.0/executionHistory/executionHistory.bin
#	.gradle/7.0/executionHistory/executionHistory.lock
#	.gradle/7.0/fileHashes/fileHashes.bin
#	.gradle/7.0/fileHashes/fileHashes.lock
#	.gradle/7.0/javaCompile/classAnalysis.bin
#	.gradle/buildOutputCleanup/buildOutputCleanup.lock
#	.gradle/checksums/checksums.lock
#	src/main/java/io/github/retrooper/packetevents/packetwrappers/play/out/setslot/WrappedPacketOutSetSlot.java
#	src/main/java/io/github/retrooper/packetevents/packetwrappers/play/out/spawnentityliving/WrappedPacketOutSpawnEntityLiving.java
2021-08-11 10:36:33 +02:00
retrooper ea7b9b432a Serverbound packet types finished. 2021-08-11 10:28:11 +02:00
retrooper 4c57e37807 "Bad packet xyz" issue, still need to fix, check via discord 2021-08-10 23:16:11 +02:00
retrooper fc526ae232 ViaVersion now works with packetevents on paper! Need to test on spigot and need to test older via versions and add protocolsupport support. 2021-08-10 22:29:06 +02:00
retrooper dc46c8b5ea Back to old replacing injector, we need to try initialize our channelinitializer BEFORE viaversion. 2021-08-10 21:05:22 +02:00
retrooper 5f78d2d059 PacketSplitter replacing attempt when making a decoder did NOT WORK :c 2021-08-10 20:45:20 +02:00
retrooper 0cf894567f Removed debug 2021-08-10 10:58:01 +02:00
retrooper 651c4a9955 Small adjustments to the decoder, we realized we are receiving invalid packets and passing invalid packets onto the next handlers. We need to figure out why we are getting invalid packets. 2021-08-09 17:52:16 +02:00
retrooper 9bfab5d899 Small cleanup 2021-08-09 10:04:15 +02:00
retrooper 99b24b7ad1 Working on injector with ViaVersion support. We get a ViaVersion exception 2021-08-08 13:44:40 +02:00
retrooper db9025dcea Progress working on injector. 2021-08-08 12:08:58 +02:00
retrooper b3729ad078 WrapperLoginServerLoginSuccess corrected;
WrapperGameClientKeepAlive completed;
WrapperGameClientPong completed;
WrapperGameClientSpectate completed;
2021-08-06 14:48:32 +02:00
retrooper 709812d307 WrapperGameClientChatMessage complete 2021-08-05 23:22:02 +02:00
retrooper fd7f0282a5 WrapperGameClientUpdateSign finished 2021-08-05 23:03:29 +02:00
retrooper 39be921ae8 Fixed issues with PluginMessage wrappers 2021-08-05 13:37:28 +02:00
retrooper d1c9d55158 Some exception refactoring 2021-08-05 12:09:20 +02:00
retrooper 0f887d3e7e Some refactoring and cleaning up, some recoding. 2021-08-05 12:08:24 +02:00
retrooper 67a89e2578 Few renamings 2021-08-05 11:55:12 +02:00
retrooper 038933e978 All login and status wrappers created 2021-08-05 11:34:51 +02:00
retrooper ca2003b644 Some changes 2021-08-05 08:41:58 +02:00
retrooper d68e69ffdf Improved some wrappers. 2021-08-05 07:21:21 +02:00
abhiram555 db1b73ca6e Wrote few wrappers for client login 2021-08-05 01:15:08 +05:30
abhiram555 e69739be72 Added Client Ping Packet Wrapper 2021-08-05 00:39:36 +05:30
abhiram555 c33681e3be Fix PacketDecodeEvent cancelling 2021-08-05 00:07:04 +05:30
retrooper 7c04d9ea7c WrapperLoginClientLoginStart finished 2021-08-04 20:33:47 +02:00
retrooper b97454dbde Merge branch 'dev' of https://github.com/abhiram555/packetevents into abhi-dev 2021-08-04 19:52:24 +02:00
abhiram555 1ba5442d0c Fixed Lagacy decoder too 2021-08-04 23:21:58 +05:30
abhiram555 7e59b91723 Added a packet wrapper for CustomPayload 2021-08-04 23:18:23 +05:30
abhiram555 9b88efec36 Properly fix the decoder 2021-08-04 22:59:32 +05:30
abhiram555 9678ef523a Fix the decoder 2021-08-04 22:06:30 +05:30
retrooper fe3664e8fa Attempt to create some bytebuf wrappers, they don't really work. Did some API cleanup, removed deprecations. 2021-08-04 11:13:10 +02:00
retrooper 3ed2656935 Deleted many classes, looking to recode most of them or just remove them. They aren't needed anymore. Working with new bytebuf system. 2021-08-03 22:52:40 +02:00
retrooper dc354330fb Build changes 2021-08-03 21:45:01 +02:00
retrooper 24cefaeeff Small cleanup, trying to find issue with weird values from bytebufs (when you haven't reloaded) 2021-08-03 18:49:56 +02:00
retrooper 897d7d035d Duplicate the bytebuf for PacketDecodeEvent so the next handler doesn't end up with an empty bytebuf 2021-08-03 18:05:00 +02:00
retrooper b4132946c9 Build issues? 2021-08-03 16:57:16 +02:00
retrooper 7e3a2a2875 Early injector duplicate decoder issue fixed 2021-08-03 16:55:15 +02:00
retrooper c28e8cd732 Small changes 2021-08-03 15:35:59 +02:00
retrooper e39e86966c Added getPlayer to PacketDecodeEvent, applied ByteBufAbstract, Still need to test 2021-08-03 13:40:42 +02:00
retrooper 90b2f6444d ByteBuf abstraction finished, now time to apply it. 2021-08-03 13:03:47 +02:00
retrooper 8a754af137 Progress on ByteBuf abstraction so we can support both 1.7.10 and newer versions. 2021-08-03 11:17:07 +02:00
abhiram555 340e10ff6d Remove .gradle 2021-08-02 20:58:06 +05:30
abhiram555 37517af695 Project Cleanup 2021-08-02 20:32:21 +05:30
abhiram555 33fcf6105a Project Cleanup 2021-08-02 20:17:50 +05:30
abhiram555 8cf9af3024 Project files cleanup 2021-08-02 20:15:49 +05:30
abhiram555 eed8409e4b Added PacketDecoder on lagacy minecraft 2021-08-02 20:12:29 +05:30
abhiram555 bd193e4be2 Removed IJ files 2021-08-02 16:19:40 +05:30
abhiram555 87c73392eb Added PacketDecodeEvent for modern minecraft version's 2021-08-02 16:18:51 +05:30
1507 changed files with 2976593 additions and 24963 deletions

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
[*.java]
indent_style = space
indent_size = 4
ij_continuation_indent_size = 8
ij_java_names_count_to_use_import_on_demand = 9999
ij_java_class_count_to_use_import_on_demand = 9999
+1
View File
@@ -0,0 +1 @@
.gitea/CODEOWNERS linguist-detectable=false
+3
View File
@@ -0,0 +1,3 @@
# Pull requests request review from the eligible staff team(s).
# One approval from either an Admin or Developer satisfies branch protection.
* @trueog/Admins @trueog/Developers
+1 -3
View File
@@ -1,5 +1,3 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: retrooper
custom: ['https://paypal.me/retrooperdev']
github: [retrooper]
+15 -18
View File
@@ -1,7 +1,7 @@
---
name: Bug report
about: Report a bug to help us fix
title: "[BUG REPORT]"
about: Report bugs to help us improve our software.
title: ""
labels: bug
assignees: ''
@@ -10,11 +10,21 @@ assignees: ''
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
**Software brand**
Please let us know what software you are using.
Eg. Spigot 1.18.2, Paper 1.18.2, Tuinity 1.18.2, Pufferfish 1.18.2, etc...
Make sure to mention the version of the software.
**Plugins**
Please give us a list of your plugins. Sometimes we run into incompatibilities. Having an overview of the plugins on your server can really help identify the problem quicker.
Eg. ViaVersion, ProtocolLib, HolographicDisplays
You may also provide a screenshot.
**How To Reproduce**
Steps to reproduce the behavior:
*Example:*
1. Login on the 1.16.4 minecraft client.
2. Join the server while it is still starting up.
1. Join with the 1.18.2 vanilla minecraft client.
2. Spam
3. ....
4. See error
@@ -24,18 +34,5 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**About your server (please complete the following information):**
- Spigot: [eg. Paper or Tuinity]
We only accept reports that are reproducible
on one of the supported spigots.
- Server Version: [eg. 1.16.4]
Feel free to report bugs for versions newer than 1.7.10, even if we
don’t support them yet, but be aware that we might have already
found the bug and fixed it in a dev build, just before you reported it.
Please don’t get frustrated in such cases.
- Plugins List if possible: [eg. ViaVersion, ProtocolLib, HolographicDisplays]
**Additional context**
Add any other context about the problem here.
+56 -19
View File
@@ -1,6 +1,3 @@
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
name: Gradle Package
on: [ push, pull_request ]
@@ -11,23 +8,63 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- uses: actions/checkout@v5
- name: Build with Gradle
run: gradle :clean :build
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v5
- name: Upload build artifacts
uses: actions/upload-artifact@v1
with:
name: packetevents-dev-build.jar
path: build/libs
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Gradle
run: chmod +x gradlew && ./gradlew build
- name: Upload build artifacts api
uses: actions/upload-artifact@v4
with:
name: api-build
path: build/libs/packetevents-api-*.jar
- name: Upload build artifacts spigot
uses: actions/upload-artifact@v4
with:
name: spigot-build
path: build/libs/packetevents-spigot-*.jar
- name: Upload build artifacts netty-common
uses: actions/upload-artifact@v4
with:
name: netty-common-build
path: build/libs/packetevents-netty-common-*.jar
- name: Upload build artifacts bungeecord
uses: actions/upload-artifact@v4
with:
name: bungeecord-build
path: build/libs/packetevents-bungeecord-*.jar
- name: Upload build artifacts velocity
uses: actions/upload-artifact@v4
with:
name: velocity-build
path: build/libs/packetevents-velocity-*.jar
- name: Upload build artifacts fabric
uses: actions/upload-artifact@v4
with:
name: fabric-build
path: build/libs/packetevents-fabric-*.jar
- name: Upload build artifacts sponge
uses: actions/upload-artifact@v4
with:
name: sponge-build
path: build/libs/packetevents-sponge-*.jar
+51
View File
@@ -0,0 +1,51 @@
name: Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: Publish Release
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v5
- name: Setup java 21
uses: actions/setup-java@v5
with:
java-version: 21
distribution: temurin
- name: Prepare gradle
run: ./gradlew printVersion --no-daemon
- name: Extract changelog
id: changelog
run: |
OUTPUT_DELIMITER="$(uuidgen)"
echo "changelog<<$OUTPUT_DELIMITER" >> "$GITHUB_OUTPUT"
# extract tag name and use it to get changelog section
TAG_NAME="v$(./gradlew -q --no-daemon printVersion)"
awk -v tag="${TAG_NAME}" '
$1 == "!!!!!" && $2 == tag {found=1; next}
$1 == "!!!!!" && found {exit}
found
' CHANGELOG.md >> "$GITHUB_OUTPUT"
# end output
echo "$OUTPUT_DELIMITER" >> "$GITHUB_OUTPUT"
- name: Publish plugin
env:
GITHUB_API_TOKEN: ${{ github.token }}
MODRINTH_API_TOKEN: ${{ secrets.MODRINTH_PUBLISH_TOKEN }}
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
run: ./gradlew publishMods --no-daemon -PnoDryPublish
+98 -85
View File
@@ -1,78 +1,18 @@
#
# JetBrains
#
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
/.idea
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iml
*.ipr
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
#
# Java
#
# Compiled class file
*.class
@@ -82,9 +22,6 @@ fabric.properties
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
@@ -97,21 +34,97 @@ fabric.properties
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
#
# Maven
#
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar
/src/main/resources/
/.gradle/
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
.gradle
build/
bin/
# Ignore Gradle GUI config
gradle-app.setting
# Cache of project
.gradletasknamecache
**/build/
# Common working directory
run/
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
/src/main/resources/plugin.yml
/.idea/
/build/
.vscode/
.project
.settings/
.classpath
# Build Source Kotlin
/buildSrc/.kotlin/
.env
+451
View File
@@ -0,0 +1,451 @@
!!!!! v2.11.2
# PacketEvents 2.11.2 is finally out! 🎉
This update fixes various bugs. It's encouraged that users update.
Again, huge thanks to all users who have donated their hard-earned money to PacketEvents since the previous release. It's been received & it's very much appreciated.
Recent donors: PebbleHost, SSomar1607, ipavdev, Suleyman Abulkhasan, frap
Also, thanks to the contributors that made this update possible.
If you intend on donating and do not wish to be mentioned, please add such a note on your donation.
# Announcement 📢⚠️
Visit our website: https://packetevents.com\
Documentation: https://docs.packetevents.com\
JavaDocs: https://javadocs.packetevents.com\
I've released a new YouTube [video](https://youtu.be/G7qYRHpZVIo).
## What's Changed (Summary)
* Fixed SynchronizedRegistriesHandler issues
* Fixed various equality/nullability issues with Registry values
* Explicitly specify 'Locale#ROOT' for all String#toLowerCaser() calls
* Removed 'end skylight' for 1.21.8 and below
* Log warning message when failing to uninject from velocity initializer
* Recommend release builds (and fallback to development builds) to users who run outdated software.
* Add 'CHAIN' to the 'CHAINS' tag
* Add new offset(Blockface face, int i) method to Vector3f/d/i classes
* Fixed 'infiniburn' tag parsing for 1.18.1 and older
* Fixed unexpected NPE if bukkit entity is null during unsafe lookup
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.11.1...v2.11.2
## If you want to support PacketEvents, consider donating to us on [PayPal](https://paypal.me/retrooperdev) or sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper).
## Maven/Gradle Dependency Setup Guide
**Check it out**: https://docs.packetevents.com/introduction/development-setup/
!!!!! v2.11.1
# PacketEvents 2.11.1 is finally out! 🎉
This update fixes various bugs. It's encouraged that users update.
Thanks to all users who donated after the previous release announcement. It's been received & it's appreciated.
Recent donors: TrekCraft, 3add, Vadim Soudé
If you intend on donating and do not wish to be mentioned, please add such a note on your donation.
# Brief Announcement 📢⚠️
### Visit our website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Fixed 'Can't resolve 'minecraft:day' in 'minecraft:timeline' for V_1_21_11'
* Fixed decoding & encoding for WrapperLoginServerPluginRequest & WrapperLoginClientPluginResponse
* Improve StateTypes testing
* Added system property packetevents.debug.nbt-codec-trace
* Fixed Sound Codec
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.11.0...v2.11.1
## If you want to support PacketEvents, consider donating to us on [PayPal](https://paypal.me/retrooperdev) or sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.11.0
# PacketEvents 2.11.0 is finally out! 🎉
This update adds support for Minecraft 1.21.11.
# Brief Announcement 📢⚠️
### Visit our website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Added support for Minecraft 1.21.11
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.10.1...v2.11.0
## If you want to support PacketEvents, consider donating to us on [PayPal](https://paypal.me/retrooperdev) or sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.10.1
# PacketEvents 2.10.1 is finally out! 🎉
This update includes some bug fixes.
# Brief Announcement 📢⚠️
### Visit our website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Fixed for certain particle types on 1.21.9 & 1.21.10 Minecraft
* Fixed the bee's component on 1.21.9 & 1.21.10 Minecraft
* Correction of 'mul' calculation in LpVector3d
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.10.0...v2.10.1
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.10.0
# PacketEvents 2.10.0 is finally out! 🎉
This update includes critical bug fixes & minor additions to the API.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Added 1.21.9 & 1.21.10 support
* Various bug fixes (such as TPS reading, PlayerModelType reading/writing, and more)
* Update adventure API
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.9.5...v2.10.0
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.9.5
# PacketEvents 2.9.5 is out now! 🎉
This update includes critical bug fixes & minor additions to the API.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Injector bug fix (for Spigot)
* WolfVariant issue fixed
* Chunk Data error fixed
* NBT tag issues fixed
* Direction Y/Z axis being swapped fixed
* Added WrappedBlockState to constructor of WrapperPlayServerBlockChange
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.9.4...v2.9.5
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.9.4
# PacketEvents 2.9.4 is out now! 🎉
This update includes minor bug fixes & minor additions to the API.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Added SpigotConversionUtil#getEntityMetadata to retrieve metadata from a Bukkit entity.
* Fixed outdated 1.8 Spigot forks from being unable to load on PacketEvents.
* Fixed WrapperPlayServerWorldBorder for versions lower than 1.12.
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.9.3...v2.9.4
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.9.3
# PacketEvents 2.9.3 is out now! 🎉
This is an update that adds support for Minecraft 1.21.8 server builds.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Added support for 1.21.8 Minecraft server builds.
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.9.2...v2.9.3
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.9.2
# PacketEvents 2.9.2 is out now! 🎉
This is a patch update that fixes issues with UserLoginEvent (which previously contained null user data) and with importing Adventure serializers.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed (Summary)
* Added support for 1.7.2+ Minecraft protocol (useful for proxies)
* Fixed UserLoginEvent. It is now (always) triggered by PlayerJoinEvent to prevent User instances from containing null data.
* Fixed importing Adventure serializers.
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.9.1...v2.9.2
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.9.1
# PacketEvents 2.9.1 is out now! 🎉
This is a hotfix patch update to fix issues with 2.9.0 release assets. See below for the 2.9.0 changelog.
### New update now supports Minecraft version 1.21.6 & 1.21.7. We suggest that you update, as numerous bugs have been fixed.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed? (Summary)
* Added 1.21.6 support
* Added 1.21.7 support
* Bug fixes
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.8.0...v2.9.1
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.9.0
# PacketEvents 2.9.0 is out now! 🎉
### New update now supports Minecraft version 1.21.6 & 1.21.7. We suggest that you update, as numerous bugs have been fixed.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed? (Summary)
* Added 1.21.6 support
* Added 1.21.7 support
* Bug fixes
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.8.0...v2.9.0
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.8.0
# PacketEvents 2.8.0 is out now! 🎉
### New update now supports Minecraft version 1.21.5. Please update, as numerous bugs have been fixed.
# Brief Announcement 📢⚠️
### We have our very own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed? (Summary)
* Added 1.21.5 support
* Various bugs fixed
**View Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.7.0...v2.8.0
## Contributors 🏅
This update wouldn't be possible without these contributors ❤️: @booky10, @Axionize, @Bram1903, @ManInMyVan, @ytnoos,
@AoElite, @HaHaWTH, @divinepablo, @scienziatopazzo, @bridgelol, @MachineBreaker, @Luuzzi, @Beaness, @Rubenicos, @Loyisa
## New Contributors
* @HaHaWTH made their first contribution in https://github.com/retrooper/packetevents/pull/1097
* @divinepablo made their first contribution in https://github.com/retrooper/packetevents/pull/1098
* @scienziatopazzo made their first contribution in https://github.com/retrooper/packetevents/pull/1105
* @bridgelol made their first contribution in https://github.com/retrooper/packetevents/pull/1199
* @Luuzzi made their first contribution in https://github.com/retrooper/packetevents/pull/1197
* @Beaness made their first contribution in https://github.com/retrooper/packetevents/pull/1212
* @Rubenicos made their first contribution in https://github.com/retrooper/packetevents/pull/1162
* @Loyisa made their first contribution in https://github.com/retrooper/packetevents/pull/1220
## If you want to support PacketEvents, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.7.0
# PacketEvents v2.7.0 is out now! 🎉
### New update with support of the latest Minecraft version. In addition to that, countless bugs were fixed.
# Brief Announcement 📢⚠️
### We have our own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed? (Summary)
* Added 1.21.4 support
* Fix: Potion contents item component for 1.21.2/1.21.3
* Fix: NPC objects to have unique server team names
* Add missing ServerVersion#V_1_9_1
* Validation checks added for window click type
**Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.6.0...v2.7.0
## New Contributors
* @Axionize made their first contribution in https://github.com/retrooper/packetevents/pull/1048
* @ShreyasAyyengar made their first contribution in https://github.com/retrooper/packetevents/pull/1044
* @mfnalex made their first contribution in https://github.com/retrooper/packetevents/pull/1076
## Contributors 🏅
This update wouldn't be possible without these contributors ❤️: @booky10, @rafi67000, @ShreyasAyyengar, @AoElite,
@Tecnio, @Axionize, @mfnalex
### If you want to support PacketEvents, and any upcoming events we plan for the future, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!! v2.6.0
# PacketEvents v2.6.0 is out now! 🎉
### New update with support of new platforms & the latest Minecraft version. In addition to that, countless bugs were fixed.
# Brief Announcement 📢⚠️
### We have our own website: https://packetevents.com
### Documentation: https://docs.packetevents.com
### JavaDocs: https://javadocs.packetevents.com
## What's Changed? (Summary)
* 1.21.2 and 1.21.3 Minecraft support
* Sponge support added
* Fabric support added (also server-side)
* Utilizing the proper bStats API
* Registry element issues fixed
* Mappings issues fixed
* AdvancedSlimePaper issues fixed
* BungeeCord issues fixed
### **Full Changelog**: https://github.com/retrooper/packetevents/compare/v2.5.0...v2.6.0
## Contributors 🏅
This update wouldn't be possible without these contributors ❤️: @booky10, @ManInMyVan, @SamB440, @rafi67000, @Bram1903,
@AbhigyaKrishna
### If you want to support PacketEvents, and any upcoming events we plan for the future, consider sponsoring us on [GitHub Sponsors](https://github.com/sponsors/retrooper)
## Maven/Gradle Dependency
### **Check out**: https://docs.packetevents.com/getting-started
!!!!!
+32 -19
View File
@@ -1,27 +1,40 @@
# packetevents
<!--suppress HtmlDeprecatedAttribute -->
<div align="center">
<h2><i>PacketEvents</i></h2>
<h3>PacketEvents is a protocol library tailored to Minecraft Java Edition, designed to facilitate the processing and transmission of packets.</h3>
<a href="https://github.com/retrooper/packetevents/actions"><img src="https://img.shields.io/github/actions/workflow/status/retrooper/packetevents/gradle-publish.yml?style=for-the-badge&logo=github"></a>
<a href="https://discord.gg/DVHxPPxHZc"><img src="https://img.shields.io/discord/721686193061888071?color=5562e9&logo=discord&logoColor=white&style=for-the-badge"></a>
<img src="https://img.shields.io/github/license/retrooper/packetevents?style=for-the-badge&logo=github">
<a href="https://bstats.org/plugin/bukkit/packetevents/11327"><img src="https://img.shields.io/bstats/servers/11327?style=for-the-badge"></a>
<a href="https://github.com/retrooper/packetevents/releases"><img src="https://img.shields.io/github/downloads/retrooper/packetevents/total.svg?style=for-the-badge&logo=github"></a>
</div>
<h3>Resources</h3>
[![](https://img.shields.io/badge/License-GPLv3-yellow.svg)](https://github.com/retrooper/packetevents/blob/dev/LICENSE)
[![](https://jitpack.io/v/retrooper/packetevents.svg)](https://jitpack.io/#retrooper/packetevents)
- [Read documentation](https://docs.packetevents.com/)
- [Getting Started](https://docs.packetevents.com/development-setup)
- [JavaDocs](https://javadocs.packetevents.com)
- [Releases](https://github.com/retrooper/packetevents/releases/)
- [Modrinth](https://modrinth.com/plugin/packetevents)
- [GitHub](https://github.com/retrooper/packetevents/releases/)
- [SpigotMC](https://www.spigotmc.org/resources/packetevents-api.80279/)
- [Development Builds](https://ci.codemc.io/job/retrooper/job/packetevents)
- [Statistics](https://bstats.org/plugin/bukkit/packetevents/11327)
PacketEvents is an open-source Packet API. It has many cross-version packet-wrappers. You can process incoming and outgoing packets on the server. You can even send packets with our packet-wrappers. We are here to save you a ton of time.
<h3>Sponsors</h3>
### Resources
* [SpigotMC](https://www.spigotmc.org/resources/packetevents-api.80279/)
* [JavaDoc](https://packetevents.github.io/javadocs)
* [Discord](https://discord.me/packetevents)
<i>Thanks to the following sponsors for supporting this project:</i>
### Setup
[Learn more](https://github.com/retrooper/packetevents/wiki/1.-Setup)
<a href="https://pebblehost.com"><img src="https://pebblehost.com/src/img/logos/main-old.png" width=150><br>
### Contributing/Forking
[Learn more](https://github.com/retrooper/packetevents/wiki/2.-Contributing-and-Forking)\
Our discord server has a role for contributors and forkers.
<a href="https://www.ej-technologies.com"><img src="https://www.ej-technologies.com/images/product_banners/jprofiler_small.png"><br>
### Sponsorships
[![](https://www.ej-technologies.com/images/product_banners/jprofiler_small.png)](https://www.ej-technologies.com/products/jprofiler/overview.html)
<h3>Credits</h3>
### Statistics
PacketEvents collects statistics anonymously using bStats. It helps give us an overview of what platforms use our project. If you really don't like, you can turn it off.
<i>Here are some projects that we are heavily inspired by, thus we have integrated</i>\
<i>small portions of their code into our work.</i>
### Credit
PacketEvents uses an injector that is extremely similar to ViaVersion's injector. I have included license and copyright holder notice in the files taken from ViaVersion. Thank you ViaVersion.
[Protocol Documentation for the Minecraft Java Edition](https://minecraft.wiki/w/Minecraft_Wiki:Projects/wiki.vg_merge/Protocol)\
[ViaVersion](https://github.com/ViaVersion/ViaVersion)\
[ProtocolSupport](https://github.com/ProtocolSupport/ProtocolSupport)\
[adventure](https://github.com/KyoriPowered/adventure)\
[MCProtocolLib](https://github.com/GeyserMC/MCProtocolLib/)
+93
View File
@@ -0,0 +1,93 @@
import com.github.retrooper.compression.strategy.dir.JsonBase64DataDirStrategy
import com.github.retrooper.compression.strategy.dir.JsonRegistryCompressionDirStrategy
import com.github.retrooper.compression.strategy.dir.JsonToNbtDirStrategy
import com.github.retrooper.excludeAdventure
plugins {
packetevents.`shadow-conventions`
packetevents.`library-conventions`
`mapping-compression`
`pe-version`
}
// papermc repo + disableAutoTargetJvm needed for mockbukkit
repositories {
maven("https://repo.papermc.io/repository/maven-public/")
}
java {
withJavadocJar()
}
dependencies {
compileOnlyApi(libs.bundles.adventure)
compileOnlyApi(libs.bundles.adventure.serializers)
implementation(libs.adventure.api)
api(project(":patch:adventure-text-serializer-gson", "shadow")) {
excludeAdventure()
}
api(libs.adventure.text.serializer.legacy) {
excludeAdventure()
}
compileOnly(libs.gson)
}
mappingCompression {
mappingDirectory = rootDir.resolve("mappings")
outDirectory = project.layout.buildDirectory.dir("mappings/generated/assets/mappings")
with<JsonToNbtDirStrategy> {
compress("data")
}
with<JsonBase64DataDirStrategy> {
compress("item_base_components")
}
with<JsonRegistryCompressionDirStrategy> {
compress("registries")
}
}
tasks {
assemble {
setDependsOn(dependsOn.filterNot { it == "shadowNoAdventure" })
}
javadoc {
mustRunAfter(generateVersionsFile)
}
sourcesJar {
mustRunAfter(generateVersionsFile)
}
withType<JavaCompile> {
dependsOn(generateVersionsFile)
}
processResources {
dependsOn(compressMappings)
from(project.layout.buildDirectory.dir("mappings/generated").get())
}
generateVersionsFile {
packageName = "com.github.retrooper.packetevents.util"
}
shadowJar {
exclude {
val path = it.path
path.startsWith("net/kyori") && !path.startsWith("net/kyori/adventure/text/serializer") && !path.startsWith(
"net/kyori/option"
)
}
}
}
publishing {
publications {
named<MavenPublication>("shadow") {
artifact(tasks["javadocJar"])
}
}
}
@@ -0,0 +1,38 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents;
import org.jetbrains.annotations.ApiStatus;
public final class PacketEvents {
private static PacketEventsAPI<?> API;
//Put these variable names anywhere else, they are really only for the injectors
@ApiStatus.Internal
public static String IDENTIFIER, ENCODER_NAME, DECODER_NAME, CONNECTION_HANDLER_NAME, SERVER_CHANNEL_HANDLER_NAME,
TIMEOUT_HANDLER_NAME;
public static PacketEventsAPI<?> getAPI() {
return API;
}
public static void setAPI(PacketEventsAPI<?> api) {
API = api;
}
}
@@ -0,0 +1,91 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents;
import com.github.retrooper.packetevents.event.EventManager;
import com.github.retrooper.packetevents.injector.ChannelInjector;
import com.github.retrooper.packetevents.manager.player.PlayerManager;
import com.github.retrooper.packetevents.manager.protocol.ProtocolManager;
import com.github.retrooper.packetevents.manager.server.ServerManager;
import com.github.retrooper.packetevents.netty.NettyManager;
import com.github.retrooper.packetevents.settings.PacketEventsSettings;
import com.github.retrooper.packetevents.util.LogManager;
import com.github.retrooper.packetevents.util.PEVersion;
//Note: The PEVersions class is generated. Refer to PEVersionTask.kt
import com.github.retrooper.packetevents.util.PEVersions;
import com.github.retrooper.packetevents.util.updatechecker.UpdateChecker;
import java.util.logging.Logger;
public abstract class PacketEventsAPI<T> {
private final EventManager eventManager = new EventManager();
private final PacketEventsSettings settings = new PacketEventsSettings();
private final UpdateChecker updateChecker = new UpdateChecker();
private final LogManager logManager = new LogManager();
private static final Logger LOGGER = Logger.getLogger(PacketEventsAPI.class.getName());
public EventManager getEventManager() {
return eventManager;
}
public PacketEventsSettings getSettings() {
return settings;
}
public UpdateChecker getUpdateChecker() {
return updateChecker;
}
public PEVersion getVersion() {
//Note: The PEVersions class is generated by the auto-version task. Refer to PEVersionTask.kt
return PEVersions.CURRENT;
}
public Logger getLogger() {
return LOGGER;
}
public LogManager getLogManager() {
return logManager;
}
public abstract void load();
public abstract boolean isLoaded();
public abstract void init();
public abstract boolean isInitialized();
public abstract void terminate();
public abstract boolean isTerminated();
public abstract T getPlugin();
public abstract ServerManager getServerManager();
public abstract ProtocolManager getProtocolManager();
public abstract PlayerManager getPlayerManager();
public abstract NettyManager getNettyManager();
public abstract ChannelInjector getInjector();
}
@@ -0,0 +1,28 @@
package com.github.retrooper.packetevents.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.Documented;
/**
* Marks an API element as obsolete and makes this information available
* at runtime via reflection. Use in conjunction with an IDE-recognized
* annotation like @ApiStatus.Obsolete if IDE warnings are also desired.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD}) // Adjust targets as needed
public @interface RuntimeObsolete {
/**
* Specifies in which version the API became obsolete.
* Should generally match the value in the corresponding @ApiStatus.Obsolete annotation.
*/
String since() default "";
/**
* Optional: Add a reason or replacement suggestion.
*/
String reason() default "";
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,23 +16,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event.eventtypes;
package com.github.retrooper.packetevents.event;
import io.github.retrooper.packetevents.event.PacketEvent;
import io.github.retrooper.packetevents.event.PacketListenerAbstract;
import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent;
import org.jspecify.annotations.NullMarked;
/**
* The {@link PacketEvent} implements this interface.
* Every inbuilt event should implement the {@link #call(PacketListenerAbstract)} method.
* Every inbuilt event should implement the {@link #call(PacketListenerCommon)} method.
* If you are making a custom event, don't implement this.
* The {@link PacketListenerAbstract#onPacketEventExternal(PacketEvent)} method is called for every event that is not in-built.
* The {@link PacketListenerCommon#onPacketEventExternal(PacketEvent)} method is called for every event that is not in-built.
* including custom events.
*
* @author retrooper
* @see PacketPlayReceiveEvent
* @since 1.8
*/
@NullMarked
public interface CallableEvent {
void call(PacketListenerAbstract listener);
default void call(PacketListenerCommon listener) {
listener.onPacketEventExternal((PacketEvent) this);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event.eventtypes;
package com.github.retrooper.packetevents.event;
import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
/**
* Every event that supports cancellation should implement this interface.
@@ -26,11 +26,11 @@ import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent;
* in deciding whether the event will cancel.
* This means an event with a lower priority than the higher priority one would not be able to decide.
* Cancelling the event means the action assosiated with the event will be cancelled.
* For example, cancelling the {@link PacketPlayReceiveEvent}
* For example, cancelling the {@link PacketReceiveEvent}
* will prevent minecraft from processing the incoming packet.
*
* @author retrooper
* @see PacketPlayReceiveEvent
* @see PacketReceiveEvent
* @since 1.7
*/
public interface CancellableEvent {
@@ -0,0 +1,185 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.exception.InvalidHandshakeException;
import org.jetbrains.annotations.Nullable;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.logging.Level;
/**
* Class for event managing. Implements both, internal and API methods.
*
* @apiNote It is highly recommended to register the event listeners at server start-up,
* without frequent modifications during runtime, since this class needs to recalculate all of
* its event listeners during any modifications. In other words, it assumes that reads (events fired)
* greatly outnumber writes (listeners modifications). If your case requires frequent listener modifications,
* open a pull request on GitHub and describe your case.
*
* @author retrooper
* @author ShadowOfHeaven (optimization)
*
*/
public class EventManager {
//Using a ConcurrentHashMap is faster and more secure here, compared to Collections.synchronizedMap(new EnumMap<>(PacketListenerPriority.class))
//This is mainly due to:
//1. On each modification Collections.synchronizedMap synchronizes the whole Map object, while ConcurrentHashMap only it's internal, currently modified Node
//2. ConcurrentHashMap won't fail in a multi-thread environment, while Collections.synchronizedMap is said to have a lot of potential problems,
//being a generalized method for synchronization
private final Map<PacketListenerPriority, Set<PacketListenerCommon>> listenersMap = new ConcurrentHashMap<>();
//Since reads greatly outnumber writes, create an array for the best possible iteration time
//Updated as a whole on writes, no index modifications are allowed
private volatile PacketListenerCommon[] listeners = new PacketListenerCommon[0];
/**
* Call the PacketEvent.
* This method processes the event on all the registered dynamic packet event listeners.
* The {@link PacketListenerPriority#LOWEST} prioritized listeners will be processing first,
* the {@link PacketListenerPriority#MONITOR} will be processing last and can
* be the final decider whether the event has been cancelled or not.
*
* @param event {@link PacketEvent}
*/
public void callEvent(PacketEvent event) {
callEvent(event, null);
}
/**
* Call the PacketEvent.
* This method processes the event on all the registered dynamic packet event listeners.
* The {@link PacketListenerPriority#LOWEST} prioritized listeners will be processing first,
* the {@link PacketListenerPriority#MONITOR} will be processing last and can
* be the final decider whether the event has been cancelled or not.
*
* @param event {@link PacketEvent}
* @param postCallListenerAction The action to be run after all the listeners have finished processing
*/
public void callEvent(PacketEvent event, @Nullable Runnable postCallListenerAction) {
for (PacketListenerCommon listener : listeners) {
try {
event.call(listener);
} catch (Exception t) {
// ignore handshake exceptions
if (t.getClass() != InvalidHandshakeException.class && (t.getCause() == null || t.getCause().getClass() != InvalidHandshakeException.class)) {
PacketEvents.getAPI().getLogger().log(Level.WARNING, "PacketEvents caught an unhandled exception while calling your listener.", t);
}
}
if (postCallListenerAction != null) {
postCallListenerAction.run();
}
}
// For performance reasons, we don't want to re-encode the packet if it's not needed.
if (event instanceof ProtocolPacketEvent && !((ProtocolPacketEvent) event).needsReEncode()) {
((ProtocolPacketEvent) event).setLastUsedWrapper(null);
}
}
/**
* Register the dynamic packet event listener.
*
* @param listener {@link PacketListenerCommon}
* @param priority {@link PacketListenerPriority}
*/
public PacketListenerCommon registerListener(PacketListener listener, PacketListenerPriority priority) {
PacketListenerCommon packetListenerAbstract = listener.asAbstract(priority);
return registerListener(packetListenerAbstract);
}
/**
* Register the dynamic packet event listener.
*
* @param listener {@link PacketListenerCommon}
*/
public PacketListenerCommon registerListener(PacketListenerCommon listener) {
this.registerListenerNoRecalculation(listener);
this.recalculateListeners();
return listener;
}
/**
* Register multiple dynamic packet event listeners with one method.
*
* @param listeners {@link PacketListenerCommon}
*/
public PacketListenerCommon[] registerListeners(PacketListenerCommon... listeners) {
for (PacketListenerCommon listener : listeners) {
this.registerListenerNoRecalculation(listener);
}
this.recalculateListeners();
return listeners;
}
public void unregisterListener(PacketListenerCommon listener) {
if (this.unregisterListenerNoRecalculation(listener)) this.recalculateListeners();
}
public void unregisterListeners(PacketListenerCommon... listeners) {
boolean modified = false;
for (PacketListenerCommon listener : listeners) {
modified |= this.unregisterListenerNoRecalculation(listener);//OR - at least one of these needs to be true to return true, meaning the boolean will permanently stay true if once set so
}
if (modified) this.recalculateListeners();
}
/**
* Unregister all dynamic packet event listeners.
*/
public void unregisterAllListeners() {
this.listenersMap.clear();
synchronized (this) {//like booky10 said, the synchronization is necessary here
this.listeners = new PacketListenerCommon[0];
}
}
//Needs to be synchronized in order to avoid race conditions (for example where the 'listeners' variable
//is overridden by its non-up-to-date value, simply because it finished a bit later than the most recent update)
private void recalculateListeners() {
synchronized (this) {
List<PacketListenerCommon> list = new ArrayList<>();
//adds from LOWEST to MONITOR, so in the correct order
for (PacketListenerPriority priority : PacketListenerPriority.values()) {
Set<PacketListenerCommon> set = this.listenersMap.get(priority);
if (set != null) list.addAll(set);
}
this.listeners = list.toArray(new PacketListenerCommon[0]);
}
}
//Internal registration methods, specifically separated for lesser overhead when registering an array of Listeners
private void registerListenerNoRecalculation(PacketListenerCommon listener) {
Set<PacketListenerCommon> listenerSet = this.listenersMap.computeIfAbsent(listener.getPriority(), p -> new CopyOnWriteArraySet<>());
listenerSet.add(listener);
}
//Returns true if the listener was removed, so a modification occurred
private boolean unregisterListenerNoRecalculation(PacketListenerCommon listener) {
Set<PacketListenerCommon> listenerSet = this.listenersMap.get(listener.getPriority());
return listenerSet != null && listenerSet.remove(listener);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,10 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event;
package com.github.retrooper.packetevents.event;
import io.github.retrooper.packetevents.event.eventtypes.CallableEvent;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.util.TimeStampMode;
import org.jspecify.annotations.NullMarked;
/**
* An event in both of PacketEvents' event systems.
@@ -27,8 +29,26 @@ import io.github.retrooper.packetevents.event.eventtypes.CallableEvent;
* @author retrooper
* @since 1.2.6
*/
@NullMarked
public abstract class PacketEvent implements CallableEvent {
private long timestamp = System.currentTimeMillis();
private final long timestamp;
public PacketEvent() {
TimeStampMode timeStampMode = PacketEvents.getAPI().getSettings()
.getTimeStampMode();
switch (timeStampMode) {
case MILLIS:
timestamp = System.currentTimeMillis();
break;
case NANO:
timestamp = System.nanoTime();
break;
//AKA NONE:
default:
timestamp = 0L;
}
}
/**
* Timestamp of when the PacketEvent was created.
@@ -40,20 +60,7 @@ public abstract class PacketEvent implements CallableEvent {
return timestamp;
}
/**
* Setter for the timestamp.
*
* @param timestamp Packet timestamp in milliseconds.
*/
public void setTimestamp(final long timestamp) {
this.timestamp = timestamp;
}
public void callPacketEventExternal(final PacketListenerAbstract listener) {
public void callPacketEventExternal(PacketListenerCommon listener) {
listener.onPacketEventExternal(this);
}
public boolean isInbuilt() {
return false;
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,24 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event.annotation;
package com.github.retrooper.packetevents.event;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This is what you override your event listener with on the old event system.
* You can specify the event priority of the listener method.
*
* @author retrooper
* @since 1.0
* @deprecated Was used for the old event system, the new one doesn't need this anymore.
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Deprecated
public @interface PacketHandler {
byte priority() default 2; //NORMAL priority value
}
@@ -0,0 +1,73 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
public interface PacketListener {
default PacketListenerAbstract asAbstract(PacketListenerPriority priority) {
return new PacketListenerAbstract(priority) {
@Override
public void onUserConnect(UserConnectEvent event) {
PacketListener.this.onUserConnect(event);
}
@Override
public void onUserLogin(UserLoginEvent event) {
PacketListener.this.onUserLogin(event);
}
@Override
public void onUserDisconnect(UserDisconnectEvent event) {
PacketListener.this.onUserDisconnect(event);
}
@Override
public void onPacketReceive(PacketReceiveEvent event) {
PacketListener.this.onPacketReceive(event);
}
@Override
public void onPacketSend(PacketSendEvent event) {
PacketListener.this.onPacketSend(event);
}
@Override
public void onPacketEventExternal(PacketEvent event) {
PacketListener.this.onPacketEventExternal(event);
}
};
}
default void onUserConnect(UserConnectEvent event) {
}
default void onUserLogin(UserLoginEvent event) {
}
default void onUserDisconnect(UserDisconnectEvent event) {
}
default void onPacketReceive(PacketReceiveEvent event) {
}
default void onPacketSend(PacketSendEvent event) {
}
default void onPacketEventExternal(PacketEvent event) {
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,20 +16,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.utils.google;
package com.github.retrooper.packetevents.event;
import com.google.common.base.Optional;
public class GoogleOptionalUtils {
public static Object getOptionalValue(Object opt) {
return ((Optional<?>) opt).get();
public abstract class PacketListenerAbstract extends PacketListenerCommon {
public PacketListenerAbstract(PacketListenerPriority priority) {
super(priority);
}
public static Object getOptionalEmpty() {
return Optional.absent();
public PacketListenerAbstract() {
super();
}
public static Object getOptional(Object value) {
return Optional.of(value);
@Override
public void onPacketReceive(PacketReceiveEvent event) {
}
@Override
public void onPacketSend(PacketSendEvent event) {
}
}
@@ -0,0 +1,64 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
/**
* Abstract packet listener.
*
* @author retrooper
* @since 1.8
*/
public abstract class PacketListenerCommon {
private final PacketListenerPriority priority;
public PacketListenerCommon(PacketListenerPriority priority) {
this.priority = priority;
}
public PacketListenerCommon() {
this.priority = PacketListenerPriority.NORMAL;
}
public PacketListenerPriority getPriority() {
return priority;
}
public void onUserConnect(UserConnectEvent event) {
}
public void onUserLogin(UserLoginEvent event) {
}
public void onUserDisconnect(UserDisconnectEvent event) {
}
void onPacketReceive(PacketReceiveEvent event) {
}
void onPacketSend(PacketSendEvent event) {
}
public void onPacketEventExternal(PacketEvent event) {
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event;
package com.github.retrooper.packetevents.event;
/**
* The priority of packet listeners affect the order they will be invoked in.
@@ -30,8 +30,7 @@ package io.github.retrooper.packetevents.event;
*/
public enum PacketListenerPriority {
/**
* Listener is of very low importance.
* This listener will be ran first.
* This listener will be run first and has little say in the outcome of events.
*/
LOWEST,
@@ -41,8 +40,11 @@ public enum PacketListenerPriority {
LOW,
/**
* Default listener priority.
* Listener is neither important nor unimportant and may run normally.
* The normal listener priority.
* If possible, always pick this.
* It allows other projects to easily overturn your decisions.
* Moreover, it is pretty bold to assume that your project should
* always have the final say.
*/
NORMAL,
@@ -52,13 +54,13 @@ public enum PacketListenerPriority {
HIGH,
/**
* Listener is of critical importance and wants to decide the cancellation of an event.
* Listener is of critical importance. Use this to decide the final state of packets.
*/
HIGHEST,
/**
* Listener is purely trying to decide the cancellation of an event.
* This listener should be ran last.
* Only use this priority if you want to perform logic based on the outcome of an event.
* Please do not modify packets in this stage.
*/
MONITOR;
@@ -0,0 +1,61 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.PacketSide;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketReceiveEvent extends ProtocolPacketEvent {
protected PacketReceiveEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(PacketSide.CLIENT, channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketReceiveEvent(
int packetID, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetID, packetType, serverVersion,
channel, user, player, byteBuf);
}
@Override
public void call(PacketListenerCommon listener) {
listener.onPacketReceive(this);
}
@Override
public PacketReceiveEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketReceiveEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
}
@@ -0,0 +1,78 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.PacketSide;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
@NullMarked
public class PacketSendEvent extends ProtocolPacketEvent {
private @Nullable List<Runnable> tasksAfterSend = null;
protected PacketSendEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(PacketSide.SERVER, channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketSendEvent(
int packetID, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetID, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public void call(PacketListenerCommon listener) {
listener.onPacketSend(this);
}
public List<Runnable> getTasksAfterSend() {
if (tasksAfterSend == null) {
tasksAfterSend = new ArrayList<>();
}
return tasksAfterSend;
}
public boolean hasTasksAfterSend() {
return tasksAfterSend != null && !tasksAfterSend.isEmpty();
}
@Override
public PacketSendEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketSendEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,23 +16,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event.eventtypes;
package com.github.retrooper.packetevents.event;
import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
/**
* Every event that has an associated player is recommended to implement this interface.
*
* @author retrooper
* @see PacketPlayReceiveEvent
* @since 1.6.9
*/
@NullMarked
public interface PlayerEvent {
/**
* Associated player.
*
* @return Player.
*/
Player getPlayer();
<T> @UnknownNullability T getPlayer();
}
@@ -0,0 +1,263 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.exception.InvalidDisconnectPacketSend;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.netty.buffer.UnpooledByteBufAllocationHelper;
import com.github.retrooper.packetevents.netty.channel.ChannelHelper;
import com.github.retrooper.packetevents.protocol.ConnectionState;
import com.github.retrooper.packetevents.protocol.PacketSide;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.player.User;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.ArrayList;
import java.util.List;
@NullMarked
public abstract class ProtocolPacketEvent extends PacketEvent implements PlayerEvent, CancellableEvent, UserEvent {
private final int packetID;
private final PacketTypeCommon packetType;
private ServerVersion serverVersion;
private final Object channel;
private final ConnectionState connectionState;
private final User user;
private @UnknownNullability Object player;
private Object byteBuf;
private boolean cancel;
private @Nullable PacketWrapper<?> lastUsedWrapper;
private @Nullable List<Runnable> postTasks = null;
private boolean cloned;
private boolean needsReEncode = PacketEvents.getAPI().getSettings().reEncodeByDefault();
public ProtocolPacketEvent(
PacketSide packetSide, Object channel, User user,
@UnknownNullability Object player, Object byteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
this.channel = channel;
this.user = user;
this.player = player;
if (autoProtocolTranslation || user.getClientVersion() == null) {
this.serverVersion = PacketEvents.getAPI().getServerManager().getVersion();
} else {
this.serverVersion = user.getPacketVersion().toServerVersion();
}
this.byteBuf = byteBuf;
int size = ByteBufHelper.readableBytes(byteBuf);
if (size == 0) {
throw new PacketProcessException("Trying to process a packet, but it has no content. (Size=0)");
}
try {
this.packetID = ByteBufHelper.readVarInt(byteBuf);
} catch (Exception e) {
throw new PacketProcessException("Failed to read the Packet ID of a packet. (Size: " + size + ")");
}
ClientVersion version = serverVersion.toClientVersion();
this.connectionState = packetSide == PacketSide.CLIENT ? user.getDecoderState() : user.getEncoderState();
PacketTypeCommon packetType = PacketType.getById(packetSide, this.connectionState, version, this.packetID);
if (packetType == null) {
// mojang messed up and keeps sending disconnect packets in the wrong protocol state
if (PacketType.getById(packetSide, ConnectionState.PLAY, version, packetID) == PacketType.Play.Server.DISCONNECT) {
throw new InvalidDisconnectPacketSend();
}
throw new PacketProcessException("Failed to map the Packet ID " + packetID + " to a PacketType constant. Bound: " + packetSide.getOpposite() + ", Connection state: " + user.getDecoderState() + ", Server version: " + serverVersion.getReleaseName());
}
this.packetType = packetType;
}
public ProtocolPacketEvent(
int packetID, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) {
this.channel = channel;
this.user = user;
this.player = player;
this.serverVersion = serverVersion;
this.byteBuf = byteBuf;
this.packetID = packetID;
this.packetType = packetType;
this.connectionState = (packetType != null && packetType.getSide() == PacketSide.SERVER)
? user.getEncoderState() : user.getDecoderState();
this.cloned = true;
}
public void markForReEncode(boolean needsReEncode) {
this.needsReEncode = needsReEncode;
}
public boolean needsReEncode() {
return needsReEncode;
}
public boolean isClone() {
return cloned;
}
public Object getChannel() {
return channel;
}
public SocketAddress getAddress() {
return ChannelHelper.remoteAddress(this.channel);
}
/**
* <strong>WARNING:</strong> This doesn't support local addresses or unix sockets.
*/
public InetSocketAddress getSocketAddress() {
return (InetSocketAddress) this.getAddress();
}
@Override
public User getUser() {
return user;
}
@Override
public <T> @UnknownNullability T getPlayer() {
return (T) player;
}
@Deprecated
@ApiStatus.Internal
public void setPlayer(Object player) {
this.player = player;
}
/**
* Gets the connection state this packet has been sent/received in.
*/
public ConnectionState getConnectionState() {
return connectionState;
}
@Deprecated
public ClientVersion getClientVersion() {
return user.getClientVersion();
}
@Deprecated
public void setClientVersion(ClientVersion clientVersion) {
PacketEvents.getAPI().getLogManager().debug("Setting client version with deprecated method " + clientVersion.getReleaseName());
user.setClientVersion(clientVersion);
}
public ServerVersion getServerVersion() {
return serverVersion;
}
@Deprecated
public void setServerVersion(ServerVersion serverVersion) {
this.serverVersion = serverVersion;
}
public Object getByteBuf() {
return byteBuf;
}
public void setByteBuf(Object byteBuf) {
this.byteBuf = byteBuf;
}
public int getPacketId() {
return packetID;
}
public PacketTypeCommon getPacketType() {
return packetType;
}
@Deprecated
public String getPacketName() {
return ((Enum<?>) packetType).name();
}
@Override
public boolean isCancelled() {
return this.cancel;
}
@Override
public void setCancelled(boolean val) {
this.cancel = val;
}
@Nullable
public PacketWrapper<?> getLastUsedWrapper() {
return lastUsedWrapper;
}
public void setLastUsedWrapper(@Nullable PacketWrapper<?> lastUsedWrapper) {
this.lastUsedWrapper = lastUsedWrapper;
}
public List<Runnable> getPostTasks() {
if (postTasks == null) {
postTasks = new ArrayList<>();
}
return postTasks;
}
public boolean hasPostTasks() {
return postTasks != null && !postTasks.isEmpty();
}
@Override
public ProtocolPacketEvent clone() {
return this instanceof PacketReceiveEvent ? ((PacketReceiveEvent) this).clone()
: ((PacketSendEvent) this).clone();
}
public void cleanUp() {
if (isClone()) {
ByteBufHelper.release(byteBuf);
}
}
public Object getFullBufferClone() {
byte[] data = ByteBufHelper.copyBytes(getByteBuf());
Object buffer = UnpooledByteBufAllocationHelper.buffer();
ByteBufHelper.writeVarInt(buffer, getPacketId());
ByteBufHelper.writeBytes(buffer, data);
return buffer;
}
}
@@ -0,0 +1,94 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
import com.github.retrooper.packetevents.event.simple.*;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
public abstract class SimplePacketListenerAbstract extends PacketListenerCommon {
public SimplePacketListenerAbstract(PacketListenerPriority priority) {
super(priority);
}
public SimplePacketListenerAbstract() {
super();
}
@Override
void onPacketReceive(PacketReceiveEvent event) {
if (event instanceof PacketHandshakeReceiveEvent) {
onPacketHandshakeReceive((PacketHandshakeReceiveEvent) event);
} else if (event instanceof PacketStatusReceiveEvent) {
onPacketStatusReceive((PacketStatusReceiveEvent) event);
} else if (event instanceof PacketLoginReceiveEvent) {
onPacketLoginReceive((PacketLoginReceiveEvent) event);
}
else if (event instanceof PacketConfigReceiveEvent) {
onPacketConfigReceive((PacketConfigReceiveEvent) event);
}
else if (event instanceof PacketPlayReceiveEvent) {
onPacketPlayReceive((PacketPlayReceiveEvent) event);
}
}
@Override
void onPacketSend(PacketSendEvent event) {
if (event instanceof PacketStatusSendEvent) {
onPacketStatusSend((PacketStatusSendEvent) event);
} else if (event instanceof PacketLoginSendEvent) {
onPacketLoginSend((PacketLoginSendEvent) event);
}
else if (event instanceof PacketConfigSendEvent) {
onPacketConfigSend((PacketConfigSendEvent) event);
}
else if (event instanceof PacketPlaySendEvent) {
onPacketPlaySend((PacketPlaySendEvent) event);
}
}
public void onPacketHandshakeReceive(PacketHandshakeReceiveEvent event) {
}
public void onPacketStatusReceive(PacketStatusReceiveEvent event) {
}
public void onPacketStatusSend(PacketStatusSendEvent event) {
}
public void onPacketLoginReceive(PacketLoginReceiveEvent event) {
}
public void onPacketLoginSend(PacketLoginSendEvent event) {
}
public void onPacketConfigReceive(PacketConfigReceiveEvent event) {
}
public void onPacketConfigSend(PacketConfigSendEvent event) {
}
public void onPacketPlayReceive(PacketPlayReceiveEvent event) {
}
public void onPacketPlaySend(PacketPlaySendEvent event) {
}
}
@@ -0,0 +1,53 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class UserConnectEvent extends PacketEvent implements CancellableEvent, UserEvent {
private final User user;
private boolean cancelled;
public UserConnectEvent(User user) {
this.user = user;
}
@Override
public User getUser() {
return user;
}
@Override
public boolean isCancelled() {
return cancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override
public void call(PacketListenerCommon listener) {
listener.onUserConnect(this);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,26 +16,27 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event.eventtypes;
package com.github.retrooper.packetevents.event;
import io.github.retrooper.packetevents.packetwrappers.NMSPacket;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jspecify.annotations.NullMarked;
import java.net.InetSocketAddress;
@NullMarked
public class UserDisconnectEvent extends PacketEvent implements UserEvent {
public abstract class CancellableNMSPacketEvent extends NMSPacketEvent implements CancellableEvent {
private boolean cancelled;
private final User user;
public CancellableNMSPacketEvent(Object channel, NMSPacket packet) {
super(channel, packet);
public UserDisconnectEvent(User user) {
this.user = user;
}
@Override
public boolean isCancelled() {
return cancelled;
public User getUser() {
return user;
}
@Override
public void setCancelled(boolean value) {
cancelled = value;
public void call(PacketListenerCommon listener) {
listener.onUserDisconnect(this);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,17 +16,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.utils.player;
//TODO Remove this enum, use Bukkit's GameMode enum everywhere.
package com.github.retrooper.packetevents.event;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jspecify.annotations.NullMarked;
/**
* Representation of a player's game mode.
* Event that involves users.
*
* @author retrooper
* @since 1.8
* @since 2.0.0
*/
public enum GameMode {
SURVIVAL,
CREATIVE,
ADVENTURE,
SPECTATOR
@NullMarked
public interface UserEvent {
User getUser();
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,29 +16,34 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.packetwrappers.play.in.beacon;
package com.github.retrooper.packetevents.event;
import io.github.retrooper.packetevents.packetwrappers.NMSPacket;
import io.github.retrooper.packetevents.packetwrappers.WrappedPacket;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jspecify.annotations.NullMarked;
public class WrappedPacketInBeacon extends WrappedPacket {
public WrappedPacketInBeacon(NMSPacket packet) {
super(packet);
@NullMarked
public class UserLoginEvent extends PacketEvent implements CallableEvent, UserEvent, PlayerEvent {
private final User user;
private final Object player;
public UserLoginEvent(User user, Object player) {
this.user = user;
this.player = player;
}
public int getPrimaryEffect() {
return readInt(0);
@Override
public User getUser() {
return user;
}
public void setPrimaryEffect(int primaryEffect) {
writeInt(0, primaryEffect);
@Override
public <T> T getPlayer() {
return (T) player;
}
public int getSecondaryEffect() {
return readInt(1);
}
public void setSecondaryEffect(int secondaryEffect) {
writeInt(1, secondaryEffect);
@Override
public void call(PacketListenerCommon listener) {
listener.onUserLogin(this);
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketConfigReceiveEvent extends PacketReceiveEvent {
public PacketConfigReceiveEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketConfigReceiveEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketConfigReceiveEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketConfigReceiveEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Configuration.Client getPacketType() {
return (PacketType.Configuration.Client) super.getPacketType();
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketConfigSendEvent extends PacketSendEvent {
public PacketConfigSendEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketConfigSendEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketConfigSendEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketConfigSendEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Configuration.Server getPacketType() {
return (PacketType.Configuration.Server) super.getPacketType();
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketHandshakeReceiveEvent extends PacketReceiveEvent {
public PacketHandshakeReceiveEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketHandshakeReceiveEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketHandshakeReceiveEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketHandshakeReceiveEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Handshaking.Client getPacketType() {
return (PacketType.Handshaking.Client) super.getPacketType();
}
}
@@ -0,0 +1,42 @@
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketHandshakeSendEvent extends PacketSendEvent {
public PacketHandshakeSendEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketHandshakeSendEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketHandshakeSendEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketHandshakeSendEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Handshaking.Client getPacketType() {
return (PacketType.Handshaking.Client) super.getPacketType();
}
}
@@ -0,0 +1,61 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketLoginReceiveEvent extends PacketReceiveEvent {
public PacketLoginReceiveEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketLoginReceiveEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketLoginReceiveEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketLoginReceiveEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Login.Client getPacketType() {
return (PacketType.Login.Client) super.getPacketType();
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketLoginSendEvent extends PacketSendEvent {
public PacketLoginSendEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketLoginSendEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketLoginSendEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketLoginSendEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Login.Server getPacketType() {
return (PacketType.Login.Server) super.getPacketType();
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketPlayReceiveEvent extends PacketReceiveEvent {
public PacketPlayReceiveEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketPlayReceiveEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketPlayReceiveEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketPlayReceiveEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Play.Client getPacketType() {
return (PacketType.Play.Client) super.getPacketType();
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketPlaySendEvent extends PacketSendEvent {
public PacketPlaySendEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketPlaySendEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketPlaySendEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketPlaySendEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Play.Server getPacketType() {
return (PacketType.Play.Server) super.getPacketType();
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketStatusReceiveEvent extends PacketReceiveEvent {
public PacketStatusReceiveEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketStatusReceiveEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketStatusReceiveEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketStatusReceiveEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Status.Client getPacketType() {
return (PacketType.Status.Client) super.getPacketType();
}
}
@@ -0,0 +1,61 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.event.simple;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.netty.buffer.ByteBufHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PacketStatusSendEvent extends PacketSendEvent {
public PacketStatusSendEvent(
Object channel, User user,
@UnknownNullability Object player, Object rawByteBuf,
boolean autoProtocolTranslation
) throws PacketProcessException {
super(channel, user, player, rawByteBuf, autoProtocolTranslation);
}
protected PacketStatusSendEvent(
int packetId, PacketTypeCommon packetType, ServerVersion serverVersion,
Object channel, User user,
@UnknownNullability Object player, Object byteBuf
) throws PacketProcessException {
super(packetId, packetType, serverVersion, channel, user, player, byteBuf);
}
@Override
public PacketStatusSendEvent clone() {
Object clonedBuffer = ByteBufHelper.retainedDuplicate(getByteBuf());
return new PacketStatusSendEvent(getPacketId(), getPacketType(), getServerVersion(),
getChannel(), getUser(), getPlayer(), clonedBuffer);
}
public PacketType.Status.Server getPacketType() {
return (PacketType.Status.Server) super.getPacketType();
}
}
@@ -0,0 +1,10 @@
package com.github.retrooper.packetevents.exception;
public class CancelPacketException extends RuntimeException {
public static final CancelPacketException INSTANCE = new CancelPacketException();
@Override
public synchronized Throwable fillInStackTrace() {
return this;
}
}
@@ -0,0 +1,4 @@
package com.github.retrooper.packetevents.exception;
public class InvalidDisconnectPacketSend extends RuntimeException {
}
@@ -0,0 +1,4 @@
package com.github.retrooper.packetevents.exception;
public class InvalidHandshakeException extends RuntimeException {
}
@@ -0,0 +1,33 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.exception;
public class PacketProcessException extends RuntimeException {
public PacketProcessException(String msg, Throwable cause) {
super(msg, cause);
}
public PacketProcessException(Throwable cause) {
super(cause);
}
public PacketProcessException(String msg) {
super(msg);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,28 +16,30 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.injector;
package com.github.retrooper.packetevents.injector;
import org.bukkit.entity.Player;
import com.github.retrooper.packetevents.protocol.PacketSide;
import com.github.retrooper.packetevents.protocol.player.User;
public interface ChannelInjector {
default boolean isBound() {
default boolean isServerBound() {
return true;
}
void inject();
void eject();
void uninject();
void injectPlayer(Player player);
void updateUser(Object channel, User user);
void ejectPlayer(Player player);
void setPlayer(Object channel, Object player);
boolean hasInjected(Player player);
boolean isPlayerSet(Object channel);
void writePacket(Object channel, Object rawNMSPacket);
boolean isProxy();
void flushPackets(Object channel);
void sendPacket(Object channel, Object rawNMSPacket);
default PacketSide getPacketSide() {
return PacketSide.SERVER;
}
}
@@ -0,0 +1,152 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.manager;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketListenerAbstract;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.manager.protocol.ProtocolManager;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.ConnectionState;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.player.User;
import com.github.retrooper.packetevents.protocol.player.UserProfile;
import com.github.retrooper.packetevents.util.LogManager;
import com.github.retrooper.packetevents.util.mappings.SynchronizedRegistriesHandler;
import com.github.retrooper.packetevents.wrapper.configuration.server.WrapperConfigServerConfigurationEnd;
import com.github.retrooper.packetevents.wrapper.configuration.server.WrapperConfigServerRegistryData;
import com.github.retrooper.packetevents.wrapper.handshaking.client.WrapperHandshakingClientHandshake;
import com.github.retrooper.packetevents.wrapper.login.server.WrapperLoginServerLoginSuccess;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerJoinGame;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerRespawn;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
public class InternalPacketListener extends PacketListenerAbstract {
public InternalPacketListener() {
this(PacketListenerPriority.LOWEST);
}
public InternalPacketListener(PacketListenerPriority priority) {
super(priority);
}
@Override
public void onPacketSend(PacketSendEvent event) {
User user = event.getUser();
if (event.getPacketType() == PacketType.Login.Server.LOGIN_SUCCESS) {
Object channel = event.getChannel();
//Process outgoing login success packet
WrapperLoginServerLoginSuccess loginSuccess = new WrapperLoginServerLoginSuccess(event);
UserProfile profile = loginSuccess.getUserProfile();
//Update user profile
user.getProfile().setUUID(profile.getUUID());
user.getProfile().setName(profile.getName());
//Texture properties are passed in login success on 1.19
user.getProfile().setTextureProperties(profile.getTextureProperties());
//Map username with channel
synchronized (channel) {
PacketEvents.getAPI().getProtocolManager().setChannel(profile.getUUID(), channel);
}
if (PacketEvents.getAPI().getLogManager().isDebug()) {
PacketEvents.getAPI().getLogManager().debug("Mapped player UUID with their channel " + profile.getUUID() + " " + channel);
}
// Switch the user's connection state to new state, but the variable event.getConnectionState() remains LOGIN
// We switch user state immediately to remain in sync with vanilla, allowing you to encode packets immediately
boolean proxy = PacketEvents.getAPI().getInjector().isProxy();
if (proxy ? event.getUser().getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_20_2)
: event.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_20_2)) {
user.setEncoderState(ConnectionState.CONFIGURATION);
} else {
user.setConnectionState(ConnectionState.PLAY);
}
}
// The server sends dimension information in configuration phase, since 1.20.2
else if (event.getPacketType() == PacketType.Configuration.Server.REGISTRY_DATA) {
WrapperConfigServerRegistryData packet = new WrapperConfigServerRegistryData(event);
if (packet.getElements() != null) { // 1.20.2 to 1.20.5
SynchronizedRegistriesHandler.handleRegistry(user, packet,
packet.getRegistryKey(), packet.getElements());
}
if (packet.getRegistryData() != null) { // since 1.20.5
SynchronizedRegistriesHandler.handleLegacyRegistries(user, packet, packet.getRegistryData());
}
}
// The server sends registry info in login packet for 1.16 to 1.20.1
else if (event.getPacketType() == PacketType.Play.Server.JOIN_GAME) {
WrapperPlayServerJoinGame joinGame = new WrapperPlayServerJoinGame(event);
user.setEntityId(joinGame.getEntityId());
if (joinGame.getDimensionCodec() != null) { // 1.16 to 1.20.1
SynchronizedRegistriesHandler.handleLegacyRegistries(user, joinGame,
joinGame.getDimensionCodec());
user.finalizeRegistries(joinGame);
}
user.setDimensionType(joinGame.getDimensionType());
}
// Respawn is used to switch dimensions
else if (event.getPacketType() == PacketType.Play.Server.RESPAWN) {
WrapperPlayServerRespawn packet = new WrapperPlayServerRespawn(event);
user.setDimensionType(packet.getDimensionType());
} else if (event.getPacketType() == PacketType.Play.Server.CONFIGURATION_START) {
user.setEncoderState(ConnectionState.CONFIGURATION);
} else if (event.getPacketType() == PacketType.Configuration.Server.CONFIGURATION_END) {
user.setEncoderState(ConnectionState.PLAY);
user.finalizeRegistries(new WrapperConfigServerConfigurationEnd(event));
}
}
@Override
public void onPacketReceive(PacketReceiveEvent event) {
User user = event.getUser();
if (event.getPacketType() == PacketType.Handshaking.Client.HANDSHAKE) {
WrapperHandshakingClientHandshake packet = new WrapperHandshakingClientHandshake(event);
ClientVersion clientVersion = packet.getClientVersion();
ConnectionState state = packet.getNextConnectionState();
LogManager logger = PacketEvents.getAPI().getLogManager();
if (logger.isDebug()) {
logger.debug("Processed handshake for " + event.getAddress() + ": "
+ state.name() + " / " + packet.getClientVersion().getReleaseName());
}
user.setClientVersion(clientVersion);
user.setConnectionState(state);
} else if (event.getPacketType() == PacketType.Login.Client.LOGIN_SUCCESS_ACK) {
user.setDecoderState(ConnectionState.CONFIGURATION);
} else if (event.getPacketType() == PacketType.Play.Client.CONFIGURATION_ACK) {
user.setDecoderState(ConnectionState.CONFIGURATION);
} else if (event.getPacketType() == PacketType.Configuration.Client.CONFIGURATION_END_ACK) {
user.setDecoderState(ConnectionState.PLAY);
}
}
}
@@ -0,0 +1,99 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.manager.player;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.ProtocolPacketEvent;
import com.github.retrooper.packetevents.protocol.ConnectionState;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.player.User;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
public interface PlayerManager {
int getPing(@NotNull Object player);
@NotNull ClientVersion getClientVersion(@NotNull Object player);
Object getChannel(@NotNull Object player);
User getUser(@NotNull Object player);
/**
* <strong>WARNING</strong>: Usage of this method should be avoided. Please use either
* {@link User#getDecoderState()} or {@link User#getEncoderState()}.<br>
* To access the specific state a packet event was sent/received in, use {@link ProtocolPacketEvent#getConnectionState()}.
* <p>
* Since 1.20.2, the Minecraft protocol allows the decoder/encoder connection states to de-sync.
*
* @throws IllegalStateException if encoder/decoder connection states do not match
*/
@ApiStatus.Obsolete
default ConnectionState getConnectionState(@NotNull Object player) throws IllegalStateException {
return getUser(player).getConnectionState();
}
default void sendPacket(@NotNull Object player, @NotNull Object byteBuf) {
PacketEvents.getAPI().getProtocolManager().sendPacket(getChannel(player), byteBuf);
}
default void sendPacket(@NotNull Object player, @NotNull PacketWrapper<?> wrapper) {
PacketEvents.getAPI().getProtocolManager().sendPacket(getChannel(player), wrapper);
}
default void sendPacketSilently(@NotNull Object player, @NotNull Object byteBuf) {
PacketEvents.getAPI().getProtocolManager().sendPacketSilently(getChannel(player), byteBuf);
}
default void sendPacketSilently(@NotNull Object player, @NotNull PacketWrapper<?> wrapper) {
PacketEvents.getAPI().getProtocolManager().sendPacketSilently(getChannel(player), wrapper);
}
default void writePacket(@NotNull Object player, @NotNull Object byteBuf) {
PacketEvents.getAPI().getProtocolManager().writePacket(getChannel(player), byteBuf);
}
default void writePacket(@NotNull Object player, @NotNull PacketWrapper<?> wrapper) {
PacketEvents.getAPI().getProtocolManager().writePacket(getChannel(player), wrapper);
}
default void writePacketSilently(@NotNull Object player, @NotNull Object byteBuf) {
PacketEvents.getAPI().getProtocolManager().writePacketSilently(getChannel(player), byteBuf);
}
default void writePacketSilently(@NotNull Object player, @NotNull PacketWrapper<?> wrapper) {
PacketEvents.getAPI().getProtocolManager().writePacketSilently(getChannel(player), wrapper);
}
default void receivePacket(Object player, Object byteBuf) {
PacketEvents.getAPI().getProtocolManager().receivePacket(getChannel(player), byteBuf);
}
default void receivePacket(Object player, PacketWrapper<?> wrapper) {
PacketEvents.getAPI().getProtocolManager().receivePacket(getChannel(player), wrapper);
}
default void receivePacketSilently(Object player, Object byteBuf) {
PacketEvents.getAPI().getProtocolManager().receivePacketSilently(getChannel(player), byteBuf);
}
default void receivePacketSilently(Object player, PacketWrapper<?> wrapper) {
PacketEvents.getAPI().getProtocolManager().receivePacketSilently(getChannel(player), wrapper);
}
}
@@ -0,0 +1,192 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.manager.protocol;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.netty.channel.ChannelHelper;
import com.github.retrooper.packetevents.protocol.ProtocolVersion;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.player.User;
import com.github.retrooper.packetevents.util.PacketTransformationUtil;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import java.util.Collection;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
public interface ProtocolManager {
@ApiStatus.Internal
Map<UUID, Object> CHANNELS = new ConcurrentHashMap<>();
// Use SocketAddress because ProtocolLib wraps Channels with NettyChannelProxy class
@ApiStatus.Internal
Map<Object, User> USERS = new ConcurrentHashMap<>();
default Collection<User> getUsers() {
return USERS.values();
}
default Collection<Object> getChannels() {
return CHANNELS.values();
}
//Methods to implement
ProtocolVersion getPlatformVersion();
void sendPacket(Object channel, Object byteBuf);
void sendPacketSilently(Object channel, Object byteBuf);
void writePacket(Object channel, Object byteBuf);
void writePacketSilently(Object channel, Object byteBuf);
void receivePacket(Object channel, Object byteBuf);
void receivePacketSilently(Object channel, Object byteBuf);
ClientVersion getClientVersion(Object channel);
//TODO Define method that accepts an array of channels/set/list of channels.
default void sendPackets(Object channel, Object... byteBuf) {
for (Object buf : byteBuf) {
sendPacket(channel, buf);
}
}
default void sendPacketsSilently(Object channel, Object... byteBuf) {
for (Object buf : byteBuf) {
sendPacketSilently(channel, buf);
}
}
default void writePackets(Object channel, Object... byteBuf) {
for (Object buf : byteBuf) {
writePacket(channel, buf);
}
}
default void writePacketsSilently(Object channel, Object... byteBuf) {
for (Object buf : byteBuf) {
writePacketSilently(channel, buf);
}
}
default void receivePackets(Object channel, Object... byteBuf) {
for (Object buf : byteBuf) {
receivePacket(channel, buf);
}
}
default void receivePacketsSilently(Object channel, Object... byteBuf) {
for (Object buf : byteBuf) {
receivePacketSilently(channel, buf);
}
}
default void setClientVersion(Object channel, ClientVersion version) {
getUser(channel).setClientVersion(version);
}
@ApiStatus.Internal
default Object[] transformWrappers(PacketWrapper<?> wrapper, Object channel, boolean outgoing) {
//It is possible that our packet transformer util decides to transform one wrapper into multiple packets.
//(Correcting some mistakes on your end)
PacketWrapper<?>[] wrappers = PacketTransformationUtil.transform(wrapper);
Object[] buffers = new Object[wrappers.length];
for (int i = 0; i < wrappers.length; i++) {
PacketWrapper<?> wrappper = wrappers[i];
synchronized (wrappper.bufferLock) {
wrappper.prepareForSend(channel, outgoing);
buffers[i] = wrappper.buffer;
// Fix race condition when sending packets to multiple people (due to when the buffer is freed)
wrappper.buffer = null;
}
}
return buffers;
}
default void sendPacket(Object channel, PacketWrapper<?> wrapper) {
Object[] transformed = transformWrappers(wrapper, channel, true);
sendPackets(channel, transformed);
}
default void sendPacketSilently(Object channel, PacketWrapper<?> wrapper) {
Object[] transformed = transformWrappers(wrapper, channel, true);
sendPacketsSilently(channel, transformed);
}
default void writePacket(Object channel, PacketWrapper<?> wrapper) {
Object[] transformed = transformWrappers(wrapper, channel, true);
writePackets(channel, transformed);
}
default void writePacketSilently(Object channel, PacketWrapper<?> wrapper) {
Object[] transformed = transformWrappers(wrapper, channel, true);
writePacketsSilently(channel, transformed);
}
default void receivePacket(Object channel, PacketWrapper<?> wrapper) {
Object[] transformed = transformWrappers(wrapper, channel, false);
receivePackets(channel, transformed);
}
default void receivePacketSilently(Object channel, PacketWrapper<?> wrapper) {
Object[] transformed = transformWrappers(wrapper, channel, false);
receivePacketsSilently(channel, transformed);
}
default User getUser(Object channel) {
Object pipeline = ChannelHelper.getPipeline(channel);
return USERS.get(pipeline);
}
@ApiStatus.Internal
default User removeUser(Object channel) {
Object pipeline = ChannelHelper.getPipeline(channel);
return USERS.remove(pipeline);
}
@ApiStatus.Internal
default void setUser(Object channel, User user) {
synchronized (channel) {
Object pipeline = ChannelHelper.getPipeline(channel);
USERS.put(pipeline, user);
}
PacketEvents.getAPI().getInjector().updateUser(channel, user);
}
default Object getChannel(UUID uuid) {
return CHANNELS.get(uuid);
}
@ApiStatus.Internal
default void setChannel(UUID uuid, Object channel) {
CHANNELS.put(uuid, channel);
}
@ApiStatus.Internal
default void removeChannel(Object channel) {
CHANNELS.values().remove(channel);
}
@ApiStatus.Internal
default void removeChannelById(UUID uuid) {
CHANNELS.remove(uuid);
}
default boolean hasChannel(Object channel) {
return CHANNELS.containsValue(channel);
}
}
@@ -0,0 +1,57 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.manager.server;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.player.User;
import org.jetbrains.annotations.Nullable;
public interface ServerManager {
/**
* Get the server version.
*
* @return Get Server Version
*/
ServerVersion getVersion();
/**
* Get the operating system of the local machine
*
* @return Get Operating System
*/
default SystemOS getOS() {
return SystemOS.getOS();
}
/**
* Gets a platform-specific network-synchronized-registries cache key.
* <p>
* This tells packetevents, if a registry should be cached or read again. On
* backend servers with global registries, this may be a constant value. On
* proxy servers with per-server registries, this may be a value which depends
* on the current server the {@link User} is on.
*
* @param user the {@link User} for which the registry gets read
* @param version the version the packet is for
* @return some value or null for no caching at all
*/
default @Nullable Object getRegistryCacheKey(User user, ClientVersion version) {
return null; // no caching
}
}
@@ -0,0 +1,217 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.manager.server;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import org.jetbrains.annotations.NotNull;
/**
* Server Version.
* This is a nice wrapper over minecraft's protocol versions.
* You won't have to memorize the protocol version, just memorize the server version you see in the launcher.
*
* @author retrooper
* @see <a href="https://wiki.vg/Protocol_version_numbers">https://wiki.vg/Protocol_version_numbers</a>
* @since 1.6.9
*/
public enum ServerVersion {
//TODO Rename to MinecraftVersion?
V_1_7_2(4), V_1_7_4(4), V_1_7_5(4),
V_1_7_6(5), V_1_7_7(5), V_1_7_8(5), V_1_7_9(5), V_1_7_10(5),
V_1_8(47), V_1_8_3(47), V_1_8_8(47),
V_1_9(107), V_1_9_1(108), V_1_9_2(109), V_1_9_4(110),
//1.10 and 1.10.1 are redundant
V_1_10(210), V_1_10_1(210), V_1_10_2(210),
V_1_11(315), V_1_11_2(316),
V_1_12(335), V_1_12_1(338), V_1_12_2(340),
V_1_13(393), V_1_13_1(401), V_1_13_2(404),
V_1_14(477), V_1_14_1(480), V_1_14_2(485), V_1_14_3(490), V_1_14_4(498),
V_1_15(573), V_1_15_1(575), V_1_15_2(578),
V_1_16(735), V_1_16_1(736), V_1_16_2(751), V_1_16_3(753), V_1_16_4(754), V_1_16_5(754),
V_1_17(755), V_1_17_1(756),
V_1_18(757), V_1_18_1(757), V_1_18_2(758),
//1.19.1 and 1.19.2 have the same protocol version
V_1_19(759), V_1_19_1(760), V_1_19_2(760), V_1_19_3(761), V_1_19_4(762),
//1.20 and 1.20.1 have the same protocol version. 1.20.3 and 1.20.4 have the same protocol version. 1.20.5 and 1.20.6 have the same protocol version
V_1_20(763), V_1_20_1(763), V_1_20_2(764), V_1_20_3(765), V_1_20_4(765), V_1_20_5(766), V_1_20_6(766),
//1.21 and 1.21.1 have the same protocol version. 1.21.2 and 1.21.3 have the same protocol version. 1.21.7 and 1.21.8 have the same protocol version. 1.21.9 and 1.21.10 have the same protocol version
V_1_21(767), V_1_21_1(767), V_1_21_2(768), V_1_21_3(768), V_1_21_4(769), V_1_21_5(770), V_1_21_6(771), V_1_21_7(772), V_1_21_8(772), V_1_21_9(773), V_1_21_10(773), V_1_21_11(774),
//TODO UPDATE Add server version constant
ERROR(-1, true);
private static final ServerVersion[] VALUES = values();
private static final ServerVersion[] REVERSED_VALUES;
static {
REVERSED_VALUES = values();
int i = 0;
int j = REVERSED_VALUES.length - 1;
ServerVersion tmp;
while (j > i) {
tmp = REVERSED_VALUES[j];
REVERSED_VALUES[j--] = REVERSED_VALUES[i];
REVERSED_VALUES[i++] = tmp;
}
}
private final int protocolVersion;
private final String name;
private ClientVersion toClientVersion;
ServerVersion(int protocolVersion) {
this.protocolVersion = protocolVersion;
this.name = name().substring(2).replace("_", ".");
}
ServerVersion(int protocolVersion, boolean isNotRelease) {
this.protocolVersion = protocolVersion;
if (isNotRelease) {
this.name = name();
} else {
this.name = name().substring(2).replace("_", ".");
}
}
public static ServerVersion[] reversedValues() {
return REVERSED_VALUES;
}
public static ServerVersion getLatest() {
return REVERSED_VALUES[1];
}
public static ServerVersion getOldest() {
return VALUES[0];
}
//TODO Optimize
@Deprecated
public static ServerVersion getById(int protocolVersion) {
for (ServerVersion version : VALUES) {
if (version.protocolVersion == protocolVersion) {
return version;
}
}
return null;
}
public ClientVersion toClientVersion() {
if (toClientVersion == null) {
toClientVersion = ClientVersion.getById(protocolVersion);
}
return toClientVersion;
}
/**
* Get the release name of this server version.
* For example, for the V_1_18 enum constant, it would return "1.18".
*
* @return Release name
*/
public String getReleaseName() {
return name;
}
/**
* Get this server version's protocol version.
*
* @return Protocol version.
*/
public int getProtocolVersion() {
return protocolVersion;
}
/**
* Is this server version newer than the compared server version?
* This method simply checks if this server version's protocol version is greater than
* the compared server version's protocol version.
*
* @param target Compared server version.
* @return Is this server version newer than the compared server version.
*/
public boolean isNewerThan(ServerVersion target) {
return this.ordinal() > target.ordinal();
}
/**
* Is this server version older than the compared server version?
* This method simply checks if this server version's protocol version is less than
* the compared server version's protocol version.
*
* @param target Compared server version.
* @return Is this server version older than the compared server version.
*/
public boolean isOlderThan(ServerVersion target) {
return this.ordinal() < target.ordinal();
}
/**
* Is this server version newer than or equal to the compared server version?
* This method simply checks if this server version's protocol version is greater than or equal to
* the compared server version's protocol version.
*
* @param target Compared server version.
* @return Is this server version newer than or equal to the compared server version.
*/
public boolean isNewerThanOrEquals(ServerVersion target) {
return this.ordinal() >= target.ordinal();
}
/**
* Is this server version older than or equal to the compared server version?
* This method simply checks if this server version's protocol version is older than or equal to
* the compared server version's protocol version.
*
* @param target Compared server version.
* @return Is this server version older than or equal to the compared server version.
*/
public boolean isOlderThanOrEquals(ServerVersion target) {
return this.ordinal() <= target.ordinal();
}
/**
* Is this server version newer than, older than or equal to the compared server version?
* This method simply checks if this server version's protocol version is greater than, less than or equal to
* the compared server version's protocol version.
*
* @param comparison Comparison type.
* @param targetVersion Compared server version.
* @return true or false, based on the comparison type.
* @see #isNewerThan(ServerVersion)
* @see #isNewerThanOrEquals(ServerVersion)
* @see #isOlderThan(ServerVersion)
* @see #isOlderThanOrEquals(ServerVersion)
*/
public boolean is(@NotNull VersionComparison comparison, @NotNull ServerVersion targetVersion) {
switch (comparison) {
case EQUALS:
return protocolVersion == targetVersion.protocolVersion;
case NEWER_THAN:
return isNewerThan(targetVersion);
case NEWER_THAN_OR_EQUALS:
return isNewerThanOrEquals(targetVersion);
case OLDER_THAN:
return isOlderThan(targetVersion);
case OLDER_THAN_OR_EQUALS:
return isOlderThanOrEquals(targetVersion);
default:
return false;
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.utils.server;
package com.github.retrooper.packetevents.manager.server;
import java.util.Locale;
/**
* System Operating system.
@@ -27,9 +29,7 @@ package io.github.retrooper.packetevents.utils.server;
public enum SystemOS {
WINDOWS, MACOS, LINUX, OTHER;
private static final SystemOS[] VALUES = values();
private static SystemOS value;
private static SystemOS CACHE;
/**
* Get the server's operating system.
@@ -38,9 +38,9 @@ public enum SystemOS {
* @return Operating System.
*/
public static SystemOS getOSNoCache() {
final String os = System.getProperty("os.name").toLowerCase();
for (SystemOS sysos : VALUES) {
if (os.contains(sysos.name().toLowerCase())) {
final String os = System.getProperty("os.name").toLowerCase(Locale.ROOT);
for (SystemOS sysos : values()) {
if (os.contains(sysos.name().toLowerCase(Locale.ROOT))) {
return sysos;
}
}
@@ -54,22 +54,10 @@ public enum SystemOS {
* @return Operating System.
*/
public static SystemOS getOS() {
if (value == null) {
value = getOSNoCache();
if (CACHE == null) {
CACHE = getOSNoCache();
}
return value;
}
/**
* Get the server's operating system.
* This method will CACHE for you.
*
* @return Operating System.
* @deprecated Use {@link #getOS()}, method renamed.
*/
@Deprecated
public static SystemOS getOperatingSystem() {
return getOS();
return CACHE;
}
}
@@ -0,0 +1,45 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.manager.server;
/**
* This enum contains all possible comparison types for server versions.
*/
public enum VersionComparison {
/*
The server version equals the compared server version.
*/
EQUALS,
/*
The server version is newer than the compared server version.
*/
NEWER_THAN,
/*
The server version is newer than or equal to the compared server version.
*/
NEWER_THAN_OR_EQUALS,
/*
The server version is older than the compared server version.
*/
OLDER_THAN,
/*
The server version is older than or equal to the compared server version.
*/
OLDER_THAN_OR_EQUALS;
}
@@ -0,0 +1,31 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty;
import com.github.retrooper.packetevents.netty.buffer.ByteBufAllocationOperator;
import com.github.retrooper.packetevents.netty.buffer.ByteBufOperator;
import com.github.retrooper.packetevents.netty.channel.ChannelOperator;
public interface NettyManager {
ChannelOperator getChannelOperator();
ByteBufOperator getByteBufOperator();
ByteBufAllocationOperator getByteBufAllocationOperator();
}
@@ -0,0 +1,36 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty.buffer;
public interface ByteBufAllocationOperator {
Object wrappedBuffer(byte[] bytes);
Object copiedBuffer(byte[] bytes);
Object buffer();
Object buffer(int initialCapacity);
Object directBuffer();
Object directBuffer(int initialCapacity);
Object compositeBuffer();
Object compositeBuffer(int maxNumComponents);
Object emptyBuffer();
}
@@ -0,0 +1,290 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty.buffer;
import com.github.retrooper.packetevents.PacketEvents;
import java.nio.charset.Charset;
public class ByteBufHelper {
public static int capacity(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().capacity(buffer);
}
public static Object capacity(Object buffer, int capacity) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().capacity(buffer, capacity);
}
public static int readerIndex(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readerIndex(buffer);
}
public static Object readerIndex(Object buffer, int readerIndex) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readerIndex(buffer, readerIndex);
}
public static int writerIndex(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().writerIndex(buffer);
}
public static Object writerIndex(Object buffer, int writerIndex) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().writerIndex(buffer, writerIndex);
}
public static int readableBytes(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readableBytes(buffer);
}
public static int writableBytes(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().writableBytes(buffer);
}
public static Object clear(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().clear(buffer);
}
public static String toString(Object buffer, int index, int length, Charset charset) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().toString(buffer, index, length, charset);
}
public static byte readByte(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readByte(buffer);
}
public static void writeByte(Object buffer, int value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeByte(buffer, value);
}
public static boolean readBoolean(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readBoolean(buffer);
}
public static void writeBoolean(Object buffer, boolean value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeBoolean(buffer, value);
}
public static short readUnsignedByte(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readUnsignedByte(buffer);
}
public static char readChar(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readChar(buffer);
}
public static void writeChar(Object buffer, int value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeChar(buffer, value);
}
public static short readShort(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readShort(buffer);
}
public static int readUnsignedShort(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readUnsignedShort(buffer);
}
public static void writeShort(Object buffer, int value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeShort(buffer, value);
}
public static void writeShortLE(Object buffer, int value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeShortLE(buffer, value);
}
public static int readMedium(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readMedium(buffer);
}
public static void writeMedium(Object buffer, int value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeMedium(buffer, value);
}
public static int readInt(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readInt(buffer);
}
public static void writeInt(Object buffer, int value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeInt(buffer, value);
}
public static long readUnsignedInt(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readUnsignedInt(buffer);
}
public static long readLong(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readLong(buffer);
}
public static void writeLong(Object buffer, long value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeLong(buffer, value);
}
public static float readFloat(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readFloat(buffer);
}
public static void writeFloat(Object buffer, float value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeFloat(buffer, value);
}
public static double readDouble(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readDouble(buffer);
}
public static void writeDouble(Object buffer, double value) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeDouble(buffer, value);
}
public static Object getBytes(Object buffer, int index, byte[] destination) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().getBytes(buffer, index, destination);
}
public static short getUnsignedByte(Object buffer, int index) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().getUnsignedByte(buffer, index);
}
public static boolean isReadable(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().isReadable(buffer);
}
public static Object copy(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().copy(buffer);
}
public static Object duplicate(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().duplicate(buffer);
}
public static boolean hasArray(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().hasArray(buffer);
}
public static byte[] array(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().array(buffer);
}
public static Object retain(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().retain(buffer);
}
public static Object retainedDuplicate(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().retainedDuplicate(buffer);
}
public static Object readSlice(Object buffer, int length) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readSlice(buffer, length);
}
public static Object readBytes(Object buffer, byte[] destination, int destinationIndex, int length) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readBytes(buffer, destination, destinationIndex, length);
}
public static Object readBytes(Object buffer, int length) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().readBytes(buffer, length);
}
public static Object writeBytes(Object buffer, Object src) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeBytes(buffer, src);
}
public static void readBytes(Object buffer, byte[] bytes) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().readBytes(buffer, bytes);
}
public static void writeBytes(Object buffer, byte[] bytes) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeBytes(buffer, bytes);
}
public static void writeBytes(Object buffer, byte[] bytes, int offset, int length) {
PacketEvents.getAPI().getNettyManager().getByteBufOperator().writeBytes(buffer, bytes, offset, length);
}
public static boolean release(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().release(buffer);
}
public static int refCnt(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().refCnt(buffer);
}
public static Object skipBytes(Object buffer, int length) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().skipBytes(buffer, length);
}
public static Object markReaderIndex(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().markReaderIndex(buffer);
}
public static Object resetReaderIndex(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().resetReaderIndex(buffer);
}
public static Object markWriterIndex(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().markWriterIndex(buffer);
}
public static Object resetWriterIndex(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().resetWriterIndex(buffer);
}
public static Object allocateNewBuffer(Object buffer) {
return PacketEvents.getAPI().getNettyManager().getByteBufOperator().allocateNewBuffer(buffer);
}
public static int getByteSize(int value) {
for (int i = 1; i < 5; ++i) {
if ((value & -1 << i * 7) == 0) {
return i;
}
}
return 5;
}
public static int readVarInt(Object buffer) {
int value = 0;
int length = 0;
byte currentByte;
do {
currentByte = readByte(buffer);
value |= (currentByte & 0x7F) << (length * 7);
length++;
if (length > 5) {
throw new RuntimeException("VarInt is too large. Must be smaller than 5 bytes.");
}
} while ((currentByte & 0x80) == 0x80);
return value;
}
public static void writeVarInt(Object buffer, int value) {
while (true) {
if ((value & ~0x7F) == 0) {
writeByte(buffer, value);
return;
}
writeByte(buffer, (value & 0x7F) | 0x80);
value >>>= 7;
}
}
public static byte[] copyBytes(Object buffer) {
byte[] bytes = new byte[readableBytes(buffer)];
getBytes(buffer, readerIndex(buffer), bytes);
return bytes;
}
}
@@ -0,0 +1,242 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty.buffer;
import com.github.retrooper.packetevents.exception.PacketProcessException;
import java.io.*;
//TODO give netty credit
public class ByteBufInputStream extends InputStream implements DataInput {
private final Object buffer;
private final int startIndex;
private final int endIndex;
private final boolean releaseOnClose;
private final StringBuilder lineBuf;
private boolean closed;
public ByteBufInputStream(Object buffer) {
this(buffer, ByteBufHelper.readableBytes(buffer));
}
public ByteBufInputStream(Object buffer, int length) {
this(buffer, length, false);
}
public ByteBufInputStream(Object buffer, boolean releaseOnClose) {
this(buffer, ByteBufHelper.readableBytes(buffer), releaseOnClose);
}
public ByteBufInputStream(Object buffer, int maxLength, boolean releaseOnClose) {
this.lineBuf = new StringBuilder();
if (buffer == null) {
throw new NullPointerException("buffer");
} else if (maxLength < 0) {
if (releaseOnClose) {
ByteBufHelper.release(buffer);
}
throw new IllegalArgumentException("maxLength: " + maxLength);
} else if (ByteBufHelper.readableBytes(buffer) > maxLength) {
if (releaseOnClose) {
ByteBufHelper.release(buffer);
}
throw new IndexOutOfBoundsException("Too many bytes to be read - Found " + ByteBufHelper.readableBytes(buffer) + ", maximum is " + maxLength);
} else {
this.releaseOnClose = releaseOnClose;
this.buffer = buffer;
this.startIndex = ByteBufHelper.readerIndex(buffer);
this.endIndex = this.startIndex + ByteBufHelper.readableBytes(buffer);
ByteBufHelper.markReaderIndex(buffer);
}
}
public int readBytes() {
return ByteBufHelper.readerIndex(buffer) - this.startIndex;
}
public void close() throws IOException {
try {
super.close();
} finally {
if (this.releaseOnClose && !this.closed) {
this.closed = true;
ByteBufHelper.release(buffer);
}
}
}
public int available() throws IOException {
return this.endIndex - ByteBufHelper.readerIndex(buffer);
}
public void mark(int readlimit) {
ByteBufHelper.markReaderIndex(buffer);
}
public boolean markSupported() {
return true;
}
public int read() throws IOException {
return !(ByteBufHelper.isReadable(buffer)) ? -1 : ByteBufHelper.readByte(buffer) & 255;
}
public int read(byte[] b, int off, int len) throws IOException {
int available = this.available();
if (available == 0) {
return -1;
} else {
len = Math.min(available, len);
ByteBufHelper.readBytes(buffer, b, off, len);
return len;
}
}
public void reset() throws IOException {
ByteBufHelper.resetReaderIndex(buffer);
}
public long skip(long n) throws IOException {
return n > 2147483647L ? (long) this.skipBytes(2147483647) : (long) this.skipBytes((int) n);
}
public boolean readBoolean() throws IOException {
this.checkAvailable(1);
return this.read() != 0;
}
public byte[] readBytes(int len) {
byte[] bytes = new byte[len];
ByteBufHelper.readBytes(buffer, bytes);
return bytes;
}
public byte readByte() throws IOException {
if (!(ByteBufHelper.isReadable(buffer))) {
throw new EOFException();
} else {
return ByteBufHelper.readByte(buffer);
}
}
public char readChar() throws IOException {
return (char) this.readShort();
}
public double readDouble() throws IOException {
return Double.longBitsToDouble(this.readLong());
}
public float readFloat() throws IOException {
return Float.intBitsToFloat(this.readInt());
}
public void readFully(byte[] b) throws IOException {
this.readFully(b, 0, b.length);
}
public void readFully(byte[] b, int off, int len) throws IOException {
this.checkAvailable(len);
ByteBufHelper.readBytes(buffer, b, off, len);
}
public int readInt() throws IOException {
this.checkAvailable(4);
return ByteBufHelper.readInt(buffer);
}
public String readLine() throws IOException {
this.lineBuf.setLength(0);
while (ByteBufHelper.isReadable(buffer)) {
int c = ByteBufHelper.readUnsignedByte(buffer);
switch (c) {
case 13:
if (ByteBufHelper.isReadable(buffer)
&& (char) ByteBufHelper.getUnsignedByte(buffer, ByteBufHelper.readerIndex(buffer)) == '\n') {
ByteBufHelper.skipBytes(buffer, 1);
}
case 10:
return this.lineBuf.toString();
default:
this.lineBuf.append((char) c);
}
}
return this.lineBuf.length() > 0 ? this.lineBuf.toString() : null;
}
public long readLong() throws IOException {
this.checkAvailable(8);
return ByteBufHelper.readLong(buffer);
}
public long[] readLongs(int size) throws IOException {
long[] array = new long[size];
for (int i = 0; i < array.length; i++) {
array[i] = readLong();
}
return array;
}
public short readShort() throws IOException {
this.checkAvailable(2);
return ByteBufHelper.readShort(buffer);
}
public String readUTF() throws IOException {
String text = DataInputStream.readUTF(this);
return text;
}
public int readUnsignedByte() throws IOException {
return this.readByte() & 255;
}
public int readUnsignedShort() throws IOException {
return this.readShort() & '\uffff';
}
public int skipBytes(int n) throws IOException {
int nBytes = Math.min(this.available(), n);
ByteBufHelper.skipBytes(buffer, nBytes);
return nBytes;
}
private void checkAvailable(int fieldSize) throws IOException {
if (fieldSize < 0) {
throw new IndexOutOfBoundsException("fieldSize cannot be a negative number");
} else if (fieldSize > this.available()) {
int value = this.available();
String msg = "fieldSize is too long! Length is " + fieldSize + ", but maximum is " + value;
if (value == 0) {
throw new PacketProcessException(msg);
}
else {
throw new EOFException(msg);
}
}
}
}
@@ -0,0 +1,121 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty.buffer;
import java.nio.charset.Charset;
public interface ByteBufOperator {
int capacity(Object buffer);
Object capacity(Object buffer, int capacity);
int readerIndex(Object buffer);
Object readerIndex(Object buffer, int readerIndex);
int writerIndex(Object buffer);
Object writerIndex(Object buffer, int writerIndex);
int readableBytes(Object buffer);
int writableBytes(Object buffer);
Object clear(Object buffer);
byte readByte(Object buffer);
short readShort(Object buffer);
int readMedium(Object buffer);
int readInt(Object buffer);
long readUnsignedInt(Object buffer);
long readLong(Object buffer);
void writeByte(Object buffer, int value);
void writeShort(Object buffer, int value);
void writeShortLE(Object buffer, int value);
void writeMedium(Object buffer, int value);
void writeInt(Object buffer, int value);
void writeLong(Object buffer, long value);
Object getBytes(Object buffer, int index, byte[] destination);
short getUnsignedByte(Object buffer, int index);
boolean isReadable(Object buffer);
Object copy(Object buffer);
Object duplicate(Object buffer);
boolean hasArray(Object buffer);
byte[] array(Object buffer);
Object retain(Object buffer);
Object retainedDuplicate(Object buffer);
Object readSlice(Object buffer, int length);
Object readBytes(Object buffer, byte[] destination, int destinationIndex, int length);
Object readBytes(Object buffer, int length);
void readBytes(Object buffer, byte[] bytes);
Object writeBytes(Object buffer, Object src);
Object writeBytes(Object buffer, byte[] bytes);
Object writeBytes(Object buffer, byte[] bytes, int offset, int length);
boolean release(Object buffer);
int refCnt(Object buffer);
Object skipBytes(Object buffer, int length);
String toString(Object buffer, int index, int length, Charset charset);
Object markReaderIndex(Object buffer);
Object resetReaderIndex(Object buffer);
Object markWriterIndex(Object buffer);
Object resetWriterIndex(Object buffer);
Object allocateNewBuffer(Object buffer);
default float readFloat(Object buffer) {
return Float.intBitsToFloat(readInt(buffer));
}
default void writeFloat(Object buffer, float value) {
writeInt(buffer, Float.floatToIntBits(value));
}
default double readDouble(Object buffer) {
return Double.longBitsToDouble(readLong(buffer));
}
default void writeDouble(Object buffer, double value) {
writeLong(buffer, Double.doubleToLongBits(value));
}
default char readChar(Object buffer) {
return (char) readShort(buffer);
}
default void writeChar(Object buffer, int value) {
writeShort(buffer, value);
}
//Use writeShort to write
default int readUnsignedShort(Object buffer) {
return readShort(buffer) & '\uffff';
}
//Use writeByte to write
default short readUnsignedByte(Object buffer) {
return (short) (this.readByte(buffer) & 255);
}
default boolean readBoolean(Object buffer) {
return readByte(buffer) != 0;
}
default void writeBoolean(Object buffer, boolean value) {
writeByte(buffer, value ? 1 : 0);
}
}
@@ -0,0 +1,114 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//TODO Give netty credit
package com.github.retrooper.packetevents.netty.buffer;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
public class ByteBufOutputStream extends OutputStream implements DataOutput {
private final Object buffer;
private final int startIndex;
private final DataOutputStream utf8out = new DataOutputStream(this);
public ByteBufOutputStream(Object buffer) {
if (buffer == null) {
throw new NullPointerException("buffer");
} else {
this.buffer = buffer;
this.startIndex = ByteBufHelper.writerIndex(buffer);
}
}
public int writtenBytes() {
return ByteBufHelper.writerIndex(buffer) - this.startIndex;
}
public void write(byte[] b, int off, int len) throws IOException {
if (len != 0) {
ByteBufHelper.writeBytes(buffer, b, off, len);
}
}
public void write(byte[] b) throws IOException {
ByteBufHelper.writeBytes(buffer, b);
}
public void write(int b) throws IOException {
ByteBufHelper.writeByte(buffer, b);
}
public void writeBoolean(boolean v) throws IOException {
ByteBufHelper.writeBoolean(buffer, v);
}
public void writeByte(int v) throws IOException {
ByteBufHelper.writeByte(buffer, v);
}
@Deprecated
public void writeBytes(String s) throws IOException {
throw new IllegalStateException("This operation is not supported!");
}
public void writeChar(int v) throws IOException {
ByteBufHelper.writeChar(buffer, v);
}
public void writeChars(String s) throws IOException {
int len = s.length();
for (int i = 0; i < len; ++i) {
ByteBufHelper.writeChar(buffer, s.charAt(i));
}
}
public void writeDouble(double v) throws IOException {
ByteBufHelper.writeDouble(buffer, v);
}
public void writeFloat(float v) throws IOException {
ByteBufHelper.writeFloat(buffer, v);
}
public void writeInt(int v) throws IOException {
ByteBufHelper.writeInt(buffer, v);
}
public void writeLong(long v) throws IOException {
ByteBufHelper.writeLong(buffer, v);
}
public void writeShort(int v) throws IOException {
ByteBufHelper.writeShort(buffer, v);
}
public void writeUTF(String s) throws IOException {
this.utf8out.writeUTF(s);
}
public Object buffer() {
return this.buffer;
}
}
@@ -0,0 +1,59 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty.buffer;
import com.github.retrooper.packetevents.PacketEvents;
public class UnpooledByteBufAllocationHelper {
public static Object wrappedBuffer(byte[] bytes) {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().wrappedBuffer(bytes);
}
public static Object copiedBuffer(byte[] bytes) {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().copiedBuffer(bytes);
}
public static Object buffer() {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().buffer();
}
public static Object directBuffer() {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().directBuffer();
}
public static Object compositeBuffer() {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().compositeBuffer();
}
public static Object buffer(int initialCapacity) {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().buffer(initialCapacity);
}
public static Object directBuffer(int initialCapacity) {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().directBuffer(initialCapacity);
}
public static Object compositeBuffer(int maxNumComponents) {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().compositeBuffer(maxNumComponents);
}
public static Object emptyBuffer() {
return PacketEvents.getAPI().getNettyManager().getByteBufAllocationOperator().emptyBuffer();
}
}
@@ -0,0 +1,103 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty.channel;
import com.github.retrooper.packetevents.PacketEvents;
import java.net.SocketAddress;
import java.util.Arrays;
import java.util.List;
public class ChannelHelper {
public static SocketAddress remoteAddress(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().remoteAddress(channel);
}
public static SocketAddress localAddress(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().localAddress(channel);
}
public static boolean isOpen(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().isOpen(channel);
}
public static Object close(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().close(channel);
}
public static Object write(Object channel, Object buffer) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().write(channel, buffer);
}
public static Object flush(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().flush(channel);
}
public static Object writeAndFlush(Object channel, Object buffer) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().writeAndFlush(channel, buffer);
}
public static Object fireChannelRead(Object channel, Object buffer) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().fireChannelRead(channel, buffer);
}
public static Object writeInContext(Object channel, String ctx, Object buffer) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().writeInContext(channel, ctx, buffer);
}
public static Object flushInContext(Object channel, String ctx) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().flushInContext(channel, ctx);
}
public static Object writeAndFlushInContext(Object channel, String ctx, Object buffer) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().writeAndFlushInContext(channel, ctx, buffer);
}
public static Object fireChannelReadInContext(Object channel, String ctx, Object buffer) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().fireChannelReadInContext(channel, ctx, buffer);
}
public static List<String> pipelineHandlerNames(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().pipelineHandlerNames(channel);
}
public static String pipelineHandlerNamesAsString(Object channel) {
return Arrays.toString(pipelineHandlerNames(channel).toArray(new String[0]));
}
public static Object getPipeline(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().getPipeline(channel);
}
public static Object getPipelineHandler(Object channel, String name) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().getPipelineHandler(channel, name);
}
public static Object getPipelineContext(Object channel, String handlerName) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().getPipelineContext(channel, handlerName);
}
public static Object pooledByteBuf(Object channel) {
return PacketEvents.getAPI().getNettyManager().getChannelOperator().pooledByteBuf(channel);
}
public static void runInEventLoop(Object channel, Runnable runnable) {
PacketEvents.getAPI().getNettyManager().getChannelOperator().runInEventLoop(channel, runnable);
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.netty.channel;
import java.net.SocketAddress;
import java.util.List;
public interface ChannelOperator {
SocketAddress remoteAddress(Object channel);
SocketAddress localAddress(Object channel);
boolean isOpen(Object channel);
Object close(Object channel);
Object write(Object channel, Object buffer);
Object flush(Object channel);
Object writeAndFlush(Object channel, Object buffer);
Object fireChannelRead(Object channel, Object buffer);
Object writeInContext(Object channel, String ctx, Object buffer);
Object flushInContext(Object channel, String ctx);
Object writeAndFlushInContext(Object channel, String ctx, Object buffer);
Object fireChannelReadInContext(Object channel, String ctx, Object buffer);
List<String> pipelineHandlerNames(Object channel);
Object getPipelineHandler(Object channel, String name);
Object getPipelineContext(Object channel, String name);
Object getPipeline(Object channel);
void runInEventLoop(Object channel, Runnable runnable);
Object pooledByteBuf(Object channel);
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,17 +16,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.event;
package com.github.retrooper.packetevents.protocol;
/**
* The legacy Packet listener.
* Implement this interface in your listener if you are using the legacy event system.
*
* @author retrooper
* @see PacketListenerAbstract
* @since 1.2.6
* @deprecated There is a new and better listener for the new event system.
* @since 1.8
*/
@Deprecated
public interface PacketListener {
public enum ConnectionState {
HANDSHAKING, STATUS, LOGIN, PLAY, CONFIGURATION;
public static ConnectionState getById(int id) {
if (id >= values().length || id < 0) {
return null;
}
return values()[id];
}
}
@@ -0,0 +1,32 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol;
public enum PacketSide {
CLIENT, SERVER;
public PacketSide getOpposite() {
if (this == CLIENT) {
return SERVER;
}
else {
return CLIENT;
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,12 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.packettype;
package com.github.retrooper.packetevents.protocol;
/**
* @author retrooper
* @since 1.8
*/
public enum PacketState {
STATUS, HANDSHAKING, LOGIN, PLAY
//TODO
public enum ProtocolVersion {
UNKNOWN
}
@@ -0,0 +1,144 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.advancements;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
import java.util.List;
public class Advancement {
private @Nullable ResourceLocation parent;
private @Nullable AdvancementDisplay display;
/**
* Removed with 1.20.2
*/
private List<String> criteria;
private List<List<String>> requirements;
/**
* Added with 1.20
*/
private boolean sendsTelemetryData;
public Advancement(
@Nullable ResourceLocation parent,
@Nullable AdvancementDisplay display,
List<List<String>> requirements,
boolean sendsTelemetryData
) {
this(parent, display, Collections.emptyList(), requirements, sendsTelemetryData);
}
@ApiStatus.Obsolete
public Advancement(
@Nullable ResourceLocation parent,
@Nullable AdvancementDisplay display,
List<String> criteria,
List<List<String>> requirements,
boolean sendsTelemetryData
) {
this.parent = parent;
this.display = display;
this.criteria = criteria;
this.requirements = requirements;
this.sendsTelemetryData = sendsTelemetryData;
}
public static Advancement read(PacketWrapper<?> wrapper) {
ResourceLocation parentId = wrapper.readOptional(ResourceLocation::read);
AdvancementDisplay display = wrapper.readOptional(AdvancementDisplay::read);
List<String> criteria = wrapper.getServerVersion().isOlderThan(ServerVersion.V_1_20_2)
? wrapper.readList(PacketWrapper::readString) : null;
List<List<String>> requirements = wrapper.readList(
ew -> wrapper.readList(PacketWrapper::readString));
boolean sendsTelemetryData = wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_20)
&& wrapper.readBoolean();
return new Advancement(parentId, display, criteria, requirements, sendsTelemetryData);
}
public static void write(PacketWrapper<?> wrapper, Advancement advancement) {
wrapper.writeOptional(advancement.parent, ResourceLocation::write);
wrapper.writeOptional(advancement.display, AdvancementDisplay::write);
if (wrapper.getServerVersion().isOlderThan(ServerVersion.V_1_20_2)) {
wrapper.writeList(advancement.criteria, PacketWrapper::writeString);
}
wrapper.writeList(advancement.getRequirements(), (ew, anyList) ->
ew.writeList(anyList, PacketWrapper::writeString));
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_20)) {
wrapper.writeBoolean(advancement.sendsTelemetryData);
}
}
public @Nullable ResourceLocation getParent() {
return this.parent;
}
public void setParent(@Nullable ResourceLocation parent) {
this.parent = parent;
}
public @Nullable AdvancementDisplay getDisplay() {
return this.display;
}
public void setDisplay(@Nullable AdvancementDisplay display) {
this.display = display;
}
/**
* Removed with 1.20.2
*/
public List<String> getCriteria() {
return this.criteria;
}
/**
* Removed with 1.20.2
*/
public void setCriteria(List<String> criteria) {
this.criteria = criteria;
}
public List<List<String>> getRequirements() {
return this.requirements;
}
public void setRequirements(List<List<String>> requirements) {
this.requirements = requirements;
}
/**
* Added with 1.20
*/
public boolean isSendsTelemetryData() {
return this.sendsTelemetryData;
}
/**
* Added with 1.20
*/
public void setSendsTelemetryData(boolean sendsTelemetryData) {
this.sendsTelemetryData = sendsTelemetryData;
}
}
@@ -0,0 +1,168 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.advancements;
import com.github.retrooper.packetevents.protocol.item.ItemStack;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.Nullable;
public final class AdvancementDisplay {
public static final int FLAG_HAS_BACKGROUND = 0b001;
public static final int FLAG_SHOW_TOAST = 0b010;
public static final int FLAG_HIDDEN = 0b100;
private Component title;
private Component description;
private ItemStack icon;
private AdvancementType type;
private boolean showToast;
private boolean hidden;
private @Nullable ResourceLocation background;
private float x;
private float y;
public AdvancementDisplay(Component title, Component description, ItemStack icon, AdvancementType type, @Nullable ResourceLocation background, boolean showToast,
boolean hidden, float x, float y) {
this.title = title;
this.description = description;
this.icon = icon;
this.type = type;
this.showToast = showToast;
this.hidden = hidden;
this.background = background;
this.x = x;
this.y = y;
}
public static AdvancementDisplay read(PacketWrapper<?> wrapper) {
Component title = wrapper.readComponent();
Component description = wrapper.readComponent();
ItemStack icon = wrapper.readItemStack();
AdvancementType type = wrapper.readEnum(AdvancementType.class);
int flags = wrapper.readInt();
ResourceLocation background = (flags & FLAG_HAS_BACKGROUND) != 0 ? ResourceLocation.read(wrapper) : null;
boolean showToast = (flags & FLAG_SHOW_TOAST) != 0;
boolean hidden = (flags & FLAG_HIDDEN) != 0;
float x = wrapper.readFloat();
float y = wrapper.readFloat();
return new AdvancementDisplay(title, description, icon, type, background, showToast, hidden, x, y);
}
public static void write(PacketWrapper<?> wrapper, AdvancementDisplay display) {
wrapper.writeComponent(display.title);
wrapper.writeComponent(display.description);
wrapper.writeItemStack(display.icon);
wrapper.writeEnum(display.type);
wrapper.writeInt(display.packFlags());
if (display.background != null) {
ResourceLocation.write(wrapper, display.background);
}
wrapper.writeFloat(display.x);
wrapper.writeFloat(display.y);
}
public int packFlags() {
int flags = 0;
if (this.background != null) {
flags |= FLAG_HAS_BACKGROUND;
}
if (this.showToast) {
flags |= FLAG_SHOW_TOAST;
}
if (this.hidden) {
flags |= FLAG_HIDDEN;
}
return flags;
}
public Component getTitle() {
return this.title;
}
public void setTitle(Component title) {
this.title = title;
}
public Component getDescription() {
return this.description;
}
public void setDescription(Component description) {
this.description = description;
}
public ItemStack getIcon() {
return this.icon;
}
public void setIcon(ItemStack icon) {
this.icon = icon;
}
public AdvancementType getType() {
return this.type;
}
public void setType(AdvancementType type) {
this.type = type;
}
public boolean isShowToast() {
return this.showToast;
}
public void setShowToast(boolean showToast) {
this.showToast = showToast;
}
public boolean isHidden() {
return this.hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
public @Nullable ResourceLocation getBackground() {
return this.background;
}
public void setBackground(@Nullable ResourceLocation background) {
this.background = background;
}
public float getX() {
return this.x;
}
public void setX(float x) {
this.x = x;
}
public float getY() {
return this.y;
}
public void setY(float y) {
this.y = y;
}
}
@@ -0,0 +1,60 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.advancements;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
public final class AdvancementHolder {
private ResourceLocation identifier;
private Advancement advancement;
public AdvancementHolder(ResourceLocation identifier, Advancement advancement) {
this.identifier = identifier;
this.advancement = advancement;
}
public static AdvancementHolder read(PacketWrapper<?> wrapper) {
ResourceLocation identifier = wrapper.readIdentifier();
Advancement advancement = Advancement.read(wrapper);
return new AdvancementHolder(identifier, advancement);
}
public static void write(PacketWrapper<?> wrapper, AdvancementHolder holder) {
wrapper.writeIdentifier(holder.identifier);
Advancement.write(wrapper, holder.advancement);
}
public ResourceLocation getIdentifier() {
return this.identifier;
}
public void setIdentifier(ResourceLocation identifier) {
this.identifier = identifier;
}
public Advancement getAdvancement() {
return this.advancement;
}
public void setAdvancement(Advancement advancement) {
this.advancement = advancement;
}
}
@@ -0,0 +1,75 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.advancements;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.Nullable;
import java.util.Map;
public final class AdvancementProgress {
private Map<String, CriterionProgress> criteria;
public AdvancementProgress(Map<String, CriterionProgress> criteria) {
this.criteria = criteria;
}
public static AdvancementProgress read(PacketWrapper<?> wrapper) {
Map<String, CriterionProgress> criteria = wrapper.readMap(PacketWrapper::readString, CriterionProgress::read);
return new AdvancementProgress(criteria);
}
public static void write(PacketWrapper<?> wrapper, AdvancementProgress progress) {
wrapper.writeMap(progress.getCriteria(), PacketWrapper::writeString, CriterionProgress::write);
}
public Map<String, CriterionProgress> getCriteria() {
return this.criteria;
}
public void setCriteria(Map<String, CriterionProgress> criteria) {
this.criteria = criteria;
}
public static final class CriterionProgress {
private @Nullable Long obtainedTimestamp;
public CriterionProgress(@Nullable Long obtainedTimestamp) {
this.obtainedTimestamp = obtainedTimestamp;
}
public static CriterionProgress read(PacketWrapper<?> wrapper) {
return new CriterionProgress(wrapper.readOptional(PacketWrapper::readLong));
}
public static void write(PacketWrapper<?> wrapper, CriterionProgress progress) {
wrapper.writeOptional(progress.obtainedTimestamp, PacketWrapper::writeLong);
}
public @Nullable Long getObtainedTimestamp() {
return this.obtainedTimestamp;
}
public void setObtainedTimestamp(@Nullable Long obtainedTimestamp) {
this.obtainedTimestamp = obtainedTimestamp;
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2021 retrooper and contributors
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,10 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package io.github.retrooper.packetevents.utils.versionlookup.viaversion;
package com.github.retrooper.packetevents.protocol.advancements;
import org.bukkit.entity.Player;
public enum AdvancementType {
public interface ViaVersionAccessor {
int getProtocolVersion(Player player);
TASK,
CHALLENGE,
GOAL,
;
}
@@ -0,0 +1,52 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2023 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.protocol.mapper.MappedEntity;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.MathUtil;
public interface Attribute extends MappedEntity {
@Override
default ResourceLocation getName() {
return this.getName(PacketEvents.getAPI().getServerManager().getVersion().toClientVersion());
}
ResourceLocation getName(ClientVersion version);
default double sanitizeValue(double value) {
return this.sanitizeValue(value, PacketEvents.getAPI().getServerManager().getVersion().toClientVersion());
}
default double sanitizeValue(double value, ClientVersion version) {
if (!Double.isNaN(value)) {
return MathUtil.clamp(value, this.getMinValue(), this.getMaxValue());
}
return this.getMinValue();
}
double getDefaultValue();
double getMinValue();
double getMaxValue();
}
@@ -0,0 +1,39 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface AttributeDisplay {
static AttributeDisplay read(PacketWrapper<?> wrapper) {
AttributeDisplayType<?> type = wrapper.readMappedEntity(AttributeDisplayTypes.getRegistry());
return type.read(wrapper);
}
@SuppressWarnings("unchecked") // not unchecked
static void write(PacketWrapper<?> wrapper, AttributeDisplay display) {
wrapper.writeMappedEntity(display.getType());
((AttributeDisplayType<? super AttributeDisplay>) display.getType()).write(wrapper, display);
}
AttributeDisplayType<?> getType();
}
@@ -0,0 +1,31 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.protocol.mapper.MappedEntity;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface AttributeDisplayType<T extends AttributeDisplay> extends MappedEntity {
T read(PacketWrapper<?> wrapper);
void write(PacketWrapper<?> wrapper, T display);
}
@@ -0,0 +1,56 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.util.mappings.VersionedRegistry;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
public final class AttributeDisplayTypes {
private static final VersionedRegistry<AttributeDisplayType<?>> REGISTRY = new VersionedRegistry<>("attribute_display_type");
private AttributeDisplayTypes() {
}
@ApiStatus.Internal
public static <T extends AttributeDisplay> AttributeDisplayType<T> define(
String name, PacketWrapper.Reader<T> reader, PacketWrapper.Writer<T> writer
) {
return REGISTRY.define(name, data ->
new StaticAttributeDisplayType<>(data, reader, writer));
}
public static VersionedRegistry<AttributeDisplayType<?>> getRegistry() {
return REGISTRY;
}
public static final AttributeDisplayType<DefaultAttributeDisplay> DEFAULT = define("default",
DefaultAttributeDisplay::read, DefaultAttributeDisplay::write);
public static final AttributeDisplayType<HiddenAttributeDisplay> HIDDEN = define("hidden",
HiddenAttributeDisplay::read, HiddenAttributeDisplay::write);
public static final AttributeDisplayType<OverrideAttributeDisplay> OVERRIDE = define("override",
OverrideAttributeDisplay::read, OverrideAttributeDisplay::write);
static {
REGISTRY.unloadMappings();
}
}
@@ -0,0 +1,25 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
public enum AttributeOperation {
ADDITION,
MULTIPLY_BASE,
MULTIPLY_TOTAL,
}
@@ -0,0 +1,372 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2023 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.mappings.VersionedRegistry;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
public final class Attributes {
private static final VersionedRegistry<Attribute> REGISTRY = new VersionedRegistry<>("attribute");
private Attributes() {
}
private static Attribute define(
String key, @Nullable String legacyPrefix,
double def, double min, double max
) {
return REGISTRY.define(key, data ->
new StaticAttribute(data, legacyPrefix, def, min, max));
}
public static VersionedRegistry<Attribute> getRegistry() {
return REGISTRY;
}
public static Attribute getByName(String name) {
// "remapping" to support < 1.21.2
String normedName = ResourceLocation.normString(name);
if (normedName.startsWith(ResourceLocation.VANILLA_NAMESPACE + ":generic.")
|| normedName.startsWith(ResourceLocation.VANILLA_NAMESPACE + ":player.")
|| normedName.startsWith(ResourceLocation.VANILLA_NAMESPACE + ":zombie.")) {
normedName = normedName.substring(normedName.indexOf('.') + 1);
}
return REGISTRY.getByName(normedName);
}
public static Attribute getById(ClientVersion version, int id) {
return REGISTRY.getById(version, id);
}
public static final Attribute ARMOR = define("armor",
"generic", 0d, 0d, 30d);
public static final Attribute ARMOR_TOUGHNESS = define("armor_toughness",
"generic", 0d, 0d, 20d);
public static final Attribute ATTACK_DAMAGE = define("attack_damage",
"generic", 2d, 0d, 2048d);
public static final Attribute ATTACK_KNOCKBACK = define("attack_knockback",
"generic", 0d, 0d, 5d);
public static final Attribute ATTACK_SPEED = define("attack_speed",
"generic", 4d, 0d, 1024d);
public static final Attribute FLYING_SPEED = define("flying_speed",
"generic", 0.4d, 0d, 1024d);
public static final Attribute FOLLOW_RANGE = define("follow_range",
"generic", 32d, 0d, 2048d);
public static final Attribute KNOCKBACK_RESISTANCE = define("knockback_resistance",
"generic", 0d, 0d, 1d);
public static final Attribute LUCK = define("luck",
"generic", 0d, -1024d, 1024d);
public static final Attribute MAX_HEALTH = define("max_health",
"generic", 20d, 1d, 1024d);
public static final Attribute MOVEMENT_SPEED = define("movement_speed",
"generic", 0.7d, 0d, 1024d);
public static final Attribute SPAWN_REINFORCEMENTS = define("spawn_reinforcements",
"zombie", 0d, 0d, 1d);
/**
* Added with 1.20.2
*/
public static final Attribute MAX_ABSORPTION = define("max_absorption",
"generic", 0d, 0d, 2048d);
/**
* Added with 1.20.5
*/
public static final Attribute BLOCK_BREAK_SPEED = define("block_break_speed",
"player", 1d, 0d, 1024d);
/**
* Added with 1.20.5
*/
public static final Attribute BLOCK_INTERACTION_RANGE = define("block_interaction_range",
"player", 4.5d, 0d, 64d);
/**
* Added with 1.20.5
*/
public static final Attribute ENTITY_INTERACTION_RANGE = define("entity_interaction_range",
"player", 3d, 0d, 64d);
/**
* Added with 1.20.5
*/
public static final Attribute FALL_DAMAGE_MULTIPLIER = define("fall_damage_multiplier",
"generic", 1d, 0d, 100d);
/**
* Added with 1.20.5
*/
public static final Attribute GRAVITY = define("gravity",
"generic", 0.08d, -1d, 1d);
/**
* Added with 1.20.5
*/
public static final Attribute JUMP_STRENGTH = define("jump_strength",
"generic", 0.42d, 0d, 32d);
/**
* Added with 1.20.5
*/
public static final Attribute SAFE_FALL_DISTANCE = define("safe_fall_distance",
"generic", 3d, 0d, 1024d);
/**
* Added with 1.20.5
*/
public static final Attribute SCALE = define("scale",
"generic", 1d, 1d / 16d, 16d);
/**
* Added with 1.20.5
*/
public static final Attribute STEP_HEIGHT = define("step_height",
"generic", 0.6d, 0d, 10d);
/**
* Added with 1.21
*/
public static final Attribute BURNING_TIME = define("burning_time",
"generic", 0d, 1d, 1024d);
/**
* Added with 1.21
*/
public static final Attribute EXPLOSION_KNOCKBACK_RESISTANCE = define("explosion_knockback_resistance",
"generic", 0d, 0d, 1d);
/**
* Added with 1.21
*/
public static final Attribute MINING_EFFICIENCY = define("mining_efficiency",
"player", 0d, 0d, 1024d);
/**
* Added with 1.21
*/
public static final Attribute MOVEMENT_EFFICIENCY = define("movement_efficiency",
"generic", 0d, 0d, 1d);
/**
* Added with 1.21
*/
public static final Attribute OXYGEN_BONUS = define("oxygen_bonus",
"generic", 0d, 0d, 1024d);
/**
* Added with 1.21
*/
public static final Attribute SNEAKING_SPEED = define("sneaking_speed",
"player", 0.3d, 0d, 1d);
/**
* Added with 1.21
*/
public static final Attribute SUBMERGED_MINING_SPEED = define("submerged_mining_speed",
"player", 0.2d, 0d, 20d);
/**
* Added with 1.21
*/
public static final Attribute SWEEPING_DAMAGE_RATIO = define("sweeping_damage_ratio",
"player", 0d, 0d, 1d);
/**
* Added with 1.21
*/
public static final Attribute WATER_MOVEMENT_EFFICIENCY = define("water_movement_efficiency",
"generic", 0d, 0d, 1d);
/**
* Added with 1.21.2
*/
public static final Attribute TEMPT_RANGE = define("tempt_range",
null, 10d, 0d, 2048d);
/**
* Added with 1.21.6
*/
public static final Attribute CAMERA_DISTANCE = define("camera_distance",
null, 4d, 0d, 32d);
/**
* Added with 1.21.6
*/
public static final Attribute WAYPOINT_TRANSMIT_RANGE = define("waypoint_transmit_range",
null, 0d, 0d, 60_000_000d);
/**
* Added with 1.21.6
*/
public static final Attribute WAYPOINT_RECEIVE_RANGE = define("waypoint_receive_range",
null, 0d, 0d, 60_000_000d);
/**
* This attribute has been renamed in 1.20.5 to {@link #JUMP_STRENGTH}
*/
@ApiStatus.Obsolete
public static final Attribute HORSE_JUMP_STRENGTH = define("horse.jump_strength",
null, 0.7d, 0d, 2d);
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ARMOR = ARMOR;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ARMOR_TOUGHNESS = ARMOR_TOUGHNESS;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ATTACK_DAMAGE = ATTACK_DAMAGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ATTACK_KNOCKBACK = ATTACK_KNOCKBACK;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_ATTACK_SPEED = ATTACK_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_FLYING_SPEED = FLYING_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_FOLLOW_RANGE = FOLLOW_RANGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_KNOCKBACK_RESISTANCE = KNOCKBACK_RESISTANCE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_LUCK = LUCK;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MAX_HEALTH = MAX_HEALTH;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MOVEMENT_SPEED = MOVEMENT_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute ZOMBIE_SPAWN_REINFORCEMENTS = SPAWN_REINFORCEMENTS;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MAX_ABSORPTION = MAX_ABSORPTION;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_BLOCK_BREAK_SPEED = BLOCK_BREAK_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_BLOCK_INTERACTION_RANGE = BLOCK_INTERACTION_RANGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_ENTITY_INTERACTION_RANGE = ENTITY_INTERACTION_RANGE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_FALL_DAMAGE_MULTIPLIER = FALL_DAMAGE_MULTIPLIER;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_GRAVITY = GRAVITY;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_JUMP_STRENGTH = JUMP_STRENGTH;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_SAFE_FALL_DISTANCE = SAFE_FALL_DISTANCE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_SCALE = SCALE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_STEP_HEIGHT = STEP_HEIGHT;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_BURNING_TIME = BURNING_TIME;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_EXPLOSION_KNOCKBACK_RESISTANCE = EXPLOSION_KNOCKBACK_RESISTANCE;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_MINING_EFFICIENCY = MINING_EFFICIENCY;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_MOVEMENT_EFFICIENCY = MOVEMENT_EFFICIENCY;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_OXYGEN_BONUS = OXYGEN_BONUS;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_SNEAKING_SPEED = SNEAKING_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_SUBMERGED_MINING_SPEED = SUBMERGED_MINING_SPEED;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute PLAYER_SWEEPING_DAMAGE_RATIO = SWEEPING_DAMAGE_RATIO;
/**
* All attribute "type" prefixes were removed with 1.21.2
*/
@Deprecated
public static final Attribute GENERIC_WATER_MOVEMENT_EFFICIENCY = WATER_MOVEMENT_EFFICIENCY;
static {
REGISTRY.unloadMappings();
}
}
@@ -0,0 +1,44 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class DefaultAttributeDisplay implements AttributeDisplay {
public static final DefaultAttributeDisplay INSTANCE = new DefaultAttributeDisplay();
private DefaultAttributeDisplay() {
}
public static DefaultAttributeDisplay read(PacketWrapper<?> wrapper) {
return INSTANCE;
}
public static void write(PacketWrapper<?> wrapper, DefaultAttributeDisplay display) {
// NO-OP
}
@Override
public AttributeDisplayType<?> getType() {
return AttributeDisplayTypes.DEFAULT;
}
}
@@ -0,0 +1,44 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class HiddenAttributeDisplay implements AttributeDisplay {
public static final HiddenAttributeDisplay INSTANCE = new HiddenAttributeDisplay();
private HiddenAttributeDisplay() {
}
public static HiddenAttributeDisplay read(PacketWrapper<?> wrapper) {
return INSTANCE;
}
public static void write(PacketWrapper<?> wrapper, HiddenAttributeDisplay display) {
// NO-OP
}
@Override
public AttributeDisplayType<?> getType() {
return AttributeDisplayTypes.HIDDEN;
}
}
@@ -0,0 +1,64 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.text.Component;
import org.jspecify.annotations.NullMarked;
import java.util.Objects;
@NullMarked
public class OverrideAttributeDisplay implements AttributeDisplay {
private final Component component;
public OverrideAttributeDisplay(Component component) {
this.component = component;
}
public static OverrideAttributeDisplay read(PacketWrapper<?> wrapper) {
return new OverrideAttributeDisplay(wrapper.readComponent());
}
public static void write(PacketWrapper<?> wrapper, OverrideAttributeDisplay display) {
wrapper.writeComponent(display.component);
}
@Override
public AttributeDisplayType<?> getType() {
return AttributeDisplayTypes.OVERRIDE;
}
public Component getComponent() {
return this.component;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof OverrideAttributeDisplay)) return false;
OverrideAttributeDisplay that = (OverrideAttributeDisplay) obj;
return this.component.equals(that.component);
}
@Override
public int hashCode() {
return Objects.hashCode(this.component);
}
}
@@ -0,0 +1,71 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.protocol.mapper.AbstractMappedEntity;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
public class StaticAttribute extends AbstractMappedEntity implements Attribute {
private final @Nullable ResourceLocation legacyName;
private final double defaultValue;
private final double minValue;
private final double maxValue;
@ApiStatus.Internal
public StaticAttribute(
@Nullable TypesBuilderData data, String legacyPrefix,
double defaultValue, double minValue, double maxValue
) {
super(data);
this.defaultValue = defaultValue;
this.minValue = minValue;
this.maxValue = maxValue;
this.legacyName = legacyPrefix == null || data == null ? null : new ResourceLocation(
data.getName().getNamespace(), legacyPrefix + "." + data.getName().getKey());
}
@Override
public ResourceLocation getName(ClientVersion version) {
if (this.data == null) {
throw new UnsupportedOperationException();
}
return version.isNewerThanOrEquals(ClientVersion.V_1_21_2) || this.legacyName == null
? this.data.getName() : this.legacyName;
}
@Override
public double getDefaultValue() {
return this.defaultValue;
}
@Override
public double getMinValue() {
return this.minValue;
}
@Override
public double getMaxValue() {
return this.maxValue;
}
}
@@ -0,0 +1,52 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.attribute;
import com.github.retrooper.packetevents.protocol.mapper.AbstractMappedEntity;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import com.github.retrooper.packetevents.wrapper.PacketWrapper.Reader;
import com.github.retrooper.packetevents.wrapper.PacketWrapper.Writer;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class StaticAttributeDisplayType<T extends AttributeDisplay> extends AbstractMappedEntity implements AttributeDisplayType<T> {
private final Reader<T> reader;
private final Writer<T> writer;
@ApiStatus.Internal
public StaticAttributeDisplayType(@Nullable TypesBuilderData data, Reader<T> reader, Writer<T> writer) {
super(data);
this.reader = reader;
this.writer = writer;
}
@Override
public T read(PacketWrapper<?> wrapper) {
return this.reader.apply(wrapper);
}
@Override
public void write(PacketWrapper<?> wrapper, T display) {
this.writer.accept(wrapper, display);
}
}
@@ -0,0 +1,13 @@
package com.github.retrooper.packetevents.protocol.chat;
public enum ChatCompletionAction {
ADD,
REMOVE,
SET;
private static final ChatCompletionAction[] VALUES = values();
public static ChatCompletionAction fromId(int id) {
return VALUES[id];
}
}
@@ -0,0 +1,169 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import com.github.retrooper.packetevents.protocol.chat.message.ChatMessage_v1_19_1;
import com.github.retrooper.packetevents.protocol.mapper.CopyableEntity;
import com.github.retrooper.packetevents.protocol.mapper.DeepComparableEntity;
import com.github.retrooper.packetevents.protocol.mapper.MappedEntity;
import com.github.retrooper.packetevents.protocol.nbt.NBT;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTString;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.util.Index;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.Objects;
import static com.github.retrooper.packetevents.util.adventure.AdventureIndexUtil.indexValueOrThrow;
@NullMarked
public interface ChatType extends MappedEntity, CopyableEntity<ChatType>, DeepComparableEntity {
@UnknownNullability("only nullable for 1.19")
ChatTypeDecoration getChatDecoration();
@ApiStatus.Obsolete(since = "1.19.1")
@Nullable ChatTypeDecoration getOverlayDecoration();
@UnknownNullability("only nullable for 1.19")
ChatTypeDecoration getNarrationDecoration();
@ApiStatus.Obsolete(since = "1.19.1")
@Nullable NarrationPriority getNarrationPriority();
static ChatType readDirect(PacketWrapper<?> wrapper) {
ChatTypeDecoration chatDecoration = ChatTypeDecoration.read(wrapper);
ChatTypeDecoration narrationDecoration = ChatTypeDecoration.read(wrapper);
return new StaticChatType(chatDecoration, narrationDecoration);
}
static void writeDirect(PacketWrapper<?> wrapper, ChatType chatType) {
ChatTypeDecoration.write(wrapper, chatType.getChatDecoration());
ChatTypeDecoration.write(wrapper, chatType.getNarrationDecoration());
}
static ChatType decode(NBT nbt, ClientVersion version, @Nullable TypesBuilderData data) {
// everything is nullable in 1.19, even the chat format!
NBTCompound compound = (NBTCompound) nbt;
NBTCompound chatTag = compound.getCompoundTagOrNull("chat");
NBTCompound narrationTag = compound.getCompoundTagOrNull("narration");
ChatTypeDecoration overlay = null;
NarrationPriority narrationPriority = null;
if (version.isOlderThan(ClientVersion.V_1_19_1)) {
NBTCompound overlayTag = compound.getCompoundTagOrNull("overlay");
if (overlayTag != null) {
// why is this nullable? why is this wrapped? There is no reason to wrap this...
overlayTag = overlayTag.getCompoundTagOrNull("description");
if (overlayTag != null) {
overlay = ChatTypeDecoration.decode(overlayTag, version);
}
}
if (chatTag != null) {
chatTag = chatTag.getCompoundTagOrNull("description");
}
if (narrationTag != null) {
// the priority is the ONLY value which isn't nullable!
narrationPriority = indexValueOrThrow(NarrationPriority.ID_INDEX,
narrationTag.getStringTagValueOrThrow("priority"));
narrationTag = narrationTag.getCompoundTagOrNull("description");
}
} else {
// ensure this isn't null in everything but 1.19
Objects.requireNonNull(chatTag, "NBT chat does not exist");
Objects.requireNonNull(narrationTag, "NBT narration does not exist");
}
ChatTypeDecoration chat = chatTag == null ? null : ChatTypeDecoration.decode(chatTag, version);
ChatTypeDecoration narration = narrationTag == null ? null : ChatTypeDecoration.decode(narrationTag, version);
return new StaticChatType(data, chat, overlay, narration, narrationPriority);
}
static NBT encode(ChatType chatType, ClientVersion version) {
NBTCompound compound = new NBTCompound();
NBT chatTag = chatType.getChatDecoration() == null ? null :
ChatTypeDecoration.encode(chatType.getChatDecoration(), version);
NBT narrationTag = chatType.getNarrationDecoration() == null ? null :
ChatTypeDecoration.encode(chatType.getNarrationDecoration(), version);
if (version.isOlderThan(ClientVersion.V_1_19_1)) {
ChatTypeDecoration overlayDeco = chatType.getOverlayDecoration();
if (overlayDeco != null) {
NBTCompound overlayCompound = new NBTCompound();
overlayCompound.setTag("description",
ChatTypeDecoration.encode(overlayDeco, version));
compound.setTag("overlay", overlayCompound);
}
if (narrationTag != null) {
NBTCompound narrationCompound = new NBTCompound();
narrationCompound.setTag("description", narrationTag);
if (chatType.getNarrationPriority() != null) {
narrationCompound.setTag("priority", new NBTString(chatType.getNarrationPriority().getId()));
}
narrationTag = narrationCompound;
}
if (chatTag != null) {
NBTCompound chatCompound = new NBTCompound();
chatCompound.setTag("description", chatTag);
chatTag = chatCompound;
}
}
if (chatTag != null) {
compound.setTag("chat", chatTag);
}
if (narrationTag != null) {
compound.setTag("narration", narrationTag);
}
return compound;
}
class Bound extends ChatMessage_v1_19_1.ChatTypeBoundNetwork {
public Bound(ChatType type, Component name, @Nullable Component targetName) {
super(type, name, targetName);
}
}
@ApiStatus.Obsolete(since = "1.19.1")
enum NarrationPriority {
CHAT("chat"),
SYSTEM("system");
public static final Index<String, NarrationPriority> ID_INDEX = Index.create(
NarrationPriority.class, NarrationPriority::getId);
private final String id;
NarrationPriority(String id) {
this.id = id;
}
public String getId() {
return this.id;
}
}
}
@@ -0,0 +1,205 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import com.github.retrooper.packetevents.protocol.nbt.NBT;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTList;
import com.github.retrooper.packetevents.protocol.nbt.NBTString;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.util.adventure.AdventureSerializer;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentLike;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.util.Index;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.function.BiFunction;
import static com.github.retrooper.packetevents.protocol.chat.ChatTypeDecoration.Parameter.CONTENT;
import static com.github.retrooper.packetevents.protocol.chat.ChatTypeDecoration.Parameter.SENDER;
import static com.github.retrooper.packetevents.protocol.chat.ChatTypeDecoration.Parameter.TARGET;
import static com.github.retrooper.packetevents.util.adventure.AdventureIndexUtil.indexValueOrThrow;
import static java.util.Arrays.asList;
import static net.kyori.adventure.text.format.NamedTextColor.GRAY;
import static net.kyori.adventure.text.format.Style.empty;
import static net.kyori.adventure.text.format.Style.style;
import static net.kyori.adventure.text.format.TextDecoration.ITALIC;
public class ChatTypeDecoration {
private final String translationKey;
private final List<Parameter> parameters;
private final Style style;
public ChatTypeDecoration(String translationKey, List<Parameter> parameters, Style style) {
this.translationKey = translationKey;
this.parameters = Collections.unmodifiableList(new ArrayList<>(parameters));
this.style = style;
}
public static ChatTypeDecoration read(PacketWrapper<?> wrapper) {
String translationKey = wrapper.readString();
List<Parameter> parameters = wrapper.readList(ew -> ew.readEnum(Parameter.values()));
Style style = wrapper.readStyle();
return new ChatTypeDecoration(translationKey, parameters, style);
}
public static void write(PacketWrapper<?> wrapper, ChatTypeDecoration decoration) {
wrapper.writeString(decoration.translationKey);
wrapper.writeList(decoration.parameters, PacketWrapper::writeEnum);
wrapper.writeStyle(decoration.style);
}
@Deprecated
public static ChatTypeDecoration decode(NBT nbt, ClientVersion version) {
return decode(nbt, PacketWrapper.createDummyWrapper(version));
}
public static ChatTypeDecoration decode(NBT nbt, PacketWrapper<?> wrapper) {
NBTCompound compound = (NBTCompound) nbt;
String translationKey = compound.getStringTagValueOrThrow("translation_key");
NBT paramsTag = compound.getTagOrThrow("parameters");
List<Parameter> params;
if (paramsTag instanceof NBTList<?>) {
params = new ArrayList<>();
NBTList<?> paramsTagList = (NBTList<?>) paramsTag;
for (NBT paramTag : paramsTagList.getTags()) {
String paramId = ((NBTString) paramTag).getValue();
params.add(indexValueOrThrow(Parameter.ID_INDEX, paramId));
}
} else {
String paramId = ((NBTString) paramsTag).getValue();
params = Collections.singletonList(indexValueOrThrow(Parameter.ID_INDEX, paramId));
}
NBTCompound styleTag = compound.getCompoundTagOrNull("style");
Style style = styleTag == null ? empty() :
wrapper.getSerializers().nbt().deserializeStyle(styleTag, wrapper);
return new ChatTypeDecoration(translationKey, params, style);
}
@Deprecated
public static NBT encode(ChatTypeDecoration decoration, ClientVersion version) {
return encode(decoration, PacketWrapper.createDummyWrapper(version));
}
public static NBT encode(ChatTypeDecoration decoration, PacketWrapper<?> wrapper) {
NBTList<NBTString> paramsTag = NBTList.createStringList();
for (Parameter param : decoration.parameters) {
paramsTag.addTag(new NBTString(param.getId()));
}
NBTCompound compound = new NBTCompound();
compound.setTag("translation_key", new NBTString(decoration.translationKey));
compound.setTag("parameters", paramsTag);
if (!decoration.style.isEmpty()) {
compound.setTag("style", wrapper.getSerializers()
.nbt().serializeStyle(decoration.style, wrapper));
}
return compound;
}
public static ChatTypeDecoration withSender(String translationKey) {
return new ChatTypeDecoration(translationKey, asList(SENDER, CONTENT), empty());
}
public static ChatTypeDecoration incomingDirectMessage(String translationKey) {
return new ChatTypeDecoration(translationKey, asList(SENDER, CONTENT),
style(GRAY, ITALIC));
}
public static ChatTypeDecoration outgoingDirectMessage(String translationKey) {
return new ChatTypeDecoration(translationKey, asList(TARGET, CONTENT),
style(GRAY, ITALIC));
}
public static ChatTypeDecoration teamMessage(String translationKey) {
return new ChatTypeDecoration(translationKey, asList(TARGET, SENDER, CONTENT), empty());
}
public Component decorate(Component component, ChatType.Bound chatType) {
ComponentLike[] components = new ComponentLike[this.parameters.size()];
for (int i = 0; i < components.length; i++) {
Parameter parameter = this.parameters.get(i);
components[i] = parameter.selector.apply(component, chatType);
}
return Component.translatable(this.translationKey, null, this.style, components);
}
public String getTranslationKey() {
return this.translationKey;
}
public List<Parameter> getParameters() {
return this.parameters;
}
public Style getStyle() {
return this.style;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (!(obj instanceof ChatTypeDecoration)) return false;
ChatTypeDecoration that = (ChatTypeDecoration) obj;
if (!this.translationKey.equals(that.translationKey)) return false;
if (!this.parameters.equals(that.parameters)) return false;
return this.style.equals(that.style);
}
@Override
public int hashCode() {
return Objects.hash(this.translationKey, this.parameters, this.style);
}
public enum Parameter {
SENDER("sender", (component, type) -> type.getName()),
TARGET("target", (component, type) -> type.getTargetName() != null
? type.getTargetName() : Component.empty()),
CONTENT("content", (component, type) -> component);
public static final Index<String, Parameter> ID_INDEX = Index.create(
Parameter.class, Parameter::getId);
private final String id;
private final BiFunction<Component, ChatType.Bound, Component> selector;
Parameter(String id, BiFunction<Component, ChatType.Bound, Component> selector) {
this.id = id;
this.selector = selector;
}
public String getId() {
return this.id;
}
@Deprecated
public static @Nullable Parameter valueByName(String id) {
return ID_INDEX.value(id);
}
}
}
@@ -0,0 +1,106 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.util.mappings.VersionedRegistry;
import org.jetbrains.annotations.ApiStatus;
import java.util.Collection;
import static com.github.retrooper.packetevents.protocol.chat.ChatTypeDecoration.incomingDirectMessage;
import static com.github.retrooper.packetevents.protocol.chat.ChatTypeDecoration.outgoingDirectMessage;
import static com.github.retrooper.packetevents.protocol.chat.ChatTypeDecoration.teamMessage;
import static com.github.retrooper.packetevents.protocol.chat.ChatTypeDecoration.withSender;
public final class ChatTypes {
private static final VersionedRegistry<ChatType> REGISTRY = new VersionedRegistry<>("chat_type");
private ChatTypes() {
}
@ApiStatus.Internal
public static ChatType define(String key) {
return define(key, withSender("chat.type.text"));
}
@ApiStatus.Internal
public static ChatType define(String key, ChatTypeDecoration chatDeco) {
return define(key, chatDeco, withSender("chat.type.text.narrate"));
}
@ApiStatus.Internal
public static ChatType define(String key, ChatTypeDecoration chatDeco, ChatTypeDecoration narrationDeco) {
return REGISTRY.define(key, data ->
new StaticChatType(data, chatDeco, narrationDeco));
}
public static VersionedRegistry<ChatType> getRegistry() {
return REGISTRY;
}
public static ChatType getByName(String name) {
return REGISTRY.getByName(name);
}
public static ChatType getById(ClientVersion version, int id) {
return REGISTRY.getById(version, id);
}
public static final ChatType CHAT = define("chat");
public static final ChatType SAY_COMMAND = define("say_command",
withSender("chat.type.announcement"));
public static final ChatType MSG_COMMAND_INCOMING = define("msg_command_incoming",
incomingDirectMessage("commands.message.display.incoming"));
public static final ChatType MSG_COMMAND_OUTGOING = define("msg_command_outgoing",
outgoingDirectMessage("commands.message.display.outgoing"));
public static final ChatType TEAM_MSG_COMMAND_INCOMING = define("team_msg_command_incoming",
teamMessage("chat.type.team.text"));
public static final ChatType TEAM_MSG_COMMAND_OUTGOING = define("team_msg_command_outgoing",
teamMessage("chat.type.team.sent"));
public static final ChatType EMOTE_COMMAND = define("emote_command",
withSender("chat.type.emote"),
withSender("chat.type.emote"));
// added by CraftBukkit for a few versions
public static final ChatType RAW = define("raw");
@Deprecated
public static final ChatType SYSTEM = define("system");
@Deprecated
public static final ChatType GAME_INFO = define("game_info");
@Deprecated
public static final ChatType MSG_COMMAND = define("msg_command");
@Deprecated
public static final ChatType TEAM_MSG_COMMAND = define("team_msg_command");
/**
* Returns an immutable view of the chat types.
*
* @return Chat Types
*/
public static Collection<ChatType> values() {
return REGISTRY.getEntries();
}
static {
REGISTRY.unloadMappings();
}
}
@@ -0,0 +1,124 @@
package com.github.retrooper.packetevents.protocol.chat;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import java.io.DataOutput;
import java.io.IOException;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.List;
import java.util.UUID;
public class LastSeenMessages {
public static final LastSeenMessages EMPTY = new LastSeenMessages(new ArrayList<>());
private final List<Entry> entries;
public LastSeenMessages(List<Entry> entries) {
this.entries = entries;
}
public void updateHash(DataOutput output) throws IOException {
for (Entry entry : this.entries) {
UUID uuid = entry.getUUID();
byte[] lastVerifier = entry.getLastVerifier();
output.writeByte(70);
output.writeLong(uuid.getMostSignificantBits());
output.writeLong(uuid.getLeastSignificantBits());
output.write(lastVerifier);
}
}
public List<Entry> getEntries() {
return entries;
}
public static class Packed {
private List<MessageSignature.Packed> packedMessageSignatures;
public Packed(List<MessageSignature.Packed> packedMessageSignatures) {
this.packedMessageSignatures = packedMessageSignatures;
}
public List<MessageSignature.Packed> getPackedMessageSignatures() {
return packedMessageSignatures;
}
public void setPackedMessageSignatures(List<MessageSignature.Packed> packedMessageSignatures) {
this.packedMessageSignatures = packedMessageSignatures;
}
}
public static class Entry {
private final UUID uuid;
private final byte[] signature;
public Entry(UUID uuid, byte[] lastVerifier) {
this.uuid = uuid;
this.signature = lastVerifier;
}
public UUID getUUID() {
return uuid;
}
public byte[] getLastVerifier() {
return signature;
}
}
public static class LegacyUpdate {
private final LastSeenMessages lastSeenMessages;
private final @Nullable Entry lastReceived;
public LegacyUpdate(LastSeenMessages lastSeenMessages, @Nullable Entry lastReceived) {
this.lastSeenMessages = lastSeenMessages;
this.lastReceived = lastReceived;
}
public LastSeenMessages getLastSeenMessages() {
return lastSeenMessages;
}
public @Nullable Entry getLastReceived() {
return lastReceived;
}
}
public static class Update {
private final int offset;
private final BitSet acknowledged;
private final byte checksum;
/**
* Checksum has been added with 1.21.5
*/
@ApiStatus.Obsolete
public Update(int offset, BitSet acknowledged) {
this(offset, acknowledged, (byte) 0);
}
public Update(int offset, BitSet acknowledged, byte checksum) {
this.offset = offset;
this.acknowledged = acknowledged;
this.checksum = checksum;
}
public int getOffset() {
return offset;
}
public BitSet getAcknowledged() {
return acknowledged;
}
/**
* Added with 1.21.5
*/
public byte getChecksum() {
return this.checksum;
}
}
}
@@ -0,0 +1,69 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.UUID;
public class MessageSender {
private @NotNull UUID uuid;
private @Nullable Component displayName;
private @Nullable Component teamName;
public MessageSender(@NotNull UUID uuid, @Nullable Component displayName, @Nullable Component teamName) {
this.uuid = uuid;
this.displayName = displayName;
this.teamName = teamName;
}
public MessageSender(@Nullable Component displayName, @Nullable Component teamName) {
this(new UUID(0L, 0L), displayName, teamName);
}
public MessageSender() {
this(null, null);
}
public UUID getUUID() {
return uuid;
}
public void setUUID(@NotNull UUID uuid) {
this.uuid = uuid;
}
public @Nullable Component getDisplayName() {
return displayName;
}
public void setDisplayName(@Nullable Component displayName) {
this.displayName = displayName;
}
public @Nullable Component getTeamName() {
return teamName;
}
public void setTeamName(@Nullable Component teamName) {
this.teamName = teamName;
}
}
@@ -0,0 +1,70 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2023 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import org.jetbrains.annotations.Nullable;
import java.util.Optional;
public class MessageSignature {
private byte[] bytes;
public MessageSignature(byte[] bytes) {
this.bytes = bytes;
}
public byte[] getBytes() {
return bytes;
}
public void setBytes(byte[] bytes) {
this.bytes = bytes;
}
public static class Packed {
private int id;
private @Nullable MessageSignature fullSignature;
public Packed(@Nullable MessageSignature fullSignature) {
this.id = -1;
this.fullSignature = fullSignature;
}
public Packed(int id) {
this.id = id;
this.fullSignature = null;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Optional<MessageSignature> getFullSignature() {
return Optional.ofNullable(fullSignature);
}
public void setFullSignature(@Nullable MessageSignature fullSignature) {
this.fullSignature = fullSignature;
}
}
}
@@ -0,0 +1,140 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.protocol.chat.Parsers.Parser;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import java.util.Optional;
public class Node {
public static final byte TYPE_MASK = 0b11;
public static final byte TYPE_ROOT = 0b00;
public static final byte TYPE_LITERAL = 0b01;
public static final byte TYPE_ARGUMENT = 0b10;
public static final byte FLAG_MASK = ~TYPE_MASK;
public static final byte FLAG_EXECUTABLE = 0b000100;
public static final byte FLAG_REDIRECT = 0b001000;
public static final byte FLAG_CUSTOM_SUGGESTIONS = 0b010000;
/**
* Added with 1.21.6
*/
public static final byte FLAG_RESTRICTED = 0b100000;
private byte flags;
private List<Integer> children;
private int redirectNodeIndex;
private Optional<String> name;
private Optional<Parser> parser;
private Optional<List<Object>> properties;
private Optional<ResourceLocation> suggestionsType;
public Node(
byte flags, List<Integer> children, int redirectNodeIndex, @Nullable String name,
@Nullable Integer parserID, @Nullable List<Object> properties, @Nullable ResourceLocation suggestionsType
) {
this(flags, children, redirectNodeIndex, name, parserID == null ? null : Parsers.getById(
PacketEvents.getAPI().getServerManager().getVersion().toClientVersion(), parserID),
properties, suggestionsType);
}
public Node(
byte flags, List<Integer> children, int redirectNodeIndex, @Nullable String name, @Nullable Parser parser,
@Nullable List<Object> properties, @Nullable ResourceLocation suggestionsType
) {
this.flags = flags;
this.children = children;
this.redirectNodeIndex = redirectNodeIndex;
this.name = Optional.ofNullable(name);
this.parser = Optional.ofNullable(parser);
this.properties = Optional.ofNullable(properties);
this.suggestionsType = Optional.ofNullable(suggestionsType);
}
public byte getFlags() {
return flags;
}
public void setFlags(byte flags) {
this.flags = flags;
}
public List<Integer> getChildren() {
return children;
}
public void setChildren(List<Integer> children) {
this.children = children;
}
public int getRedirectNodeIndex() {
return redirectNodeIndex;
}
public void setRedirectNodeIndex(int redirectNodeIndex) {
this.redirectNodeIndex = redirectNodeIndex;
}
public Optional<String> getName() {
return name;
}
public void setName(Optional<String> name) {
this.name = name;
}
public Optional<Parser> getParser() {
return this.parser;
}
public void setParser(Optional<Parser> parser) {
this.parser = parser;
}
public Optional<Integer> getParserID() {
return this.parser.map(parser -> parser.getId(PacketEvents.getAPI()
.getServerManager().getVersion().toClientVersion()));
}
public void setParserID(Optional<Integer> parserID) {
this.parser = parserID.map(id -> Parsers.getById(PacketEvents.getAPI()
.getServerManager().getVersion().toClientVersion(), id));
}
public Optional<List<Object>> getProperties() {
return properties;
}
public void setProperties(Optional<List<Object>> properties) {
this.properties = properties;
}
public Optional<ResourceLocation> getSuggestionsType() {
return suggestionsType;
}
public void setSuggestionsType(Optional<ResourceLocation> suggestionsType) {
this.suggestionsType = suggestionsType;
}
}
@@ -0,0 +1,276 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.mapper.AbstractMappedEntity;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import com.github.retrooper.packetevents.util.mappings.VersionedRegistry;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NullMarked;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
@NullMarked
public final class Parsers {
private static final VersionedRegistry<Parser> REGISTRY = new VersionedRegistry<>("command_argument_type");
private Parsers() {
}
@ApiStatus.Internal
public static Parser define(String key) {
return define(key, null, null);
}
@ApiStatus.Internal
public static Parser define(String key, @Nullable Reader reader, @Nullable Writer writer) {
return REGISTRY.define(key, data -> new Parser(data, reader, writer));
}
public static Parser getByName(String name) {
return REGISTRY.getByName(name);
}
public static Parser getById(ClientVersion version, int id) {
return REGISTRY.getById(version, id);
}
public static List<Parser> getParsers() {
return new ArrayList<>(REGISTRY.getEntries());
}
public static VersionedRegistry<Parser> getRegistry() {
return REGISTRY;
}
public static final Parser BRIGADIER_BOOL = define("brigadier:bool", null, null);
public static final Parser BRIGADIER_FLOAT = define("brigadier:float",
packetWrapper -> {
byte flags = packetWrapper.readByte();
float min = (flags & 0x01) != 0 ? packetWrapper.readFloat() : -Float.MAX_VALUE;
float max = (flags & 0x02) != 0 ? packetWrapper.readFloat() : Float.MAX_VALUE;
return Arrays.asList(flags, min, max);
},
(packetWrapper, properties) -> {
byte flags = (byte) properties.get(0);
packetWrapper.writeByte(flags);
if ((flags & 0x01) != 0) packetWrapper.writeFloat((float) properties.get(1));
if ((flags & 0x02) != 0) packetWrapper.writeFloat((float) properties.get(2));
}
);
public static final Parser BRIGADIER_DOUBLE = define("brigadier:double",
packetWrapper -> {
byte flags = packetWrapper.readByte();
double min = (flags & 0x01) != 0 ? packetWrapper.readDouble() : -Double.MAX_VALUE;
double max = (flags & 0x02) != 0 ? packetWrapper.readDouble() : Double.MAX_VALUE;
return Arrays.asList(flags, min, max);
},
(packetWrapper, properties) -> {
byte flags = (byte) properties.get(0);
packetWrapper.writeByte(flags);
if ((flags & 0x01) != 0) packetWrapper.writeDouble((double) properties.get(1));
if ((flags & 0x02) != 0) packetWrapper.writeDouble((double) properties.get(2));
}
);
public static final Parser BRIGADIER_INTEGER = define("brigadier:integer",
packetWrapper -> {
byte flags = packetWrapper.readByte();
int min = (flags & 0x01) != 0 ? packetWrapper.readInt() : Integer.MIN_VALUE;
int max = (flags & 0x02) != 0 ? packetWrapper.readInt() : Integer.MAX_VALUE;
return Arrays.asList(flags, min, max);
},
(packetWrapper, properties) -> {
byte flags = (byte) properties.get(0);
packetWrapper.writeByte(flags);
if ((flags & 0x01) != 0) packetWrapper.writeInt((int) properties.get(1));
if ((flags & 0x02) != 0) packetWrapper.writeInt((int) properties.get(2));
}
);
public static final Parser BRIGADIER_LONG = define("brigadier:long",
packetWrapper -> {
byte flags = packetWrapper.readByte();
long min = (flags & 0x01) != 0 ? packetWrapper.readLong() : Long.MIN_VALUE;
long max = (flags & 0x02) != 0 ? packetWrapper.readLong() : Long.MAX_VALUE;
return Arrays.asList(flags, min, max);
},
(packetWrapper, properties) -> {
byte flags = (byte) properties.get(0);
packetWrapper.writeByte(flags);
if ((flags & 0x01) != 0) packetWrapper.writeLong((long) properties.get(1));
if ((flags & 0x02) != 0) packetWrapper.writeLong((long) properties.get(2));
}
);
public static final Parser BRIGADIER_STRING = define("brigadier:string",
packetWrapper -> Collections.singletonList(packetWrapper.readVarInt()),
(packetWrapper, properties) -> packetWrapper.writeVarInt((Integer) properties.get(0))
);
public static final Parser ENTITY = define("entity",
packetWrapper -> Collections.singletonList(packetWrapper.readByte()),
(packetWrapper, properties) -> packetWrapper.writeByte(((Byte) properties.get(0)).intValue())
);
public static final Parser GAME_PROFILE = define("game_profile", null, null);
public static final Parser BLOCK_POS = define("block_pos", null, null);
public static final Parser COLUMN_POS = define("column_pos", null, null);
public static final Parser VEC3 = define("vec3", null, null);
public static final Parser VEC2 = define("vec2", null, null);
public static final Parser BLOCK_STATE = define("block_state", null, null);
public static final Parser BLOCK_PREDICATE = define("block_predicate", null, null);
public static final Parser ITEM_STACK = define("item_stack", null, null);
public static final Parser ITEM_PREDICATE = define("item_predicate", null, null);
public static final Parser COLOR = define("color", null, null);
public static final Parser COMPONENT = define("component", null, null);
public static final Parser STYLE = define("style", null, null);
public static final Parser MESSAGE = define("message", null, null);
public static final Parser NBT_COMPOUND_TAG = define("nbt_compound_tag", null, null);
@ApiStatus.Obsolete
public static final Parser NBT = define("nbt", null, null);
public static final Parser NBT_TAG = define("nbt_tag", null, null);
public static final Parser NBT_PATH = define("nbt_path", null, null);
public static final Parser OBJECTIVE = define("objective", null, null);
public static final Parser OBJECTIVE_CRITERIA = define("objective_criteria", null, null);
public static final Parser OPERATION = define("operation", null, null);
public static final Parser PARTICLE = define("particle", null, null);
public static final Parser ANGLE = define("angle", null, null);
public static final Parser ROTATION = define("rotation", null, null);
public static final Parser SCOREBOARD_SLOT = define("scoreboard_slot", null, null);
public static final Parser SCORE_HOLDER = define("score_holder",
packetWrapper -> Collections.singletonList(packetWrapper.readByte()),
(packetWrapper, properties) -> packetWrapper.writeByte(((Byte) properties.get(0)).intValue())
);
public static final Parser SWIZZLE = define("swizzle", null, null);
public static final Parser TEAM = define("team", null, null);
public static final Parser ITEM_SLOT = define("item_slot", null, null);
public static final Parser ITEM_SLOTS = define("item_slots", null, null);
public static final Parser RESOURCE_LOCATION = define("resource_location", null, null);
public static final Parser MOB_EFFECT = define("mob_effect", null, null);
public static final Parser FUNCTION = define("function", null, null);
public static final Parser ENTITY_ANCHOR = define("entity_anchor", null, null);
public static final Parser INT_RANGE = define("int_range", null, null);
public static final Parser FLOAT_RANGE = define("float_range", null, null);
public static final Parser ITEM_ENCHANTMENT = define("item_enchantment", null, null);
public static final Parser ENTITY_SUMMON = define("entity_summon", null, null);
public static final Parser DIMENSION = define("dimension", null, null);
public static final Parser GAMEMODE = define("gamemode", null, null);
public static final Parser TIME = define("time",
wrapper -> Collections.singletonList(wrapper.getServerVersion()
.isNewerThanOrEquals(ServerVersion.V_1_19_4) ? wrapper.readInt() : 0),
(wrapper, properties) -> {
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_19_4)) {
wrapper.writeInt((int) properties.get(0));
}
}
);
public static final Parser RESOURCE_OR_TAG = define("resource_or_tag",
packetWrapper -> Collections.singletonList(packetWrapper.readIdentifier()),
(packetWrapper, properties) -> packetWrapper.writeIdentifier((ResourceLocation) properties.get(0))
);
public static final Parser RESOURCE_OR_TAG_KEY = define("resource_or_tag_key",
packetWrapper -> Collections.singletonList(packetWrapper.readIdentifier()),
(packetWrapper, properties) -> packetWrapper.writeIdentifier((ResourceLocation) properties.get(0))
);
public static final Parser RESOURCE = define("resource",
packetWrapper -> Collections.singletonList(packetWrapper.readIdentifier()),
(packetWrapper, properties) -> packetWrapper.writeIdentifier((ResourceLocation) properties.get(0))
);
public static final Parser RESOURCE_KEY = define("resource_key",
packetWrapper -> Collections.singletonList(packetWrapper.readIdentifier()),
(packetWrapper, properties) -> packetWrapper.writeIdentifier((ResourceLocation) properties.get(0))
);
public static final Parser TEMPLATE_MIRROR = define("template_mirror", null, null);
public static final Parser TEMPLATE_ROTATION = define("template_rotation", null, null);
public static final Parser HEIGHTMAP = define("heightmap", null, null);
public static final Parser LOOT_TABLE = define("loot_table", null, null);
public static final Parser LOOT_PREDICATE = define("loot_predicate", null, null);
public static final Parser LOOT_MODIFIER = define("loot_modifier", null, null);
public static final Parser UUID = define("uuid", null, null);
/**
* Added with 1.21.5
*/
public static final Parser RESOURCE_SELECTOR = define("resource_selector",
wrapper -> Collections.singletonList(wrapper.readIdentifier()),
(wrapper, value) -> wrapper.writeIdentifier((ResourceLocation) value.get(0))
);
/**
* Added with 1.21.6
*/
public static final Parser HEX_COLOR = define("hex_color", null, null);
/**
* Added with 1.21.6
*/
public static final Parser DIALOG = define("dialog", null, null);
static {
REGISTRY.unloadMappings();
}
@FunctionalInterface
public interface Reader extends Function<PacketWrapper<?>, List<Object>> {}
@FunctionalInterface
public interface Writer extends BiConsumer<PacketWrapper<?>, List<Object>> {}
public static final class Parser extends AbstractMappedEntity {
private final Reader reader;
private final Writer writer;
@Deprecated
public Parser(String name, @Nullable Function<PacketWrapper<?>, List<Object>> read, @Nullable BiConsumer<PacketWrapper<?>, List<Object>> write) {
this(
new TypesBuilderData(new ResourceLocation(name), new int[0]),
read == null ? null : read::apply,
write == null ? null : write::accept
);
}
@ApiStatus.Internal
public Parser(@Nullable TypesBuilderData data, @Nullable Reader reader, @Nullable Writer writer) {
super(data);
this.reader = reader;
this.writer = writer;
}
public Optional<List<Object>> readProperties(PacketWrapper<?> wrapper) {
if (this.reader != null) {
return Optional.of(this.reader.apply(wrapper));
}
return Optional.empty();
}
public void writeProperties(PacketWrapper<?> wrapper, List<Object> properties) {
if (this.writer != null) {
this.writer.accept(wrapper, properties);
}
}
}
}
@@ -0,0 +1,41 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2022 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import com.github.retrooper.packetevents.protocol.player.PublicProfileKey;
import java.util.UUID;
public class RemoteChatSession {
private final UUID sessionId;
private final PublicProfileKey publicProfileKey;
public RemoteChatSession(UUID sessionId, PublicProfileKey publicProfileKey) {
this.sessionId = sessionId;
this.publicProfileKey = publicProfileKey;
}
public UUID getSessionId() {
return sessionId;
}
public PublicProfileKey getPublicProfileKey() {
return publicProfileKey;
}
}
@@ -0,0 +1,27 @@
package com.github.retrooper.packetevents.protocol.chat;
public class SignedCommandArgument {
private String argument;
private MessageSignature signature;
public SignedCommandArgument(String argument, MessageSignature signature) {
this.argument = argument;
this.signature = signature;
}
public String getArgument() {
return argument;
}
public void setArgument(String argument) {
this.argument = argument;
}
public MessageSignature getSignature() {
return signature;
}
public void setSignature(MessageSignature signature) {
this.signature = signature;
}
}
@@ -0,0 +1,124 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2024 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat;
import com.github.retrooper.packetevents.protocol.mapper.AbstractMappedEntity;
import com.github.retrooper.packetevents.util.mappings.TypesBuilderData;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.UnknownNullability;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.Objects;
@NullMarked
public class StaticChatType extends AbstractMappedEntity implements ChatType {
private final @UnknownNullability("only nullable for 1.19") ChatTypeDecoration chatDecoration;
private final @Nullable ChatTypeDecoration overlayDecoration;
private final @UnknownNullability("only nullable for 1.19") ChatTypeDecoration narrationDecoration;
private final @Nullable NarrationPriority narrationPriority;
public StaticChatType(
ChatTypeDecoration chatDecoration,
ChatTypeDecoration narrationDecoration
) {
this(null, chatDecoration, null, narrationDecoration, null);
}
@ApiStatus.Internal
public StaticChatType(
@Nullable TypesBuilderData data,
ChatTypeDecoration chatDecoration,
ChatTypeDecoration narrationDecoration
) {
this(data, chatDecoration, null, narrationDecoration, null);
}
public StaticChatType(
@UnknownNullability("only nullable for 1.19") ChatTypeDecoration chatDecoration,
@Nullable ChatTypeDecoration overlayDecoration,
@UnknownNullability("only nullable for 1.19") ChatTypeDecoration narrationDecoration,
@Nullable NarrationPriority narrationPriority
) {
this(null, chatDecoration, overlayDecoration, narrationDecoration, narrationPriority);
}
@ApiStatus.Internal
public StaticChatType(
@Nullable TypesBuilderData data,
@Nullable ChatTypeDecoration chatDecoration,
@Nullable ChatTypeDecoration overlayDecoration,
@Nullable ChatTypeDecoration narrationDecoration,
@Nullable NarrationPriority narrationPriority
) {
super(data);
this.chatDecoration = chatDecoration;
this.overlayDecoration = overlayDecoration;
this.narrationDecoration = narrationDecoration;
this.narrationPriority = narrationPriority;
}
@Override
public ChatType copy(@Nullable TypesBuilderData newData) {
return new StaticChatType(newData, this.chatDecoration,
this.overlayDecoration, this.narrationDecoration, this.narrationPriority);
}
@Override
public @UnknownNullability("only nullable for 1.19") ChatTypeDecoration getChatDecoration() {
return this.chatDecoration;
}
@Override
public @Nullable ChatTypeDecoration getOverlayDecoration() {
return this.overlayDecoration;
}
@Override
public @UnknownNullability("only nullable for 1.19") ChatTypeDecoration getNarrationDecoration() {
return this.narrationDecoration;
}
@Override
public @Nullable NarrationPriority getNarrationPriority() {
return this.narrationPriority;
}
@Override
public boolean deepEquals(@Nullable Object obj) {
if (this == obj) return true;
if (!(obj instanceof StaticChatType)) return false;
StaticChatType that = (StaticChatType) obj;
if (!Objects.equals(this.chatDecoration, that.chatDecoration)) return false;
if (!Objects.equals(this.overlayDecoration, that.overlayDecoration)) return false;
if (!Objects.equals(this.narrationDecoration, that.narrationDecoration)) return false;
return this.narrationPriority == that.narrationPriority;
}
@Override
public int deepHashCode() {
return Objects.hash(this.chatDecoration, this.overlayDecoration, this.narrationDecoration, this.narrationPriority);
}
@Override
public String toString() {
return "StaticChatType{chatDecoration=" + this.chatDecoration + ", overlayDecoration=" + this.overlayDecoration + ", narrationDecoration=" + this.narrationDecoration + ", narrationPriority=" + this.narrationPriority + '}';
}
}
@@ -0,0 +1,71 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat.clickevent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTInt;
import com.github.retrooper.packetevents.protocol.nbt.NBTString;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class ChangePageClickEvent implements ClickEvent {
private final int page;
@ApiStatus.Obsolete
public ChangePageClickEvent(String page) {
this(Integer.parseInt(page));
}
public ChangePageClickEvent(int page) {
this.page = page;
}
public static ChangePageClickEvent decode(NBTCompound compound, PacketWrapper<?> wrapper) {
int page = wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_5)
? compound.getNumberTagValueOrThrow("page").intValue()
: Integer.parseInt(compound.getStringTagValueOrThrow("value"));
return new ChangePageClickEvent(page);
}
public static void encode(NBTCompound compound, PacketWrapper<?> wrapper, ChangePageClickEvent clickEvent) {
if (wrapper.getServerVersion().isNewerThanOrEquals(ServerVersion.V_1_21_5)) {
compound.setTag("page", new NBTInt(clickEvent.page));
} else {
compound.setTag("value", new NBTString(Integer.toString(clickEvent.page)));
}
}
@Override
public ClickEventAction<?> getAction() {
return ClickEventActions.CHANGE_PAGE;
}
@Override
public net.kyori.adventure.text.event.ClickEvent asAdventure() {
return net.kyori.adventure.text.event.ClickEvent.changePage(this.page);
}
public int getPage() {
return this.page;
}
}
@@ -0,0 +1,76 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat.clickevent;
import com.github.retrooper.packetevents.protocol.dialog.Dialog;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTEnd;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.adventure.NbtTagHolder;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import net.kyori.adventure.text.event.ClickEvent.Payload;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface ClickEvent {
static ClickEvent decode(NBTCompound compound, PacketWrapper<?> wrapper) {
String actionName = compound.getStringTagValueOrThrow("action");
ClickEventAction<?> action = ClickEventActions.getRegistry().getByNameOrThrow(actionName);
return action.decode(compound, wrapper);
}
@SuppressWarnings("unchecked") // not unchecked
static void encode(NBTCompound compound, PacketWrapper<?> wrapper, ClickEvent clickEvent) {
compound.set("action", clickEvent.getAction().getName(), ResourceLocation::encode, wrapper);
((ClickEventAction<? super ClickEvent>) clickEvent.getAction()).encode(compound, wrapper, clickEvent);
}
ClickEventAction<?> getAction();
static ClickEvent fromAdventure(net.kyori.adventure.text.event.ClickEvent clickEvent) {
switch (clickEvent.action()) {
case OPEN_URL:
return new OpenUrlClickEvent(clickEvent.value());
case OPEN_FILE:
return new OpenFileClickEvent(clickEvent.value());
case RUN_COMMAND:
return new RunCommandClickEvent(clickEvent.value());
case SUGGEST_COMMAND:
return new SuggestCommandClickEvent(clickEvent.value());
case CHANGE_PAGE:
return new ChangePageClickEvent(clickEvent.value());
case COPY_TO_CLIPBOARD:
return new CopyToClipboardClickEvent(clickEvent.value());
case SHOW_DIALOG:
return new ShowDialogClickEvent((Dialog) ((Payload.Dialog) clickEvent.payload()).dialog());
case CUSTOM:
Payload.Custom payload = (Payload.Custom) clickEvent.payload();
NbtTagHolder nbtTag = (NbtTagHolder) payload.nbt();
return new CustomClickEvent(
new ResourceLocation(payload.key()),
nbtTag.getTag() instanceof NBTEnd ? null : nbtTag.getTag()
);
default:
throw new UnsupportedOperationException("Unsupported clickevent: " + clickEvent);
}
}
net.kyori.adventure.text.event.ClickEvent asAdventure();
}
@@ -0,0 +1,34 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat.clickevent;
import com.github.retrooper.packetevents.protocol.mapper.MappedEntity;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface ClickEventAction<T extends ClickEvent> extends MappedEntity {
boolean isAllowFromServer();
T decode(NBTCompound compound, PacketWrapper<?> wrapper);
void encode(NBTCompound compound, PacketWrapper<?> wrapper, T clickEvent);
}
@@ -0,0 +1,89 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat.clickevent;
import com.github.retrooper.packetevents.protocol.util.NbtMapDecoder;
import com.github.retrooper.packetevents.protocol.util.NbtMapEncoder;
import com.github.retrooper.packetevents.util.mappings.VersionedRegistry;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
public final class ClickEventActions {
private static final VersionedRegistry<ClickEventAction<?>> REGISTRY = new VersionedRegistry<>("click_event_action");
private ClickEventActions() {
}
@ApiStatus.Internal
public static <T extends ClickEvent> ClickEventAction<T> define(
String name, boolean allowFromServer,
NbtMapDecoder<T> decoder, NbtMapEncoder<T> encoder
) {
return REGISTRY.define(name, data -> new StaticClickEventAction<>(
data, allowFromServer, decoder, encoder));
}
public static VersionedRegistry<ClickEventAction<?>> getRegistry() {
return REGISTRY;
}
public static final ClickEventAction<OpenUrlClickEvent> OPEN_URL = define("open_url", true,
OpenUrlClickEvent::decode, OpenUrlClickEvent::encode);
public static final ClickEventAction<OpenFileClickEvent> OPEN_FILE = define("open_file", false,
OpenFileClickEvent::decode, OpenFileClickEvent::encode);
public static final ClickEventAction<RunCommandClickEvent> RUN_COMMAND = define("run_command", true,
RunCommandClickEvent::decode, RunCommandClickEvent::encode);
/**
* Removed in 1.9
*/
@ApiStatus.Obsolete
public static final ClickEventAction<TwitchUserInfoClickEvent> TWITCH_USER_INFO = define("twitch_user_info", false,
TwitchUserInfoClickEvent::decode, TwitchUserInfoClickEvent::encode);
public static final ClickEventAction<SuggestCommandClickEvent> SUGGEST_COMMAND = define("suggest_command", true,
SuggestCommandClickEvent::decode, SuggestCommandClickEvent::encode);
/**
* Added with 1.8
*/
public static final ClickEventAction<ChangePageClickEvent> CHANGE_PAGE = define("change_page", true,
ChangePageClickEvent::decode, ChangePageClickEvent::encode);
/**
* Added with 1.15
*/
public static final ClickEventAction<CopyToClipboardClickEvent> COPY_TO_CLIPBOARD = define("copy_to_clipboard", true,
CopyToClipboardClickEvent::decode, CopyToClipboardClickEvent::encode);
/**
* Added with 1.21.6
*/
public static final ClickEventAction<ShowDialogClickEvent> SHOW_DIALOG = define("show_dialog", true,
ShowDialogClickEvent::decode, ShowDialogClickEvent::encode);
/**
* Added with 1.21.6
*/
public static final ClickEventAction<CustomClickEvent> CUSTOM = define("custom", true,
CustomClickEvent::decode, CustomClickEvent::encode);
static {
REGISTRY.unloadMappings();
}
}
@@ -0,0 +1,57 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat.clickevent;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTString;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class CopyToClipboardClickEvent implements ClickEvent {
private final String value;
public CopyToClipboardClickEvent(String value) {
this.value = value;
}
public static CopyToClipboardClickEvent decode(NBTCompound compound, PacketWrapper<?> wrapper) {
String value = compound.getStringTagValueOrThrow("value");
return new CopyToClipboardClickEvent(value);
}
public static void encode(NBTCompound compound, PacketWrapper<?> wrapper, CopyToClipboardClickEvent clickEvent) {
compound.setTag("value", new NBTString(clickEvent.value));
}
@Override
public ClickEventAction<?> getAction() {
return ClickEventActions.COPY_TO_CLIPBOARD;
}
@Override
public net.kyori.adventure.text.event.ClickEvent asAdventure() {
return net.kyori.adventure.text.event.ClickEvent.copyToClipboard(this.value);
}
public String getValue() {
return this.value;
}
}
@@ -0,0 +1,72 @@
/*
* This file is part of packetevents - https://github.com/retrooper/packetevents
* Copyright (C) 2025 retrooper and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.retrooper.packetevents.protocol.chat.clickevent;
import com.github.retrooper.packetevents.protocol.nbt.NBT;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTEnd;
import com.github.retrooper.packetevents.resources.ResourceLocation;
import com.github.retrooper.packetevents.util.adventure.NbtTagHolder;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
public class CustomClickEvent implements ClickEvent {
private final ResourceLocation id;
private final @Nullable NBT payload;
public CustomClickEvent(ResourceLocation id, @Nullable NBT payload) {
this.id = id;
this.payload = payload;
}
public static CustomClickEvent decode(NBTCompound compound, PacketWrapper<?> wrapper) {
ResourceLocation id = compound.getOrThrow("id", ResourceLocation::decode, wrapper);
NBT payload = compound.getTagOrNull("payload");
return new CustomClickEvent(id, payload);
}
public static void encode(NBTCompound compound, PacketWrapper<?> wrapper, CustomClickEvent clickEvent) {
compound.set("id", clickEvent.id, ResourceLocation::encode, wrapper);
if (clickEvent.payload != null) {
compound.setTag("payload", clickEvent.payload);
}
}
@Override
public ClickEventAction<?> getAction() {
return ClickEventActions.CUSTOM;
}
@Override
public net.kyori.adventure.text.event.ClickEvent asAdventure() {
return net.kyori.adventure.text.event.ClickEvent.custom(
this.id.key(), new NbtTagHolder(this.payload != null ? this.payload : NBTEnd.INSTANCE));
}
public ResourceLocation getId() {
return this.id;
}
public @Nullable NBT getPayload() {
return this.payload;
}
}
Loaded 100 of 1507 files, more files were not shown because too many files have changed in this diff. Show more