Compare commits

..
Author SHA1 Message Date
Jake Potrebic f34503e142 Revert to vanilla persistence and add API tristate override 2022-04-23 10:23:20 -07:00
Jake Potrebic 47f43da438 Add missing javadoc deprecation msgs for PlayerProfile (#7688) 2022-04-23 07:40:37 -07:00
Nassim Jahnke caf4a6f0d6 Remove or replace a few dumb deprecations (#7760) 2022-04-23 11:25:30 +02:00
Jake Potrebic 16f224a79a Trigger bee_nest_destroyed trigger in the correct place (#7436) 2022-04-22 18:17:14 -07:00
Jake Potrebic 0f8aa4e6fd Fix NPE for BlockDataMeta#getBlockData (#7670) 2022-04-22 17:21:38 -07:00
Bjarne Koll ef6a1a5f99 Revert to old createProfile(UUID, String) logic (#7723) 2022-04-22 19:54:08 +01:00
Jason Penilla c449f6a1f7 Build updates
- update paperweight to 1.3.6
- update tiny-remapper to 0.8.2
2022-04-21 19:27:56 -07:00
Jason 567fce6c76 Don't apply previous potion when item is potion (fixes #7756) (#7757) 2022-04-21 17:07:56 -07:00
petersv5andPeter Svensson 76ed156764 Grant temporary immunity from EAR to moving entities (Fixes #7637) (#7644)
Co-authored-by: Peter Svensson <petersv@psv.nu>
2022-04-20 10:34:00 +01:00
Owen 873bfa6000 Remove World#refreshChunk deprecation (#7684) 2022-04-20 10:28:53 +01:00
Shane Freeder 4ecc338e09 WorldCreator#keepSpawnLoaded (#7673) 2022-04-20 10:26:09 +01:00
Shane Freeder c7d4c0188e Ignore invalid jars inside of the updates folder (Fixes #7751)
This really needs a deeper look here, the way updates are handled is
fairly immature, but, this wasn't ever intended to be a large scale thing

Ideally, imho, we'd collect the list of update files into some form of Map,
that way we just have a reference of Name > File refs, and can filter out
cases where there are two versions of a plugin in there and warn expectidely,
but, that creates some complications, you would need to fall back to a dir
scan in the case of a plugin calling loadPlugin, but, it would at least
give us more defined behavior, as well as improve performance here vs
repeatidely trying to deserialise the plugin.yml defs for every file
in there on every load
2022-04-20 10:11:35 +01:00
Xemor c642d25f63 Improve update folder behavior (#7687)
Closes #6570
2022-04-18 18:12:39 +02:00
Noah van der Aa 86fb3d201d Don't send itemmeta for books with the hide option enabled (#7734) 2022-04-18 12:23:37 +02:00
HexedHero c66b0f99f2 Add pre-unbreaking amount to PlayerItemDamageEvent (#7724) 2022-04-18 11:51:45 +02:00
Owen 8bfb1d22f8 Pass ServerLevel for gamerule callbacks (#7668) 2022-04-18 11:46:21 +02:00
Nassim Jahnke 6b9f7a073e Don't fire worldborder events for virtual borders (#7749)
Fixes #7748
2022-04-18 11:26:18 +02:00
Jake Potrebic af943641e2 Fix slime spawners not spawning outside slime chunks (#7741) 2022-04-16 11:32:20 -07:00
Nassim Jahnke 1cfd363d32 Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fc460d1b PR-735: Add Villager#zombify
c8c8331e PR-690: Add method to read ItemStack input
62845f2f SPIGOT-6829: Add per-player world border API

CraftBukkit Changes:
a459f4d4 PR-1033: Add Villager#zombify
d65d1430 PR-975: Add method to read ItemStack input
b5559f8c SPIGOT-6990: Fix setRepairCost(0) in Anvil
6c308e1b SPIGOT-6829: Add per-player world border API

Spigot Changes:
42b61526 SPIGOT-7000: Generation and /locate issues when using custom structure seeds
2022-04-16 10:29:50 +02:00
Pedro c6e631aacb Use username instead of display name in PlayerList#getPlayerStats (#7740) 2022-04-15 15:23:10 -07:00
Jason Penilla b8fa41ecdf [ci skip] Remove Mojang repo from test-plugin 2022-04-13 20:16:14 -07:00
Jason a9f252e56a Replace third party repos with Paper repo (#7733)
we now mirror Fabric, Forge, and Mojang
2022-04-13 19:58:48 -07:00
Shane Freeder d4a712d957 [CI-SKIP] Remove unused import from last patch 2022-04-13 09:15:28 +01:00
Shane Freeder a9ee1046a5 Prevent tile entity copies loading chunks 2022-04-13 08:27:16 +01:00
Jason Penilla e42d683d75 Fix StructureGrowEvent species for RED_MUSHROOM 2022-04-12 16:40:30 -07:00
Owen f8e8d6c3cd Strip enderpearl owners when they are no longer ticked (#7559) 2022-04-08 01:52:25 +01:00
Jason 4322c05f02 Use patched spigot decompiler (#7706) 2022-04-07 09:36:19 -07:00
Nassim Jahnke 2f16393ad9 Updated Upstream (CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
2542945e Remove broken quickMoveStack implementation
5631e8bf SPIGOT-6973: Setting biome calls String#intern for every biome placed
2022-04-07 10:56:36 +02:00
Etil 11e0dcdf86 Fix NBT pieces overriding a block entity during worldgen deadlock (#7692) 2022-04-07 10:42:20 +02:00
Pedro 29144573e6 Allow seting custom podium location for ender dragon (#7695) 2022-04-07 10:31:30 +02:00
Jason Penilla 62dcff3e8d Update actions 2022-04-05 10:44:21 -07:00
Jason Penilla 92426e39be Update Gradle wrapper 2022-04-05 10:37:45 -07:00
Jason Penilla 820e9ca70b Update decompiler & param mappings 2022-04-05 10:37:36 -07:00
Jake Potrebic 87e11bf7fd Cache resource keys instead of trying to create them (#7643) 2022-04-02 18:10:13 -07:00
Nassim Jahnke ea2c81e4b9 Fix lectern quick move 2022-04-02 09:15:39 +02:00
Peter Crawley 443c5062c1 Fix Nullability Annotations for PrepareItemEnchantEvent (#7681) 2022-04-01 20:14:56 -07:00
Jake Potrebic 04c7b16bde Undeprecate Material#isLegacy (#7679) 2022-03-31 09:13:19 -07:00
Spottedleaf 7bf9446d9e Add per player chunk loading limits
Configurable under "settings.chunk-loading.player-max-chunk-load-rate",
defaults to -1. This commit also changes the chunk loading to be
distributed equally for all players, rather than distance based. This is
to ensure players flying around do not take priority over everyone else.
The exception to this new rule is the min-load-radius, which still has
priority over everything else.
2022-03-31 06:33:13 -07:00
Jake Potrebic 7f47b9b7f8 Remove KeyedObject interface (#7680) 2022-03-30 13:28:38 -07:00
Jake Potrebic d3c102373f fix player loottables running when mob loot gamerule is false (#7651) 2022-03-29 13:15:26 -07:00
Owen fa68bb1e81 Fix entity position desync for hanging entities (#7659) 2022-03-29 10:42:46 +02:00
Jake Potrebic 7fa8870043 Updated Upstream (Bukkit/CraftBukkit) (#7672)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
7902647a PR-737: Update WorldCreator#generatorSettings docs
67556a50 PR-736: Update README

CraftBukkit Changes:
10922194 Java 18 support
d53c4fb6 PR-1039: Use correct ops in GeneratorSettings
a567e4ae PR-1038: Removed the no longer needed getChunkUnchecked method from ChunkProviderServer.
4ac8fcce SPIGOT-6980: Since 1.18.2, World#isChunkLoaded returned false for chunks that have just been loaded (e.g. inside ChunkLoadEvent).
e6cc7c70 PR-1035: Update README
3ec79a27 SPIGOT-5140: Call EntityChangeBlockEvent when a ChorusFlower is destroyed by a projectile
2022-03-29 10:32:18 +02:00
Jason e2f743d914 Fix PalettedContainer synchronization (#7663) 2022-03-27 10:51:39 -07:00
SoSeDiK e7d928a8e1 Fix EntityChangeBlockEvent#getBlockData for when sheep eats grass block (#7646) 2022-03-21 11:43:52 -07:00
Jake Potrebic ab666a48ee Deprecating remaining blockkey methods (#7638) 2022-03-21 11:06:42 -07:00
Jake Potrebic a939d6e08e Fix generator settings string for flat-type worlds (#7568) 2022-03-21 11:06:26 -07:00
Owen 993f8288fa Add TameableDeathMessageEvent (#5392) 2022-03-20 00:50:33 +00:00
Owen a686ff5670 Add more missing entity API (#7592) 2022-03-19 15:30:16 +01:00
Bjarne Koll 7b46444bea Properly create profiles with custom name/uuid (#7558) 2022-03-19 14:39:38 +01:00
Shane Freeder 5eb61dd432 Buffer OOB setBlock calls
lets debug mode throw a trace in order to potentially see where
such calls are cascading from easier, but, generally, if you see one setBlock
call, you're gonna see more, and this just potentially causes a flood of logs
which can cause issues for slower terminals, etc.

We can limit the flood by just allowing one for a single gen region,
we'll also only gen a trace for the first one, I see no real pressing need
to generate more, given that that would *massively* negate this patch otherwise
2022-03-19 12:35:56 +00:00
Jake Potrebic 855637f967 Updated Upstream (CraftBukkit) (#7624)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
e9f972d6 Improve CreativeCategory conversion
c2698249 PR-1034: Fix exception on init of CraftCreativeCategory
f48739ca Add tests for material creative categories
2022-03-19 10:33:49 +01:00
Jason Penilla bc68ee09be Remove redundant GameProfileCache diff 2022-03-17 21:21:01 -07:00
Jason Penilla 319d5fa29f Fix state locking for getTopMRUProfiles & getProfileIfCached
Also add missing last access update in getProfileIfCached
2022-03-17 21:21:01 -07:00
Philip Kelley 2eeca6f108 Fix world saving in unloadWorld 2022-03-17 13:24:02 +01:00
Jason 8897cea0b0 Add enchantWithLevels API (#7615) 2022-03-17 09:51:43 +01:00
Jake Potrebic b8c90d2428 Added method to check snapshot state of TileStates (#7325) 2022-03-16 18:28:06 -07:00
Jake Potrebic 8788bf7441 fix datapacks not being able to modify nether/end (#7588) 2022-03-16 17:54:52 -07:00
Jason f0d0078deb Add debug for invalid GameProfiles on skull blocks/items (#7512) 2022-03-16 13:34:09 -07:00
Jake Potrebic 1c5f8b0fce Updated Upstream (Bukkit/CraftBukkit) (#7604)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
33a2b476 PR-734: Make PlayerInventory#getItem Nullable

CraftBukkit Changes:
953d3ddc SPIGOT-3034: PlayerKickEvent.setLeaveMessage(String) doesn't actually do anything
2c47af0c SPIGOT-6963: CraftMetaBlockState#getBlockState applied TileEntity ids without the minecraft namespace prefix.
2022-03-16 16:57:51 +01:00
Nassim Jahnke f35a0ceb93 Remove Java version check once and for all (#7612)
Closes #7611
2022-03-16 14:10:32 +01:00
Bjarne Koll 2d3e8f7729 Properly lookup random-ticked precipitation blocks (#7606) 2022-03-15 19:44:25 +01:00
Jason 0ca80c7ee8 Add getComputedBiome API (#5668) 2022-03-15 11:38:36 -07:00
Spottedleaf a5be178ac3 Use correct toX/Y/Z in player move packet handling 2022-03-14 12:44:36 -07:00
Owen c8e49cc53e Add get/set wait time for fish hooks. (#5595) 2022-03-13 22:33:01 +00:00
Noah van der Aa 1ce3555ada [ci-skip] Fix typo in feature request issue template (#7593) 2022-03-13 21:41:05 +00:00
Jason Penilla b65b48fd31 [ci skip] Update gradle wrapper 2022-03-13 14:25:04 -07:00
Nassim Jahnke 1358d1e914 Updated Upstream (CraftBukkit/Spigot) (#7580)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
881e06e5 PR-725: Add Item Unlimited Lifetime APIs

CraftBukkit Changes:
74c08312 SPIGOT-6962: Call EntityChangeBlockEvent when when FallingBlockEntity starts to fall
64db5126 SPIGOT-6959: Make /loot command ignore empty items for spawn
2d760831 Increase outdated build delay
9ed7e4fb SPIGOT-6138, SPIGOT-6415: Don't call CreatureSpawnEvent after cross-dimensional travel
fc4ad813 SPIGOT-6895: Trees grown with applyBoneMeal() don't fire the StructureGrowthEvent
59733a2e SPIGOT-6961: Actually return a copy of the ItemMeta

Spigot Changes:
ffceeae3 SPIGOT-6956: Drop unload queue patch as attempt at fixing stop issue
e19ddabd PR-1011: Add Item Unlimited Lifetime APIs
34d40b0e SPIGOT-2942: give command fires PlayerDropItemEvent, cancelling it causes Item Duplication
2022-03-13 08:47:54 +01:00
Jason Penilla ab03538fa1 Fix colors in some console messages 2022-03-12 18:47:04 -07:00
Jake Potrebic 87927e176c Fix CreativeCategory API (#7586) 2022-03-12 15:32:42 -08:00
Jason bfa33d955c Various improvements to console color formatting (#7560) 2022-03-12 14:31:21 -07:00
Owen dc96bba6de Ensure the item sent isn't air (#7584) 2022-03-12 21:34:03 +01:00
Spottedleaf aab1f8a74e Fix swamp hut cat generation deadlock
The worldgen thread will attempt to get structure references
via the world's getChunkAt method, which is fine if the gen is
not cancelled - but if the chunk was unloaded, the call will block
indefinitely. Instead of using the world state, we use the already
supplied generatoraccess which will always have the chunk available.

Missed patch from tuinity merge
2022-03-12 06:32:31 -08:00
Owen ea1efef116 Remove Patches (#7541) 2022-03-11 21:13:46 +01:00
Owen 1790528a61 More projectile API (#5731) 2022-03-11 17:37:08 +01:00
Nassim Jahnke d714682f8f Add more entity api (#7564) 2022-03-11 15:24:45 +01:00
Owen 657d163740 Prevent despawned navigators being readded (#7574) 2022-03-11 02:39:11 +00:00
sulu5890 b55ba19ad3 Update README for new docs (#7561) 2022-03-09 10:10:59 +01:00
Noah van der Aa 4423e1221a Update docs link in paper.yml (#7562) 2022-03-09 10:10:53 +01:00
froobynooby 7a21333019 Fix setting the view distance to 32 (#7503) 2022-03-09 10:09:20 +01:00
Max Lee 718fab1f6b Add CPU name and JVM vendor info in timings (#7490) 2022-03-09 10:06:58 +01:00
Riley Park e0b3f3f8cb Adventure 4.10.1 2022-03-07 14:39:52 -08:00
Nassim Jahnke c34fb0942a Add ghast api (#7554) 2022-03-06 22:20:38 +01:00
Jake Potrebic d9bf5e740b Add method to set noclip on arrows (#7263) 2022-03-06 22:19:08 +01:00
Nassim Jahnke 7b9c30fb82 Fix scoreboard objective name length limit 2022-03-06 16:32:33 +01:00
Nassim Jahnke a36d7f6427 Updated Upstream (CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
808cb7ca PR-1023: Improve consistency of tag API
2022-03-06 09:08:26 +01:00
Spottedleaf 1e12cf8db6 Add more to the save fixes
- Set forceTicks to true, so that player packets are always
  processed so that the main process queue can be drained
2022-03-05 17:36:57 -08:00
Spottedleaf 196271de4e Fix save problems on shutdown
- Save level.dat first, in case the shutdown is killed later
- Force run minecraftserver tasks and the chunk source tasks
  while waiting for the chunk system to empty, as there's simply
  too much trash that could prevent them from executing during
  the chunk source tick (i.e "time left in tick" logic).
2022-03-05 17:29:47 -08:00
Jake Potrebic 6564f70f4c Fix cancelling ProjectileHitEvent for piercing arrows (#7492) 2022-03-05 21:45:57 +01:00
Owen 935151388a Fix handling message in PlayerHandshakeEvent (#7542) 2022-03-05 20:20:52 +00:00
Pheotis f9b05cc3f1 Expose furnace minecart push property. (#7548) 2022-03-05 21:15:24 +01:00
Spottedleaf 1d7a6a0732 Add missing glow_item_frame walkers
Needs one for ItemStack and Entity. It looks like I missed
the entity one because Mojang defined it as being simple,
which it certainly isn't (they "missed" it too).
2022-03-04 20:57:59 -08:00
Riley Park 42a9c3789d Move Adventure patch up 2022-03-04 13:45:31 -08:00
Jason 6d4784392d replace bungeecord-chat dependency with deprecated version (#7539) 2022-03-04 13:53:36 -07:00
Nassim Jahnke b6616c8a18 Fix falling block spawn methods
For some reason Spigot broke both behavior and the method as a whole
2022-03-04 20:47:30 +01:00
JOO200 0ee6ddaf33 Add javadoc linking for adventure-text-minimessage (#7538) 2022-03-04 11:27:26 -07:00
Noah van der Aa 63aa4d3319 Clarify exception messages for invalid view distances (#7510) 2022-03-04 11:23:28 +01:00
Shane Freeder b9f26bb1e9 Add printPaperVersion task 2022-03-04 09:41:03 +00:00
Nassim Jahnke 719daa8bbf Updated Upstream (CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
4ed5af5e SPIGOT-6956: Reduce differences caused by setKeepSpawnInMemory(false)
21fe78aa SPIGOT-6957: Bad default value for WorldCreator#generatorSettings
ce373be6 PR-1022: Fix get HighestBlockAt in chunk snapshot
2022-03-04 09:33:13 +01:00
Jason c09365aeac Fix deadlock on watchdog crash (#7535) 2022-03-04 09:26:22 +01:00
Jake Potrebic 15b6b3db2c Add StructuresLocateEvent as replacement for StructureLocateEvent (#7524) 2022-03-04 09:09:43 +01:00
Jason Penilla 753bf2c103 Update paperweight to 1.3.5 2022-03-03 19:06:19 -07:00
Jake Potrebic d33cdcf2e6 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
e25c6a75 PR-638: Add CreativeCategory API for Materials

CraftBukkit Changes:
86292d3e0 PR-876: Add CreativeCategory API for Materials
2022-03-03 10:21:48 -08:00
Jason Penilla 90788a556c clean up prepareTickingChunk diff 2022-03-02 11:24:32 -07:00
Shane Freeder 12d89fe5ae Revert chunk postprocessing back to 1.18.1 logic 2022-03-02 18:08:10 +00:00
Shane Freeder c6ea84c7fa Drop unneeded desync patch
spigot no longer even fires the event for this case, so, this may
actually be a regression, not too sure here, but, as-is this patch
is dead
2022-03-02 09:44:22 +00:00
Nassim Jahnke d3caeeb6c2 Fix early registry access in xray patch 2022-03-02 10:28:32 +01:00
Nassim Jahnke b1afebbd52 Force close world loading screen on join (#7529)
Fixes infinite loading screens for dead players due to async chunk loading and player chunk loading patches and prevents players from missing messages and similar if chunk loading is slow
2022-03-02 10:21:30 +01:00
Jake Potrebic 178802ab94 Fix various 1.18.2 update issues (#7523) 2022-03-01 14:40:34 -08:00
Jake Potrebic 14add2b049 Updated Upstream (CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
6e755020a SPIGOT-6952: Tag#isTagged throws NullPointerException in 1.18.2
2022-03-01 14:05:10 -08:00
Jason Penilla 0859f59469 1_18_R2 2022-03-01 00:10:23 -07:00
Jason PenillaandJake Potrebic ab8a139612 Configure javadoc overview and doc-files copying
closes #7462

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2022-02-28 22:52:40 -07:00
Jason Penilla 126ca7376e Add TODO for leaf 2022-02-28 22:52:40 -07:00
Jason Penilla b9037a5c7d fix issue resulting from kenny's apatch addiction 2022-02-28 22:52:40 -07:00
Jake Potrebic 146ac7bcd6 address failing mob goals test 2022-02-28 22:52:40 -07:00
Jake Potrebic cc45a355a4 move decompile fixes to start of git history 2022-02-28 22:52:39 -07:00
Jake Potrebic 5071d50207 clean up view distance api diff 2022-02-28 22:52:39 -07:00
Jason Penilla fd7432601d update reobf-mappings-patch.tiny 2022-02-28 22:52:39 -07:00
Jake Potrebic 3526f22211 move patch relying on TraceUtil to after its creation 2022-02-28 22:52:39 -07:00
Jake Potrebic fbe43d6a1d clean up patch changes 2022-02-28 22:52:39 -07:00
Spottedleaf c6fc144ba0 Fix unload stall
Also added required tickets that should not be removed during
shutdown
2022-02-28 22:52:39 -07:00
Jason Penilla 37436ac61a Move comment up 2022-02-28 22:52:38 -07:00
Riley Park 9a73213f88 Adventure 4.10.0 2022-02-28 22:52:38 -07:00
Jake Potrebic 9da236fe6a re-add config for stronghold seed patch 2022-02-28 22:52:38 -07:00
Jake Potrebic 490517d31e fixed flat bedrock patch 2022-02-28 22:52:38 -07:00
Nassim Jahnke c98499113f Fix mc dev fix by removing it 2022-02-28 22:52:38 -07:00
Nassim Jahnke 02e2402161 Update README 2022-02-28 22:52:37 -07:00
Nassim Jahnke 706c98a603 Update Datafixer 2022-02-28 22:52:37 -07:00
Jake Potrebic f4eb08a477 Readd 'Fix entity type tags suggestions in selectors' 2022-02-28 22:52:37 -07:00
Jake Potrebic 19f9520b3a 1.18.2 compiles successfuly now 2022-02-28 22:52:37 -07:00
Jake Potrebic 60af9b0cb3 moar fixes 2022-02-28 22:52:37 -07:00
Nassim Jahnke 12efc3fcf5 Fixes 2022-02-28 22:52:36 -07:00
Nassim Jahnke c2e2281f29 Initial 1.18 update 2022-02-28 22:52:35 -07:00
Shane Freeder 30cb7d0407 ignore excessive vel for Minecarts (Fixes #7515) 2022-02-28 15:31:41 +00:00
Spottedleaf 7f65b0b589 Add DataConverter to StructureCheck, for structure lookups
Mojang added a partial conversion here to quickly check for
structures, which bypasses the chunk system. So we need a
hook here.
2022-02-25 08:46:35 -08:00
Jake Potrebic bfa50ad5b3 Custom Potion Mixes (#6744) 2022-02-22 19:09:15 -08:00
Jake Potrebic 2a55e35124 Option to have default CustomSpawners in custom worlds (#7493) 2022-02-23 02:44:06 +00:00
Owen b6dad9c903 Fix desync on teleporting entity on first tick (#7183) 2022-02-23 02:20:29 +00:00
Noah van der Aa 04a337af59 Add some missing deprecations to the adventure patch (#7500) 2022-02-23 02:11:52 +00:00
Jake Potrebic 501834e57a Fix custom inventory holders (#6199) 2022-02-22 15:00:45 -08:00
Spottedleaf db811631ae Execute mid tick tasks during tile entity ticking
It was never done here in the past since the old TE management
system was barely functional, and could not handle chunk loading
remotely well
2022-02-22 14:42:00 -08:00
Spottedleaf 854f3d35c1 Put world into worldlist before initing the world
Some parts of legacy conversion will need the overworld
to get the legacy structure data storage
2022-02-22 14:28:34 -08:00
Spottedleaf cdb893bb9e Add mid-tick task execution to block ticking
Dropped from the ticking block list rewrite
2022-02-22 14:24:28 -08:00
Jason Penilla 9cab01ed1d [ci skip] Update Gradle wrapper to 7.4 2022-02-21 13:44:17 -07:00
Jake Potrebic b757019dc5 Add missing block data mins and maxes (#6790) 2022-02-20 13:58:31 -08:00
Jake Potrebic 392acfdaa4 Configurable sculk sensor listener range (#6443) 2022-02-20 13:44:14 -08:00
Jake Potrebic 36a1650dbf Furnace RecipesUsed API (#7399) 2022-02-19 14:00:33 -08:00
Nassim Jahnke 7b8e0c3acf Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
6fac07eb SPIGOT-6935: Make Arrow color nullable
abbc5c55 PR-730: Added a checkstyle rule to check for missing package declarations.
97157b12 PR-730: Added missing declaration of the org.bukkit.profile package.
9dcee1dc PR-727: Fix typo in StriderTemperatureChangeEvent javadocs

CraftBukkit Changes:
1e87776a SPIGOT-6935: Make Arrow color nullable
2022-02-19 13:50:20 +01:00
Jake Potrebic 5bb4549f48 Fix entity armor not showing on death animation (#7355) 2022-02-18 10:16:41 -08:00
Spottedleaf 286bd1bfb5 1.18 misc performance dev branch (#7368)
- Port player chunk loader patch
Makes the chunk system act as it did in 1.17, no additional tickets (and thus logic) to make a chunk ticking.
Adds simulation distance API, deprecates old no-tick method.
- More collision optimisations
Ancient patch from tuinity that never could be pushed to master.
- Fix Optimise ArraySetSorted#removeIf patch
- Execute chunk tasks fairly for worlds while waiting for next tick
- Port Replace ticket level propagator
2022-02-18 09:44:46 -08:00
Bjarne Koll b173c3ee2c Use access transformers for player profile API (#7468) 2022-02-18 09:30:37 -08:00
Jake Potrebic f5b9e07a2a Add GameEvent tags (#6439) 2022-02-17 18:42:22 -08:00
Shane Freeder 2a4aef3d97 Mark ChatRender#render as ApiStatus.Override 2022-02-18 01:32:48 +00:00
Nassim Jahnke c50fc3a026 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7480)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
8d818032 PR-723: Add Furnace#getRecipesUsed
d7b5a313 PR-726: Add Particle dataTypes to javadocs
72fe8b71 PR-724: Add PDC to World

CraftBukkit Changes:
c0326c28 PR-1009: Add Furnace#getRecipesUsed
cc5ddd79 PR-1010: Add PDC to World
6a54e5d3 PR-1012: Always save as skull owner and not as internal data

Spigot Changes:
699290cd Rebuild patches
2022-02-15 11:30:58 +01:00
Jason Penilla a8f2d67491 - properly fix IllegalArgumentException in /paper mobcaps command
- fix IllegalArgumentException in `/paper playermobcaps` command
- add missing Validate calls to CraftServer#getSpawnLimit(SpawnCategory)
2022-02-12 12:50:27 -07:00
Noah van der Aa e6898ff61e Fix IllegalArgumentException for /paper mobcaps command (#7472) 2022-02-12 19:02:14 +00:00
Nassim Jahnke 92c777d393 Fix PlayerProfile BukkitObject serialization, deprecate setName and setId for removal (#7471)
Having a modifiable hash here is a bit flawed and most developers should never need these methods
2022-02-12 19:29:41 +01:00
Noah van der Aa 9567753460 Don't load plugins prefixed with a dot (#7392) 2022-02-12 15:03:51 +01:00
Jake Potrebic 3d91ecac51 Fix cancelled snow bucket placement (#6751) 2022-02-12 14:56:27 +01:00
Jake Potrebic 2c4a5892ec Fix issues with LimitedRegion (#7343)
These issues stemmed from Paper integrating new upstream API
that was duplicated by a lot of existing Paper API
2022-02-12 14:51:13 +01:00
Jake Potrebic 2c8d48c555 Make Panda implement Sittable (#7414) 2022-02-12 14:36:41 +01:00
IzzelAliz 4a745f9163 Optimize Util#sequence (#7115)
Basically the same diff is already in Vanilla 22w06a, so might as well merge this now/have a conflict to know to remove the stream they added
2022-02-12 14:28:41 +01:00
Nassim Jahnke 26734e83b0 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7454)
* Updated Upstream (Bukkit/CraftBukkit/Spigot)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
8085edde SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls
04c7e13c PR-719: Add Player Profile API
71564210 SPIGOT-6910: Add BlockDamageAbortEvent

CraftBukkit Changes:
febaa1c6 SPIGOT-6918: Add SpawnCategory API and configurations for Axolotls
9dafd109 Don't send updates over large distances
bdac46b0 SPIGOT-6782: EntityPortalEvent should not destroy entity when setTo() uses same world as getFrom()
8f361ece PR-1002: Add Player Profile API
911875d4 Increase outdated build delay
e5f8a767 SPIGOT-6917: Use main scoreboard for /trigger
a672a531 Clean up callBlockDamageEvent
8e1bdeef SPIGOT-6910: Add BlockDamageAbortEvent

Spigot Changes:
6edb62f3 Rebuild patches
7fbc6a1e Rebuild patches

* Updated Upstream (CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
de951355 SPIGOT-6927: Fix default value of spawn-limits in Worlds
2022-02-12 14:20:33 +01:00
Bjarne Koll 00da0989f3 Log exceptions thrown during chat processing (#7467) 2022-02-11 19:42:12 -07:00
Nassim JahnkeandJason Penilla 0cc2503b88 Implement World#regenerateChunk (#7425)
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
2022-02-05 20:47:11 +01:00
PureGero 6df46412cf Use destination world when preloading spawn chunk (#7441) 2022-02-04 09:30:13 +01:00
Jason 46ed080d3b fix portal linking in upgraded chunks (fixes #7419) (#7438) 2022-02-03 12:28:39 -07:00
Jason 9940bcabcc API for creating command sender which forwards feedback (#7432) 2022-02-02 19:44:57 -07:00
Nassim Jahnke f23c03955b Fix infinite recursion in spawnCategoryForChunk/Position 2022-02-02 21:57:11 +01:00
Spottedleaf 2ec04e0938 Use correct headerLocation for regionfile initialisation
If the regionfile cannot be recalculated (i.e entity/poi type),
then attempts to remove the invalid entry would blow up
2022-02-02 06:02:16 -08:00
Shane Freeder 2121aed33d Rebuild patches
Cos, you know, pushing the correct changes the first time woulda been
overrated
2022-02-01 13:06:41 +00:00
Shane Freeder f79c0daece Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
5c21a63f PR-717: Add PlayerHideEntityEvent and PlayerShowEntityEvent

CraftBukkit Changes:
c26a7b54d PR-1000: Add PlayerHideEntityEvent and PlayerShowEntityEvent
2022-02-01 11:35:36 +00:00
Shane Freeder 17eb8845f3 Use a CHM for StructureTemplate.Pallete cache
fixes a CME due to this collection being shared across threads

This patch was in 1.16.5 for a good while and noticed somebody
getting impacted by the same thing
2022-02-01 09:47:46 +00:00
Jake Potrebic 3109dd87ee Updated Upstream (Bukkit/CraftBukkit) (#7428) 2022-01-31 15:56:54 -08:00
Jason Penilla 41263d9231 [ci skip] Update paperweight to 1.3.4 2022-01-27 13:19:45 -07:00
Noah van der Aa 2e99e5e677 Updated Upstream (Bukkit/CraftBukkit) (#7411)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
af88996a SPIGOT-6890: Add repair cost amount in AnvilInventory
bc7bd363 PR-716: Fix scheduler javadocs (previously, the <b> tag broke the rendering)
6db1ab70 Improve item cooldown JavaDocs

CraftBukkit Changes:
13670b44 SPIGOT-6890: Add repair cost amount in AnvilInventory
0d109e86 PR-999: Prevent non-item cooldowns
2022-01-27 15:35:36 +01:00
Jason Penilla ca523abbdd [ci skip] Fix param mismatch from last commit 2022-01-25 20:53:18 -07:00
Jason Penilla f7dbd062e7 [ci skip] Update parameter mappings 2022-01-25 20:44:24 -07:00
Jason Penilla b164899084 Update tiny-remapper 2022-01-25 20:22:49 -07:00
Jake Potrebic 9490475b02 Add STRUCTURE_TYPE registry entry (#6400) 2022-01-23 11:12:42 -08:00
Jake Potrebic 7978121c7c More PotionEffectType API (#5737) 2022-01-23 10:42:38 -08:00
Jake Potrebic f6c7d536a8 Add configurable stronghold seed (#7334) 2022-01-23 15:26:22 +01:00
Owen a058ac05d8 Dolphin API (#7102) 2022-01-23 14:55:11 +01:00
Owen 9a1930867b Lock Frozen Ticks API (#7207) 2022-01-23 14:35:07 +01:00
MrPowerGamerBRandJake Potrebic 0a9602c412 [ci skip] Fix multiple ItemStack array nullability mistakes (#7055)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2022-01-22 17:40:57 -08:00
Jake Potrebic 512995c2a5 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7359) 2022-01-22 16:59:56 -08:00
Kezz 60e46abb00 Fix NotePlayEvent (#5180) 2022-01-21 23:42:10 -08:00
Jake Potrebic dcca6cb1be Make tag presets unmodifiable (#7378) 2022-01-21 15:07:35 -08:00
JanandJan Boerman feb72b8ae1 Update ASM EventExecutor generator patch to respect event handler return types. Fixes #7311 (#7317)
Co-authored-by: Jan Boerman <janboerman95@gmail.com>
2022-01-20 12:54:57 -07:00
Brody Beckwith 2a306f513c Add Multi Block Change API (#7333) 2022-01-20 18:50:50 +01:00
Riley Park 128691a963 Deprecate log4j logger method in Plugin 2022-01-19 18:39:27 -08:00
Noah van der Aa c904da6eab Offset spigot item optimizations instead of Mojang's (#6290) 2022-01-19 11:18:24 -08:00
Jake Potrebic 45338214b0 Fix setSpawnedItem from 1.18 update (#7328) 2022-01-18 19:09:04 -08:00
Jake Potrebic 6b526f9645 Fix setting unplaced furnace cook speed multiplier (#7327) 2022-01-18 11:33:37 -08:00
Jason 7c3893c0c4 Warn on strange @EventHandler return types (#7372) 2022-01-18 11:47:54 -07:00
Noah van der Aa f1db23e47f [ci skip] Fix incorrect javadoc for Mob pathfinding API (#6842) 2022-01-17 23:26:11 -08:00
Nassim Jahnke 919e59494c Push illegal char kick to main thread (#7363) 2022-01-17 23:16:36 -08:00
Jake Potrebic 048e030914 Change default for hoppers ignoring occluded blocks (#7342) 2022-01-17 23:11:11 -08:00
HexedHero 17e1f65669 Fix Lure infinite loop (#6850) 2022-01-17 22:54:31 -08:00
Camotoy 60b7d5ee0c Add unsupported field to disable username validation (#7350)
* Add unsupported field to disable username validation

* Add unsupported field to disable username validation
2022-01-17 19:52:47 -08:00
Owen 6d67504ab5 Expand Panda API (#7061) 2022-01-17 15:23:44 -08:00
Jake Potrebic 99cf01f993 Fix and deprecate ItemStack#getI18NDisplayName (#7358) 2022-01-16 16:53:26 -08:00
Jake Potrebic 5c74af2efa Fix NPE for bucket empty result stack being null (#7354) 2022-01-16 12:08:24 -08:00
Jake Potrebic 36ce000793 Fix xp reward for baby zombies (#7353) 2022-01-16 20:15:16 +01:00
PureGero 78999b5778 Remove redundant getRemoteAddress that can cause an NPE (#7331) 2022-01-13 19:56:45 -08:00
Jake Potrebic 6663747b89 Some block state hunks were in the wrong patch (#7308) 2022-01-13 11:31:48 -08:00
Jake Potrebic 0c64d401aa Updated Upstream (Bukkit/CraftBukkit) (#7323) 2022-01-12 13:39:20 -08:00
John ebaca20edd Added getHostname to AsyncPlayerPreLoginEvent (#6656) 2022-01-12 09:21:29 -08:00
Nassim Jahnke cb198ff936 Fix chunk range int overflow 2022-01-11 19:34:25 +01:00
Shane Freeder 6f0762c012 Fix defaults for slime-spawn-height in paper config
do note that if you happened to grab the previous build in the few minutes it
was alive, you'll want to reset your settings here

also, i
2022-01-11 02:55:05 +00:00
Pedro 31f01379ce Add configurable height for slime spawn per world (#6310) 2022-01-10 18:27:16 -08:00
Nassim Jahnke 3ea224d128 Reset placed blocks on exceptions 2022-01-10 14:03:18 +01:00
Tom Miller 87d8ef9f24 Add/Remove multiple entries with Scoreboard Team (#6640) 2022-01-09 21:08:55 -08:00
Jacob Andersen 2be9beb5dc Add material tags for deepslate ores (#7174) 2022-01-09 20:25:22 -08:00
a736c1a3c7 Add new overload to PersistentDataContainer#has (#7278)
Co-authored-by: u9g <winworkswow@gmail.com>
Co-authored-by: Josh Roy <joshroy126@gmail.com>
2022-01-09 11:35:45 -05:00
Jake Potrebic 7d7ae7b881 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7246) 2022-01-08 21:12:05 -08:00
Jason d9fb602057 Expose vanilla BiomeProvider from WorldInfo (#7295) 2022-01-07 15:35:32 -08:00
Spottedleaf eb48ada00b Merge chunk task urgent executor thread into the worker queue
By keeping them separate, urgent tasks could not be executed
by the worker queue.
2022-01-07 15:15:35 -08:00
Spottedleaf 5ccd3050ed Fix incorrect old oversized chunk data merging
All legacy oversized chunks were created before the new
chunk format, so don't try to merge into the new format.
2022-01-07 13:49:39 -08:00
Brokkonaut c3d812d341 Make water animal spawn height configurable (#7135) 2022-01-07 11:38:51 +01:00
Nassim Jahnke 9a47cf1834 Don't print utterly useless brig exception 2022-01-06 13:11:08 +01:00
Nassim Jahnke e64ac41fe2 Catch more json parse errors 2022-01-06 12:40:51 +01:00
Jake Potrebic 55a1756ade Fix saving configs with more long comments (#7248) 2022-01-05 11:54:42 -08:00
Nassim Jahnke 20c131b96b [ci skip] Add forums to readme (#7286) 2022-01-05 13:58:11 +01:00
Nassim Jahnke 5e30e19e20 Fix compile 2022-01-03 10:23:56 +01:00
Nassim Jahnke 00d6cca4df Fix filtered text not being applied on sign update
Fixes #7266
2022-01-03 10:17:27 +01:00
Jake Potrebic eb98398158 Fixed FishingHook param mappings being swapped (#7243) 2022-01-02 22:24:33 -08:00
Nassim Jahnke d0b8b1e972 Fix disarmed tripwire block updates
Fixes #7259
Closes #7261
2022-01-02 21:33:53 +01:00
Jason 79dd62ae62 Use AreaMap for per-player mob spawning (#7235) 2022-01-02 11:06:08 -08:00
Pierre Maurice Schwang 19bc612483 Make BlockData creation thread safe again (#6876) 2022-01-02 18:29:21 +01:00
sean d3f3429d03 Use simulation distance for per-player mob spawns (#7247) 2022-01-02 15:05:08 +01:00
Shane Freeder 503ac8f1cb Provide option to disable username validation (Closes #7250) (#7254) 2022-01-02 12:51:22 +00:00
Noah van der Aa cee7e0df01 Fix soul speed particles with hide-itemmeta enabled (#7239) 2022-01-01 15:26:53 -08:00
thamid-gamer fb4ff200f4 Use isSensitiveToWater in nerfed check for water-sensitive mobs (#7236) 2022-01-01 13:56:41 -08:00
Spottedleaf 3c5284dae9 Allow . in usernames 2022-01-01 11:50:44 -08:00
Spottedleaf 4bf2aef745 Validate usernames 2022-01-01 05:48:17 -08:00
Jake Potrebic 3a43821c38 Updated Upstream (Bukkit/CraftBukkit/Spigot) 2021-12-31 19:05:42 -08:00
Jason 8b1734123e Fix vanilla LocalMobCapCalculator being used when per-player mob spawning is enabled (#7230) 2021-12-31 18:07:21 -08:00
Jason Penilla fa438331e0 [ci skip] Update shadow and remove semicolons from kotlin code 2021-12-31 14:28:13 -08:00
Simon Gardling 58c41d0f60 [ci skip] Update log4j-api in Paper-API to 2.17.1 (#7227) 2021-12-31 14:26:20 -08:00
Jason Penilla c40e04e9e7 Remove wrong update call in distance map add method 2021-12-31 13:59:34 -08:00
Noah van der Aa 64f9225c94 Fix riding distance statistics (#7021/SPIGOT-6475) (#7033) 2021-12-30 23:17:08 -08:00
LemonCaramel 686bbd33d4 Fix EntityLoadCrossbowEvent Sync Issue (#5739) 2021-12-30 22:54:23 -08:00
LexiandJake Potrebic 2d458ee14f Check player world in endPortalSoundRadius (#6226)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2021-12-30 19:50:44 -08:00
Owen1212055 721f14842f [ci skip] Change test logging settings to log by default (#7203) 2021-12-30 13:52:30 -08:00
Owen1212055 a99a33cdd9 Bucketable API (#7204) 2021-12-30 11:58:38 -08:00
Jake Potrebic 7b833ca18f Fix bees aging inside hives (#6466) 2021-12-30 11:44:39 -08:00
1257 changed files with 21674 additions and 9511 deletions

No files matched your search

+1 -1
View File
@@ -41,4 +41,4 @@ body:
attributes:
value: |
Before submitting this feature request, please search our issue tracker to ensure your feature has not
alerady been requested.
already been requested.
+2 -2
View File
@@ -18,9 +18,9 @@ jobs:
java: [17]
fail-fast: true
steps:
- uses: actions/checkout@v2.3.5
- uses: actions/checkout@v2.4.0
- name: JDK ${{ matrix.java }}
uses: actions/setup-java@v2.3.1
uses: actions/setup-java@v3.1.0
with:
java-version: ${{ matrix.java }}
cache: 'gradle'
+1
View File
@@ -49,4 +49,5 @@ MeFisto94 <MeFisto94@users.noreply.github.com>
Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
LemonCaramel <admin@caramel.moe>
Noah van der Aa <ndvdaa@gmail.com>
Doc <nachito94@msn.com>
```
-5
View File
@@ -8,11 +8,6 @@ java {
withJavadocJar()
}
repositories {
mavenCentral()
maven("https://libraries.minecraft.net")
}
dependencies {
implementation(project(":paper-api"))
api("com.mojang:brigadier:1.0.18")
+4 -4
View File
@@ -8,7 +8,7 @@ High performance Spigot fork that aims to fix gameplay and mechanics inconsisten
**Support and Project Discussion:**
- [IRC](https://webchat.esper.net/?channels=paper) or [Discord](https://discord.gg/papermc)
- [Our forums](https://forums.papermc.io/), [Discord](https://discord.gg/papermc), or [IRC](https://webchat.esper.net/?channels=paper)
How To (Server Admins)
------
@@ -18,7 +18,7 @@ Download Paper from our [downloads page](https://papermc.io/downloads).
Run the Paperclip jar directly from your server. Just like old times
* Documentation on using Paper: [paper.readthedocs.io](https://paper.readthedocs.io/)
* Documentation on using Paper: [docs.papermc.io](https://docs.papermc.io)
* For a sneak peek on upcoming features, [see here](https://github.com/PaperMC/Paper/projects)
How To (Plugin Developers)
@@ -38,7 +38,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@@ -54,7 +54,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT")
}
java {
+46 -9
View File
@@ -54,9 +54,6 @@ public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
# LivingEntity setkiller
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
# SkeletonHorse Additions
public net.minecraft.world.entity.animal.horse.SkeletonHorse trapTime
# Fix client rendering skulls
public net.minecraft.world.item.ItemStack tag
@@ -75,8 +72,6 @@ public net.minecraft.server.level.ChunkMap getPoiManager()Lnet/minecraft/world/e
# Improve death events
public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.LivingEntity getSoundVolume()F
public net.minecraft.world.entity.Mob handItems
public net.minecraft.world.entity.Mob armorItems
# Add sun related api
public net.minecraft.world.entity.Mob isSunBurnTick()Z
@@ -189,8 +184,6 @@ public net.minecraft.server.level.ServerLevel players
# Chunk priority urgency system
public net.minecraft.server.level.ChunkMap$ChunkDistanceManager
# Here's Johnny
public net.minecraft.world.entity.monster.Vindicator isJohnny
# Chunk debug command
public net.minecraft.server.level.Ticket createdTick
@@ -226,6 +219,13 @@ public net.minecraft.world.entity.animal.Fox isDefending()Z
public net.minecraft.world.entity.animal.Fox setDefending(Z)V
public net.minecraft.world.entity.animal.Fox isFaceplanted()Z
public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V
public net.minecraft.world.entity.animal.Panda getEatCounter()I
public net.minecraft.world.entity.animal.Panda setEatCounter(I)V
public net.minecraft.world.entity.animal.Bee isRolling()Z
public net.minecraft.world.entity.animal.Bee setRolling(Z)V
public net.minecraft.world.entity.monster.piglin.Piglin isChargingCrossbow()Z
public net.minecraft.world.entity.monster.Vex hasLimitedLife
public net.minecraft.world.entity.monster.Vex limitedLifeTicks
# Cook speed multipler API
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipeType
@@ -270,10 +270,19 @@ public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
# Optimize isValidLocation
public net.minecraft.world.level.chunk.LevelChunkSection states
# Player.setPlayerProfile API
# Player Profile API
public-f net.minecraft.world.entity.player.Player gameProfile
public org.bukkit.craftbukkit.profile.CraftProfileProperty
public org.bukkit.craftbukkit.profile.CraftPlayerTextures
public org.bukkit.craftbukkit.profile.CraftPlayerTextures copyFrom(Lorg/bukkit/profile/PlayerTextures;)V
public org.bukkit.craftbukkit.profile.CraftPlayerTextures rebuildPropertyIfDirty()V
public org.bukkit.craftbukkit.profile.CraftPlayerProfile getProperty(Ljava/lang/String;)Lcom/mojang/authlib/properties/Property;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile setProperty(Ljava/lang/String;Lcom/mojang/authlib/properties/Property;)V
public org.bukkit.craftbukkit.profile.CraftPlayerProfile toString(Lcom/mojang/authlib/properties/PropertyMap;)Ljava/lang/String;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile equals(Lcom/mojang/authlib/properties/PropertyMap;Lcom/mojang/authlib/properties/PropertyMap;)Z
public org.bukkit.craftbukkit.profile.CraftPlayerProfile hashCode(Lcom/mojang/authlib/properties/PropertyMap;)I
# Generator Settings
# Flat bedrock generator settings
public net.minecraft.world.level.levelgen.SurfaceRules$Condition
public net.minecraft.world.level.levelgen.SurfaceRules$Context
public net.minecraft.world.level.levelgen.SurfaceRules$Context blockX
@@ -295,3 +304,31 @@ public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
# Add health methods for item entities
public net.minecraft.world.entity.item.ItemEntity health
# Fix riding distance statistics
public net.minecraft.world.entity.player.Player checkRidingStatistics(DDD)V
# Fix NotePlayEvent
public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum;
# Stronghold seed configuration
public-f net.minecraft.world.level.chunk.ChunkGenerator strongholdSeed
# More Sculk Sensor API
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
# Fix custom inventory holders
public-f net.minecraft.world.inventory.AbstractContainerMenu dataSlots
public-f net.minecraft.world.inventory.AbstractContainerMenu remoteDataSlots
# Fix falling block spawn methods
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
# Fix cancelling ProjectileHitEvent for piercing arrows
protected net.minecraft.world.entity.projectile.Projectile hitCancelled
# Expose firework item directly + manually setting flight ticks
public net.minecraft.world.entity.projectile.FireworkRocketEntity life
# More Projectile API
public net.minecraft.world.entity.projectile.FishingHook timeUntilLured
+3 -4
View File
@@ -14,16 +14,15 @@ tiny 2 0 mojang+yarn spigot
# CraftBukkit changes type
c net/minecraft/server/level/ServerLevel net/minecraft/server/level/WorldServer
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData N
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData M
c net/minecraft/world/level/chunk/LevelChunk net/minecraft/world/level/chunk/Chunk
f Lnet/minecraft/server/level/ServerLevel; level q
# See mappings-patch.tiny
c net/minecraft/server/level/ChunkMap net/minecraft/server/level/PlayerChunkMap
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager D
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager E
# 1.18 todo: verify paper still changes this
# Paper changes type
c net/minecraft/core/MappedRegistry net/minecraft/core/RegistryMaterials
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId bA
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId bE
+42 -18
View File
@@ -1,8 +1,11 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.1.1" apply false
id("io.papermc.paperweight.core") version "1.3.3"
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
id("io.papermc.paperweight.core") version "1.3.6"
}
allprojects {
@@ -16,6 +19,8 @@ allprojects {
}
}
val paperMavenPublicUrl = "https://papermc.io/repo/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
@@ -27,28 +32,39 @@ subprojects {
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
if (name == "Paper-MojangAPI") {
return@subprojects
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
maven(paperMavenPublicUrl)
}
}
val spigotDecompiler: Configuration by configurations.creating
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/") {
content { onlyForConfigurations("paperclip") }
maven(paperMavenPublicUrl) {
content {
onlyForConfigurations(
configurations.paperclip.name,
spigotDecompiler.name,
)
}
}
}
dependencies {
paramMappings("net.fabricmc:yarn:1.18.1+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.7.0:fat")
decompiler("net.minecraftforge:forgeflower:1.5.498.22")
paramMappings("net.fabricmc:yarn:1.18.2+build.2:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.8.2:fat")
decompiler("net.minecraftforge:forgeflower:1.5.498.29")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.4")
paperclip("io.papermc:paperclip:3.0.2")
}
@@ -56,9 +72,13 @@ paperweight {
minecraftVersion.set(providers.gradleProperty("mcVersion"))
serverProject.set(project(":paper-server"))
paramMappingsRepo.set("https://maven.fabricmc.net/")
remapRepo.set("https://maven.fabricmc.net/")
decompileRepo.set("https://files.minecraftforge.net/maven/")
paramMappingsRepo.set(paperMavenPublicUrl)
remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl)
craftBukkit {
fernFlowerJar.set(layout.file(spigotDecompiler.elements.map { it.single().asFile }))
}
paper {
spigotApiPatchDir.set(layout.projectDirectory.dir("patches/api"))
@@ -86,14 +106,12 @@ tasks.generateDevelopmentBundle {
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://libraries.minecraft.net/",
"https://papermc.io/repo/repository/maven-public/",
"https://maven.fabricmc.net/",
paperMavenPublicUrl,
)
}
publishing {
if (project.providers.gradleProperty("publishDevBundle").forUseAtConfigurationTime().isPresent) {
if (project.providers.gradleProperty("publishDevBundle").isPresent) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
@@ -118,3 +136,9 @@ tasks.register("printMinecraftVersion") {
println(providers.gradleProperty("mcVersion").get().trim())
}
}
tasks.register("printPaperVersion") {
doLast {
println(project.version)
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
group=io.papermc.paper
version=1.18.1-R0.1-SNAPSHOT
version=1.18.2-R0.1-SNAPSHOT
mcVersion=1.18.1
mcVersion=1.18.2
org.gradle.caching=true
org.gradle.parallel=true
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
@@ -27,10 +27,10 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..b23bde3b5e881f146539a307d0a59f21
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..c76bfbcfbe034700bdbd9396643cfca625273a14
index 0000000000000000000000000000000000000000..d6b99d37c960a7d8de1852dbc74c3ce671101b14
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,66 @@
@@ -0,0 +1,80 @@
+plugins {
+ `java-library`
+ `maven-publish`
@@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..c76bfbcfbe034700bdbd9396643cfca6
+ // api dependencies are listed transitively to API consumers
+ api("commons-lang:commons-lang:2.6")
+ api("com.google.guava:guava:31.0.1-jre")
+ api("com.google.code.gson:gson:2.8.8")
+ api("com.google.code.gson:gson:2.8.9")
+ api("net.md-5:bungeecord-chat:1.16-R0.4")
+ api("org.yaml:snakeyaml:1.30")
+
@@ -90,19 +90,33 @@ index 0000000000000000000000000000000000000000..c76bfbcfbe034700bdbd9396643cfca6
+}
+
+tasks.withType<Javadoc> {
+ (options as StandardJavadocDocletOptions).links(
+ val options = options as StandardJavadocDocletOptions
+ options.overview = "src/main/javadoc/overview.html"
+ options.isDocFilesSubDirs = true
+ options.links(
+ "https://guava.dev/releases/31.0.1-jre/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ )
+
+ // workaround for https://github.com/gradle/gradle/issues/4046
+ inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
+ doLast {
+ copy {
+ from("src/main/javadoc") {
+ include("**/doc-files/**")
+ }
+ into("build/docs/javadoc")
+ }
+ }
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 9c130bf7fe7ec4b6b5d4f4c30cdbe6dc75b0f9a0..0000000000000000000000000000000000000000
index 7a34ef5514a30bcb61e657970bf087bdf9c2db90..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,262 +0,0 @@
@@ -1,263 +0,0 @@
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -110,7 +124,7 @@ index 9c130bf7fe7ec4b6b5d4f4c30cdbe6dc75b0f9a0..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.18.1-R0.1-SNAPSHOT</version>
- <version>1.18.2-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
@@ -153,7 +167,7 @@ index 9c130bf7fe7ec4b6b5d4f4c30cdbe6dc75b0f9a0..00000000000000000000000000000000
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.8</version>
- <version>2.8.9</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@@ -330,6 +344,7 @@ index 9c130bf7fe7ec4b6b5d4f4c30cdbe6dc75b0f9a0..00000000000000000000000000000000
- </executions>
- <configuration>
- <configLocation>checkstyle.xml</configLocation>
- <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
- <includeTestSourceDirectory>true</includeTestSourceDirectory>
- </configuration>
- <dependencies>
+5 -5
View File
@@ -5,11 +5,11 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index c76bfbcfbe034700bdbd9396643cfca625273a14..1f680baffba17265e8ce38b3516624bffd034075 100644
index d6b99d37c960a7d8de1852dbc74c3ce671101b14..e49f4853e36f493754841231eeb5dd093b3788e0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,15 +15,27 @@ dependencies {
api("com.google.code.gson:gson:2.8.8")
api("com.google.code.gson:gson:2.8.9")
api("net.md-5:bungeecord-chat:1.16-R0.4")
api("org.yaml:snakeyaml:1.30")
+ // Paper start
@@ -37,12 +37,12 @@ index c76bfbcfbe034700bdbd9396643cfca625273a14..1f680baffba17265e8ce38b3516624bf
testImplementation("junit:junit:4.13.2")
testImplementation("org.hamcrest:hamcrest-library:1.3")
testImplementation("org.ow2.asm:asm-tree:9.2")
@@ -60,7 +72,7 @@ tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).links(
@@ -63,7 +75,7 @@ tasks.withType<Javadoc> {
options.links(
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
)
}
@@ -7,14 +7,14 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..80fdd05dd593455ca89b66636ed30f1d9facf4ed 100644
index 98afa6a25131dc626ea7a5122f33df6bd2d39178..eefc024acc3e14ae21855df7f2f358bd1e0a9e38 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,6 +8,19 @@ java {
@@ -8,18 +8,37 @@ java {
withJavadocJar()
}
+val adventureVersion = "4.9.3"
+val adventureVersion = "4.10.1"
+val apiAndDocs: Configuration by configurations.creating {
+ attributes {
+ attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -30,87 +30,64 @@ index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..80fdd05dd593455ca89b66636ed30f1d
dependencies {
// api dependencies are listed transitively to API consumers
api("commons-lang:commons-lang:2.6")
@@ -20,6 +33,11 @@ dependencies {
api("com.google.guava:guava:31.0.1-jre")
api("com.google.code.gson:gson:2.8.9")
- api("net.md-5:bungeecord-chat:1.16-R0.4")
+ api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.6") // Paper
api("org.yaml:snakeyaml:1.30")
// Paper start
api("com.googlecode.json-simple:json-simple:1.1.1") {
isTransitive = false // includes junit
}
api("it.unimi.dsi:fastutil:8.5.6")
+ apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
+ apiAndDocs("net.kyori:adventure-api")
+ apiAndDocs("net.kyori:adventure-text-minimessage")
+ apiAndDocs("net.kyori:adventure-text-serializer-gson")
+ apiAndDocs("net.kyori:adventure-text-serializer-legacy")
+ apiAndDocs("net.kyori:adventure-text-serializer-plain")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.8.4")
@@ -70,10 +88,25 @@ tasks.jar {
}
tasks.withType<Javadoc> {
+ inputs.files(apiAndDocs)
+ .ignoreEmptyDirectories()
+ .withPropertyName(apiAndDocs.name + "-configuration")
+ doFirst {
+ (options as CoreJavadocOptions).addStringOption(
+ "sourcepath",
+ apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath)
+ )
+ }
(options as StandardJavadocDocletOptions).links(
@@ -77,9 +96,24 @@ tasks.withType<Javadoc> {
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
- "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ // Paper start
+ //"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat
+ "https://jd.adventure.kyori.net/api/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-minimessage/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-serializer-gson/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-serializer-legacy/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-serializer-plain/$adventureVersion/",
+ // Paper end
)
}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
index ef58a6c00f444bd498a2d8fc4e457236f393954f..ecd149157d4fb80444f34bf5633d74bcdb63dec5 100644
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@SuppressWarnings("WeakerAccess")
-public class TimingsReportListener implements MessageCommandSender {
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender { // Paper
private final List<CommandSender> senders;
private final Runnable onDone;
private String timingsURL;
@@ -74,4 +74,17 @@ public class TimingsReportListener implements MessageCommandSender {
this.senders.add(Bukkit.getConsoleSender());
}
}
+
+ // Paper start
+ @Override
+ public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
+ inputs.files(apiAndDocs).ignoreEmptyDirectories().withPropertyName(apiAndDocs.name + "-configuration")
+ doFirst {
+ options.addStringOption(
+ "sourcepath",
+ apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath)
+ )
+ }
+
+ @NotNull
+ @Override
+ public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
+ return this.senders;
+ }
+ // Paper end
}
// workaround for https://github.com/gradle/gradle/issues/4046
inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
doLast {
diff --git a/src/main/java/io/papermc/paper/chat/ChatRenderer.java b/src/main/java/io/papermc/paper/chat/ChatRenderer.java
new file mode 100644
index 0000000000000000000000000000000000000000..85fd5d6777b53bab09cc54c360bb75141635bdd3
index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88ad3bab097
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chat/ChatRenderer.java
@@ -0,0 +1,75 @@
@@ -0,0 +1,78 @@
+package io.papermc.paper.chat;
+
+import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.text.Component;
+import org.bukkit.entity.Player;
+import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -127,6 +104,7 @@ index 0000000000000000000000000000000000000000..85fd5d6777b53bab09cc54c360bb7514
+ * @param viewer the receiving {@link Audience}
+ * @return a rendered chat message
+ */
+ @ApiStatus.OverrideOnly
+ @NotNull
+ Component render(@NotNull Player source, @NotNull Component sourceDisplayName, @NotNull Component message, @NotNull Audience viewer);
+
@@ -176,6 +154,7 @@ index 0000000000000000000000000000000000000000..85fd5d6777b53bab09cc54c360bb7514
+ * @param message the chat message
+ * @return a rendered chat message
+ */
+ @ApiStatus.OverrideOnly
+ @NotNull
+ Component render(@NotNull Player source, @NotNull Component sourceDisplayName, @NotNull Component message);
+ }
@@ -488,10 +467,10 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7fa03a92eb 100644
index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257915b4afb 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -369,7 +369,9 @@ public final class Bukkit {
@@ -357,7 +357,9 @@ public final class Bukkit {
*
* @param message the message
* @return the number of players
@@ -501,7 +480,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
public static int broadcastMessage(@NotNull String message) {
return server.broadcastMessage(message);
}
@@ -1012,6 +1014,19 @@ public final class Bukkit {
@@ -1051,6 +1053,19 @@ public final class Bukkit {
server.shutdown();
}
@@ -521,7 +500,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
/**
* Broadcasts the specified message to every user with the given
* permission name.
@@ -1021,6 +1036,21 @@ public final class Bukkit {
@@ -1060,6 +1075,21 @@ public final class Bukkit {
* permissibles} must have to receive the broadcast
* @return number of message recipients
*/
@@ -543,7 +522,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
public static int broadcast(@NotNull String message, @NotNull String permission) {
return server.broadcast(message, permission);
}
@@ -1220,6 +1250,7 @@ public final class Bukkit {
@@ -1298,6 +1328,7 @@ public final class Bukkit {
return server.createInventory(owner, type);
}
@@ -551,7 +530,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
/**
* Creates an empty inventory with the specified type and title. If the type
* is {@link InventoryType#CHEST}, the new inventory has a size of 27;
@@ -1245,6 +1276,38 @@ public final class Bukkit {
@@ -1323,6 +1354,38 @@ public final class Bukkit {
* @see InventoryType#isCreatable()
*/
@NotNull
@@ -590,7 +569,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
public static Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title) {
return server.createInventory(owner, type, title);
}
@@ -1263,6 +1326,7 @@ public final class Bukkit {
@@ -1341,6 +1404,7 @@ public final class Bukkit {
return server.createInventory(owner, size);
}
@@ -598,7 +577,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
/**
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
* specified size and title.
@@ -1275,10 +1339,30 @@ public final class Bukkit {
@@ -1353,10 +1417,30 @@ public final class Bukkit {
* @throws IllegalArgumentException if the size is not a multiple of 9
*/
@NotNull
@@ -629,7 +608,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
/**
* Creates an empty merchant.
*
@@ -1286,7 +1370,20 @@ public final class Bukkit {
@@ -1364,7 +1448,20 @@ public final class Bukkit {
* when the merchant inventory is viewed
* @return a new merchant
*/
@@ -650,7 +629,7 @@ index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7f
public static Merchant createMerchant(@Nullable String title) {
return server.createMerchant(title);
}
@@ -1366,22 +1463,47 @@ public final class Bukkit {
@@ -1470,22 +1567,47 @@ public final class Bukkit {
return server.isPrimaryThread();
}
@@ -729,7 +708,7 @@ index 32c92621c2c15eec14c50965f5ecda00c46e6c80..e076d447da62445764a9776ee2554c07
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Nameable.java b/src/main/java/org/bukkit/Nameable.java
index fee814e01a653d2b53c56e8b566383ca44aa5346..2acdf2a6d3955923c721222b9da784f3278f6418 100644
index fee814e01a653d2b53c56e8b566383ca44aa5346..b71b780792b672b37c8fe65d43489b860a227381 100644
--- a/src/main/java/org/bukkit/Nameable.java
+++ b/src/main/java/org/bukkit/Nameable.java
@@ -4,6 +4,30 @@ import org.jetbrains.annotations.Nullable;
@@ -763,6 +742,27 @@ index fee814e01a653d2b53c56e8b566383ca44aa5346..2acdf2a6d3955923c721222b9da784f3
/**
* Gets the custom name on a mob or block. If there is no name this method
* will return null.
@@ -11,8 +35,10 @@ public interface Nameable {
* This value has no effect on players, they will always use their real
* name.
*
+ * @deprecated in favour of {@link #customName()}
* @return name of the mob/block or null
*/
+ @Deprecated // Paper
@Nullable
public String getCustomName();
@@ -25,7 +51,9 @@ public interface Nameable {
* This value has no effect on players, they will always use their real
* name.
*
+ * @deprecated in favour of {@link #customName(net.kyori.adventure.text.Component)}
* @param name the name to set
*/
+ @Deprecated // Paper
public void setCustomName(@Nullable String name);
}
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af6427f1f030 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
@@ -802,10 +802,10 @@ index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af64
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f380589dd 100644
index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904e4ceb9df 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -56,7 +56,7 @@ import org.jetbrains.annotations.Nullable;
@@ -58,13 +58,13 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a server implementation.
*/
@@ -813,8 +813,6 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
+public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
/**
* Returns the de facto plugins directory, generally used for storing plugin jars to be loaded,
@@ -74,7 +74,7 @@ public interface Server extends PluginMessageRecipient {
* Used for all administrative messages, such as an operator using a
* command.
* <p>
@@ -823,7 +821,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
*/
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
@@ -82,7 +82,7 @@ public interface Server extends PluginMessageRecipient {
@@ -72,7 +72,7 @@ public interface Server extends PluginMessageRecipient {
* Used for all announcement messages, such as informing users that a
* player has joined.
* <p>
@@ -832,7 +830,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
*/
public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
@@ -304,7 +304,9 @@ public interface Server extends PluginMessageRecipient {
@@ -294,7 +294,9 @@ public interface Server extends PluginMessageRecipient {
*
* @param message the message
* @return the number of players
@@ -842,7 +840,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
public int broadcastMessage(@NotNull String message);
/**
@@ -856,8 +858,33 @@ public interface Server extends PluginMessageRecipient {
@@ -894,8 +896,33 @@ public interface Server extends PluginMessageRecipient {
* @param permission the required permission {@link Permissible
* permissibles} must have to receive the broadcast
* @return number of message recipients
@@ -876,7 +874,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
/**
* Gets the player by the given name, regardless if they are offline or
@@ -1022,6 +1049,7 @@ public interface Server extends PluginMessageRecipient {
@@ -1093,6 +1120,7 @@ public interface Server extends PluginMessageRecipient {
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type);
@@ -884,7 +882,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
/**
* Creates an empty inventory with the specified type and title. If the type
* is {@link InventoryType#CHEST}, the new inventory has a size of 27;
@@ -1047,6 +1075,36 @@ public interface Server extends PluginMessageRecipient {
@@ -1118,6 +1146,36 @@ public interface Server extends PluginMessageRecipient {
* @see InventoryType#isCreatable()
*/
@NotNull
@@ -921,7 +919,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title);
/**
@@ -1061,6 +1119,22 @@ public interface Server extends PluginMessageRecipient {
@@ -1132,6 +1190,22 @@ public interface Server extends PluginMessageRecipient {
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, int size) throws IllegalArgumentException;
@@ -944,7 +942,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
/**
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
* specified size and title.
@@ -1071,10 +1145,13 @@ public interface Server extends PluginMessageRecipient {
@@ -1142,10 +1216,13 @@ public interface Server extends PluginMessageRecipient {
* viewed
* @return a new inventory
* @throws IllegalArgumentException if the size is not a multiple of 9
@@ -958,7 +956,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
/**
* Creates an empty merchant.
*
@@ -1082,7 +1159,18 @@ public interface Server extends PluginMessageRecipient {
@@ -1153,7 +1230,18 @@ public interface Server extends PluginMessageRecipient {
* when the merchant inventory is viewed
* @return a new merchant
*/
@@ -977,7 +975,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
Merchant createMerchant(@Nullable String title);
/**
@@ -1146,20 +1234,41 @@ public interface Server extends PluginMessageRecipient {
@@ -1240,20 +1328,41 @@ public interface Server extends PluginMessageRecipient {
*/
boolean isPrimaryThread();
@@ -1019,7 +1017,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
String getShutdownMessage();
/**
@@ -1536,7 +1645,9 @@ public interface Server extends PluginMessageRecipient {
@@ -1610,7 +1719,9 @@ public interface Server extends PluginMessageRecipient {
* Sends the component to the player
*
* @param component the components to send
@@ -1029,7 +1027,7 @@ index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f
public void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1545,7 +1656,9 @@ public interface Server extends PluginMessageRecipient {
@@ -1619,7 +1730,9 @@ public interface Server extends PluginMessageRecipient {
* Sends an array of components as a single message to the player
*
* @param components the components to send
@@ -1102,24 +1100,24 @@ index ac5e263d737973af077e3406a84a84baca4370db..2d91924b7f5ef16a91d40cdc1bfc3d68
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 945b8b030d1b2a13afc0c4efad76997eb7bf00ba..e464769f72bf7d8e0f0630fd4f03011f8ac80dc7 100644
index 01e11f882abb6c631f810584aa23646042688435..f43ad19a44f3b7368a1a110cc55247277f4d3751 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -17,6 +17,14 @@ import org.bukkit.plugin.PluginDescriptionFile;
@@ -22,6 +22,14 @@ import org.bukkit.plugin.PluginDescriptionFile;
*/
@Deprecated
public interface UnsafeValues {
+ // Paper start
+ net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener();
+ net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
+ @Deprecated net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
+ net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainTextSerializer();
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
+ net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
+ // Paper end
void reportTimings(); // Paper
Material toLegacy(Material material);
diff --git a/src/main/java/org/bukkit/Warning.java b/src/main/java/org/bukkit/Warning.java
index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb1e09f3f4 100644
--- a/src/main/java/org/bukkit/Warning.java
@@ -1133,19 +1131,19 @@ index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb
return warning == null || warning.value();
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 8ab8515c55ba5944469084b3b4f093cb9f9648fb..c58b1885662c6a234ffee75995051c9750c1a512 100644
index 81adea0efd380b7452f5f573e7a6ea378b071eab..cf6fe1b5a1531e8d30c0386e36c023d003458b7e 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -38,7 +38,7 @@ import org.jetbrains.annotations.Nullable;
@@ -40,7 +40,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a world, which may contain entities, chunks and blocks
*/
-public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable {
+public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience { // Paper
-public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder {
+public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience { // Paper
/**
* Gets the {@link Block} at the given coordinates
@@ -633,6 +633,14 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -635,6 +635,14 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public List<Player> getPlayers();
@@ -1278,19 +1276,20 @@ index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa33
/**
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43c6cfdf44 100644
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15ba936cc6 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -32,7 +32,7 @@ public abstract class Command {
@@ -32,8 +32,7 @@ public abstract class Command {
protected String description;
protected String usageMessage;
private String permission;
- private String permissionMessage;
- public org.spigotmc.CustomTimingsHandler timings; // Spigot
+ private net.kyori.adventure.text.Component permissionMessage; // Paper
public co.aikar.timings.Timing timings; // Paper
@NotNull public String getTimingName() {return getName();} // Paper
@@ -186,10 +186,10 @@ public abstract class Command {
protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -186,10 +185,10 @@ public abstract class Command {
if (permissionMessage == null) {
target.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is a mistake.");
@@ -1305,7 +1304,7 @@ index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43
}
return false;
@@ -316,10 +316,12 @@ public abstract class Command {
@@ -317,10 +316,12 @@ public abstract class Command {
* command
*
* @return Permission check failed message
@@ -1319,7 +1318,7 @@ index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43
}
/**
@@ -380,10 +382,12 @@ public abstract class Command {
@@ -381,10 +382,12 @@ public abstract class Command {
* @param permissionMessage new permission message, null to indicate
* default message, or an empty string to indicate no message
* @return this command object, for chaining
@@ -1333,7 +1332,7 @@ index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43
return this;
}
@@ -398,6 +402,25 @@ public abstract class Command {
@@ -399,6 +402,25 @@ public abstract class Command {
this.usageMessage = (usage == null) ? "" : usage;
return this;
}
@@ -1461,23 +1460,6 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..f98d46fa45bb7c842d791b09f082a096
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
index a7ef1f51c2b96617a32e6e7b1723e8770ba8a6a8..68daa56546d00089d7d6c13ee897d828c377bbc3 100644
--- a/src/main/java/org/bukkit/command/MessageCommandSender.java
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -49,6 +49,12 @@ public interface MessageCommandSender extends CommandSender {
default String getName() {
throw new NotImplementedException();
}
+ // Paper start
+ @Override
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
+ throw new NotImplementedException();
+ }
+ // Paper end
@Override
default boolean isOp() {
diff --git a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
index a542c4bb3c973bbe4b976642feccde6a4d90cb7b..614cba22c0997dbb45576f800675db4053a9831c 100644
--- a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
@@ -1562,7 +1544,7 @@ index 9566e4306ada5e82dede0f002aa06da12c44996b..4d5f0837bd0e02a30c943d8969fb6b13
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 25a6f9313a1953def7470e411b53016f2ca14bef..10cb6088c4618f228c757f4e592b44edab81c2dc 100644
index 922d33ff4fa9d901d3c5c0a9f8399ad8aef62c37..cd287978c34873c7122794e4f3e762915978a1f0 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
@@ -1574,7 +1556,7 @@ index 25a6f9313a1953def7470e411b53016f2ca14bef..10cb6088c4618f228c757f4e592b44ed
/**
* Gets the entity's current position
@@ -648,4 +648,20 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -656,4 +656,20 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@Override
Spigot spigot();
// Spigot end
@@ -1596,10 +1578,10 @@ index 25a6f9313a1953def7470e411b53016f2ca14bef..10cb6088c4618f228c757f4e592b44ed
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dca1da9595 100644
index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840ce98aed8b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -35,7 +35,28 @@ import org.jetbrains.annotations.Nullable;
@@ -37,7 +37,28 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a player, connected or not
*/
@@ -1629,7 +1611,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
/**
* Gets the "friendly" name to display of this player. This may include
@@ -45,7 +66,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -47,7 +68,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* places defined by plugins.
*
* @return the friendly name
@@ -1639,7 +1621,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
@NotNull
public String getDisplayName();
@@ -57,15 +80,50 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -59,15 +82,50 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* places defined by plugins.
*
* @param name The new display name.
@@ -1690,7 +1672,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public String getPlayerListName();
/**
@@ -74,14 +132,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -76,14 +134,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* If the value is null, the name will be identical to {@link #getName()}.
*
* @param name new player list name
@@ -1709,7 +1691,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
@Nullable
public String getPlayerListHeader();
@@ -89,7 +151,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -91,7 +153,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Gets the currently displayed player list footer for this player.
*
* @return player list header or null
@@ -1719,7 +1701,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
@Nullable
public String getPlayerListFooter();
@@ -97,14 +161,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -99,14 +163,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Sets the currently displayed player list header for this player.
*
* @param header player list header, null for empty
@@ -1738,7 +1720,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void setPlayerListFooter(@Nullable String footer);
/**
@@ -113,7 +181,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -115,7 +183,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param header player list header, null for empty
* @param footer player list footer, null for empty
@@ -1748,7 +1730,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void setPlayerListHeaderFooter(@Nullable String header, @Nullable String footer);
/**
@@ -151,9 +221,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -153,9 +223,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Kicks player with custom kick message.
*
* @param message kick message
@@ -1769,7 +1751,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
/**
* Says a message (or runs a command).
*
@@ -473,6 +554,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -500,6 +581,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item);
@@ -1860,7 +1842,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
/**
* Send a sign change. This fakes a sign change packet for a user at
* a certain location. This will not actually change the world in any way.
@@ -487,7 +652,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -514,7 +679,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param lines the new text on the sign or null to clear it
* @throws IllegalArgumentException if location is null
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
@@ -1870,7 +1852,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException;
/**
@@ -506,7 +673,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -533,7 +700,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException if location is null
* @throws IllegalArgumentException if dyeColor is null
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
@@ -1880,7 +1862,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException;
/**
@@ -526,7 +695,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -553,7 +722,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException if location is null
* @throws IllegalArgumentException if dyeColor is null
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
@@ -1890,8 +1872,19 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException;
/**
@@ -1008,6 +1179,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1028,6 +1199,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1041,8 +1213,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
+ @Deprecated // Paper
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt);
+ // Paper start
@@ -1945,11 +1938,22 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -1099,6 +1318,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1117,6 +1338,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component, boolean)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1132,8 +1354,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
+ @Deprecated // Paper
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force);
+ // Paper end
+ // Paper start
+ /**
+ * Request that the player's client download and switch resource packs.
+ * <p>
@@ -2000,7 +2004,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
/**
* Gets the Scoreboard displayed to this player
*
@@ -1192,7 +1459,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1249,7 +1520,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param title Title text
* @param subtitle Subtitle text
@@ -2009,7 +2013,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
*/
@Deprecated
public void sendTitle(@Nullable String title, @Nullable String subtitle);
@@ -1211,7 +1478,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1268,7 +1539,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param fadeIn time in ticks for titles to fade in. Defaults to 10.
* @param stay time in ticks for titles to stay. Defaults to 70.
* @param fadeOut time in ticks for titles to fade out. Defaults to 20.
@@ -2019,7 +2023,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
/**
@@ -1438,6 +1707,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1495,6 +1768,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public int getClientViewDistance();
@@ -2034,7 +2038,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
/**
* Gets the player's estimated ping in milliseconds.
*
@@ -1463,8 +1740,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1520,8 +1801,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* they wish.
*
* @return the player's locale
@@ -2045,7 +2049,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public String getLocale();
/**
@@ -1506,6 +1785,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1563,6 +1846,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public boolean isAllowingServerListings();
@@ -2060,7 +2064,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
// Spigot start
public class Spigot extends Entity.Spigot {
@@ -1560,11 +1847,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1617,11 +1908,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2074,7 +2078,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
@Override
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -1575,7 +1864,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1632,7 +1925,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param component the components to send
@@ -2084,7 +2088,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1585,7 +1876,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1642,7 +1937,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param components the components to send
@@ -2094,7 +2098,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1596,7 +1889,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1653,7 +1950,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param component the components to send
@@ -2104,7 +2108,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1607,7 +1902,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1664,7 +1963,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param components the components to send
@@ -2113,7 +2117,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dc
+ @Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
index 63c80b4ee1f7adc8a9efc3b607993104b1991f90..91cab8b13d5bba34007f124838b32a1df58c5ac7 100644
--- a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
@@ -3303,10 +3307,10 @@ index 14346d83bc99581b18e53d19af03708c0bf22cf7..664de64b020cf9090a2fbee0afe2bfaf
public abstract String getTitle();
}
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 4ff149fd98895dd8ba45939a37c223b1f8d7281f..6cc4bad2ecd19f44a680ff03cbfb99d48ea5c337 100644
index f89d71b77d1200314df6ca23614d5ca6fb15ceb3..af4a7ce37eb10bab06eadb6583c7894b3ec55ae6 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -141,4 +141,24 @@ public interface ItemFactory {
@@ -159,4 +159,24 @@ public interface ItemFactory {
@Deprecated
@NotNull
Material updateMaterial(@NotNull final ItemMeta meta, @NotNull final Material material) throws IllegalArgumentException;
@@ -3367,23 +3371,10 @@ index f70a6a22b85ff0da76e67e9b223ad4e0b020b5c4..a15abec467bac70116a6fc21a300d493
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c10d87ba4 100644
index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64af0edfb2 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -1,8 +1,12 @@
package org.bukkit.inventory.meta;
import java.util.List;
+
+import net.kyori.adventure.inventory.Book;
import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.Material;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.common.returnsreceiver.qual.This;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -10,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable;
* Represents a book ({@link Material#WRITABLE_BOOK} or {@link
* Material#WRITTEN_BOOK}) that can have a title, an author, and pages.
*/
@@ -3392,7 +3383,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
/**
* Represents the generation (or level of copying) of a written book
@@ -119,6 +123,117 @@ public interface BookMeta extends ItemMeta {
@@ -119,6 +119,118 @@ public interface BookMeta extends ItemMeta {
*/
boolean hasPages();
@@ -3419,7 +3410,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
+ */
+ @NotNull
+ @Override
+ @This BookMeta title(@Nullable net.kyori.adventure.text.Component title);
+ @org.checkerframework.common.returnsreceiver.qual.This BookMeta title(@Nullable net.kyori.adventure.text.Component title);
+
+ /**
+ * Gets the author of the book.
@@ -3441,7 +3432,8 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
+ */
+ @NotNull
+ @Override
+ @This BookMeta author(@Nullable net.kyori.adventure.text.Component author);
+ @org.checkerframework.common.returnsreceiver.qual.This BookMeta author(@Nullable net.kyori.adventure.text.Component author);
+
+ /**
+ * Gets the specified page in the book. The page must exist.
+ * <p>
@@ -3502,7 +3494,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
+ }
+
+ @Override
+ @NonNull
+ @org.checkerframework.checker.nullness.qual.NonNull
+ BookMetaBuilder toBuilder();
+
+ // Paper end
@@ -3510,7 +3502,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
/**
* Gets the specified page in the book. The given page must exist.
* <p>
@@ -126,8 +241,10 @@ public interface BookMeta extends ItemMeta {
@@ -126,8 +238,10 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to get, in range [1, getPageCount()]
* @return the page from the book
@@ -3521,7 +3513,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
String getPage(int page);
/**
@@ -141,15 +258,19 @@ public interface BookMeta extends ItemMeta {
@@ -141,15 +255,19 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to set, in range [1, getPageCount()]
* @param data the data to set for that page
@@ -3541,7 +3533,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
List<String> getPages();
/**
@@ -157,7 +278,9 @@ public interface BookMeta extends ItemMeta {
@@ -157,7 +275,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 100 pages with 256 characters per page.
*
* @param pages A list of pages to set the book to use
@@ -3551,7 +3543,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
void setPages(@NotNull List<String> pages);
/**
@@ -165,7 +288,9 @@ public interface BookMeta extends ItemMeta {
@@ -165,7 +285,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of strings, each being a page
@@ -3561,7 +3553,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
void setPages(@NotNull String... pages);
/**
@@ -173,7 +298,9 @@ public interface BookMeta extends ItemMeta {
@@ -173,7 +295,9 @@ public interface BookMeta extends ItemMeta {
* 256 characters per page.
*
* @param pages A list of strings, each being a page
@@ -3571,7 +3563,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
void addPage(@NotNull String... pages);
/**
@@ -195,8 +322,10 @@ public interface BookMeta extends ItemMeta {
@@ -195,8 +319,10 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to get
* @return the page from the book
@@ -3582,7 +3574,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
public BaseComponent[] getPage(int page) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -210,7 +339,9 @@ public interface BookMeta extends ItemMeta {
@@ -210,7 +336,9 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to set
* @param data the data to set for that page
@@ -3592,7 +3584,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
public void setPage(int page, @Nullable BaseComponent... data) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -219,8 +350,10 @@ public interface BookMeta extends ItemMeta {
@@ -219,8 +347,10 @@ public interface BookMeta extends ItemMeta {
* Gets all the pages in the book.
*
* @return list of all the pages in the book
@@ -3603,7 +3595,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
public List<BaseComponent[]> getPages() {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -230,7 +363,9 @@ public interface BookMeta extends ItemMeta {
@@ -230,7 +360,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of pages to set the book to use
@@ -3613,7 +3605,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
public void setPages(@NotNull List<BaseComponent[]> pages) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -240,7 +375,9 @@ public interface BookMeta extends ItemMeta {
@@ -240,7 +372,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of component arrays, each being a page
@@ -3623,7 +3615,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
public void setPages(@NotNull BaseComponent[]... pages) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -250,7 +387,9 @@ public interface BookMeta extends ItemMeta {
@@ -250,7 +384,9 @@ public interface BookMeta extends ItemMeta {
* with 256 characters per page.
*
* @param pages A list of component arrays, each being a page
@@ -3634,7 +3626,7 @@ index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index f2e9f2753ec92aa4a3e3f06ca6053bd70b9091d7..1c362636c56db0e6c118171ba367c43c4f7cff33 100644
index 91eee1470f0969e9eef0753c0c700ae5354f1acc..69f68ca2d62c2cfe07a193776054c14c352a5942 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -31,6 +31,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -3985,7 +3977,7 @@ index ff3fcb2697eb00736238d0efdcaefe43043334d3..75acd6f8f3d774bb79e8e513125e801c
/**
diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
index 5c855dbd0da895392f7a6e92cdc90782baf614ad..f7754ab421c7b452a53c28d1e2fafdccfbba24bf 100644
index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d78560f15 100644
--- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java
+++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
@@ -27,6 +27,48 @@ public interface Scoreboard {
@@ -4001,7 +3993,7 @@ index 5c855dbd0da895392f7a6e92cdc90782baf614ad..f7754ab421c7b452a53c28d1e2fafdcc
+ * @param displayName Name displayed to players for the Objective.
+ * @return The registered Objective
+ * @throws IllegalArgumentException if name is null
+ * @throws IllegalArgumentException if name is longer than 16
+ * @throws IllegalArgumentException if name is longer than 32767
+ * characters.
+ * @throws IllegalArgumentException if criteria is null
+ * @throws IllegalArgumentException if displayName is null
@@ -4021,7 +4013,7 @@ index 5c855dbd0da895392f7a6e92cdc90782baf614ad..f7754ab421c7b452a53c28d1e2fafdcc
+ * @param renderType Manner of rendering the Objective
+ * @return The registered Objective
+ * @throws IllegalArgumentException if name is null
+ * @throws IllegalArgumentException if name is longer than 16
+ * @throws IllegalArgumentException if name is longer than 32767
+ * characters.
+ * @throws IllegalArgumentException if criteria is null
+ * @throws IllegalArgumentException if displayName is null
File renamed without changes.
@@ -1878,10 +1878,10 @@ index 0000000000000000000000000000000000000000..a92925d41110226f7fda055b71ce7be6
+}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
new file mode 100644
index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236f393954f
index 0000000000000000000000000000000000000000..73452e53afc68061245a915c863067f47a1d99f9
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -0,0 +1,77 @@
@@ -0,0 +1,87 @@
+package co.aikar.timings;
+
+import com.google.common.collect.Lists;
@@ -1893,13 +1893,12 @@ index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236
+import org.bukkit.command.RemoteConsoleCommandSender;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@SuppressWarnings("WeakerAccess")
+public class TimingsReportListener implements MessageCommandSender {
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
+ private final List<CommandSender> senders;
+ private final Runnable onDone;
+ private String timingsURL;
@@ -1943,6 +1942,17 @@ index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236
+ }
+
+ @Override
+ public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
+ }
+
+ @NotNull
+ @Override
+ public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
+ return this.senders;
+ }
+
+ @Override
+ public void sendMessage(@NotNull String message) {
+ senders.forEach((sender) -> sender.sendMessage(message));
+ }
@@ -2782,10 +2792,10 @@ index 0000000000000000000000000000000000000000..5989ee21297935651b0edd44b8239e65
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 072bcbbbf167e02ce5014b672f2cf63122d29b21..de7f303bce9e2454eaec12131cd1439a54281c7e 100644
index d5fdc57ffcfac4eb18d7fbf44ce13257915b4afb..35de49ea52b507dd925ed3c118518a335035a710 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -747,7 +747,6 @@ public final class Bukkit {
@@ -801,7 +801,6 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
@@ -2794,10 +2804,10 @@ index 072bcbbbf167e02ce5014b672f2cf63122d29b21..de7f303bce9e2454eaec12131cd1439a
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 2bfccae871b92749fa5893b5a7ff327fc93695ad..31e989bdaf60d38e14c84c4a0a31ede6e1a72e86 100644
index 14b078e8fa4347dd0e186e5847693904e4ceb9df..bbb4eb3c4e46ade7dd939c2b0e4436161d6f8a1e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1500,6 +1500,26 @@ public interface Server extends PluginMessageRecipient {
@@ -1715,6 +1715,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2825,21 +2835,21 @@ index 2bfccae871b92749fa5893b5a7ff327fc93695ad..31e989bdaf60d38e14c84c4a0a31ede6
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 247d194f86c00db11acbc58e7d163b2606db4f07..945b8b030d1b2a13afc0c4efad76997eb7bf00ba 100644
index f43ad19a44f3b7368a1a110cc55247277f4d3751..ce5794d684a1126ec9acbf4af17f5d6fa783f551 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -18,6 +18,7 @@ import org.bukkit.plugin.PluginDescriptionFile;
@Deprecated
public interface UnsafeValues {
@@ -31,6 +31,7 @@ public interface UnsafeValues {
net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
// Paper end
+ void reportTimings(); // Paper
Material toLegacy(Material material);
Material fromLegacy(Material material);
@@ -69,4 +70,12 @@ public interface UnsafeValues {
* @return true if a file matching this key was found and deleted
*/
boolean removeAdvancement(NamespacedKey key);
@@ -86,4 +87,12 @@ public interface UnsafeValues {
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot);
CreativeCategory getCreativeCategory(Material material);
+
+ // Paper start
+ /**
@@ -2877,20 +2887,19 @@ index 0000000000000000000000000000000000000000..f9a00aecca5ec41b460bf41dfe1c6969
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..03bdc1622791e1206406c87065978688d602e39e 100644
index 50e6d45ec9349b56d20e2ffc664eca15ba936cc6..c4dcafac892169a7bfcc065701fffb43c6cfdf44 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -33,7 +33,8 @@ public abstract class Command {
@@ -33,6 +33,8 @@ public abstract class Command {
protected String usageMessage;
private String permission;
private String permissionMessage;
- public org.spigotmc.CustomTimingsHandler timings; // Spigot
private net.kyori.adventure.text.Component permissionMessage; // Paper
+ public co.aikar.timings.Timing timings; // Paper
+ @NotNull public String getTimingName() {return getName();} // Paper
protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -47,7 +48,6 @@ public abstract class Command {
@@ -46,7 +48,6 @@ public abstract class Command {
this.usageMessage = (usageMessage == null) ? "/" + name : usageMessage;
this.aliases = aliases;
this.activeAliases = new ArrayList<String>(aliases);
@@ -2898,7 +2907,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..03bdc1622791e1206406c87065978688
}
/**
@@ -245,7 +245,6 @@ public abstract class Command {
@@ -244,7 +245,6 @@ public abstract class Command {
}
this.nextLabel = name;
if (!isRegistered()) {
@@ -2931,10 +2940,10 @@ index d6c8938b1e13b63116b7b0e074ea8ef5997f8dc3..a6ad94ef98a1df1d2842635d850bc990
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
new file mode 100644
index 0000000000000000000000000000000000000000..a7ef1f51c2b96617a32e6e7b1723e8770ba8a6a8
index 0000000000000000000000000000000000000000..f8f0aa688e337222f305fb07f57eec474e3a3a2b
--- /dev/null
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -0,0 +1,129 @@
@@ -0,0 +1,136 @@
+package org.bukkit.command;
+
+import org.apache.commons.lang.NotImplementedException;
@@ -2981,6 +2990,13 @@ index 0000000000000000000000000000000000000000..a7ef1f51c2b96617a32e6e7b1723e877
+ return Bukkit.getServer();
+ }
+
+ // Paper start
+ @Override
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
+ throw new NotImplementedException();
+ }
+ // Paper end
+
+ @NotNull
+ @Override
+ default String getName() {
@@ -3377,11 +3393,11 @@ index 2a145d851ce30360aa39549745bd87590c034584..00000000000000000000000000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 709016bdc30d5502765af842d4fc83af53779a9e..c36e4ceb1094aa9469f976e0952e2725358ff761 100644
index dc7e32a6f3be974a1d9c367d6b0f840ce98aed8b..71e696eadf7c9290791c8b50d666dc501621f24e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1610,7 +1610,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@@ -1968,7 +1968,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
+
@@ -3499,7 +3515,7 @@ index a09c3f71ca563b6f40a118ce1344d0eb273bed40..cf2f517765d8f2a23cc4a17d9ee2dcd8
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
} else {
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 6bdd9f1dcc4c69c1811622cddc82526d2f8d9e52..657243776c8a2abb5a57e5c407212a8387d649eb 100644
index 930f3fe08c2acd70eaf7850d0b1b2890512defa0..24e3eaa008e53af8d77439e4f2ab9007285d7826 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -29,7 +29,8 @@ import org.jetbrains.annotations.Nullable;
@@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index a238302f2a12194aa30a88867070705dc749b36b..cc42bfa74b41ef6d6374efa7b882f71677fb0824 100644
index b1d770a62e499d909de4352303409fcfdc5d58a9..fc7d17fd3028f790ff9e034e8234bf0506f017c2 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -73,6 +73,20 @@ public final class Bukkit {
@@ -75,6 +75,20 @@ public final class Bukkit {
return server;
}
@@ -32,12 +32,12 @@ index a238302f2a12194aa30a88867070705dc749b36b..cc42bfa74b41ef6d6374efa7b882f716
* Attempts to set the {@link Server} singleton.
* <p>
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 3e91c4000c468fd8bdcb938e942a7bbf4988cab2..1fb1d4f32af8150711ca766fcd7d0a0c177df7c4 100644
index 465a7f5312a5d5b65f7366f476b7c42795f53105..dd79325a8f52190c44b833870043d167641211a6 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -58,6 +58,18 @@ import org.jetbrains.annotations.Nullable;
@@ -60,6 +60,18 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Server extends PluginMessageRecipient {
public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
+ /**
+ * Returns the de facto plugins directory, generally used for storing plugin jars to be loaded,
@@ -5,10 +5,10 @@ Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index e3cc40a54b48e8a90ccc93c272c1a2dca1da9595..a6f6dea965eee2de2183f189580d1b7141a9308f 100644
index 71e696eadf7c9290791c8b50d666dc501621f24e..4b24f217742497c0674952eb4eb73f00a0ce4069 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1746,6 +1746,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1807,6 +1807,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public String getLocale();
+4 -4
View File
@@ -5,10 +5,10 @@ Subject: [PATCH] Add getTPS method
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 84a620bbbc24ded4075bce0209caed7fa03a92eb..bbee4e40917cca4e692c3d60c1c513b4c847160f 100644
index 5c6b7f5095a5bb7290e1edefb0c9e985123f80d8..595d368bc88b6217f1fb2e074de7fd5b07fa96df 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1728,6 +1728,17 @@ public final class Bukkit {
@@ -1845,6 +1845,17 @@ public final class Bukkit {
return server.getEntity(uuid);
}
@@ -27,10 +27,10 @@ index 84a620bbbc24ded4075bce0209caed7fa03a92eb..bbee4e40917cca4e692c3d60c1c513b4
* Get the advancement specified by this key.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index ede5de4c310a93989608bf48b3e5116f380589dd..835041d2ab6545e52d963d96d558f9a7e52d279a 100644
index 1dedbea03e259679e101a8443b662b20375adfd0..5aa2040dc51f65ad57329a5a235a22c50c62f1b2 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1461,6 +1461,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1567,6 +1567,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
Entity getEntity(@NotNull UUID uuid);
+2 -2
View File
@@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c7
+ }
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index e464769f72bf7d8e0f0630fd4f03011f8ac80dc7..bfeec56e83229dbfc8625b3b90bd6c138c73bc1d 100644
index ce5794d684a1126ec9acbf4af17f5d6fa783f551..5ba6c7a69937badd64256248560268fb695d5f74 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -85,5 +85,12 @@ public interface UnsafeValues {
@@ -94,5 +94,12 @@ public interface UnsafeValues {
* @return name
*/
String getTimingsServerName();
+2 -2
View File
@@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 10cb6088c4618f228c757f4e592b44edab81c2dc..65088203d29798efe211612dfadb356f457ed466 100644
index cd287978c34873c7122794e4f3e762915978a1f0..c315d2494969190f8b53236f905ad5c5cf1bfc39 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -663,5 +663,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -671,5 +671,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.customName())));
}
+34 -8
View File
@@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances.
Also add send/no-tick view distance to World.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d2a27ad66 100644
index cf6fe1b5a1531e8d30c0386e36c023d003458b7e..ad342ecd8b86903276c62644624cff55cf190026 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2450,6 +2450,52 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2597,6 +2597,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
int getSimulationDistance();
// Spigot end
@@ -23,13 +23,21 @@ index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d
+ void setViewDistance(int viewDistance);
+
+ /**
+ * Sets the simulation distance for this world.
+ * @param simulationDistance simulation distance in [2, 32]
+ */
+ void setSimulationDistance(int simulationDistance);
+
+ /**
+ * Returns the no-tick view distance for this world.
+ * <p>
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
+ * be set to tick.
+ * </p>
+ * @return The no-tick view distance for this world.
+ * @deprecated Use {@link #getViewDistance()}
+ */
+ @Deprecated
+ int getNoTickViewDistance();
+
+ /**
@@ -39,7 +47,9 @@ index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d
+ * be set to tick.
+ * </p>
+ * @param viewDistance view distance in [2, 32]
+ * @deprecated Use {@link #setViewDistance(int)}
+ */
+ @Deprecated
+ void setNoTickViewDistance(int viewDistance);
+
+ /**
@@ -49,7 +59,7 @@ index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d
+ * </p>
+ * @return The sending view distance for this world.
+ */
+ public int getSendViewDistance();
+ int getSendViewDistance();
+
+ /**
+ * Sets the sending view distance for this world.
@@ -58,17 +68,17 @@ index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d
+ * </p>
+ * @param viewDistance view distance in [2, 32] or -1
+ */
+ public void setSendViewDistance(int viewDistance);
+ void setSendViewDistance(int viewDistance);
+ // Paper end - view distance api
+
// Spigot start
public class Spigot {
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a6f6dea965eee2de2183f189580d1b7141a9308f..bf60cc1beed41f6dc30b0df0bae9b937ddfa5553 100644
index 4b24f217742497c0674952eb4eb73f00a0ce4069..621ab05b0cecc8c21c5bcac8956082d138a006ae 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1760,6 +1760,62 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1821,6 +1821,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param affects Whether the player can affect mob spawning
*/
public void setAffectsSpawning(boolean affects);
@@ -78,7 +88,6 @@ index a6f6dea965eee2de2183f189580d1b7141a9308f..bf60cc1beed41f6dc30b0df0bae9b937
+ *
+ * @return the player's view distance
+ * @see org.bukkit.World#getViewDistance()
+ * @see org.bukkit.World#getNoTickViewDistance()
+ */
+ public int getViewDistance();
+
@@ -87,9 +96,22 @@ index a6f6dea965eee2de2183f189580d1b7141a9308f..bf60cc1beed41f6dc30b0df0bae9b937
+ *
+ * @param viewDistance the player's view distance
+ * @see org.bukkit.World#setViewDistance(int)
+ * @see org.bukkit.World#setNoTickViewDistance(int)
+ */
+ public void setViewDistance(int viewDistance);
+
+ /**
+ * Gets the simulation distance for this player
+ *
+ * @return the player's simulation distance
+ */
+ public int getSimulationDistance();
+
+ /**
+ * Sets the simulation distance for this player
+ *
+ * @param simulationDistance the player's new simulation distance
+ */
+ public void setSimulationDistance(int simulationDistance);
+
+ /**
+ * Gets the no-ticking view distance for this player.
@@ -98,7 +120,9 @@ index a6f6dea965eee2de2183f189580d1b7141a9308f..bf60cc1beed41f6dc30b0df0bae9b937
+ * be set to tick.
+ * </p>
+ * @return The no-tick view distance for this player.
+ * @deprecated Use {@link #getViewDistance()}
+ */
+ @Deprecated
+ public int getNoTickViewDistance();
+
+ /**
@@ -108,7 +132,9 @@ index a6f6dea965eee2de2183f189580d1b7141a9308f..bf60cc1beed41f6dc30b0df0bae9b937
+ * be set to tick.
+ * </p>
+ * @param viewDistance view distance in [2, 32] or -1
+ * @deprecated Use {@link #setViewDistance(int)}
+ */
+ @Deprecated
+ public void setNoTickViewDistance(int viewDistance);
+
+ /**
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index bbee4e40917cca4e692c3d60c1c513b4c847160f..259c15ada05115b9fc86f1de06649d5cec2ef137 100644
index 595d368bc88b6217f1fb2e074de7fd5b07fa96df..4486e8ddcfc3aa1403bbfce28c0356c174709a9b 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1912,6 +1912,19 @@ public final class Bukkit {
@@ -2029,6 +2029,19 @@ public final class Bukkit {
return server.getUnsafe();
}
@@ -29,10 +29,10 @@ index bbee4e40917cca4e692c3d60c1c513b4c847160f..259c15ada05115b9fc86f1de06649d5c
public static Server.Spigot spigot() {
return server.spigot();
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 835041d2ab6545e52d963d96d558f9a7e52d279a..66211ef974b9e091983bfda108f6e420c01a9d78 100644
index 5aa2040dc51f65ad57329a5a235a22c50c62f1b2..96d6b49d609142fe93d5d07e65dd126adb5c2bde 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1471,6 +1471,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1577,6 +1577,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public double[] getTPS();
// Paper end
@@ -6,10 +6,10 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
Change Javadoc to be accurate
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 259c15ada05115b9fc86f1de06649d5cec2ef137..5fc71e24f1562ff0d448b964f29fd109d4d9bb4d 100644
index 4486e8ddcfc3aa1403bbfce28c0356c174709a9b..1bd3780f8331074b24f9f4e2bbeeb2b37514aaa3 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -376,6 +376,30 @@ public final class Bukkit {
@@ -378,6 +378,30 @@ public final class Bukkit {
return server.broadcastMessage(message);
}
@@ -41,10 +41,10 @@ index 259c15ada05115b9fc86f1de06649d5cec2ef137..5fc71e24f1562ff0d448b964f29fd109
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 66211ef974b9e091983bfda108f6e420c01a9d78..8fb6545406ab6029d82c903856bda6c6d6fa0636 100644
index 96d6b49d609142fe93d5d07e65dd126adb5c2bde..75bc4937f7a895c1bbf0a0800035ad8f7e0c5f46 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -309,6 +309,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -311,6 +311,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Deprecated // Paper
public int broadcastMessage(@NotNull String message);
@@ -76,10 +76,10 @@ index 66211ef974b9e091983bfda108f6e420c01a9d78..8fb6545406ab6029d82c903856bda6c6
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 152f848d2f93a52999f093bd83b4732af9aab8d8..771682aa1c5e1bfb9670cc98ce99439014d0d31c 100644
index 621ab05b0cecc8c21c5bcac8956082d138a006ae..9d26a1ed696d78895df216b3f94d419963b4b1c6 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -708,6 +708,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -735,6 +735,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendMap(@NotNull MapView map);
@@ -432,7 +432,7 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b6a848261f7c136cbcb4a4f40223d2f248d546c2..1df2ff828aee7dac50d63fe1d51104e9fb2ed264 100644
index 9d26a1ed696d78895df216b3f94d419963b4b1c6..f7acb33e31172eed213801acf54ce6e88042f70d 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2,6 +2,7 @@ package org.bukkit.entity;
@@ -443,7 +443,7 @@ index b6a848261f7c136cbcb4a4f40223d2f248d546c2..1df2ff828aee7dac50d63fe1d51104e9
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -742,6 +743,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -769,6 +770,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
spigot().sendMessage(position, components);
}
@@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index cd2c4ff23cdbcc3e4e9ae94477a372d25ad31e39..422f322b9623dcb33472744ddfd91d7dba817471 100644
index f7acb33e31172eed213801acf54ce6e88042f70d..89ffcc20e94d166397f5794ee14515051c790dc4 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1251,7 +1251,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1286,7 +1286,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the URL is null.
* @throws IllegalArgumentException Thrown if the URL is too long. The
* length restriction is an implementation specific arbitrary value.
@@ -18,7 +18,7 @@ index cd2c4ff23cdbcc3e4e9ae94477a372d25ad31e39..422f322b9623dcb33472744ddfd91d7d
public void setResourcePack(@NotNull String url);
/**
@@ -2025,6 +2027,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2102,6 +2104,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName())));
}
@@ -6,10 +6,10 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index 0e8e827b5a05ac9423386eaea4188d132cc7f954..70d6503745942ea8637146369aeab8f9357c42d5 100644
index 19b65a9b56b73f873ef646d14a6cf091b69d3873..bc6f68a0cadeec865401e9cb0dce89460484b148 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -38,6 +38,9 @@ dependencies {
@@ -39,6 +39,9 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
@@ -118,10 +118,10 @@ index 0000000000000000000000000000000000000000..c83672427324bd068ed52916f700b684
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
new file mode 100644
index 0000000000000000000000000000000000000000..b6e7d8ee8d903ebf975d60bec0e08603d9a49fdb
index 0000000000000000000000000000000000000000..b8d5c13980858dc27fb5383726b7ebcaf14adcb8
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
@@ -0,0 +1,47 @@
@@ -0,0 +1,51 @@
+package com.destroystokyo.paper.event.executor.asm;
+
+import java.lang.reflect.Method;
@@ -147,14 +147,18 @@ index 0000000000000000000000000000000000000000..b6e7d8ee8d903ebf975d60bec0e08603
+ methodGenerator.returnValue();
+ methodGenerator.endMethod();
+ // Generate the execute method
+ methodGenerator = new GeneratorAdapter(writer.visitMethod(ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event;)V", null, null), ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Listener;)V");;
+ methodGenerator = new GeneratorAdapter(writer.visitMethod(ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event;)V", null, null), ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Listener;)V");
+ methodGenerator.loadArg(0);
+ methodGenerator.checkCast(Type.getType(m.getDeclaringClass()));
+ methodGenerator.loadArg(1);
+ methodGenerator.checkCast(Type.getType(m.getParameterTypes()[0]));
+ methodGenerator.visitMethodInsn(m.getDeclaringClass().isInterface() ? INVOKEINTERFACE : INVOKEVIRTUAL, Type.getInternalName(m.getDeclaringClass()), m.getName(), Type.getMethodDescriptor(m), m.getDeclaringClass().isInterface());
+ if (m.getReturnType() != void.class) {
+ methodGenerator.pop();
+ // The only purpose of this switch statement is to generate the correct pop instruction, should the event handler method return something other than void.
+ // Non-void event handlers will be unsupported in a future release.
+ switch (Type.getType(m.getReturnType()).getSize()) {
+ // case 0 is omitted because the only type that has size 0 is void - no pop instruction needed.
+ case 1 -> methodGenerator.pop(); // handles reference types and most primitives
+ case 2 -> methodGenerator.pop2(); // handles long and double
+ }
+ methodGenerator.returnValue();
+ methodGenerator.endMethod();
@@ -6,10 +6,10 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 5fc71e24f1562ff0d448b964f29fd109d4d9bb4d..191e9985fc17ffbdb9b6bdadbea46da54f5f7599 100644
index 1bd3780f8331074b24f9f4e2bbeeb2b37514aaa3..2b3ced048a48f660ca0859425583d342e7847744 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1947,6 +1947,13 @@ public final class Bukkit {
@@ -2064,6 +2064,13 @@ public final class Bukkit {
public static org.bukkit.command.CommandMap getCommandMap() {
return server.getCommandMap();
}
@@ -24,10 +24,10 @@ index 5fc71e24f1562ff0d448b964f29fd109d4d9bb4d..191e9985fc17ffbdb9b6bdadbea46da5
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 8fb6545406ab6029d82c903856bda6c6d6fa0636..731679a0893635f5cb71a19fd9ee8562795230b8 100644
index 75bc4937f7a895c1bbf0a0800035ad8f7e0c5f46..be5f25a51a12082cb6732445c221d61246da89e9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1717,4 +1717,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1823,4 +1823,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
Spigot spigot();
// Spigot end
@@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 191e9985fc17ffbdb9b6bdadbea46da54f5f7599..3f58ffb4c59a92259fc5dde3d220658b6e54896f 100644
index 2b3ced048a48f660ca0859425583d342e7847744..012b656a43cc0cf33597b835d045f8b5f3d309dd 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1954,6 +1954,15 @@ public final class Bukkit {
@@ -2071,6 +2071,15 @@ public final class Bukkit {
public static void reloadPermissions() {
server.reloadPermissions();
}
@@ -26,10 +26,10 @@ index 191e9985fc17ffbdb9b6bdadbea46da54f5f7599..3f58ffb4c59a92259fc5dde3d220658b
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 731679a0893635f5cb71a19fd9ee8562795230b8..01df6fc54078901a9195dd2bb45eaef1706ba036 100644
index be5f25a51a12082cb6732445c221d61246da89e9..9c1cd95e125b1d7677daea1575a466a1b955053a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1719,4 +1719,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1825,4 +1825,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
// Spigot end
void reloadPermissions(); // Paper
@@ -5,7 +5,7 @@ Subject: [PATCH] Add String based Action Bar API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 422f322b9623dcb33472744ddfd91d7dba817471..9d9dd1f73b4c3ff143fbba87d8b5630017affd08 100644
index 89ffcc20e94d166397f5794ee14515051c790dc4..a8ace9646ebcb70a5247a7d25c411a0bcf2d9185 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3,6 +3,7 @@ package org.bukkit.entity;
@@ -16,7 +16,7 @@ index 422f322b9623dcb33472744ddfd91d7dba817471..9d9dd1f73b4c3ff143fbba87d8b56300
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -710,6 +711,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -737,6 +738,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@@ -56,7 +56,7 @@ index 422f322b9623dcb33472744ddfd91d7dba817471..9d9dd1f73b4c3ff143fbba87d8b56300
/**
* Sends the component to the player
*
@@ -737,9 +771,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -764,9 +798,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Sends an array of components as a single message to the specified screen position of this player
*
@@ -68,7 +68,7 @@ index 422f322b9623dcb33472744ddfd91d7dba817471..9d9dd1f73b4c3ff143fbba87d8b56300
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
spigot().sendMessage(position, components);
}
@@ -2216,6 +2252,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2293,6 +2329,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Sends the component to the specified screen position of this player
*
@@ -76,7 +76,7 @@ index 422f322b9623dcb33472744ddfd91d7dba817471..9d9dd1f73b4c3ff143fbba87d8b56300
* @param position the screen position
* @param component the components to send
* @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component}
@@ -2228,6 +2265,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2305,6 +2342,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Sends an array of components as a single message to the specified screen position of this player
*
@@ -7,12 +7,12 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 7b1fb280a86ab44756fc233b085f878d2a27ad66..cec39714294127478b6e73452354ba7ccab78b25 100644
index bf23ef001fb5177b7aab0b3ed8752f58641bb840..8a2ca11be9ebde91268b20d25a35e1d6842f49de 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -40,6 +40,33 @@ import org.jetbrains.annotations.Nullable;
@@ -42,6 +42,33 @@ import org.jetbrains.annotations.Nullable;
*/
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience { // Paper
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience { // Paper
+ // Paper start
+ /**
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check
diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java
index 7e8f5649ce0eb0090899514b1e228601eb644613..afb7b136b461202026290624836446cff9f9e45d 100644
index 95bb16185514e0b894f407028997ce7d4504f8fb..238b9e2309d633623d35a1dbded6edadf20831f3 100644
--- a/src/main/java/org/bukkit/WorldBorder.java
+++ b/src/main/java/org/bukkit/WorldBorder.java
@@ -117,4 +117,18 @@ public interface WorldBorder {
@@ -127,4 +127,18 @@ public interface WorldBorder {
* @return if this location is inside the border or not
*/
public boolean isInside(@NotNull Location location);
@@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 3f58ffb4c59a92259fc5dde3d220658b6e54896f..45c4fddb8562736eaf98810d70d002ae6e3664e7 100644
index 012b656a43cc0cf33597b835d045f8b5f3d309dd..a5868c0bdee345195e279467b526d5d9ff7f64d2 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1963,6 +1963,16 @@ public final class Bukkit {
@@ -2080,6 +2080,16 @@ public final class Bukkit {
public static boolean reloadCommandAliases() {
return server.reloadCommandAliases();
}
@@ -27,10 +27,10 @@ index 3f58ffb4c59a92259fc5dde3d220658b6e54896f..45c4fddb8562736eaf98810d70d002ae
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 01df6fc54078901a9195dd2bb45eaef1706ba036..1db8f63d9207330acc1b403adce0773149bc879f 100644
index 9c1cd95e125b1d7677daea1575a466a1b955053a..acd69a5d946974e0b50439a98712750698768ce5 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1721,4 +1721,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1827,4 +1827,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
void reloadPermissions(); // Paper
boolean reloadCommandAliases(); // Paper
+7 -20
View File
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix upstream javadocs
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 45c4fddb8562736eaf98810d70d002ae6e3664e7..9838557d874e498e1f7cef8f219000dcaea7a263 100644
index a5868c0bdee345195e279467b526d5d9ff7f64d2..ece84330d2700db8708d2ae2ab7badf4acb428a8 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1220,6 +1220,8 @@ public final class Bukkit {
@@ -1311,6 +1311,8 @@ public final class Bukkit {
/**
* Gets every player that has ever played on this server.
@@ -19,10 +19,10 @@ index 45c4fddb8562736eaf98810d70d002ae6e3664e7..9838557d874e498e1f7cef8f219000dc
* @return an array containing all previous players
*/
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 1db8f63d9207330acc1b403adce0773149bc879f..ad11f8271d5b6f44d7d5cf0c122b51b2b8d1af3b 100644
index acd69a5d946974e0b50439a98712750698768ce5..3c987b2fb0f748ce92a87c4ee54a4e9722e1910e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1027,6 +1027,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1110,6 +1110,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
/**
* Gets every player that has ever played on this server.
@@ -45,7 +45,7 @@ index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index db4ba67618d29f72d695c66c27d771795565a1d0..0ab94ddd3b88eee8040233a89823bd2fadc78d55 100644
index 50ac6f0374da5697a38ef5ec7625da91d4a4276c..f607c57275958bf1cbf8e77b4d7efa936064c228 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -21,6 +21,11 @@ import org.jetbrains.annotations.Nullable;
@@ -76,10 +76,10 @@ index be9334a8b5fba9181ad63c211697e798be63da25..0514a141cb93a650be38c63d4336d46e
* Instructs this Mob to set the specified LivingEntity as its target.
* <p>
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d98029f01bc81c5bf33545fee54bdbce17960b50..dae5ffe9ed6ea43b269d14a6aaf08929fb90570f 100644
index a8ace9646ebcb70a5247a7d25c411a0bcf2d9185..f32eaa35d9152564300455a24c811e15d3ab694f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -728,7 +728,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -755,7 +755,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* Use supplied alternative character to the section symbol to represent legacy color codes.
*
@@ -122,16 +122,3 @@ index 1b2267f4e8ebded198773ec80e2bff2c861c7084..1a58734d919fae247eeb85dd785fd599
public Location getTo() {
return to;
}
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
index 99d900b2394b6c210ccf845768dae72864f32270..515587a958041e94f03c48ae87812abc39e1791c 100644
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -106,7 +106,7 @@ public interface PlayerInventory extends Inventory {
*
* @return the ItemStack in the given slot
*/
- @NotNull
+ @Nullable
public ItemStack getItem(@NotNull EquipmentSlot slot);
/**
+2 -2
View File
@@ -5,10 +5,10 @@ Subject: [PATCH] Item#canEntityPickup
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
index 3f2736fbddd8661e764bc2f8d0499bd13ca91df5..c404a5b8efea7c780db5ddae19456753808abb3d 100644
index 65dd4554c6cc0801fcbc0ef6809b794dcebd1124..ab06c640cef1309ab44b0fae8d95df48cdc869a7 100644
--- a/src/main/java/org/bukkit/entity/Item.java
+++ b/src/main/java/org/bukkit/entity/Item.java
@@ -75,4 +75,20 @@ public interface Item extends Entity {
@@ -89,4 +89,20 @@ public interface Item extends Entity {
*/
@Nullable
public UUID getThrower();
+117 -11
View File
@@ -7,22 +7,24 @@ Provides basic elements of a PlayerProfile to be used by future API/events
diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
new file mode 100644
index 0000000000000000000000000000000000000000..2ef9a7bd55e2c9cf8cb20d5f77282676ae11181f
index 0000000000000000000000000000000000000000..d4766e2116c2202d84080637a2832bef0ab3f718
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
@@ -0,0 +1,177 @@
@@ -0,0 +1,199 @@
+package com.destroystokyo.paper.profile;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.UUID;
+
+import org.bukkit.profile.PlayerTextures;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Represents a players profile for the game, such as UUID, Name, and textures.
+ */
+public interface PlayerProfile {
+public interface PlayerProfile extends org.bukkit.profile.PlayerProfile {
+
+ /**
+ * @return The players name, if set
@@ -37,6 +39,7 @@ index 0000000000000000000000000000000000000000..2ef9a7bd55e2c9cf8cb20d5f77282676
+ * @return The previous Name
+ */
+ @NotNull
+ @Deprecated(forRemoval = true)
+ String setName(@Nullable String name);
+
+ /**
@@ -51,9 +54,28 @@ index 0000000000000000000000000000000000000000..2ef9a7bd55e2c9cf8cb20d5f77282676
+ * @return The previous UUID
+ */
+ @Nullable
+ @Deprecated(forRemoval = true)
+ UUID setId(@Nullable UUID uuid);
+
+ /**
+ * Gets the {@link PlayerTextures} of this profile.
+ * This will build a snapshot of the current texture data once
+ * requested inside PlayerTextures.
+ *
+ * @return the textures, not <code>null</code>
+ */
+ @NotNull
+ PlayerTextures getTextures();
+
+ /**
+ * Copies the given textures.
+ *
+ * @param textures the textures to copy, or <code>null</code> to clear the
+ * textures
+ */
+ void setTextures(@Nullable PlayerTextures textures);
+
+ /**
+ * @return A Mutable set of this players properties, such as textures.
+ * Values specified here are subject to implementation details.
+ */
@@ -267,16 +289,20 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 9838557d874e498e1f7cef8f219000dcaea7a263..c7daa7c9f85c62d0effd5c3f406568d77fd8cd78 100644
index ece84330d2700db8708d2ae2ab7badf4acb428a8..90c875ad60e473c3ec25f209933d48615d0fd6c0 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1975,6 +1975,40 @@ public final class Bukkit {
@@ -2092,6 +2092,83 @@ public final class Bukkit {
public static boolean suggestPlayerNamesWhenNullTabCompletions() {
return server.suggestPlayerNamesWhenNullTabCompletions();
}
+
+ /**
+ * Creates a PlayerProfile for the specified uuid, with name as null
+ * Creates a PlayerProfile for the specified uuid, with name as null.
+ *
+ * If a player with the passed uuid exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ *
+ * @param uuid UUID to create profile for
+ * @return A PlayerProfile object
+ */
@@ -286,7 +312,16 @@ index 9838557d874e498e1f7cef8f219000dcaea7a263..c7daa7c9f85c62d0effd5c3f406568d7
+ }
+
+ /**
+ * Creates a PlayerProfile for the specified name, with UUID as null
+ * Creates a PlayerProfile for the specified name, with UUID as null.
+ *
+ * If a player with the passed name exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile("JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on a case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
@@ -299,6 +334,16 @@ index 9838557d874e498e1f7cef8f219000dcaea7a263..c7daa7c9f85c62d0effd5c3f406568d7
+ * Creates a PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile(null, "JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on an case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * The name comparison will compare the {@link String#toLowerCase()} version of both the passed name parameter and
+ * a players name to honour the case-insensitive nature of a mojang profile lookup.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
@@ -307,21 +352,45 @@ index 9838557d874e498e1f7cef8f219000dcaea7a263..c7daa7c9f85c62d0effd5c3f406568d7
+ @NotNull
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) {
+ return server.createProfile(uuid, name);
+ }
+
+ /**
+ * Creates an exact PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player.
+ * <p>
+ * Compared to {@link #createProfile(UUID, String)}, this method will never mutate the passed uuid or name.
+ * If a player with either the same uuid or a matching name (case-insensitive) is found on the server, their
+ * properties, such as textures, will be pre-populated in the profile, however the passed uuid and name stay intact.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
+ @NotNull
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name) {
+ return server.createProfileExact(uuid, name);
+ }
// Paper end
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index ad11f8271d5b6f44d7d5cf0c122b51b2b8d1af3b..fb5c308d82e9103a212deea2a6fa2e158cddb931 100644
index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..9796ae6fcf605af88c1e5c1d29d77ea6857632cc 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1732,5 +1732,33 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1838,5 +1838,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return true if player names should be suggested
*/
boolean suggestPlayerNamesWhenNullTabCompletions();
+
+ /**
+ * Creates a PlayerProfile for the specified uuid, with name as null
+ * Creates a PlayerProfile for the specified uuid, with name as null.
+ *
+ * If a player with the passed uuid exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ *
+ * @param uuid UUID to create profile for
+ * @return A PlayerProfile object
+ */
@@ -329,7 +398,16 @@ index ad11f8271d5b6f44d7d5cf0c122b51b2b8d1af3b..fb5c308d82e9103a212deea2a6fa2e15
+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull UUID uuid);
+
+ /**
+ * Creates a PlayerProfile for the specified name, with UUID as null
+ * Creates a PlayerProfile for the specified name, with UUID as null.
+ *
+ * If a player with the passed name exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile("JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on a case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
@@ -340,6 +418,16 @@ index ad11f8271d5b6f44d7d5cf0c122b51b2b8d1af3b..fb5c308d82e9103a212deea2a6fa2e15
+ * Creates a PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile(null, "JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on an case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * The name comparison will compare the {@link String#toLowerCase()} version of both the passed name parameter and
+ * a players name to honour the case-insensitive nature of a mojang profile lookup.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
@@ -347,5 +435,23 @@ index ad11f8271d5b6f44d7d5cf0c122b51b2b8d1af3b..fb5c308d82e9103a212deea2a6fa2e15
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name);
+
+ /**
+ * Creates an exact PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player.
+ * <p>
+ * Compared to {@link #createProfile(UUID, String)}, this method will never mutate the passed uuid or name.
+ * If a player with either the same uuid or a matching name (case-insensitive) is found on the server, their
+ * properties, such as textures, will be pre-populated in the profile, however the passed uuid and name stay intact.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name);
// Paper end
}
@@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 0ab94ddd3b88eee8040233a89823bd2fadc78d55..396092fd249928ca01133eeeeb61f0ad90b2e332 100644
index f607c57275958bf1cbf8e77b4d7efa936064c228..8a479c7dfd3825fab8bb057d8afa5ae0cb01b071 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -315,6 +315,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -318,6 +318,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
public int getExpToLevel();
+2 -2
View File
@@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner()
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 65088203d29798efe211612dfadb356f457ed466..71f519b8f03d2a52f2c5a9283a18c74c1ca52328 100644
index c315d2494969190f8b53236f905ad5c5cf1bfc39..b9a61d06d72831dc0c591e129553453a537d3785 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -673,5 +673,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -681,5 +681,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@Nullable
Location getOrigin();
@@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 6cc4bad2ecd19f44a680ff03cbfb99d48ea5c337..b1fbb931148a87f29e8b8796b13851d767cc1d68 100644
index af4a7ce37eb10bab06eadb6583c7894b3ec55ae6..159e5a908b35b84b7fabc36581e093d9aa4c4b67 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -160,5 +160,16 @@ public interface ItemFactory {
@@ -178,5 +178,19 @@ public interface ItemFactory {
*/
@NotNull
net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack);
@@ -23,16 +23,19 @@ index 6cc4bad2ecd19f44a680ff03cbfb99d48ea5c337..b1fbb931148a87f29e8b8796b13851d7
+ *
+ * @param item Item to return Display name of
+ * @return Display name of Item
+ * @deprecated {@link ItemStack} implements {@link net.kyori.adventure.translation.Translatable}; use that and
+ * {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
+ */
+ @Nullable
+ @Deprecated
+ String getI18NDisplayName(@Nullable ItemStack item);
// Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index a15abec467bac70116a6fc21a300d4930b909f15..de5bcdb7b84acdd5e22500e367df292f35a86e19 100644
index a15abec467bac70116a6fc21a300d4930b909f15..dfd16531926e639231e93cb295de3d802d17413d 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -611,5 +611,17 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -611,5 +611,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
public @NotNull net.kyori.adventure.text.Component displayName() {
return Bukkit.getServer().getItemFactory().displayName(this);
}
@@ -43,8 +46,11 @@ index a15abec467bac70116a6fc21a300d4930b909f15..de5bcdb7b84acdd5e22500e367df292f
+ * You must replace the language file embedded in the server jar.
+ *
+ * @return Display name of Item
+ * @deprecated {@link ItemStack} implements {@link net.kyori.adventure.translation.Translatable}; use that and
+ * {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
+ */
+ @Nullable
+ @Deprecated
+ public String getI18NDisplayName() {
+ return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
+ }
@@ -7,12 +7,12 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index b1fbb931148a87f29e8b8796b13851d767cc1d68..71e5ee496a947fbd8e3ec579833b157c76b51833 100644
index 159e5a908b35b84b7fabc36581e093d9aa4c4b67..66ffc658dba85942f179760dc6c50258e24ab903 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -171,5 +171,17 @@ public interface ItemFactory {
*/
@@ -192,5 +192,17 @@ public interface ItemFactory {
@Nullable
@Deprecated
String getI18NDisplayName(@Nullable ItemStack item);
+
+ /**
@@ -29,7 +29,7 @@ index b1fbb931148a87f29e8b8796b13851d767cc1d68..71e5ee496a947fbd8e3ec579833b157c
// Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index de5bcdb7b84acdd5e22500e367df292f35a86e19..e8783b0116f4efd5447a5f6f260506000983ffd2 100644
index dfd16531926e639231e93cb295de3d802d17413d..2581117ded5d91070bc9416eee53383e915a1564 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -536,7 +536,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -14,23 +14,23 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction.
diff --git a/build.gradle.kts b/build.gradle.kts
index d8d459561cc75935136f8f9888ff27b45ad98f9e..a23b2bd8e1ca1ff8d0ad5ed5d5e41c89e4795090 100644
index bc6f68a0cadeec865401e9cb0dce89460484b148..d6c4abc30af2b535644707a240b60d1b613785e9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -38,6 +38,8 @@ dependencies {
@@ -39,6 +39,8 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
+ api("org.apache.logging.log4j:log4j-api:2.17.0")
+ api("org.apache.logging.log4j:log4j-api:2.17.1")
+ api("org.slf4j:slf4j-api:1.8.0-beta4")
implementation("org.ow2.asm:asm:9.2")
implementation("org.ow2.asm:asm-commons:9.2")
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 03ca87a1cbace2459174bb7bb8847bda766e80c5..c25fc646be750d3a3b2f4fb3f1c53daee5254107 100644
index 03ca87a1cbace2459174bb7bb8847bda766e80c5..34438b5362b0ba0949625d81e8371fe0d1f76fdf 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -179,6 +179,18 @@ public interface Plugin extends TabExecutor {
@@ -179,6 +179,22 @@ public interface Plugin extends TabExecutor {
@NotNull
public Logger getLogger();
@@ -40,6 +40,10 @@ index 03ca87a1cbace2459174bb7bb8847bda766e80c5..c25fc646be750d3a3b2f4fb3f1c53dae
+ return org.slf4j.LoggerFactory.getLogger(getLogger().getName());
+ }
+
+ /**
+ * @deprecated use {@link #getSLF4JLogger()}
+ */
+ @Deprecated
+ @NotNull
+ default org.apache.logging.log4j.Logger getLog4JLogger() {
+ return org.apache.logging.log4j.LogManager.getLogger(getLogger().getName());
@@ -29,3 +29,26 @@ index ce1e1e6cc6740d568fbf859c7e2c014fab5a59cd..62ab55729e69bfac8eb4b40d877b945d
/**
* Returns the biome that this block resides in
*
diff --git a/src/main/java/org/bukkit/block/TileState.java b/src/main/java/org/bukkit/block/TileState.java
index 3b10fcc13893403b29f0260b8605144679e89b82..5c8517c5bcae10161952c104b6a4ff7c713bcdbd 100644
--- a/src/main/java/org/bukkit/block/TileState.java
+++ b/src/main/java/org/bukkit/block/TileState.java
@@ -36,4 +36,18 @@ public interface TileState extends BlockState, PersistentDataHolder {
@NotNull
@Override
PersistentDataContainer getPersistentDataContainer();
+
+ // Paper start
+ /**
+ * Checks if this TileState is a snapshot or a live
+ * representation of the underlying tile entity.
+ * <p>
+ * NOTE: You may still have to call {@link BlockState#update()} on
+ * live representations to update any visuals on the block.
+ *
+ * @return true if this is a snapshot
+ * @see Block#getState(boolean)
+ */
+ boolean isSnapshot();
+ // Paper end
}
@@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..7b2af1bd72dfbcf4e962a982940fc49b
+
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 48b127cafe6fecb1849b176df43cbf26e5a1db79..b621f693379aedc23a90b03e724ba8a2ffeb283e 100644
index f32eaa35d9152564300455a24c811e15d3ab694f..204c337558e84304de4f511473be8cccb2a8cd4f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -37,7 +37,7 @@ import org.jetbrains.annotations.Nullable;
@@ -39,7 +39,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a player, connected or not
*/
@@ -10,10 +10,10 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b621f693379aedc23a90b03e724ba8a2ffeb283e..1e3a56ff656cdfe18cf665eecd8f126275f29715 100644
index 204c337558e84304de4f511473be8cccb2a8cd4f..cb7bce8072dfcccfc3aba8f85d7d722faf560a55 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -986,12 +986,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1021,12 +1021,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void resetPlayerWeather();
@@ -7,18 +7,10 @@ This allows you to create already filled textures on Skulls to avoid texture loo
which commonly cause rate limit issues with Mojang API
diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java
index 943d751fb3e48212fbe258845beba03c25fa22d9..a6914f01e01e9103702185f92b0209b3c84c152a 100644
index 83ca284e02f0c2229126d8f40cb33b18f44524d3..d89da5e370d95cfbc4dac776a64e402c5c1f5fc1 100644
--- a/src/main/java/org/bukkit/block/Skull.java
+++ b/src/main/java/org/bukkit/block/Skull.java
@@ -7,6 +7,7 @@ import org.bukkit.block.data.BlockData;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import com.destroystokyo.paper.profile.PlayerProfile; // Paper
/**
* Represents a captured state of a skull block.
@@ -61,6 +62,20 @@ public interface Skull extends TileState {
@@ -62,6 +62,20 @@ public interface Skull extends TileState {
*/
public void setOwningPlayer(@NotNull OfflinePlayer player);
@@ -27,35 +19,39 @@ index 943d751fb3e48212fbe258845beba03c25fa22d9..a6914f01e01e9103702185f92b0209b3
+ * Sets this skull to use the supplied Player Profile, which can include textures already prefilled.
+ * @param profile The profile to set this Skull to use, may not be null
+ */
+ void setPlayerProfile(@NotNull PlayerProfile profile);
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
+
+ /**
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link PlayerProfile}
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link com.destroystokyo.paper.profile.PlayerProfile}
+ * @return The profile of the owner, if set
+ */
+ @Nullable PlayerProfile getPlayerProfile();
+ @Nullable com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
+ // Paper end
+
/**
* Gets the rotation of the skull in the world (or facing direction if this
* is a wall mounted skull).
* Gets the profile of the player who owns the skull. This player profile
* may appear as the texture depending on skull type.
@@ -69,6 +83,7 @@ public interface Skull extends TileState {
* @return the profile of the owning player
*/
@Nullable
+ @Deprecated // Paper
PlayerProfile getOwnerProfile();
/**
@@ -83,6 +98,7 @@ public interface Skull extends TileState {
* @throws IllegalArgumentException if the profile does not contain the
* necessary information
*/
+ @Deprecated // Paper
void setOwnerProfile(@Nullable PlayerProfile profile);
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
index 496254f959345d74167a9b44d160ea1bb428c5a1..88d1c889c09adb91abb09a8e43a30c871b217da2 100644
index dcefd0eea9461441c4209d587896d704389487d0..9ad062968335ee02bff5353d8c63c330d9338cd7 100644
--- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
@@ -1,9 +1,11 @@
package org.bukkit.inventory.meta;
+import com.destroystokyo.paper.profile.PlayerProfile;
import org.bukkit.OfflinePlayer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+
/**
* Represents a skull that can have an owner.
*/
@@ -36,6 +38,20 @@ public interface SkullMeta extends ItemMeta {
@@ -37,6 +37,20 @@ public interface SkullMeta extends ItemMeta {
@Deprecated
boolean setOwner(@Nullable String owner);
@@ -64,15 +60,31 @@ index 496254f959345d74167a9b44d160ea1bb428c5a1..88d1c889c09adb91abb09a8e43a30c87
+ * Sets this skull to use the supplied Player Profile, which can include textures already prefilled.
+ * @param profile The profile to set this Skull to use, or null to clear owner
+ */
+ void setPlayerProfile(@Nullable PlayerProfile profile);
+ void setPlayerProfile(@Nullable com.destroystokyo.paper.profile.PlayerProfile profile);
+
+ /**
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link PlayerProfile}
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link com.destroystokyo.paper.profile.PlayerProfile}
+ * @return The profile of the owner, if set
+ */
+ @Nullable PlayerProfile getPlayerProfile();
+ @Nullable com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
+ // Paper end
+
/**
* Gets the owner of the skull.
*
@@ -63,6 +77,7 @@ public interface SkullMeta extends ItemMeta {
* @return the profile of the owning player
*/
@Nullable
+ @Deprecated // Paper
PlayerProfile getOwnerProfile();
/**
@@ -77,6 +92,7 @@ public interface SkullMeta extends ItemMeta {
* @throws IllegalArgumentException if the profile does not contain the
* necessary information
*/
+ @Deprecated // Paper
void setOwnerProfile(@Nullable PlayerProfile profile);
@Override
@@ -5,19 +5,85 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 621420d35378e0038c33892c185216894912f023..82387e0c8477f5baa6bd473505b0e0aad6e78268 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1176,8 +1176,10 @@ public final class Bukkit {
* @return the new PlayerProfile
* @throws IllegalArgumentException if both the unique id is
* <code>null</code> and the name is <code>null</code> or blank
+ * @deprecated use {@link #createProfile(UUID, String)}
*/
@NotNull
+ @Deprecated // Paper
public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) {
return server.createPlayerProfile(uniqueId, name);
}
@@ -1188,8 +1190,10 @@ public final class Bukkit {
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
+ * @deprecated use {@link #createProfile(UUID)}
*/
@NotNull
+ @Deprecated // Paper
public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) {
return server.createPlayerProfile(uniqueId);
}
@@ -1201,8 +1205,10 @@ public final class Bukkit {
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
+ * @deprecated use {@link #createProfile(String)}
*/
@NotNull
+ @Deprecated // Paper
public static PlayerProfile createPlayerProfile(@NotNull String name) {
return server.createPlayerProfile(name);
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 58c8e74b61dd4d952919a854a374ae7b4c3e02c0..e196903e2e4d619603f445713cee36ea402fc55e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1001,8 +1001,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the new PlayerProfile
* @throws IllegalArgumentException if both the unique id is
* <code>null</code> and the name is <code>null</code> or blank
+ * @deprecated use {@link #createProfile(UUID, String)}
*/
@NotNull
+ @Deprecated // Paper
PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name);
/**
@@ -1011,8 +1013,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
+ * @deprecated use {@link #createProfile(UUID)}
*/
@NotNull
+ @Deprecated // Paper
PlayerProfile createPlayerProfile(@NotNull UUID uniqueId);
/**
@@ -1022,8 +1026,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
+ * @deprecated use {@link #createProfile(String)}
*/
@NotNull
+ @Deprecated
PlayerProfile createPlayerProfile(@NotNull String name);
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 7e390f5d7438f292ddd849f47964282a1ad889d1..ac94189b7bc76e1de0ae7d46fe581af57594ef64 100644
index cb7bce8072dfcccfc3aba8f85d7d722faf560a55..3ec3b05acb30432b9e16d8a2028ae587850fec75 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -4,6 +4,7 @@ import java.net.InetSocketAddress;
import java.util.UUID;
import com.destroystokyo.paper.Title; // Paper
import net.kyori.adventure.text.Component;
+import com.destroystokyo.paper.profile.PlayerProfile; // Paper
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -2202,6 +2203,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2279,6 +2279,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
*/
boolean hasResourcePack();
@@ -27,14 +93,36 @@ index 7e390f5d7438f292ddd849f47964282a1ad889d1..ac94189b7bc76e1de0ae7d46fe581af5
+ * @return The players profile object
+ */
+ @NotNull
+ PlayerProfile getPlayerProfile();
+ com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
+
+ /**
+ * Changes the PlayerProfile for this player. This will cause this player
+ * to be reregistered to all clients that can currently see this player
+ * @param profile The new profile to use
+ */
+ void setPlayerProfile(@NotNull PlayerProfile profile);
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
// Paper end
// Spigot start
diff --git a/src/main/java/org/bukkit/profile/PlayerProfile.java b/src/main/java/org/bukkit/profile/PlayerProfile.java
index 16ae1282f3178e8873483a25a5d5cce16b2c21a9..c4aa20fbb0865a0b43ece475ee115ad6a7c65a48 100644
--- a/src/main/java/org/bukkit/profile/PlayerProfile.java
+++ b/src/main/java/org/bukkit/profile/PlayerProfile.java
@@ -16,7 +16,9 @@ import org.jetbrains.annotations.Nullable;
* <p>
* New profiles can be created via
* {@link Server#createPlayerProfile(UUID, String)}.
+ * @deprecated see {@link com.destroystokyo.paper.profile.PlayerProfile}
*/
+@Deprecated // Paper
public interface PlayerProfile extends Cloneable, ConfigurationSerializable {
/**
@@ -25,6 +27,7 @@ public interface PlayerProfile extends Cloneable, ConfigurationSerializable {
* @return the player's unique id, or <code>null</code> if not available
*/
@Nullable
+ @Deprecated // Paper
UUID getUniqueId();
/**
+4 -4
View File
@@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index c7daa7c9f85c62d0effd5c3f406568d77fd8cd78..23960534cbb83cfca08ccc1e37bc7a713728b791 100644
index aae3eec8d28a0047bc590ecc55d87d11ee6d08f0..8875c963e358d1db37ecef7312e7608c89040013 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -616,6 +616,20 @@ public final class Bukkit {
@@ -656,6 +656,20 @@ public final class Bukkit {
return server.getPlayer(id);
}
@@ -34,10 +34,10 @@ index c7daa7c9f85c62d0effd5c3f406568d77fd8cd78..23960534cbb83cfca08ccc1e37bc7a71
* Gets the plugin manager for interfacing with plugins.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index fb5c308d82e9103a212deea2a6fa2e158cddb931..f7320c0797f31cc9609a6764d886bdb6dbd082af 100644
index 51c96a0b6645cf31f4ca051f6a8c75b5f188484c..30d905685b336c7127445ac1d1946334ee954416 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -524,6 +524,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -561,6 +561,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
public Player getPlayer(@NotNull UUID id);
@@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 396092fd249928ca01133eeeeb61f0ad90b2e332..5cc025b69c4f405be8f7098d0dcef40fa522b39f 100644
index 8a479c7dfd3825fab8bb057d8afa5ae0cb01b071..6ef0d7f3dcb779fb7dc5786e7433262092908eaa 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -476,6 +476,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -479,6 +479,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
@Deprecated
public void setShoulderEntityRight(@Nullable Entity entity);
@@ -24,10 +24,10 @@ index 396092fd249928ca01133eeeeb61f0ad90b2e332..5cc025b69c4f405be8f7098d0dcef40f
/**
* Make the entity drop the item in their hand.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index ac94189b7bc76e1de0ae7d46fe581af57594ef64..dbfd062792b0cc1d8fbfc8a30b0143467e7aaef7 100644
index 3ec3b05acb30432b9e16d8a2028ae587850fec75..18ce1833e8fa2c255b915755ef6d3d61e4d0007f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2058,7 +2058,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2134,7 +2134,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Open a Sign for editing by the Player.
*
@@ -8,10 +8,10 @@ Allows a more logical API for banning players.
player.banPlayer("Breaking the rules");
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index 58313929f81509030216a0e5e3869da63e11108e..6cf05fed701c67a2c797a4e0839c795802a238a1 100644
index 76e511e7f619960ab50d534c17489e2bc87ebf5a..9d774a10b9543e9293cb10ee9d7c9adebbfef34c 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -45,6 +45,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -58,6 +58,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* @return true if banned, otherwise false
*/
public boolean isBanned();
@@ -74,21 +74,10 @@ index 58313929f81509030216a0e5e3869da63e11108e..6cf05fed701c67a2c797a4e0839c7958
/**
* Checks if this player is whitelisted or not
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index da5dd22e75b998495258a482557221ebd52e0c39..07ae612268a5857cedf8c646a09eb30c9b0a036b 100644
index 18ce1833e8fa2c255b915755ef6d3d61e4d0007f..c0fed694f66acc623eaef2f3d53bcd32180b09af 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -5,6 +5,10 @@ import java.util.UUID;
import com.destroystokyo.paper.Title; // Paper
import net.kyori.adventure.text.Component;
import com.destroystokyo.paper.profile.PlayerProfile; // Paper
+import java.util.Date; // Paper
+import org.bukkit.BanEntry; // Paper
+import org.bukkit.BanList; // Paper
+import org.bukkit.Bukkit; // Paper
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -712,6 +716,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -738,6 +738,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@@ -100,7 +89,7 @@ index da5dd22e75b998495258a482557221ebd52e0c39..07ae612268a5857cedf8c646a09eb30c
+ */
+ // For reference, Bukkit defines this as nullable, while they impl isn't, we'll follow API.
+ @Nullable
+ public default BanEntry banPlayerFull(@Nullable String reason) {
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason) {
+ return banPlayerFull(reason, null, null);
+ }
+
@@ -112,7 +101,7 @@ index da5dd22e75b998495258a482557221ebd52e0c39..07ae612268a5857cedf8c646a09eb30c
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) {
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) {
+ return banPlayerFull(reason, null, source);
+ }
+
@@ -124,7 +113,7 @@ index da5dd22e75b998495258a482557221ebd52e0c39..07ae612268a5857cedf8c646a09eb30c
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires) {
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable java.util.Date expires) {
+ return banPlayerFull(reason, expires, null);
+ }
+
@@ -137,102 +126,102 @@ index da5dd22e75b998495258a482557221ebd52e0c39..07ae612268a5857cedf8c646a09eb30c
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires, @Nullable String source) {
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) {
+ banPlayer(reason, expires, source);
+ return banPlayerIP(reason, expires, source, true);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ *
+ * @param reason Reason for ban
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) {
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) {
+ return banPlayerIP(reason, null, null, kickPlayer);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * @param reason Reason for ban
+ * @param source Source of ban, or null for default
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) {
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) {
+ return banPlayerIP(reason, null, source, kickPlayer);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, boolean kickPlayer) {
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, boolean kickPlayer) {
+ return banPlayerIP(reason, expires, null, kickPlayer);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ *
+ * @param reason Reason for ban
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason) {
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason) {
+ return banPlayerIP(reason, null, null);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * @param reason Reason for ban
+ * @param source Source of ban, or null for default
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) {
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) {
+ return banPlayerIP(reason, null, source);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires) {
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires) {
+ return banPlayerIP(reason, expires, null);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @param source Source of the banm or null for default
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source) {
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) {
+ return banPlayerIP(reason, expires, source, true);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @param source Source of the banm or null for default
@@ -240,8 +229,8 @@ index da5dd22e75b998495258a482557221ebd52e0c39..07ae612268a5857cedf8c646a09eb30c
+ * @return Ban Entry
+ */
+ @Nullable
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer) {
+ BanEntry banEntry = Bukkit.getServer().getBanList(BanList.Type.IP).addBan(getAddress().getAddress().getHostAddress(), reason, expires, source);
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source, boolean kickPlayer) {
+ org.bukkit.BanEntry banEntry = org.bukkit.Bukkit.getServer().getBanList(org.bukkit.BanList.Type.IP).addBan(getAddress().getAddress().getHostAddress(), reason, expires, source);
+ if (kickPlayer && isOnline()) {
+ getPlayer().kickPlayer(reason);
+ }
@@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index cec39714294127478b6e73452354ba7ccab78b25..bd1e64d03d601d55bab3f1de367792544ed802b1 100644
index 8a2ca11be9ebde91268b20d25a35e1d6842f49de..e6d6283f3dd76b6c5af34374a05a5ab966419d06 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1,6 +1,9 @@
@@ -19,7 +19,7 @@ index cec39714294127478b6e73452354ba7ccab78b25..bd1e64d03d601d55bab3f1de36779254
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -652,6 +655,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -654,6 +657,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes);
@@ -500,10 +500,10 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index dc5142460a711ee79aed30276382b92c82cbef00..40a3a54fc82252692fc8710cabb243d0984ccf4f 100644
index 8d048a8f1446f862dcc61952971b54bab9bb2ac3..60a70b9e7a613e64a31a127264f17485ed2aa76f 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -122,6 +122,17 @@ public enum Particle {
@@ -155,6 +155,17 @@ public enum Particle {
return dataType;
}
@@ -522,10 +522,10 @@ index dc5142460a711ee79aed30276382b92c82cbef00..40a3a54fc82252692fc8710cabb243d0
* Options which can be applied to redstone dust particles - a particle
* color and size.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index e8b94ae777cad907dbb31c9ea5a3c1690b178777..6156fb9827400cb6c1c0a96e0b6fed180a12d610 100644
index e6d6283f3dd76b6c5af34374a05a5ab966419d06..d4c55682f6b2433808a2f0542189a5672d4991ea 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2637,7 +2637,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2784,7 +2784,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
*/
@@ -6,10 +6,10 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index e8783b0116f4efd5447a5f6f260506000983ffd2..9fee2f157ac5149cd65136bf8468deaca410fbf4 100644
index 2581117ded5d91070bc9416eee53383e915a1564..9376c6a02731c71798aaf3361b2e30c521547874 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -636,5 +636,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -639,5 +639,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
public String getI18NDisplayName() {
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
}
+2 -2
View File
@@ -106,10 +106,10 @@ index bbc636baef2e2b0586c7d517be428438ca26ab66..a8d4f7972d07ddde171b4a1ec470a4c6
* Returns a list of entities within a bounding box centered around a Location.
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 6156fb9827400cb6c1c0a96e0b6fed180a12d610..1e29c0e69973a1f7422852a04f97a6e7c19a3e54 100644
index d4c55682f6b2433808a2f0542189a5672d4991ea..68b10c8643e9c2c873e627b2185f983a9c1023aa 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1419,6 +1419,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -1421,6 +1421,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire);
@@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 9fee2f157ac5149cd65136bf8468deaca410fbf4..686e2a0b9fe061816b41435ef2337870dbdca8e5 100644
index 9376c6a02731c71798aaf3361b2e30c521547874..487e6a6391123a4792c3bdeba869aa2bcb5922cc 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -2,7 +2,9 @@ package org.bukkit.inventory;
@@ -18,7 +18,7 @@ index 9fee2f157ac5149cd65136bf8468deaca410fbf4..686e2a0b9fe061816b41435ef2337870
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@@ -644,5 +646,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -647,5 +649,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
// Requires access to NMS
return ensureServerConversions().getMaxItemUseDuration();
}
@@ -5,10 +5,10 @@ Subject: [PATCH] Add World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 1e29c0e69973a1f7422852a04f97a6e7c19a3e54..91755d27b84abad516d891d4b0b7869124cb263e 100644
index 68b10c8643e9c2c873e627b2185f983a9c1023aa..057b7ace5428d2799d33d91097f6cec786c7bd58 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -939,6 +939,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -941,6 +941,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z);
@@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 5cc025b69c4f405be8f7098d0dcef40fa522b39f..1d573d33304e9c15a9949af68dab0626ae04dce4 100644
index 6ef0d7f3dcb779fb7dc5786e7433262092908eaa..b007b582d344b79ee67751fd1e21f6cef6a1a950 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -158,6 +158,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
+2 -2
View File
@@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API
Get the chunk the entity is currently registered to
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 71f519b8f03d2a52f2c5a9283a18c74c1ca52328..c0d6dc1b584c34c541bf9a2549016b4e29818d45 100644
index b9a61d06d72831dc0c591e129553453a537d3785..df07eb07896790a09d1022daef5cffc6a435f739 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -3,6 +3,7 @@ package org.bukkit.entity;
@@ -17,7 +17,7 @@ index 71f519b8f03d2a52f2c5a9283a18c74c1ca52328..c0d6dc1b584c34c541bf9a2549016b4e
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Nameable;
@@ -680,5 +681,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -688,5 +689,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return True if entity spawned from a mob spawner
*/
boolean fromMobSpawner();
@@ -7,10 +7,10 @@ Not here to name and shame, only so server admins can be aware of which
plugins have and haven't been updated.
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index bfeec56e83229dbfc8625b3b90bd6c138c73bc1d..9341c7fbf619a42ed5329136b7fb4f52fb81a922 100644
index 5ba6c7a69937badd64256248560268fb695d5f74..db272568d7dee924083e37c55bdbf90f05fafc69 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -92,5 +92,11 @@ public interface UnsafeValues {
@@ -101,5 +101,11 @@ public interface UnsafeValues {
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
}
+15 -10
View File
@@ -73,20 +73,25 @@ index 0000000000000000000000000000000000000000..9ce2948dfaa56d0adf53fe9b6117a90d
+}
+
diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/org/bukkit/entity/SkeletonHorse.java
index b2c6b6a8689f6bd6ce784bbe6f571f756dd700c1..ba9983463263f77db3d3487bc12f01db4508a32b 100644
index a34ad28fc43bde224c39253e8479bf7bb7e8df1c..38539d5b77e06865aa65b8db0c1a3b6eaa914d03 100644
--- a/src/main/java/org/bukkit/entity/SkeletonHorse.java
+++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java
@@ -3,4 +3,12 @@ package org.bukkit.entity;
/**
* Represents a SkeletonHorse - variant of {@link AbstractHorse}.
*/
-public interface SkeletonHorse extends AbstractHorse { }
+public interface SkeletonHorse extends AbstractHorse {
+ // Paper start
+ int getTrapTime();
@@ -43,4 +43,18 @@ public interface SkeletonHorse extends AbstractHorse {
* @param trapTime new trap time
*/
void setTrapTime(int trapTime);
+
+ // Paper start
+ /**
+ * @deprecated use {@link #isTrapped()}
+ */
+ @Deprecated
+ boolean isTrap();
+
+ /**
+ * @deprecated use {@link #setTrapped(boolean)}
+ */
+ @Deprecated
+ void setTrap(boolean trap);
+ // Paper end
+}
}
@@ -7,7 +7,7 @@ Allows you to easily access the chunks X/z as a long, and a method
to look up by the long key too.
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
index 5fd6030b2693d793951ed632ad4870e1a6f909aa..40ddeb7abd49eeece531a8e90b4508f3831cc3e9 100644
index 06737962b844275a74ee2407cc09918599cbaea4..1a4b6922c0a881b60ddf305b1e2b3af0dfde46c3 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -28,6 +28,32 @@ public interface Chunk extends PersistentDataHolder {
@@ -44,10 +44,10 @@ index 5fd6030b2693d793951ed632ad4870e1a6f909aa..40ddeb7abd49eeece531a8e90b4508f3
* Gets the world containing this chunk
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 91755d27b84abad516d891d4b0b7869124cb263e..d3d0e4448135f6c0440c15e0dd3fc15c2616263a 100644
index 057b7ace5428d2799d33d91097f6cec786c7bd58..ee277a464b1ecaaa7948c333a04e347e6255c904 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -207,6 +207,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -209,6 +209,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Chunk getChunkAt(@NotNull Block block);
@@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
index 40ddeb7abd49eeece531a8e90b4508f3831cc3e9..5a4884db36d448c885e49c965ae329a0638dd628 100644
index 1a4b6922c0a881b60ddf305b1e2b3af0dfde46c3..049c36807d2a970842442c1b7517c06f3f150041 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -1,6 +1,8 @@
@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 10 Aug 2018 22:08:34 -0400
Subject: [PATCH] Make EnderDragon extend Mob
diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java
index c14278d2c99deedddfd9c8afdc900760b0331546..92da609fb2bdf7c6396ba868410a40725fda05f0 100644
--- a/src/main/java/org/bukkit/entity/EnderDragon.java
+++ b/src/main/java/org/bukkit/entity/EnderDragon.java
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents an Ender Dragon
*/
-public interface EnderDragon extends ComplexLivingEntity, Boss {
+public interface EnderDragon extends ComplexLivingEntity, Boss, org.bukkit.entity.Mob { // Paper - add Mob
/**
* Represents a phase or action that an Ender Dragon can perform.
@@ -18,7 +18,7 @@ Y range: [0, 1023]
X, Z range: [-67 108 864, 67 108 863]
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..58728a0f0722b378efa129e26f0c822b63d1af36 100644
index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..5c5e05673e0912f4dbd6c728f4c3b7fcdae8f0e8 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -15,7 +15,6 @@ import org.jetbrains.annotations.Nullable;
@@ -29,7 +29,7 @@ index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..58728a0f0722b378efa129e26f0c822b
import java.util.function.Predicate;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@@ -605,6 +604,17 @@ public class Location implements Cloneable, ConfigurationSerializable {
@@ -605,6 +604,19 @@ public class Location implements Cloneable, ConfigurationSerializable {
blockLoc.setZ(getBlockZ());
return blockLoc;
}
@@ -38,7 +38,9 @@ index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..58728a0f0722b378efa129e26f0c822b
+ /**
+ * @return The block key for this location's block location.
+ * @see Block#getBlockKey(int, int, int)
+ * @deprecated only encodes y block ranges from -512 to 511 and represents an already changed implementation detail
+ */
+ @Deprecated
+ public long toBlockKey() {
+ return Block.getBlockKey(getBlockX(), getBlockY(), getBlockZ());
+ }
@@ -48,10 +50,10 @@ index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..58728a0f0722b378efa129e26f0c822b
* @return A new location where X/Y/Z are the center of the block
*/
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index dbfa490c997c515007fc0d86ee5e2b4b98d174e5..4789dafc716c3db63983d49d7af75e3f374f4f51 100644
index a501384906fa01ddc83476ef2dbbb8d11a03fb8c..449d6882c8f41d9e0f46436c430e071b85eb2775 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -90,6 +90,38 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -92,6 +92,40 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Block getBlockAt(@NotNull Location location);
@@ -62,8 +64,10 @@ index dbfa490c997c515007fc0d86ee5e2b4b98d174e5..4789dafc716c3db63983d49d7af75e3f
+ * @param key The block key. See {@link Block#getBlockKey()}
+ * @return Block at the key
+ * @see Block#getBlockKey(int, int, int)
+ * @deprecated only encodes y block ranges from -512 to 511 and represents an already changed implementation detail
+ */
+ @NotNull
+ @Deprecated
+ public default Block getBlockAtKey(long key) {
+ int x = Block.getBlockKeyX(key);
+ int y = Block.getBlockKeyY(key);
@@ -91,7 +95,7 @@ index dbfa490c997c515007fc0d86ee5e2b4b98d174e5..4789dafc716c3db63983d49d7af75e3f
* Gets the highest non-empty (impassable) coordinate at the given
* coordinates.
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index 62ab55729e69bfac8eb4b40d877b945d95df27cd..50fb2c8cbed7a3875a81cf409238912d9b38d820 100644
index d29bdc125dba0128d93d57e8d9393b970e6c00a9..b101f5264bdde8bd14913d5161c1047020830f8d 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -155,6 +155,82 @@ public interface Block extends Metadatable {
@@ -5,7 +5,7 @@ Subject: [PATCH] isChunkGenerated API
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 58728a0f0722b378efa129e26f0c822b63d1af36..88b3e0323dbc4f0fce31b147c7aaa08d65745852 100644
index 5c5e05673e0912f4dbd6c728f4c3b7fcdae8f0e8..57cb548683f7b2972c998afd34176952426f8b47 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -3,6 +3,7 @@ package org.bukkit;
@@ -34,10 +34,10 @@ index 58728a0f0722b378efa129e26f0c822b63d1af36..88b3e0323dbc4f0fce31b147c7aaa08d
/**
* Sets the position of this Location and returns itself
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 7ed2442031cdcc429aabe91d639871566359ba53..59c796ec6b33b282d1f1ee769bc802a3fe7061b1 100644
index 449d6882c8f41d9e0f46436c430e071b85eb2775..dcca66c345b3c51d7b9956ddd3ac2bf0b789899c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -253,6 +253,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -257,6 +257,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
public default Chunk getChunkAt(long chunkKey) {
return getChunkAt((int) chunkKey, (int) (chunkKey >> 32));
}
@@ -8,10 +8,10 @@ Adds API's to load or generate chunks asynchronously.
Also adds utility methods to Entity to teleport asynchronously.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 59c796ec6b33b282d1f1ee769bc802a3fe7061b1..a0a4d0f143303bd449494ec1479db1e449836595 100644
index dcca66c345b3c51d7b9956ddd3ac2bf0b789899c..04583189f7ed9a446ed649780e2b99cb5e1ab3ad 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -962,6 +962,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -966,6 +966,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
return nearby;
}
@@ -495,7 +495,7 @@ index 59c796ec6b33b282d1f1ee769bc802a3fe7061b1..a0a4d0f143303bd449494ec1479db1e4
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index c0d6dc1b584c34c541bf9a2549016b4e29818d45..23a3bf005a21cd417f9b2d8ecd64c2887d1e979e 100644
index df07eb07896790a09d1022daef5cffc6a435f739..7a05615ec7678338801bcae2ec9a029b13d323d2 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -163,6 +163,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -5,13 +5,13 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 62b41c809cec18b75ee83371f0ca97ccde141e30..fc44e75c52354d95fa7422e1d08ac4cba455be74 100644
index c0fed694f66acc623eaef2f3d53bcd32180b09af..98b856d068c765a277d1e218a04e05588e18fdcb 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2377,6 +2377,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2449,6 +2449,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param profile The new profile to use
*/
void setPlayerProfile(@NotNull PlayerProfile profile);
void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
+
+ /**
+ * Returns the amount of ticks the current cooldown lasts
@@ -13,7 +13,7 @@ You can use EntityPathfindEvent to cancel new pathfinds from overriding your cur
diff --git a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
new file mode 100644
index 0000000000000000000000000000000000000000..e2a6f9c3881ff9d7373ac30e60009200432555aa
index 0000000000000000000000000000000000000000..43f062257472a06e9e64c2feef6c3b1012aee00e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
@@ -0,0 +1,212 @@
@@ -214,7 +214,7 @@ index 0000000000000000000000000000000000000000..e2a6f9c3881ff9d7373ac30e60009200
+
+ /**
+ * @return Returns the index of the current point along the points returned in {@link #getPoints()} the entity
+ * is trying to reach, or null if we are done with this pathfinding.
+ * is trying to reach. This value will be higher than the maximum index of {@link #getPoints()} if this path finding is done.
+ */
+ int getNextPointIndex();
+
@@ -226,10 +226,10 @@ index c65f0d6569c130b4920a9e71ad24af6427f1f030..01bcb3a1bdb5accdf844d0178cec3d25
return key;
}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 1c362636c56db0e6c118171ba367c43c4f7cff33..01b462fccce71cef3398dd43944046f322b8e57e 100644
index 69f68ca2d62c2cfe07a193776054c14c352a5942..45baebc97f0aec8abc9a894bc135e4767d7c9e35 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -432,4 +432,87 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -444,4 +444,87 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@SuppressWarnings("javadoc")
@NotNull
ItemMeta clone();
@@ -6,12 +6,12 @@ Subject: [PATCH] Implement furnace cook speed multiplier API
Signed-off-by: Tassu <git@tassu.me>
diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java
index c5a8c96fa2204d6b4d2409b1bfc97697d39d964e..9063cf370a0fe66c2a27086e125f9111b77366ae 100644
index ac3b24c5c99eeb1435d785efade728dd40947da5..dbdf3dbe9517b09a7965cf9d65cae1edd87af67d 100644
--- a/src/main/java/org/bukkit/block/Furnace.java
+++ b/src/main/java/org/bukkit/block/Furnace.java
@@ -61,6 +61,26 @@ public interface Furnace extends Container {
*/
public void setCookTimeTotal(int cookTimeTotal);
@@ -74,6 +74,26 @@ public interface Furnace extends Container {
@NotNull
public Map<CookingRecipe<?>, Integer> getRecipesUsed();
+ // Paper start
+ /**
@@ -5,10 +5,10 @@ Subject: [PATCH] Material API additions
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 2a0773e0981f8470eb897ffd9178bb97e8365050..58c3ab444d484ac781810e26e04b9919eaff3bf2 100644
index df3f24066022e2381a87d27338dec173199388c7..53d1609e2a75c007cb7e5e8f963b0deb53bae5f7 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -99,6 +99,7 @@ import org.jetbrains.annotations.Nullable;
@@ -103,6 +103,7 @@ import org.jetbrains.annotations.Nullable;
/**
* An enum of all material IDs accepted by the official server and client
*/
@@ -16,7 +16,7 @@ index 2a0773e0981f8470eb897ffd9178bb97e8365050..58c3ab444d484ac781810e26e04b9919
public enum Material implements Keyed {
//<editor-fold desc="Materials" defaultstate="collapsed">
AIR(9648, 0),
@@ -3969,6 +3970,22 @@ public enum Material implements Keyed {
@@ -3973,6 +3974,22 @@ public enum Material implements Keyed {
}
}
@@ -113,10 +113,10 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015
+}
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
new file mode 100644
index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8acdb2de32
index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd585fea27
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
@@ -0,0 +1,646 @@
@@ -0,0 +1,655 @@
+/*
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
+ *
@@ -149,6 +149,9 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+/**
+ * Represents a collection tags to identify materials that share common properties.
+ * Will map to minecraft for missing tags, as well as custom ones that may be useful.
+ * <p>
+ * All tags in this class are unmodifiable, attempting to modify them will throw an
+ * {@link UnsupportedOperationException}.
+ */
+@SuppressWarnings({"NonFinalUtilityClass", "unused", "WeakerAccess"})
+public class MaterialTags {
@@ -159,94 +162,94 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ }
+ public static final MaterialSetTag ARROWS = new MaterialSetTag(keyFor("arrows"))
+ .endsWith("ARROW")
+ .ensureSize("ARROWS", 3);
+ .ensureSize("ARROWS", 3).lock();
+
+ /**
+ * Covers all colors of beds.
+ */
+ public static final MaterialSetTag BEDS = new MaterialSetTag(keyFor("beds"))
+ .endsWith("_BED")
+ .ensureSize("BEDS", 16);
+ .ensureSize("BEDS", 16).lock();
+
+ /**
+ * Covers all bucket items.
+ */
+ public static final MaterialSetTag BUCKETS = new MaterialSetTag(keyFor("buckets"))
+ .endsWith("BUCKET")
+ .ensureSize("BUCKETS", 10);
+ .ensureSize("BUCKETS", 10).lock();
+
+ /**
+ * Covers coal and charcoal.
+ */
+ public static final MaterialSetTag COALS = new MaterialSetTag(keyFor("coals"))
+ .add(Material.COAL, Material.CHARCOAL);
+ .add(Material.COAL, Material.CHARCOAL).lock();
+
+ /**
+ * Covers both cobblestone wall variants.
+ */
+ public static final MaterialSetTag COBBLESTONE_WALLS = new MaterialSetTag(keyFor("cobblestone_walls"))
+ .endsWith("COBBLESTONE_WALL")
+ .ensureSize("COBBLESTONE_WALLS", 2);
+ .ensureSize("COBBLESTONE_WALLS", 2).lock();
+
+ /**
+ * Covers both cobblestone and mossy Cobblestone.
+ */
+ public static final MaterialSetTag COBBLESTONES = new MaterialSetTag(keyFor("cobblestones"))
+ .add(Material.COBBLESTONE, Material.MOSSY_COBBLESTONE);
+ .add(Material.COBBLESTONE, Material.MOSSY_COBBLESTONE).lock();
+
+ /**
+ * Covers all colors of concrete.
+ */
+ public static final MaterialSetTag CONCRETES = new MaterialSetTag(keyFor("concretes"))
+ .endsWith("_CONCRETE")
+ .ensureSize("CONCRETES", 16);
+ .ensureSize("CONCRETES", 16).lock();
+
+ /**
+ * Covers all colors of concrete powder.
+ */
+ public static final MaterialSetTag CONCRETE_POWDER = new MaterialSetTag(keyFor("concrete_powder"))
+ .endsWith("_CONCRETE_POWDER")
+ .ensureSize("CONCRETE_POWDER", 16);
+ .ensureSize("CONCRETE_POWDER", 16).lock();
+
+ /**
+ * Covers the two types of cooked fish.
+ */
+ public static final MaterialSetTag COOKED_FISH = new MaterialSetTag(keyFor("cooked_fish"))
+ .add(Material.COOKED_COD, Material.COOKED_SALMON);
+ .add(Material.COOKED_COD, Material.COOKED_SALMON).lock();
+
+ /**
+ * Covers all variants of doors.
+ */
+ public static final MaterialSetTag DOORS = new MaterialSetTag(keyFor("doors"))
+ .endsWith("_DOOR")
+ .ensureSize("DOORS", 9);
+ .ensureSize("DOORS", 9).lock();
+
+ /**
+ * Covers all dyes.
+ */
+ public static final MaterialSetTag DYES = new MaterialSetTag(keyFor("dyes"))
+ .endsWith("_DYE")
+ .ensureSize("DYES", 16);
+ .ensureSize("DYES", 16).lock();
+
+ /**
+ * Covers all variants of gates.
+ */
+ public static final MaterialSetTag FENCE_GATES = new MaterialSetTag(keyFor("fence_gates"))
+ .endsWith("_GATE")
+ .ensureSize("FENCE_GATES", 8);
+ .ensureSize("FENCE_GATES", 8).lock();
+
+ /**
+ * Covers all variants of fences.
+ */
+ public static final MaterialSetTag FENCES = new MaterialSetTag(keyFor("fences"))
+ .endsWith("_FENCE")
+ .ensureSize("FENCES", 9);
+ .ensureSize("FENCES", 9).lock();
+
+ /**
+ * Covers all variants of fish buckets.
+ */
+ public static final MaterialSetTag FISH_BUCKETS = new MaterialSetTag(keyFor("fish_buckets"))
+ .add(Material.COD_BUCKET, Material.PUFFERFISH_BUCKET, Material.SALMON_BUCKET, Material.TROPICAL_FISH_BUCKET);
+ .add(Material.COD_BUCKET, Material.PUFFERFISH_BUCKET, Material.SALMON_BUCKET, Material.TROPICAL_FISH_BUCKET).lock();
+
+ /**
+ * Covers the non-colored glass and 16 stained glass (not panes).
@@ -254,21 +257,21 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag GLASS = new MaterialSetTag(keyFor("glass"))
+ .endsWith("_GLASS")
+ .add(Material.GLASS)
+ .ensureSize("GLASS", 18);
+ .ensureSize("GLASS", 18).lock();
+
+ /**
+ * Covers the non-colored glass panes and stained glass panes (panes only).
+ */
+ public static final MaterialSetTag GLASS_PANES = new MaterialSetTag(keyFor("glass_panes"))
+ .endsWith("GLASS_PANE")
+ .ensureSize("GLASS_PANES", 17);
+ .ensureSize("GLASS_PANES", 17).lock();
+
+ /**
+ * Covers all glazed terracotta blocks.
+ */
+ public static final MaterialSetTag GLAZED_TERRACOTTA = new MaterialSetTag(keyFor("glazed_terracotta"))
+ .endsWith("GLAZED_TERRACOTTA")
+ .ensureSize("GLAZED_TERRACOTTA", 16);
+ .ensureSize("GLAZED_TERRACOTTA", 16).lock();
+
+ /**
+ * Covers the colors of stained terracotta.
@@ -277,35 +280,35 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ .endsWith("TERRACOTTA")
+ .not(Material.TERRACOTTA)
+ .notEndsWith("GLAZED_TERRACOTTA")
+ .ensureSize("STAINED_TERRACOTTA", 16);
+ .ensureSize("STAINED_TERRACOTTA", 16).lock();
+
+ /**
+ * Covers terracotta along with the stained variants.
+ */
+ public static final MaterialSetTag TERRACOTTA = new MaterialSetTag(keyFor("terracotta"))
+ .endsWith("TERRACOTTA")
+ .ensureSize("TERRACOTTA", 33);
+ .ensureSize("TERRACOTTA", 33).lock();
+
+ /**
+ * Covers both golden apples.
+ */
+ public static final MaterialSetTag GOLDEN_APPLES = new MaterialSetTag(keyFor("golden_apples"))
+ .endsWith("GOLDEN_APPLE")
+ .ensureSize("GOLDEN_APPLES", 2);
+ .ensureSize("GOLDEN_APPLES", 2).lock();
+
+ /**
+ * Covers the variants of horse armor.
+ */
+ public static final MaterialSetTag HORSE_ARMORS = new MaterialSetTag(keyFor("horse_armors"))
+ .endsWith("_HORSE_ARMOR")
+ .ensureSize("HORSE_ARMORS", 4);
+ .ensureSize("HORSE_ARMORS", 4).lock();
+
+ /**
+ * Covers the variants of infested blocks.
+ */
+ public static final MaterialSetTag INFESTED_BLOCKS = new MaterialSetTag(keyFor("infested_blocks"))
+ .startsWith("INFESTED_")
+ .ensureSize("INFESTED_BLOCKS", 7);
+ .ensureSize("INFESTED_BLOCKS", 7).lock();
+
+ /**
+ * Covers the variants of mushroom blocks.
@@ -313,19 +316,19 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag MUSHROOM_BLOCKS = new MaterialSetTag(keyFor("mushroom_blocks"))
+ .endsWith("MUSHROOM_BLOCK")
+ .add(Material.MUSHROOM_STEM)
+ .ensureSize("MUSHROOM_BLOCKS", 3);
+ .ensureSize("MUSHROOM_BLOCKS", 3).lock();
+
+ /**
+ * Covers all mushrooms.
+ */
+ public static final MaterialSetTag MUSHROOMS = new MaterialSetTag(keyFor("mushrooms"))
+ .add(Material.BROWN_MUSHROOM, Material.RED_MUSHROOM);
+ .add(Material.BROWN_MUSHROOM, Material.RED_MUSHROOM).lock();
+
+ /**
+ * Covers all music disc items.
+ */
+ public static final MaterialSetTag MUSIC_DISCS = new MaterialSetTag(keyFor("music_discs"))
+ .startsWith("MUSIC_DISC_");
+ .startsWith("MUSIC_DISC_").lock();
+
+ /**
+ * Covers all ores.
@@ -333,91 +336,91 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag ORES = new MaterialSetTag(keyFor("ores"))
+ .add(Material.ANCIENT_DEBRIS)
+ .endsWith("_ORE")
+ .ensureSize("ORES", 19);
+ .ensureSize("ORES", 19).lock();
+
+ /**
+ * Covers all piston typed items and blocks including the piston head and moving piston.
+ */
+ public static final MaterialSetTag PISTONS = new MaterialSetTag(keyFor("pistons"))
+ .contains("PISTON")
+ .ensureSize("PISTONS", 4);
+ .ensureSize("PISTONS", 4).lock();
+
+ /**
+ * Covers all potato items.
+ */
+ public static final MaterialSetTag POTATOES = new MaterialSetTag(keyFor("potatoes"))
+ .endsWith("POTATO")
+ .ensureSize("POTATOES", 3);
+ .ensureSize("POTATOES", 3).lock();
+
+ /**
+ * Covers all wooden pressure plates and the weighted pressure plates and the stone pressure plate.
+ */
+ public static final MaterialSetTag PRESSURE_PLATES = new MaterialSetTag(keyFor("pressure_plates"))
+ .endsWith("_PRESSURE_PLATE")
+ .ensureSize("PRESSURE_PLATES", 12);
+ .ensureSize("PRESSURE_PLATES", 12).lock();
+
+ /**
+ * Covers the variants of prismarine blocks.
+ */
+ public static final MaterialSetTag PRISMARINE = new MaterialSetTag(keyFor("prismarine"))
+ .add(Material.PRISMARINE, Material.PRISMARINE_BRICKS, Material.DARK_PRISMARINE);
+ .add(Material.PRISMARINE, Material.PRISMARINE_BRICKS, Material.DARK_PRISMARINE).lock();
+
+ /**
+ * Covers the variants of prismarine slabs.
+ */
+ public static final MaterialSetTag PRISMARINE_SLABS = new MaterialSetTag(keyFor("prismarine_slabs"))
+ .add(Material.PRISMARINE_SLAB, Material.PRISMARINE_BRICK_SLAB, Material.DARK_PRISMARINE_SLAB);
+ .add(Material.PRISMARINE_SLAB, Material.PRISMARINE_BRICK_SLAB, Material.DARK_PRISMARINE_SLAB).lock();
+
+ /**
+ * Covers the variants of prismarine stairs.
+ */
+ public static final MaterialSetTag PRISMARINE_STAIRS = new MaterialSetTag(keyFor("prismarine_stairs"))
+ .add(Material.PRISMARINE_STAIRS, Material.PRISMARINE_BRICK_STAIRS, Material.DARK_PRISMARINE_STAIRS);
+ .add(Material.PRISMARINE_STAIRS, Material.PRISMARINE_BRICK_STAIRS, Material.DARK_PRISMARINE_STAIRS).lock();
+
+ /**
+ * Covers the variants of pumpkins.
+ */
+ public static final MaterialSetTag PUMPKINS = new MaterialSetTag(keyFor("pumpkins"))
+ .add(Material.CARVED_PUMPKIN, Material.JACK_O_LANTERN, Material.PUMPKIN);
+ .add(Material.CARVED_PUMPKIN, Material.JACK_O_LANTERN, Material.PUMPKIN).lock();
+
+ /**
+ * Covers the variants of quartz blocks.
+ */
+ public static final MaterialSetTag QUARTZ_BLOCKS = new MaterialSetTag(keyFor("quartz_blocks"))
+ .add(Material.QUARTZ_BLOCK, Material.QUARTZ_PILLAR, Material.CHISELED_QUARTZ_BLOCK, Material.SMOOTH_QUARTZ);
+ .add(Material.QUARTZ_BLOCK, Material.QUARTZ_PILLAR, Material.CHISELED_QUARTZ_BLOCK, Material.SMOOTH_QUARTZ).lock();
+
+ /**
+ * Covers all uncooked fish items.
+ */
+ public static final MaterialSetTag RAW_FISH = new MaterialSetTag(keyFor("raw_fish"))
+ .add(Material.COD, Material.PUFFERFISH, Material.SALMON, Material.TROPICAL_FISH);
+ .add(Material.COD, Material.PUFFERFISH, Material.SALMON, Material.TROPICAL_FISH).lock();
+
+ /**
+ * Covers the variants of red sandstone blocks.
+ */
+ public static final MaterialSetTag RED_SANDSTONES = new MaterialSetTag(keyFor("red_sandstones"))
+ .endsWith("RED_SANDSTONE")
+ .ensureSize("RED_SANDSTONES", 4);
+ .ensureSize("RED_SANDSTONES", 4).lock();
+
+ /**
+ * Covers the variants of sandstone blocks.
+ */
+ public static final MaterialSetTag SANDSTONES = new MaterialSetTag(keyFor("sandstones"))
+ .add(Material.SANDSTONE, Material.CHISELED_SANDSTONE, Material.CUT_SANDSTONE, Material.SMOOTH_SANDSTONE);
+ .add(Material.SANDSTONE, Material.CHISELED_SANDSTONE, Material.CUT_SANDSTONE, Material.SMOOTH_SANDSTONE).lock();
+
+ /**
+ * Covers sponge and wet sponge.
+ */
+ public static final MaterialSetTag SPONGES = new MaterialSetTag(keyFor("sponges"))
+ .endsWith("SPONGE")
+ .ensureSize("SPONGES", 2);
+ .ensureSize("SPONGES", 2).lock();
+
+ /**
+ * Covers the non-colored and colored shulker boxes.
+ */
+ public static final MaterialSetTag SHULKER_BOXES = new MaterialSetTag(keyFor("shulker_boxes"))
+ .endsWith("SHULKER_BOX")
+ .ensureSize("SHULKER_BOXES", 17);
+ .ensureSize("SHULKER_BOXES", 17).lock();
+
+ /**
+ * Covers zombie, creeper, skeleton, dragon, and player heads.
@@ -426,35 +429,35 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ .endsWith("_HEAD")
+ .endsWith("_SKULL")
+ .not(Material.PISTON_HEAD)
+ .ensureSize("SKULLS", 12);
+ .ensureSize("SKULLS", 12).lock();
+
+ /**
+ * Covers all spawn egg items.
+ */
+ public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
+ .endsWith("_SPAWN_EGG")
+ .ensureSize("SPAWN_EGGS", 67);
+ .ensureSize("SPAWN_EGGS", 67).lock();
+
+ /**
+ * Covers all colors of stained glass.
+ */
+ public static final MaterialSetTag STAINED_GLASS = new MaterialSetTag(keyFor("stained_glass"))
+ .endsWith("_STAINED_GLASS")
+ .ensureSize("STAINED_GLASS", 16);
+ .ensureSize("STAINED_GLASS", 16).lock();
+
+ /**
+ * Covers all colors of stained glass panes.
+ */
+ public static final MaterialSetTag STAINED_GLASS_PANES = new MaterialSetTag(keyFor("stained_glass_panes"))
+ .endsWith("STAINED_GLASS_PANE")
+ .ensureSize("STAINED_GLASS_PANES", 16);
+ .ensureSize("STAINED_GLASS_PANES", 16).lock();
+
+ /**
+ * Covers all variants of trapdoors.
+ */
+ public static final MaterialSetTag TRAPDOORS = new MaterialSetTag(keyFor("trapdoors"))
+ .endsWith("_TRAPDOOR")
+ .ensureSize("TRAPDOORS", 9);
+ .ensureSize("TRAPDOORS", 9).lock();
+
+ /**
+ * Covers all wood variants of doors.
@@ -462,7 +465,7 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag WOODEN_DOORS = new MaterialSetTag(keyFor("wooden_doors"))
+ .endsWith("_DOOR")
+ .not(Material.IRON_DOOR)
+ .ensureSize("WOODEN_DOORS", 8);
+ .ensureSize("WOODEN_DOORS", 8).lock();
+
+ /**
+ * Covers all wood variants of fences.
@@ -470,7 +473,7 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag WOODEN_FENCES = new MaterialSetTag(keyFor("wooden_fences"))
+ .endsWith("_FENCE")
+ .not(Material.NETHER_BRICK_FENCE)
+ .ensureSize("WOODEN_FENCES", 8);
+ .ensureSize("WOODEN_FENCES", 8).lock();
+
+ /**
+ * Covers all wood variants of trapdoors.
@@ -478,112 +481,112 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag WOODEN_TRAPDOORS = new MaterialSetTag(keyFor("wooden_trapdoors"))
+ .endsWith("_TRAPDOOR")
+ .not(Material.IRON_TRAPDOOR)
+ .ensureSize("WOODEN_TRAPDOORS", 8);
+ .ensureSize("WOODEN_TRAPDOORS", 8).lock();
+
+ /**
+ * Covers the wood variants of gates.
+ */
+ public static final MaterialSetTag WOODEN_GATES = new MaterialSetTag(keyFor("wooden_gates"))
+ .endsWith("_GATE")
+ .ensureSize("WOODEN_GATES", 8);
+ .ensureSize("WOODEN_GATES", 8).lock();
+
+ /**
+ * Covers the variants of purpur.
+ */
+ public static final MaterialSetTag PURPUR = new MaterialSetTag(keyFor("purpur"))
+ .startsWith("PURPUR_")
+ .ensureSize("PURPUR", 4);
+ .ensureSize("PURPUR", 4).lock();
+
+ /**
+ * Covers the variants of signs.
+ */
+ public static final MaterialSetTag SIGNS = new MaterialSetTag(keyFor("signs"))
+ .endsWith("_SIGN")
+ .ensureSize("SIGNS", 16);
+ .ensureSize("SIGNS", 16).lock();
+
+ /**
+ * Covers the variants of a regular torch.
+ */
+ public static final MaterialSetTag TORCH = new MaterialSetTag(keyFor("torch"))
+ .add(Material.TORCH, Material.WALL_TORCH)
+ .ensureSize("TORCH", 2);
+ .ensureSize("TORCH", 2).lock();
+
+ /**
+ * Covers the variants of a redstone torch.
+ */
+ public static final MaterialSetTag REDSTONE_TORCH = new MaterialSetTag(keyFor("restone_torch"))
+ .add(Material.REDSTONE_TORCH, Material.REDSTONE_WALL_TORCH)
+ .ensureSize("REDSTONE_TORCH", 2);
+ .ensureSize("REDSTONE_TORCH", 2).lock();
+
+ /**
+ * Covers the variants of a soul torch.
+ */
+ public static final MaterialSetTag SOUL_TORCH = new MaterialSetTag(keyFor("soul_torch"))
+ .add(Material.SOUL_TORCH, Material.SOUL_WALL_TORCH)
+ .ensureSize("SOUL_TORCH", 2);
+ .ensureSize("SOUL_TORCH", 2).lock();
+
+ /**
+ * Covers the variants of torches.
+ */
+ public static final MaterialSetTag TORCHES = new MaterialSetTag(keyFor("torches"))
+ .add(TORCH, REDSTONE_TORCH, SOUL_TORCH)
+ .ensureSize("TORCHES", 6);
+ .ensureSize("TORCHES", 6).lock();
+
+ /**
+ * Covers the variants of lanterns.
+ */
+ public static final MaterialSetTag LANTERNS = new MaterialSetTag(keyFor("lanterns"))
+ .add(Material.LANTERN, Material.SOUL_LANTERN)
+ .ensureSize("LANTERNS", 2);
+ .ensureSize("LANTERNS", 2).lock();
+
+ /**
+ * Covers the variants of rails.
+ */
+ public static final MaterialSetTag RAILS = new MaterialSetTag(keyFor("rails"))
+ .endsWith("RAIL")
+ .ensureSize("RAILS", 4);
+ .ensureSize("RAILS", 4).lock();
+
+ /**
+ * Covers the variants of swords.
+ */
+ public static final MaterialSetTag SWORDS = new MaterialSetTag(keyFor("swords"))
+ .endsWith("_SWORD")
+ .ensureSize("SWORDS", 6);
+ .ensureSize("SWORDS", 6).lock();
+
+ /**
+ * Covers the variants of shovels.
+ */
+ public static final MaterialSetTag SHOVELS = new MaterialSetTag(keyFor("shovels"))
+ .endsWith("_SHOVEL")
+ .ensureSize("SHOVELS", 6);
+ .ensureSize("SHOVELS", 6).lock();
+
+ /**
+ * Covers the variants of pickaxes.
+ */
+ public static final MaterialSetTag PICKAXES = new MaterialSetTag(keyFor("pickaxes"))
+ .endsWith("_PICKAXE")
+ .ensureSize("PICKAXES", 6);
+ .ensureSize("PICKAXES", 6).lock();
+
+ /**
+ * Covers the variants of axes.
+ */
+ public static final MaterialSetTag AXES = new MaterialSetTag(keyFor("axes"))
+ .endsWith("_AXE")
+ .ensureSize("AXES", 6);
+ .ensureSize("AXES", 6).lock();
+
+ /**
+ * Covers the variants of hoes.
+ */
+ public static final MaterialSetTag HOES = new MaterialSetTag(keyFor("hoes"))
+ .endsWith("_HOE")
+ .ensureSize("HOES", 6);
+ .ensureSize("HOES", 6).lock();
+
+ /**
+ * Covers the variants of helmets.
+ */
+ public static final MaterialSetTag HELMETS = new MaterialSetTag(keyFor("helmets"))
+ .endsWith("_HELMET")
+ .ensureSize("HELMETS", 7);
+ .ensureSize("HELMETS", 7).lock();
+
+ /**
+ * Covers the variants of items that can be equipped in the helmet slot.
@@ -592,14 +595,14 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ .endsWith("_HELMET")
+ .add(SKULLS)
+ .add(Material.CARVED_PUMPKIN)
+ .ensureSize("HEAD_EQUIPPABLE", 20);
+ .ensureSize("HEAD_EQUIPPABLE", 20).lock();
+
+ /**
+ * Covers the variants of chestplate.
+ */
+ public static final MaterialSetTag CHESTPLATES = new MaterialSetTag(keyFor("chestplates"))
+ .endsWith("_CHESTPLATE")
+ .ensureSize("CHESTPLATES", 6);
+ .ensureSize("CHESTPLATES", 6).lock();
+
+ /**
+ * Covers the variants of items that can be equipped in the chest slot.
@@ -607,21 +610,21 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag CHEST_EQUIPPABLE = new MaterialSetTag(keyFor("chest_equippable"))
+ .endsWith("_CHESTPLATE")
+ .add(Material.ELYTRA)
+ .ensureSize("CHEST_EQUIPPABLE", 7);
+ .ensureSize("CHEST_EQUIPPABLE", 7).lock();
+
+ /**
+ * Covers the variants of leggings.
+ */
+ public static final MaterialSetTag LEGGINGS = new MaterialSetTag(keyFor("leggings"))
+ .endsWith("_LEGGINGS")
+ .ensureSize("LEGGINGS", 6);
+ .ensureSize("LEGGINGS", 6).lock();
+
+ /**
+ * Covers the variants of boots.
+ */
+ public static final MaterialSetTag BOOTS = new MaterialSetTag(keyFor("boots"))
+ .endsWith("_BOOTS")
+ .ensureSize("BOOTS", 6);
+ .ensureSize("BOOTS", 6).lock();
+
+ /**
+ * Covers the variants of bows.
@@ -629,28 +632,28 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag BOWS = new MaterialSetTag(keyFor("bows"))
+ .add(Material.BOW)
+ .add(Material.CROSSBOW)
+ .ensureSize("BOWS", 2);
+ .ensureSize("BOWS", 2).lock();
+
+ /**
+ * Covers the variants of player-throwable projectiles (not requiring a bow or any other "assistance").
+ */
+ public static final MaterialSetTag THROWABLE_PROJECTILES = new MaterialSetTag(keyFor("throwable_projectiles"))
+ .add(Material.EGG, Material.SNOWBALL, Material.SPLASH_POTION, Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET);
+ .add(Material.EGG, Material.SNOWBALL, Material.SPLASH_POTION, Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET).lock();
+
+ /**
+ * Covers materials that can be colored, such as wool, shulker boxes, stained glass etc.
+ */
+ @SuppressWarnings("unchecked")
+ public static final MaterialSetTag COLORABLE = new MaterialSetTag(keyFor("colorable"))
+ .add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS);
+ //.ensureSize("COLORABLE", 81); unit test don't have the vanilla item tags, so counts don't line up for real
+ .add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS).lock();
+ //.ensureSize("COLORABLE", 81).lock(); unit test don't have the vanilla item tags, so counts don't line up for real
+
+ /**
+ * Covers the variants of coral.
+ */
+ public static final MaterialSetTag CORAL = new MaterialSetTag(keyFor("coral"))
+ .endsWith("_CORAL")
+ .ensureSize("CORAL", 10);
+ .ensureSize("CORAL", 10).lock();
+
+ /**
+ * Covers the variants of coral fans.
@@ -658,14 +661,14 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag CORAL_FANS = new MaterialSetTag(keyFor("coral_fans"))
+ .endsWith("_CORAL_FAN")
+ .endsWith("_CORAL_WALL_FAN")
+ .ensureSize("CORAL_FANS", 20);
+ .ensureSize("CORAL_FANS", 20).lock();
+
+ /**
+ * Covers the variants of coral blocks.
+ */
+ public static final MaterialSetTag CORAL_BLOCKS = new MaterialSetTag(keyFor("coral_blocks"))
+ .endsWith("_CORAL_BLOCK")
+ .ensureSize("CORAL_BLOCKS", 10);
+ .ensureSize("CORAL_BLOCKS", 10).lock();
+
+ /**
+ * Covers all items that can be enchanted from the enchantment table or anvil.
@@ -673,44 +676,50 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ public static final MaterialSetTag ENCHANTABLE = new MaterialSetTag(keyFor("enchantable"))
+ .add(PICKAXES, SWORDS, SHOVELS, AXES, HOES, HELMETS, CHEST_EQUIPPABLE, LEGGINGS, BOOTS, BOWS)
+ .add(Material.TRIDENT, Material.SHIELD, Material.FISHING_ROD, Material.SHEARS, Material.FLINT_AND_STEEL, Material.CARROT_ON_A_STICK, Material.WARPED_FUNGUS_ON_A_STICK)
+ .ensureSize("ENCHANTABLE", 65);
+ .ensureSize("ENCHANTABLE", 65).lock();
+
+ /**
+ * Covers the variants of raw ores.
+ */
+ public static final MaterialSetTag RAW_ORES = new MaterialSetTag(keyFor("raw_ores"))
+ .add(Material.RAW_COPPER, Material.RAW_GOLD, Material.RAW_IRON);
+ .add(Material.RAW_COPPER, Material.RAW_GOLD, Material.RAW_IRON).lock();
+
+ /**
+ * Covers the variants of deepslate ores.
+ */
+ public static final MaterialSetTag DEEPSLATE_ORES = new MaterialSetTag(keyFor("deepslate_ores"))
+ .add(material -> material.name().startsWith("DEEPSLATE_") && material.name().endsWith("_ORE"))
+ .ensureSize("DEEPSLATE_ORES", 8).lock();
+
+ /**
+ * Covers the variants of raw ore blocks.
+ */
+ public static final MaterialSetTag RAW_ORE_BLOCKS = new MaterialSetTag(keyFor("raw_ore_blocks"))
+ .add(Material.RAW_COPPER_BLOCK, Material.RAW_GOLD_BLOCK, Material.RAW_IRON_BLOCK);
+
+ .add(Material.RAW_COPPER_BLOCK, Material.RAW_GOLD_BLOCK, Material.RAW_IRON_BLOCK).lock();
+
+ /**
+ * Covers all oxidized copper blocks.
+ */
+ public static final MaterialSetTag OXIDIZED_COPPER_BLOCKS = new MaterialSetTag(keyFor("oxidized_copper_blocks"))
+ .startsWith("OXIDIZED_").startsWith("WAXED_OXIDIZED_").ensureSize("OXIDIZED_COPPER_BLOCKS", 8);
+ .startsWith("OXIDIZED_").startsWith("WAXED_OXIDIZED_").ensureSize("OXIDIZED_COPPER_BLOCKS", 8).lock();
+
+ /**
+ * Covers all weathered copper blocks.
+ */
+ public static final MaterialSetTag WEATHERED_COPPER_BLOCKS = new MaterialSetTag(keyFor("weathered_copper_blocks"))
+ .startsWith("WEATHERED_").startsWith("WAXED_WEATHERED_").ensureSize("WEATHERED_COPPER_BLOCKS", 8);
+ .startsWith("WEATHERED_").startsWith("WAXED_WEATHERED_").ensureSize("WEATHERED_COPPER_BLOCKS", 8).lock();
+
+ /**
+ * Covers all exposed copper blocks.
+ */
+ public static final MaterialSetTag EXPOSED_COPPER_BLOCKS = new MaterialSetTag(keyFor("exposed_copper_blocks"))
+ .startsWith("EXPOSED_").startsWith("WAXED_EXPOSED_").ensureSize("EXPOSED_COPPER_BLOCKS", 8);
+ .startsWith("EXPOSED_").startsWith("WAXED_EXPOSED_").ensureSize("EXPOSED_COPPER_BLOCKS", 8).lock();
+
+ /**
+ * Covers all un-weathered copper blocks.
+ */
+ public static final MaterialSetTag UNAFFECTED_COPPER_BLOCKS = new MaterialSetTag(keyFor("unaffected_copper_blocks"))
+ .startsWith("CUT_COPPER").startsWith("WAXED_CUT_COPPER").add(Material.COPPER_BLOCK).add(Material.WAXED_COPPER_BLOCK).ensureSize("UNAFFECTED_COPPER_BLOCKS", 8);
+ .startsWith("CUT_COPPER").startsWith("WAXED_CUT_COPPER").add(Material.COPPER_BLOCK).add(Material.WAXED_COPPER_BLOCK).ensureSize("UNAFFECTED_COPPER_BLOCKS", 8).lock();
+
+ /**
+ * Covers all waxed copper blocks.
@@ -718,7 +727,7 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ * Combine with other copper-related tags to filter is-waxed or not.
+ */
+ public static final MaterialSetTag WAXED_COPPER_BLOCKS = new MaterialSetTag(keyFor("waxed_copper_blocks"))
+ .add(m -> m.name().startsWith("WAXED_") && m.name().contains("COPPER")).ensureSize("WAXED_COPPER_BLOCKS", 16);
+ .add(m -> m.name().startsWith("WAXED_") && m.name().contains("COPPER")).ensureSize("WAXED_COPPER_BLOCKS", 16).lock();
+
+ /**
+ * Covers all un-waxed copper blocks.
@@ -726,13 +735,13 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ * Combine with other copper-related tags to filter is-un-waxed or not.
+ */
+ public static final MaterialSetTag UNWAXED_COPPER_BLOCKS = new MaterialSetTag(keyFor("unwaxed_copper_blocks"))
+ .contains("CUT_COPPER").endsWith("_COPPER").notContains("WAXED").ensureSize("UNWAXED_COPPER_BLOCKS", 16);
+ .contains("CUT_COPPER").endsWith("_COPPER").notContains("WAXED").ensureSize("UNWAXED_COPPER_BLOCKS", 16).lock();
+
+ /**
+ * Covers all copper block variants.
+ */
+ public static final MaterialSetTag COPPER_BLOCKS = new MaterialSetTag(keyFor("copper_blocks"))
+ .add(WAXED_COPPER_BLOCKS).add(UNWAXED_COPPER_BLOCKS).ensureSize("COPPER_BLOCKS", 32);
+ .add(WAXED_COPPER_BLOCKS).add(UNWAXED_COPPER_BLOCKS).ensureSize("COPPER_BLOCKS", 32).lock();
+
+ /**
+ * Covers all weathering/waxed states of the plain copper block.
@@ -743,32 +752,32 @@ index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8a
+ .contains("EXPOSED_COPPER")
+ .contains("COPPER_BLOCK")
+ .not(Material.RAW_COPPER_BLOCK)
+ .ensureSize("FULL_COPPER_BLOCKS", 8);
+ .ensureSize("FULL_COPPER_BLOCKS", 8).lock();
+
+ /**
+ * Covers all weathering/waxed states of the cut copper block.
+ */
+ public static final MaterialSetTag CUT_COPPER_BLOCKS = new MaterialSetTag(keyFor("cut_copper_blocks"))
+ .endsWith("CUT_COPPER").ensureSize("CUT_COPPER_BLOCKS", 8);
+ .endsWith("CUT_COPPER").ensureSize("CUT_COPPER_BLOCKS", 8).lock();
+
+ /**
+ * Covers all weathering/waxed states of the cut copper stairs.
+ */
+ public static final MaterialSetTag CUT_COPPER_STAIRS = new MaterialSetTag(keyFor("cut_copper_stairs"))
+ .endsWith("CUT_COPPER_STAIRS").ensureSize("CUT_COPPER_STAIRS", 8);
+ .endsWith("CUT_COPPER_STAIRS").ensureSize("CUT_COPPER_STAIRS", 8).lock();
+
+ /**
+ * Covers all weathering/waxed states of the cut copper slab.
+ */
+ public static final MaterialSetTag CUT_COPPER_SLABS = new MaterialSetTag(keyFor("cut_copper_slabs"))
+ .endsWith("CUT_COPPER_SLAB").ensureSize("CUT_COPPER_SLABS", 8);
+ .endsWith("CUT_COPPER_SLAB").ensureSize("CUT_COPPER_SLABS", 8).lock();
+}
diff --git a/src/main/java/io/papermc/paper/tag/BaseTag.java b/src/main/java/io/papermc/paper/tag/BaseTag.java
new file mode 100644
index 0000000000000000000000000000000000000000..4b8552e4e4c07b197fa9431fa911535b0222561e
index 0000000000000000000000000000000000000000..71484259de4783b861803c48850317eb2d60bda0
--- /dev/null
+++ b/src/main/java/io/papermc/paper/tag/BaseTag.java
@@ -0,0 +1,160 @@
@@ -0,0 +1,180 @@
+package io.papermc.paper.tag;
+
+import com.google.common.collect.Lists;
@@ -790,6 +799,7 @@ index 0000000000000000000000000000000000000000..4b8552e4e4c07b197fa9431fa911535b
+ protected final NamespacedKey key;
+ protected final Set<T> tagged;
+ private final List<Predicate<T>> globalPredicates;
+ private boolean locked = false;
+
+ public BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Predicate<T> filter) {
+ this(clazz, key);
@@ -816,6 +826,21 @@ index 0000000000000000000000000000000000000000..4b8552e4e4c07b197fa9431fa911535b
+ return (Set<E>) EnumSet.noneOf((Class<Enum>) enumClass);
+ }
+
+ public @NotNull C lock() {
+ this.locked = true;
+ return (C) this;
+ }
+
+ public boolean isLocked() {
+ return this.locked;
+ }
+
+ private void checkLock() {
+ if (this.locked) {
+ throw new UnsupportedOperationException("Tag (" + this.key + ") is locked");
+ }
+ }
+
+ @NotNull
+ @Override
+ public NamespacedKey getKey() {
@@ -843,12 +868,14 @@ index 0000000000000000000000000000000000000000..4b8552e4e4c07b197fa9431fa911535b
+
+ @NotNull
+ public C add(@NotNull T...values) {
+ this.checkLock();
+ this.tagged.addAll(Lists.newArrayList(values));
+ return (C) this;
+ }
+
+ @NotNull
+ public C add(@NotNull Collection<T> collection) {
+ this.checkLock();
+ this.tagged.addAll(collection);
+ return (C) this;
+ }
@@ -883,12 +910,14 @@ index 0000000000000000000000000000000000000000..4b8552e4e4c07b197fa9431fa911535b
+
+ @NotNull
+ public C not(@NotNull T...values) {
+ this.checkLock();
+ this.tagged.removeAll(Lists.newArrayList(values));
+ return (C) this;
+ }
+
+ @NotNull
+ public C not(@NotNull Collection<T> values) {
+ this.checkLock();
+ this.tagged.removeAll(values);
+ return (C) this;
+ }
@@ -979,16 +1008,20 @@ index 0000000000000000000000000000000000000000..c89c4619aaf388197834d98eb95af2f1
+}
diff --git a/src/main/java/io/papermc/paper/tag/EntityTags.java b/src/main/java/io/papermc/paper/tag/EntityTags.java
new file mode 100644
index 0000000000000000000000000000000000000000..683688edff2c86d92f6b3e15271c3289b39e42d7
index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5e988de0f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/tag/EntityTags.java
@@ -0,0 +1,50 @@
@@ -0,0 +1,54 @@
+package io.papermc.paper.tag;
+
+import org.bukkit.NamespacedKey;
+
+import static org.bukkit.entity.EntityType.*;
+
+/**
+ * All tags in this class are unmodifiable, attempting to modify them will throw an
+ * {@link UnsupportedOperationException}.
+ */
+public class EntityTags {
+
+ private static NamespacedKey keyFor(String key) {
@@ -1002,28 +1035,28 @@ index 0000000000000000000000000000000000000000..683688edff2c86d92f6b3e15271c3289
+ */
+ public static final EntitySetTag UNDEADS = new EntitySetTag(keyFor("undeads"))
+ .add(DROWNED, HUSK, PHANTOM, SKELETON, SKELETON_HORSE, STRAY, WITHER, WITHER_SKELETON, ZOGLIN, ZOMBIE, ZOMBIE_HORSE, ZOMBIE_VILLAGER, ZOMBIFIED_PIGLIN)
+ .ensureSize("UNDEADS", 13);
+ .ensureSize("UNDEADS", 13).lock();
+
+ /**
+ * Covers all horses
+ */
+ public static final EntitySetTag HORSES = new EntitySetTag(keyFor("horses"))
+ .contains("HORSE")
+ .ensureSize("HORSES", 3);
+ .ensureSize("HORSES", 3).lock();
+
+ /**
+ * Covers all minecarts
+ */
+ public static final EntitySetTag MINECARTS = new EntitySetTag(keyFor("minecarts"))
+ .contains("MINECART")
+ .ensureSize("MINECARTS", 7);
+ .ensureSize("MINECARTS", 7).lock();
+
+ /**
+ * Covers mobs that split into smaller mobs
+ */
+ public static final EntitySetTag SPLITTING_MOBS = new EntitySetTag(keyFor("splitting_mobs"))
+ .add(SLIME, MAGMA_CUBE)
+ .ensureSize("SLIMES", 2);
+ .ensureSize("SLIMES", 2).lock();
+
+ /**
+ * Covers all water based mobs
@@ -1031,7 +1064,7 @@ index 0000000000000000000000000000000000000000..683688edff2c86d92f6b3e15271c3289
+ */
+ public static final EntitySetTag WATER_BASED = new EntitySetTag(keyFor("water_based"))
+ .add(AXOLOTL, DOLPHIN, SQUID, GLOW_SQUID, GUARDIAN, ELDER_GUARDIAN, TURTLE, COD, SALMON, PUFFERFISH, TROPICAL_FISH)
+ .ensureSize("WATER_BASED", 11);
+ .ensureSize("WATER_BASED", 11).lock();
+}
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
index 5a25301a81b0e88a4891cbc4710289544d44105c..34d23f53acf00620223731c4fdacffde9cff41a8 100644
@@ -1050,27 +1083,41 @@ index 5a25301a81b0e88a4891cbc4710289544d44105c..34d23f53acf00620223731c4fdacffde
public interface Tag<T extends Keyed> extends Keyed {
diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..328c51471dc12e81c1a1b643455337b3fef4d14a
index 0000000000000000000000000000000000000000..f849d8b12a7e3d1606698408ab4bb140a3b370e4
--- /dev/null
+++ b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
@@ -0,0 +1,25 @@
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
+ */
+
+package com.destroystokyo.paper;
+
+import io.papermc.paper.tag.BaseTag;
+import io.papermc.paper.tag.EntityTags;
+import org.bukkit.Bukkit;
+import org.bukkit.TestServer;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+
+import static org.junit.Assert.assertTrue;
+
+public class MaterialTagsTest {
+
+ @Before
+ public void before() {
+ TestServer.getInstance();
+ }
+
+ @Test
+ public void testInitialize() {
+ try {
+ TestServer.getInstance();
+ MaterialTags.SHULKER_BOXES.getValues();
+ assert true;
+ } catch (Throwable e) {
@@ -1078,6 +1125,32 @@ index 0000000000000000000000000000000000000000..328c51471dc12e81c1a1b643455337b3
+ assert false;
+ }
+ }
+
+ @Test
+ public void testLocked() {
+ testLocked(MaterialTags.class);
+ testLocked(EntityTags.class);
+ }
+
+ private static void testLocked(Class<?> clazz) {
+ for (BaseTag<?, ?> tag : collectTags(clazz)) {
+ assertTrue("Tag " + tag.key() + " is not locked", tag.isLocked());
+ }
+ }
+
+ private static Set<BaseTag<?, ?>> collectTags(Class<?> clazz) {
+ Set<BaseTag<?, ?>> tags = new HashSet<>();
+ try {
+ for (Field field : clazz.getDeclaredFields()) {
+ if (Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers()) && BaseTag.class.isAssignableFrom(field.getType())) {
+ tags.add((BaseTag<?, ?>) field.get(null));
+ }
+ }
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return tags;
+ }
+}
diff --git a/src/test/java/io/papermc/paper/EntityTagsTest.java b/src/test/java/io/papermc/paper/EntityTagsTest.java
new file mode 100644
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sun related API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index a0a4d0f143303bd449494ec1479db1e449836595..614c04c31c95e9a404b5caac3e07285ce2c58367 100644
index 04583189f7ed9a446ed649780e2b99cb5e1ab3ad..f36eb8896ee84c1d3bbce17b11ed05c5f99f2e29 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1789,6 +1789,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -1793,6 +1793,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
public void setFullTime(long time);
@@ -221,10 +221,10 @@ index 0000000000000000000000000000000000000000..abeb24fccda2acfdb0dfdadacb8fe688
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Turtle.java b/src/main/java/org/bukkit/entity/Turtle.java
index 0a4cd29930c2f1c28f5a3e6884c7dec45b5cac11..5375ea14097f4f10b2294488b92924a35a72d4d7 100644
index 0a4cd29930c2f1c28f5a3e6884c7dec45b5cac11..8bee07c81172e189fab9b82b398983f509099474 100644
--- a/src/main/java/org/bukkit/entity/Turtle.java
+++ b/src/main/java/org/bukkit/entity/Turtle.java
@@ -1,6 +1,55 @@
@@ -1,6 +1,62 @@
package org.bukkit.entity;
+import org.bukkit.Location;
@@ -279,5 +279,12 @@ index 0a4cd29930c2f1c28f5a3e6884c7dec45b5cac11..5375ea14097f4f10b2294488b92924a3
+ * @param hasEgg True if carrying egg
+ */
+ void setHasEgg(boolean hasEgg);
+
+ /**
+ * Returns whether the turtle is currently laying an egg.
+ *
+ * @return whether the turtle is laying an egg
+ */
+ boolean isLayingEgg();
+ // Paper end
+}
-42
View File
@@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 12 Oct 2018 01:37:16 -0500
Subject: [PATCH] Here's Johnny!
diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java
index b8ea68a8f420c1ba99c0621a15e654d3ee48c8d6..c5d9e76a6a4125eb0409967a57e3836b8f2d24a0 100644
--- a/src/main/java/org/bukkit/entity/Vindicator.java
+++ b/src/main/java/org/bukkit/entity/Vindicator.java
@@ -3,4 +3,30 @@ package org.bukkit.entity;
/**
* Represents a Vindicator.
*/
-public interface Vindicator extends Illager { }
+public interface Vindicator extends Illager {
+ // Paper start
+ /**
+ * Check if this Vindicator is set to Johnny mode.
+ * <p>
+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except
+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile
+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and
+ * magma cubes, will try to attack the vindicator in return.
+ *
+ * @return True if in Johnny mode
+ */
+ boolean isJohnny();
+
+ /**
+ * Set this Vindicator's Johnny mode.
+ * <p>
+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except
+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile
+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and
+ * magma cubes, will try to attack the vindicator in return.
+ *
+ * @param johnny True to enable Johnny mode
+ */
+ void setJohnny(boolean johnny);
+ // Paper end
+}
@@ -5,10 +5,10 @@ Subject: [PATCH] Make the default permission message configurable
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 23960534cbb83cfca08ccc1e37bc7a713728b791..53a361b2f6d8d8e79f215e64d3b42fcbe54b0d81 100644
index 098a09baa481f76e63991268d3dfabc413626fcf..ca6f3a18ca8902b99c1c8c21b6da5def7fdb2aa8 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1990,6 +1990,15 @@ public final class Bukkit {
@@ -2113,6 +2113,15 @@ public final class Bukkit {
return server.suggestPlayerNamesWhenNullTabCompletions();
}
@@ -22,13 +22,13 @@ index 23960534cbb83cfca08ccc1e37bc7a713728b791..53a361b2f6d8d8e79f215e64d3b42fcb
+ }
+
/**
* Creates a PlayerProfile for the specified uuid, with name as null
* @param uuid UUID to create profile for
* Creates a PlayerProfile for the specified uuid, with name as null.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index f7320c0797f31cc9609a6764d886bdb6dbd082af..963edbb1e7d47410b7474b8e0ce6774a76ea9d88 100644
index 2642be263b4201ce572386bbaf3434b5af836e8d..28be40d6844f801c26e8359e509afc5e3dedd71f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1745,6 +1745,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1857,6 +1857,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean suggestPlayerNamesWhenNullTabCompletions();
@@ -40,8 +40,8 @@ index f7320c0797f31cc9609a6764d886bdb6dbd082af..963edbb1e7d47410b7474b8e0ce6774a
+ String getPermissionMessage();
+
/**
* Creates a PlayerProfile for the specified uuid, with name as null
* @param uuid UUID to create profile for
* Creates a PlayerProfile for the specified uuid, with name as null.
*
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index b1152f4dede61383232cc6713d448840612eac13..95847fcb1ac2e430ee192f4f7ac94e981151c5db 100644
--- a/src/main/java/org/bukkit/command/Command.java
@@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose.
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index 6cf05fed701c67a2c797a4e0839c795802a238a1..3afd5f5c0208a4ee93b5dbfc2aab2b9d2e8a7544 100644
index 9d774a10b9543e9293cb10ee9d7c9adebbfef34c..23e853bae0e051cd43deb9eb24c54e74a56d8ab0 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -147,7 +147,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -160,7 +160,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* UTC.
*
* @return Date of last log-in for this player, or 0
@@ -29,7 +29,7 @@ index 6cf05fed701c67a2c797a4e0839c795802a238a1..3afd5f5c0208a4ee93b5dbfc2aab2b9d
public long getLastPlayed();
/**
@@ -165,6 +167,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -178,6 +180,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
*/
@Nullable
public Location getBedSpawnLocation();
@@ -10,10 +10,10 @@ persistenting Living Entity, SPAWNER for spawners,
or DEFAULT since data was not stored.
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 23a3bf005a21cd417f9b2d8ecd64c2887d1e979e..4ed3486e8ef097837cf6762b618e08fa9ff166a5 100644
index 7a05615ec7678338801bcae2ec9a029b13d323d2..634f3b5dd22bf439aaec7c3ecfb3477b66e994e8 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -719,5 +719,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -727,5 +727,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
// TODO remove impl here
return getLocation().getChunk();
}
Loaded 100 of 1257 files, more files were not shown because too many files have changed in this diff. Show more