* Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft/Origami)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
b94a99b03 Updated Upstream (CraftBukkit) (#5762)
f5cb169e0 [Auto] Updated Upstream (CraftBukkit)
407ad043c Add ElderGuardianAppearanceEvent (#5394)
a04ad7bfb Fix invulnerable end crystals: MC-108513 (#5734)
c894e8bbb Fix issue with soft despawn distance (#5755)
302e5101a Add BellRevealRaiderEvent (#5729)
34e6b2dc3 editMeta: tighten contract via docs (#5714)
db2d501ba Do not print spawn loaded chunks
86ffde038 Add getHandRaised to LivingEntity (#5752)
9072c349a Fix broadcast event and add Adventure broadcast (#5477)

Tuinity Changes:
f7c4249 Fix dangerous end portal logic
3eda860 Updated Upstream (Paper)

Airplane Changes:
3e07ea8 Patch container checks for WildChests compat
d04adc9 Updated Upstream (Tuinity)
489bb76 Update gradle
0d5670e Merge pull request #24 from HexedHero/spelling-mistake-lightning
c605be6 Fix typo

Purpur Changes:
d2204a3d Updated Upstream (Paper, Tuinity & Airplane)
2b35782c Fix #364 - isCritical always false
6ab78311 Fix empty shulker boxes disappearing when broken
afaf8b4f Updated Upstream (Paper)
b97feb78 [ci-skip] readme
eb77666a Updated Upstream (Paper)

Empirecraft Changes:
105217a9 Move more files out of nms package
548a13f4 Move some server patches out nms package
f24d7b4c Updated Paper
99745711 Updated Paper
deb9886e Add a fix for piglins picking up too much - SPIGOT-6482
8c662d78 Add javadoc description to reload api
1af9bbc8 Adjust comments on vehicle event patch
2aa479b8 cleanup ItemStack isSimilar api patches
f344cb62 Updated Paper
dbb49189 Re-add EMC User API
a6c40eb2 Updated Paper
a57940b2 Remove EMC specific User API patches

Origami Changes:
d0cdf96 Fix issues with disabling the chunk loading of the feature search
529f5b6 Fix creature type despawn distances not applying
1af8601 Fix Endermen being able to load chunks on teleport

* Updated Upstream and Sidestream(s) (Airplane/Purpur)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Airplane Changes:
8c50125 Switch bitset to long storage
617dfe2 Patch Paper to use fast item merge raytracing
16104e8 Updated Upstream (Tuinity)

Purpur Changes:
5824eb8f Beacon Activation Range Configurable (#372)
baa20a6b Config MobEffect by world (#369)
ff09f9e6 Updated Upstream (Tuinity & Airplane)

* Updated Upstream and Sidestream(s) (Paper/Purpur/Empirecraft)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
f89be1281 [CI-SKIP] Fixup patch header
acbb69e67 Restore vanilla water animal limit
ea381dde3 Reset villager inventory on cancelled pickup event (again) (#5766) (Fixes #5765)

Purpur Changes:
6fe21994 Updated Upstream (Paper)

Empirecraft Changes:
0e568e7c Updated Paper
bbd2a014 Fire FurnaceExtractEvent more often for null players

* Updated Upstream and Sidestream(s) (Paper)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
5d05da257 Use original user input instead of legacy event result for AbstractChatEvent#originalMessage (#5770)

* remove Purpur

* Updated Upstream and Sidestream(s) (Paper)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
af1a50993 [Auto] Updated Upstream (CraftBukkit)

* Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Empirecraft/Origami)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
0daded2f2 Add more line of sight methods (#5749)
8fd4e70db Improve seed based feature search to not load chunk (#5760)
7ad8498c3 Make item validations configurable (#5775)
3673d6758 Fix Cannot be adventure component serialized when the legacy component is null (#5754)
afb0748a2 [Auto] Updated Upstream (Bukkit)
7d751ad8d Fix dangerous end portal logic (#5776)
12716324d Do not tick Chunk TickS for every chunk

Tuinity Changes:
2683c77 Use area map for nearby players in mob spawning (#283)

Airplane Changes:
2be99de Toggle for DEAR
3485304 Updated Upstream (Tuinity)

Empirecraft Changes:
33438474 Refine FurnaceExtractEvent patch

Origami Changes:
35c6a27 Re-add removed patch for MC-2025
a19a185 Fix missing particles

* Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Empirecraft)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
c64958508 fix: wrong return in javadocs for bookmeta (#5579)
3dbb8926e Fix PotionSplashEvent for water splash potions (#5697)
b759d006e Adds per-world spawn limits (#4837)
81de619d3 Updated Upstream (CraftBukkit) (#5786)
5e3604f1b Better fix for invulnerable crystals and improve Origin API (#5761)
d5fe9c817 Updated Upstream (CraftBukkit) (#5784)
d20e5b195 Fix timings sometimes incorrectly marking commands (#5783)

Tuinity Changes:
df76b3c Updated Upstream (Paper)

Airplane Changes:
a13c511 Simple item block collision toggle
3cd9d1c Updated Upstream (Tuinity)

Empirecraft Changes:
c7ef1a7a Updated Paper

* Updated Upstream and Sidestream(s) (Tuinity/Airplane/Origami)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Tuinity Changes:
f32fe9a Updated Upstream (Paper)

Airplane Changes:
125aff7 Updated Upstream (Tuinity)

Origami Changes:
756162f Update Paper
2f9721c Update snakeyaml and enable comment loading/saving

* fix

* fix

* Updated Upstream and Sidestream(s) (Tuinity)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Tuinity Changes:
901ac35 Optimise BlockSoil nearby water lookup

* Updated Upstream and Sidestream(s) (Paper/Empirecraft)

Upstream/An Sidestream has released updates that appears to apply and compile correctly
This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing.

Paper Changes:
e04368045 Updated Upstream (Bukkit/CraftBukkit) (#5794)

Empirecraft Changes:
e187791e Updated Paper
This commit is contained in:
Simon Gardling 2021-06-14 14:31:04 -04:00 committed by GitHub
parent 6ade716a40
commit 6bf2b9226a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
406 changed files with 1225 additions and 36130 deletions

5
.gitmodules vendored
View File

@ -7,11 +7,6 @@
url = https://github.com/Spottedleaf/Tuinity
branch = master
[submodule "upstream/Purpur"]
path = upstream/Purpur
url = https://github.com/pl3xgaming/Purpur.git
branch = ver/1.16.5
[submodule "upstream/Airplane"]
path = upstream/Airplane
url = https://github.com/Technove/Airplane.git

View File

@ -8,182 +8,52 @@ This is an overview of all the patches that are currently used.
| Side | Patch | Author | CoAuthors |
| ----- | ------------- |:-------------:| -----:|
| api | AFK API | William Blake Galbreath | |
| server | AFK API | William Blake Galbreath | |
| api | API for any mob to burn daylight | Ben Kerllenevich | |
| server | API for any mob to burn daylight | Ben Kerllenevich | |
| server | Ability to re-add farmland mechanics from Alpha | Yive | |
| server | Actually unload POI data | Spottedleaf | |
| server | Add /ping command | William Blake Galbreath | |
| server | Add 5 second tps average in /tps | William Blake Galbreath | |
| api | Add EntityTeleportHinderedEvent | Mariell Hoversholm | |
| server | Add EntityTeleportHinderedEvent | Mariell Hoversholm | |
| api | Add GameProfileLookupEvent | tr7zw | |
| server | Add GameProfileLookupEvent | tr7zw | |
| server | Add IntelliJ IDEA runnable | Zoe | |
| server | Add MC-4 fix back | BillyGalbreath | |
| api | Add NBT API as a first-class lib | tr7zw | |
| server | Add NBT API as a first-class lib | tr7zw | |
| api | Add StructureGenerateEvent | Nahuel | Mariell Hoversholm |
| server | Add StructureGenerateEvent | Nahuel | Mariell Hoversholm |
| server | Add Velocity natives for encryption and compression | Andrew Steinborn | |
| server | Add adjustable breeding cooldown to config | montlikadani | |
| server | Add allow water in end world option | William Blake Galbreath | |
| server | Add boat fall damage config | BillyGalbreath | |
| server | Add canSaveToDisk to Entity | William Blake Galbreath | |
| server | Add config change multiplier critical damage value | DoctaEnkoda | |
| server | Add config for allowing Endermen to despawn even while | jmp | |
| server | Add config for snow on blue ice | BillyGalbreath | |
| server | Add config for villager trading | Ben Kerllenevich | |
| server | Add configurable snowball damage | BillyGalbreath | |
| server | Add credits command | Encode42 | |
| api | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | |
| server | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | |
| server | Add demo command | BillyGalbreath | |
| api | Add enchantment target for bows and crossbows | BillyGalbreath | |
| server | Add enderman and creeper griefing controls | William Blake Galbreath | |
| server | Add ghast allow-griefing option | BillyGalbreath | |
| api | Add last tick time API | Ivan Pekov | tr7zw |
| server | Add last tick time API | Ivan Pekov | tr7zw |
| server | Add mobGriefing bypass to everything affected | Encode42 | |
| server | Add no-random-tick block list | William Blake Galbreath | |
| server | Add nspt command | Ivan Pekov | |
| server | Add obfhelpers for plugin use | William Blake Galbreath | |
| server | Add option for boats to eject players on land | William Blake Galbreath | |
| server | Add option to allow loyalty on tridents to work in the void | William Blake Galbreath | |
| server | Add option to disable dolphin treasure searching | William Blake Galbreath | |
| server | Add option to disable mushroom and note block updates | William Blake Galbreath | |
| server | Add option to disable observer clocks | Phoenix616 | |
| api | Add option to disable zombie aggressiveness towards villagers | nitricspace | |
| server | Add option to disable zombie aggressiveness towards villagers | nitricspace | |
| server | Add option to set armorstand step height | William Blake Galbreath | |
| server | Add option to teleport to spawn if outside world border | William Blake Galbreath | |
| server | Add packet limiter config | Spottedleaf | |
| server | Add permission for F3+N debug | William Blake Galbreath | |
| server | Add phantom spawning options | William Blake Galbreath | |
| server | Add player death exp control options | William Blake Galbreath | |
| api | Add predicate to recipe's ExactChoice ingredient | William Blake Galbreath | |
| server | Add predicate to recipe's ExactChoice ingredient | William Blake Galbreath | |
| server | Add soft async catcher | Spottedleaf | |
| server | Add tablist suffix option for afk | montlikadani | |
| server | Add timings for Behavior | Phoenix616 | |
| server | Add timings for Pathfinder | MrIvanPlays | |
| server | Add twisting and weeping vines growth rates | BillyGalbreath | |
| api | Add unsafe Entity serialization API | Mariell Hoversholm | |
| server | Add unsafe Entity serialization API | Mariell Hoversholm | |
| server | Add vindicator johnny spawn chance | William Blake Galbreath | |
| server | Add wither skeleton takes wither damage option | William Blake Galbreath | |
| api | Advancement API | William Blake Galbreath | |
| server | Advancement API | William Blake Galbreath | |
| server | Airplane Branding Changes | Paul Sauve | |
| server | Airplane Configuration | Paul Sauve | |
| server | Airplane MC Dev Fixes | Paul Sauve | |
| server | Airplane Profiler | Paul Sauve | |
| server | Allow Entities to be removed from a world while ticking | Spottedleaf | |
| server | Allow anvil colors | William Blake Galbreath | |
| server | Allow color codes in books | William Blake Galbreath | |
| server | Allow controlled flushing for network manager | Spottedleaf | |
| server | Allow infinite and mending enchantments together | William Blake Galbreath | |
| server | Allow infinity on crossbows | Ben Kerllenevich | |
| api | Allow inventory resizing | William Blake Galbreath | |
| server | Allow leashing villagers | William Blake Galbreath | |
| server | Allow soil to moisten from water directly under it | William Blake Galbreath | |
| server | Allow toggling special MobSpawners per world | jmp | |
| server | Allows change broadcast message by player | DoctaEnkoda | |
| server | Allows you to change the thrust limit of a piston by World | DoctaEnkoda | |
| api | Alphabetize in-game /plugins list | BillyGalbreath | |
| server | Alternative Keepalive Handling | William Blake Galbreath | |
| api | Anvil API | William Blake Galbreath | |
| server | Anvil API | William Blake Galbreath | |
| server | Apply display names from item forms of entities to entities | jmp | |
| server | Arrows should not reset despawn counter | William Blake Galbreath | |
| server | Attempt to recalculate regionfile header if it is corrupt | Spottedleaf | |
| server | Avoid double I/O operation on load player file | ㄗㄠˋ ㄑㄧˊ | |
| server | Barrels and enderchests 6 rows | William Blake Galbreath | |
| server | Be aware of entity teleports when chunk checking entities | Spottedleaf | |
| server | Bee can work when raining or at night | DoctaEnkoda | |
| server | Better checking for useless move packets | Paul Sauve | |
| server | Brand changes | Spottedleaf | |
| server | Brandings | YatopiaMC | |
| server | Break individual slabs when sneaking | BillyGalbreath | |
| server | Breedable Polar Bears | William Blake Galbreath | |
| server | Breedable parrots | BillyGalbreath | |
| api | Bring back server name | William Blake Galbreath | |
| server | Bring back server name | William Blake Galbreath | |
| server | Cache climbing check for activation | Paul Sauve | |
| server | Cache coordinate key for micro opt | Paul Sauve | |
| server | Cache entityhuman display name | Paul Sauve | |
| server | Cache palette array | Paul Sauve | |
| server | Cat spawning options | William Blake Galbreath | |
| server | Change writes to use NORMAL priority rather than LOW | Spottedleaf | |
| server | Changeable Mob Left Handed Chance | Ben Kerllenevich | |
| server | Charged creeper naturally spawn | William Blake Galbreath | |
| api | ChatColor conveniences | William Blake Galbreath | |
| server | Chickens can retaliate | William Blake Galbreath | |
| server | Config for Enderman to aggro spawned Endermites | Encode42 | |
| server | Config for changing the blocks that turn into paths | 12emin34 | |
| server | Config for health to impact Creeper explosion radius | Encode42 | |
| server | Config for powered rail activation distance | Encode42 | |
| server | Config for skipping night | Ben Kerllenevich | |
| server | Config for unverified username message | Ben Kerllenevich | |
| server | Config for wither explosion radius | Ben Kerllenevich | |
| server | Config migration: climbing should not bypass cramming | jmp | |
| server | Config migration: disable saving projectiles to disk -> | jmp | |
| server | Config to allow Note Block sounds when blocked | Encode42 | |
| server | Config to allow for unsafe enchants | Encode42 | |
| server | Config to always tame in Creative | Encode42 | |
| server | Config to change max number of bees | DoctaEnkoda | |
| server | Config to disable Llama caravans | Encode42 | |
| server | Config to disable hostile mob spawn on ice | Encode42 | |
| server | Config to disable method profiler | Paul Sauve | |
| server | Config to ignore Dragon Head wearers and stare aggro | Encode42 | |
| server | Config to ignore nearby mobs when sleeping | Encode42 | |
| server | Config to make Creepers explode on death | Encode42 | |
| server | Config to show Armor Stand arms on spawn | Encode42 | |
| server | Config to use infinity bows without arrows | Encode42 | |
| server | Configs for if Wither/Ender Dragon can ride vehicles | jmp | |
| server | Configurable BlockPhysicsEvent | Mykyta Komarnytskyy | |
| server | Configurable Ender Pearl cooldown, damage, and Endermite RNG | Encode42 | |
| server | Configurable TPS Catchup | William Blake Galbreath | |
| server | Configurable chance for wolves to spawn rabid | Encode42 | |
| server | Configurable criterion triggers | Mykyta Komarnytskyy | |
| server | Configurable damage settings for magma blocks | Ben Kerllenevich | |
| server | Configurable daylight cycle | William Blake Galbreath | |
| server | Configurable default wolf collar color | Encode42 | |
| server | Configurable dungeon seed | William Blake Galbreath | |
| server | Configurable enchanting table tick | Ivan Pekov | |
| server | Configurable end spike seed | William Blake Galbreath | |
| server | Configurable entity base attributes | BillyGalbreath | |
| server | Configurable flight checks | l_MrBoom_l | |
| server | Configurable jockey options | William Blake Galbreath | |
| server | Configurable movement checks | l_MrBoom_l | |
| api | Configurable permission message upgrades | William Blake Galbreath | |
| server | Configurable powered rail boost modifier | Callum Seabrook | |
| server | Configurable ravager griefable blocks list | BillyGalbreath | |
| server | Configurable server mod name | William Blake Galbreath | |
| server | Configurable sponge absorption | Encode42 | |
| server | Configurable villager brain ticks | William Blake Galbreath | |
| server | Configurable villager breeding | draycia | |
| server | Configurable void damage height and damage | William Blake Galbreath | |
| api | Conflict on change for adventure deprecations | BillyGalbreath | |
| server | Consolidate flush calls for entity tracker packets | Spottedleaf | |
| server | Copy passenger list in enderTeleportTo | Spottedleaf | |
| server | Correctly handle recursion for chunkholder updates | Spottedleaf | |
| server | Cows eat mushrooms | William Blake Galbreath | |
| server | Crying obsidian valid for portal frames | William Blake Galbreath | |
| server | Custom Locale Support | Zoe | |
| server | Custom table implementation for blockstate state lookups | Spottedleaf | |
| server | Customizable wither health and healing | jmp | |
| api | Default permissions | William Blake Galbreath | |
| server | Delay chunk unloads | Spottedleaf | |
| server | Despawn rate config options per projectile type | jmp | |
| server | Detail more information in watchdog dumps | Spottedleaf | |
| server | Disable loot drops on death by cramming | William Blake Galbreath | |
| server | Disable outdated build check | William Blake Galbreath | |
| api | Disable reload command | Ivan Pekov | |
| server | Disable the Snooper | Sotr | |
| server | Dispenser curse of binding protection | William Blake Galbreath | |
| server | Dispensers place anvils option | William Blake Galbreath | |
| server | Distance manager tick timings | Spottedleaf | |
| server | Do not allow the server to unload chunks at request of | Spottedleaf | |
| server | Do not allow ticket level changes while unloading | Spottedleaf | |
@ -199,119 +69,51 @@ This is an overview of all the patches that are currently used.
| server | Don't read neighbour chunk data off disk when converting | Spottedleaf | |
| server | Don't trigger Lootable Refresh for non player interaction | Aikar | |
| server | Don't wake up entities when damage event is cancelled | Phoenix616 | |
| server | Dont run with scissors! | JustDoom | |
| server | Dont send useless entity packets | William Blake Galbreath | |
| server | Drowning Settings | Ben Kerllenevich | |
| server | Dynamic activation range | Paul Sauve | |
| server | EMC - Configurable disable give dropping | Aikar | |
| api | EMC - MonsterEggSpawnEvent | Aikar | |
| server | EMC - MonsterEggSpawnEvent | Aikar | |
| server | Early return optimization for target finding | Paul Sauve | |
| server | End crystal explosion options | Ben Kerllenevich | |
| server | End gateway should check if entity can use portal | William Blake Galbreath | |
| server | Ender dragon always drop full exp | William Blake Galbreath | |
| server | Ensure pools create daemon threads | Ivan Pekov | |
| server | Entities can use portals configuration | William Blake Galbreath | |
| server | Entities pick up loot bypass mob-griefing gamerule | William Blake Galbreath | |
| server | Entity lifespan | William Blake Galbreath | |
| server | Execute chunk tasks mid-tick | Spottedleaf | |
| api | ExecuteCommandEvent | William Blake Galbreath | |
| api | Expose findClass for profiler | Paul Sauve | |
| server | Farmland trampling changes | Mariell Hoversholm | |
| server | Fix 'outdated server' showing in ping before server fully | William Blake Galbreath | |
| server | Fix IndexOutOfBoundsException when sending too many changes | Ivan Pekov | |
| server | Fix LightEngineThreaded memory leak | Ivan Pekov | |
| server | Fix Log4j Warning | snoopdoooggyttv | |
| server | Fix NPE in pickup logic for arrow | Spottedleaf | |
| server | Fix SPIGOT-6278 | BillyGalbreath | |
| server | Fix advancement triggers on entity death | BillyGalbreath | |
| server | Fix chunks refusing to unload at low TPS | Spottedleaf | |
| server | Fix cow rotation when shearing mooshroom | William Blake Galbreath | |
| server | Fix exp drop of zombie pigmen (MC-56653) | Phoenix616 | |
| server | Fix incorrect isRealPlayer init | Spottedleaf | |
| api | Fix javadoc warnings (missing @param and @return) | BillyGalbreath | |
| server | Fix lead fall dmg config | tr7zw | |
| server | Fix rotating UP/DOWN CW and CCW | BillyGalbreath | |
| server | Fix stuck in portals | BillyGalbreath | |
| server | Fix swamp hut cat generation deadlock | Spottedleaf | |
| server | Fix the dead lagging the server | William Blake Galbreath | |
| server | Fix vanilla command permission handler | William Blake Galbreath | |
| server | Flying squids! Oh my! | William Blake Galbreath | |
| api | Full netherite armor grants fire resistance | BillyGalbreath | |
| server | Full netherite armor grants fire resistance | BillyGalbreath | |
| server | Gamemode extra permissions | BillyGalbreath | |
| server | Giants AI settings | William Blake Galbreath | |
| server | Global Eula file | tr7zw | |
| server | Heavily optimize furnance fuel and recipe lookups | tr7zw | Mykyta Komarn |
| server | Heavily optimize recipe lookups in CraftingManager | Mykyta Komarn | Ivan Pekov, ishland |
| server | Hide hidden players from entity selector | BillyGalbreath | |
| server | Highly optimise single and multi-AABB VoxelShapes and | Spottedleaf | |
| server | Highly optimize VillagePlace filtering | Ivan Pekov | |
| server | Illusioners AI settings | William Blake Galbreath | |
| server | Implement Mob Blindness | Encode42 | |
| server | Implement TPSBar | BillyGalbreath | |
| server | Implement bed explosion options | William Blake Galbreath | |
| server | Implement configurable search radius for villagers to spawn | William Blake Galbreath | |
| server | Implement elytra settings | William Blake Galbreath | |
| server | Implement infinite lava | William Blake Galbreath | |
| server | Implement respawn anchor explosion options | William Blake Galbreath | |
| server | Improve abnormal server shutdown process | Spottedleaf | |
| server | Improve async tp to not load chunks when crossing worlds | Spottedleaf | |
| server | Improve container checking with a bitset | Paul Sauve | |
| server | Improve fluid direction caching | Paul Sauve | |
| server | Improve paper prevent moving into unloaded chunk check | Spottedleaf | |
| server | Infinite fuel furnace | William Blake Galbreath | |
| server | Infinity bow settings | William Blake Galbreath | |
| api | Iron golem poppy calms anger | BillyGalbreath | |
| server | Iron golem poppy calms anger | BillyGalbreath | |
| api | Item entity immunities | William Blake Galbreath | |
| server | Item entity immunities | William Blake Galbreath | |
| server | Item stuck sleep config | tr7zw | |
| api | ItemFactory#getMonsterEgg | William Blake Galbreath | |
| server | ItemFactory#getMonsterEgg | William Blake Galbreath | |
| api | ItemStack convenience methods | William Blake Galbreath | |
| server | Kelp weeping and twisting vines configurable max growth age | BillyGalbreath | |
| server | Lag compensate block breaking | Spottedleaf | |
| api | Lagging threshold | William Blake Galbreath | |
| server | Lagging threshold | William Blake Galbreath | |
| api | Left handed API | BillyGalbreath | |
| server | Left handed API | BillyGalbreath | |
| server | Lithium: CompactSineLUT | JellySquid | |
| api | LivingEntity safeFallDistance | William Blake Galbreath | |
| server | LivingEntity safeFallDistance | William Blake Galbreath | |
| api | LivingEntity#broadcastItemBreak | William Blake Galbreath | |
| server | LivingEntity#broadcastItemBreak | William Blake Galbreath | |
| api | Llama API | William Blake Galbreath | |
| server | Llama API | William Blake Galbreath | |
| server | Lobotomize stuck villagers | BillyGalbreath | |
| server | Logger settings (suppressing pointless logs) | William Blake Galbreath | |
| server | MC-147659 - Fix non black cats spawning in swamp huts | William Blake Galbreath | |
| server | MC-168772 Fix - Add turtle egg block options | William Blake Galbreath | |
| server | MC-Dev fixes | Spottedleaf | |
| server | Make CallbackExecutor strict again | Spottedleaf | |
| server | Make Iron Golems Swim | William Blake Galbreath | |
| server | Make VoxelShapeCollisionEntity lazier | Paul Sauve | |
| server | Make anvil cumulative cost configurable | 12emin34 | |
| server | Make entity breeding times configurable | jmp | |
| server | Make entity tracker use highest range of passengers | Spottedleaf | |
| server | Make lava flow speed configurable | William Blake Galbreath | |
| server | Make sure inlined getChunkAt has inlined logic for loaded | Spottedleaf | |
| server | Manually inline methods in BlockPosition | Spottedleaf | |
| server | Mending mends most damages equipment first | William Blake Galbreath | |
| server | Minecart settings and WASD controls | William Blake Galbreath | |
| api | Modify POM | YatopiaMC | |
| server | Modify POM | YatopiaMC | |
| server | Modify default configs | tr7zw | |
| server | More debug for plugins not shutting down tasks | Paul Sauve | |
| server | Movement options for armor stands | Mariell Hoversholm | |
| server | Multi-Threaded Server Ticking Vanilla | Spottedleaf | |
| server | Multi-Threaded ticking CraftBukkit | Spottedleaf | |
| server | Name craft scheduler threads according to the plugin using | Spottedleaf | |
| server | New nbt cache | Hugo Planque | ishland |
| server | Nuke streams off BlockPosition | Ivan Pekov | |
| server | Nuke streams off SectionPosition | Ivan Pekov | |
| server | One Punch Man! | Fourmisain | |
| server | Oprimise map impl for tracked players | Spottedleaf | |
| server | Optimise BlockSoil nearby water lookup | Spottedleaf | |
| server | Optimise WorldServer#notify | Spottedleaf | |
| server | Optimise chunk tick iteration | Spottedleaf | |
| server | Optimise closest entity lookup | Spottedleaf | |
@ -327,58 +129,31 @@ This is an overview of all the patches that are currently used.
| server | Optimize TileEntity load/unload | tr7zw | |
| server | Optimize Villagers | Ivan Pekov | |
| server | Optimize advancement loading | Ivan Pekov | |
| server | Optimize collisions | DoctaEnkoda | |
| server | Optimize inventory API item handling | Phoenix616 | |
| server | Optimize random calls in chunk ticking | Paul Sauve | |
| server | Optimize redundant calls | Paul Sauve | |
| server | Optimize some stuff in WorldServer ticking | MrIvanPlays | |
| server | Optimize whitelist command for multiple additions / removals | Ivan Pekov | |
| server | Option for Villager Clerics to farm Nether Wart | jmp | |
| server | Option for chests to open even with a solid block on top | jmp | |
| server | Option for simpler Villagers | tr7zw | |
| server | Option to disable dragon egg teleporting | BillyGalbreath | |
| server | Option to make doors require redstone | BillyGalbreath | |
| server | Option to toggle milk curing bad omen | William Blake Galbreath | |
| server | Origami - Fix ProtocolLib issues on Java 15 | Phoenix616 | |
| server | Origami Server Config | Phoenix616 | |
| server | PaperPR - Config option for Piglins guarding chests | jmp | |
| server | Patch Paper to use fast item merge raytracing | Paul Sauve | |
| server | Per World Spawn Limits | Chase Whipple | |
| server | Per entity (type) collision settings | MrIvanPlays | tr7zw |
| api | Per player viewdistances | Spottedleaf | |
| server | Persistent TileEntity Lore and DisplayName | jmp | |
| server | Phantom flames on swoop | BillyGalbreath | |
| api | Phantoms attracted to crystals and crystals shoot phantoms | William Blake Galbreath | |
| server | Phantoms attracted to crystals and crystals shoot phantoms | William Blake Galbreath | |
| server | Phantoms burn in light | draycia | |
| server | Piglin portal spawn modifier | BillyGalbreath | |
| server | Pigs give saddle back | William Blake Galbreath | |
| api | Player invulnerabilities | William Blake Galbreath | |
| server | Player invulnerabilities | William Blake Galbreath | |
| api | PlayerAttackEntityEvent | Ivan Pekov | |
| server | PlayerAttackEntityEvent | Ivan Pekov | |
| api | PlayerSetSpawnerTypeWithEggEvent | William Blake Galbreath | |
| server | PlayerSetSpawnerTypeWithEggEvent | William Blake Galbreath | |
| server | Players should not cram to death | William Blake Galbreath | |
| server | Populator seed controls | Spottedleaf | |
| server | Port Cadmium | Lucy-t | |
| server | Preload ProtocolLib EnumWrappers | ishland | |
| server | Prevent long map entry creation in light engine | Spottedleaf | |
| server | Prevent unload() calls removing tickets for sync loads | Spottedleaf | |
| server | Projectile offset config | YouHaveTrouble | |
| api | Purpur config files | William Blake Galbreath | |
| server | Purpur config files | William Blake Galbreath | |
| server | Rabbit naturally spawn toast and killer | William Blake Galbreath | |
| api | Rabid Wolf API | Encode42 | |
| server | Raid cooldown setting | jmp | |
| server | Range check flag dirty calls in PlayerChunk | Spottedleaf | |
| server | Rebrand | William Blake Galbreath | |
| server | Redirect Configs | tr7zw | |
| server | Redstone deactivates spawners | draycia | |
| server | Reduce allocation rate from crammed entities | Spottedleaf | |
| server | Reduce allocs & improve perf of StructureManager | Paul Sauve | |
| server | Reduce chunk loading & lookups | Paul Sauve | |
| server | Reduce frequency of checking for entity despawn | Paul Sauve | |
| server | Reduce iterator allocation from chunk gen | Spottedleaf | |
| server | Reduce memory allocations | Paul Sauve | |
| server | Reduce pathfinder branches | Spottedleaf | |
| server | Reduce projectile chunk loading | Paul Sauve | |
| server | Remove chunk lookup & lambda allocation from counting mobs | Spottedleaf | |
@ -392,67 +167,38 @@ This is an overview of all the patches that are currently used.
| server | Revert getChunkAt(Async) retaining chunks for long periods of | Spottedleaf | |
| server | Rework PlayerChunk main thread checks | Spottedleaf | |
| server | Rewrite the light engine | Spottedleaf | |
| api | Ridables | William Blake Galbreath | |
| server | Ridables | William Blake Galbreath | |
| server | Send full pos packets for hard colliding entities | Spottedleaf | |
| server | Separate lookup locking from state access in UserCache | Spottedleaf | |
| server | Set name visible when using a Name Tag on an Armor Stand | jmp | |
| server | Short enderman height | William Blake Galbreath | |
| server | ShulkerBox allow oversized stacks | BillyGalbreath | |
| server | Shutdown Bootstrap thread pool | foss-mc | |
| server | Signs allow color codes | William Blake Galbreath | |
| server | Signs editable on right click | William Blake Galbreath | |
| server | Silk touch spawners | William Blake Galbreath | |
| server | Simple item block collision toggle | Paul Sauve | |
| server | Simpler ShapelessRecipes comparison for Vanilla | Paul Sauve | |
| server | Skip POI finding if stuck in vehicle | Paul Sauve | |
| server | Skip copying unloading tile entities | Paul Sauve | |
| server | Skip creating hashset for entity track range | Paul Sauve | |
| server | Skip events if there's no listeners | William Blake Galbreath | |
| server | Smarter statistics ticking | Mykyta Komarnytskyy | |
| server | Smol entity optimisations | Ivan Pekov | |
| server | Sneak to bulk process composter | BillyGalbreath | |
| server | Snow Golem rate of fire config | Simon Gardling | |
| server | Snowman drop and put back pumpkin | William Blake Galbreath | |
| api | Spigot - Improve output of plugins command | Parker Hawke | |
| server | Spread out and optimise player list ticks | James Lyne | |
| server | Squid EAR immunity | William Blake Galbreath | |
| server | Stonecutter damage | William Blake Galbreath | |
| server | Stop large move vectors in player packet handling from | Spottedleaf | |
| server | Stop squids floating on top of water | William Blake Galbreath | |
| server | Stop wasting resources on JsonList#get | Ivan Pekov | |
| server | Striders give saddle back | Ben Kerllenevich | |
| server | Strip raytracing for EntityLiving#hasLineOfSight | Paul Sauve | |
| api | Suspected plugins report | ishland | |
| server | Suspected plugins report | ishland | |
| server | Swap priority of checks in chunk ticking | Paul Sauve | |
| server | Swaps the predicate order of collision | ㄗㄠˋ ㄑㄧˊ | |
| server | Tick fluids config | BillyGalbreath | |
| server | Time scoreboard search | Spottedleaf | |
| server | Timings stuff | William Blake Galbreath | |
| server | Toggle for Zombified Piglin death always counting as player | jmp | |
| server | Toggle for water sensitive mob damage | YouHaveTrouble | |
| server | Totems work in inventory | draycia | |
| api | Tuinity POM Changes | Spottedleaf | |
| server | Tuinity POM Changes | Spottedleaf | |
| server | Tuinity Server Config | Spottedleaf | |
| api | Tuinity config | Spottedleaf | |
| server | Tulips change fox type | William Blake Galbreath | |
| server | Update version fetcher repo | JRoy | |
| server | Use array for gamerule storage | Paul Sauve | |
| server | Use configured height for nether surface builders | William Blake Galbreath | |
| server | Use hash table for maintaing changed block set | Spottedleaf | |
| server | Use list for fast iteration over pathfinder goals | Paul Sauve | |
| server | Use raw iterator where possible | Paul Sauve | |
| server | Use unmodifiableMap instead of making copy | Paul Sauve | |
| server | Util patch | Spottedleaf | |
| server | Utilities | YatopiaMC | Mykyta Komarnytskyy, Ivan Pekov |
| api | Villager#resetOffers | William Blake Galbreath | |
| server | Villagers farming can bypass mob-griefing gamerule | William Blake Galbreath | |
| server | Villagers follow emerald blocks | William Blake Galbreath | |
| api | Yatopia Config & Redirect Config | YatopiaMC | |
| server | Yatopia configuration | tr7zw | |
| server | Zombie break door minimum difficulty option | BillyGalbreath | |
| server | Zombie horse naturally spawn | William Blake Galbreath | |
| server | add config for logging login location | Simon Gardling | |
| server | dont load chunks for physics | Aikar | |
| server | lithium DataTrackerMixin | JellySquid | tr7zw |

2
Paper

@ -1 +1 @@
Subproject commit 525d0e3d3752fa78e7c136a4d4bf13c3278691d9
Subproject commit e04368045e2fe8e53a7b686e9bfb7c41766267be

View File

@ -16,7 +16,6 @@ Yatopia combines the code from many [Paper](https://github.com/PaperMC/Paper) fo
* [EMC](https://github.com/starlis/empirecraft)
* [Lithium](https://github.com/jellysquid3/lithium-fabric)
* [Origami](https://github.com/Minebench/Origami)
* [Purpur](https://github.com/pl3xgaming/Purpur)
* [Airplane](https://github.com/Technove/Airplane)
* [Cadmium](https://github.com/LucilleTea/cadmium-fabric)
* [Tic-Tacs](https://github.com/Gegy/tic-tacs)

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Expose findClass for profiler
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 81da90531cc3a7ab13d455860f89411081825949..6ced06643cd9740e2c62bc8f10d150a2f9a92e31 100644
index d2fa792e182736070a119e96b4ae79337de53d2a..4b484d5c2a605188f55ea8cdc0c2839ee6d850ff 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -114,6 +114,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot

View File

@ -1,112 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
Date: Wed, 3 Feb 2021 21:36:16 -0600
Subject: [PATCH] Airplane Branding Changes
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/pom.xml b/pom.xml
index 642ee96ead8176f5c5a811946b050f4fa5dab6e2..6dc6469928051a2a38e8eba43aa237b0f21a502f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,8 +39,8 @@
<dependencies>
<dependency>
- <groupId>com.tuinity</groupId>
- <artifactId>tuinity-api</artifactId>
+ <groupId>gg.airplane</groupId>
+ <artifactId>airplane-api</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..b480bd3044370b8eb733166f0c4b737344475993 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Tuinity", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page
+ Metrics metrics = new Metrics("Airplane", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -603,7 +603,7 @@ public class Metrics {
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() || PaperConfig.isProxyOnlineMode() ? "online" : "offline"));
- metrics.addCustomChart(new Metrics.SimplePie("tuinity_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page
+ metrics.addCustomChart(new Metrics.SimplePie("airplane_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index d50b61876f15d95b836b3dd81d9c3492c91a8448..5460f57f0473868b3fb09c526a1767f717a2740e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -29,8 +29,8 @@ public class PaperVersionFetcher implements VersionFetcher {
@Nonnull
@Override
public Component getVersionMessage(@Nonnull String serverVersion) {
- String[] parts = serverVersion.substring("git-Tuinity-".length()).split("[-\\s]"); // Tuinity
- final Component updateMessage = getUpdateStatusMessage("Spottedleaf/Tuinity", GITHUB_BRANCH_NAME, parts[0]); // Tuinity
+ String[] parts = serverVersion.substring("git-Airplane-".length()).split("[-\\s]"); // Tuinity
+ final Component updateMessage = getUpdateStatusMessage("TECHNOVE/Airplane", GITHUB_BRANCH_NAME, parts[0]); // Tuinity
final Component history = getHistory();
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 264ed751002b3f52294d00d3135503dabc639a13..b2ae9d92dd2c93304a282b08099dfb1acd72ef4f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1650,7 +1650,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
public String getServerModName() {
- return "Tuinity"; // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "Airplane"; // Airplane // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}
public CrashReport b(CrashReport crashreport) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 0e9819a7da160e7a5f28734c4dd3b673c8881792..4d0a9c89ca6838907b25ac4b2b1a849844efa7ec 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -230,7 +230,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
- private final String serverName = "Tuinity"; // Paper // Tuinity
+ private final String serverName = "Airplane"; // Paper // Tuinity // Airplane
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 001b1e5197eaa51bfff9031aa6c69876c9a47960..1788d79ea489e446d3d9f541693d4ba3dfc26015 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ public final class Versioning {
public static String getBukkitVersion() {
String result = "Unknown-Version";
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.tuinity/tuinity-api/pom.properties"); // Tuinity
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane
Properties properties = new Properties();
if (stream != null) {

View File

@ -22,7 +22,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/pom.xml b/pom.xml
index 6dc6469928051a2a38e8eba43aa237b0f21a502f..65c8a649cb0e4d2d8d1b1c21ec30405f60539b9f 100644
index 642ee96ead8176f5c5a811946b050f4fa5dab6e2..9cac82f2655c55b7374c7b23b1c65cb9958627e2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -193,6 +193,13 @@

View File

@ -55,7 +55,7 @@ index cc566784c7dd21cc2c44e0f351347f657e57ddcf..e9e7fcf2b63febe2a7d055826fabb86b
return d0 == 0.0D ? 0 : (d0 > 0.0D ? 1 : -1);
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index 33f689b1c9f4c00969fbdd8ddb21901637afb81c..785c210414ca11584bc51087616845f0d5badc91 100644
index 2ff3297fb8c0e4f8c969ba2727eecb7fe06525c4..56812a96b57586d91c0f218f4720807e2d957627 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -111,6 +111,7 @@ import net.minecraft.world.phys.AxisAlignedBB;
@ -66,12 +66,15 @@ index 33f689b1c9f4c00969fbdd8ddb21901637afb81c..785c210414ca11584bc51087616845f0
import net.minecraft.world.scores.ScoreboardTeam;
import org.apache.logging.log4j.Logger;
@@ -3101,7 +3102,7 @@ public abstract class EntityLiving extends Entity {
Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ());
@@ -3102,7 +3103,10 @@ public abstract class EntityLiving extends Entity {
Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ());
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
- return this.world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
+ return this.world.rayTraceDirect(vec3d, vec3d1, VoxelShapeCollision.a(this)) == MovingObjectPosition.EnumMovingObjectType.MISS; // Airplane - use direct method
+ // Airplane start - use direct method
+ //return this.world.rayTrace(new RayTrace(vec3d, vec3d1, RayTrace.BlockCollisionOption.COLLIDER, RayTrace.FluidCollisionOption.NONE, this)).getType() == MovingObjectPosition.EnumMovingObjectType.MISS;
+ return this.world.rayTraceDirect(vec3d, vec3d1, VoxelShapeCollision.a(this)) == MovingObjectPosition.EnumMovingObjectType.MISS;
+ // Airplane end
}
@Override
@ -109,7 +112,7 @@ index e612e1d30f76e217b1aa23488ab025adce048f57..6109d59c02d0c7877e213213c6aec6f8
default MovingObjectPositionBlock rayTraceBlock(RayTrace raytrace1, BlockPosition blockposition) {
// Paper start - Prevent raytrace from loading chunks
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 276b1f0c9c9af7db31fba9be0593ae9def540caf..6ab528223682d57bec1cdbd383acd8ab06904e4a 100644
index cb8064df7e9f1b8b4d4292486e2193680d83663c..37da32675f0c00c793cd137c9a7305932cefb705 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -69,6 +69,8 @@ import net.minecraft.world.level.saveddata.maps.WorldMap;
@ -121,7 +124,7 @@ index 276b1f0c9c9af7db31fba9be0593ae9def540caf..6ab528223682d57bec1cdbd383acd8ab
import net.minecraft.world.phys.shapes.OperatorBoolean;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
@@ -387,6 +389,91 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -385,6 +387,91 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
return null;
}

View File

@ -7,7 +7,7 @@ Especially at over 30,000 chunks these random calls are fairly heavy. We
use a different method here for checking lightning, and for checking
ice.
Lighting: Each chunk now keeps an int of how many ticks until the
Lightning: Each chunk now keeps an int of how many ticks until the
lightning should strike. This int is a random number from 0 to 100000 * 2,
the multiplication is required to keep the probability the same.
@ -34,7 +34,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
index fe040615ff03478a20cdf8376f89a6b7d100ba61..207a9c3928aad7c6e89a120b54d87e003ebd232c 100644
index 1b86c032fde3409cb89b849b9ba094af82cd9269..0718b80ac82a1cf00519c30c6d2ef78fe3914c71 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -1000,6 +1000,7 @@ public class ChunkProviderServer extends IChunkProvider {

View File

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index 785c210414ca11584bc51087616845f0d5badc91..c6d551ad958711dec777902f02c9f5dadac26ff8 100644
index 56812a96b57586d91c0f218f4720807e2d957627..6b82dffa3d0938a94114ead277b42c71ea3bb52b 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -910,11 +910,13 @@ public abstract class EntityLiving extends Entity {

View File

@ -27,14 +27,14 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
index ab019b577002677a4ce788106f8e5a1d7757a2ae..0e452ea9c5d098326d22a20aa67e423f85843db7 100644
index ab019b577002677a4ce788106f8e5a1d7757a2ae..5077e70e4f408814b1072ceb45c52a322a7662d2 100644
--- a/src/main/java/gg/airplane/AirplaneConfig.java
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
@@ -47,4 +47,36 @@ public class AirplaneConfig {
@@ -47,4 +47,37 @@ public class AirplaneConfig {
}
}
+
+ public static boolean dearEnabled;
+ public static int startDistance;
+ public static int startDistanceSquared;
+ public static int maximumActivationPrio;
@ -46,6 +46,7 @@ index ab019b577002677a4ce788106f8e5a1d7757a2ae..0e452ea9c5d098326d22a20aa67e423f
+ private static void dynamicActivationRange() {
+ config.setComment("activation-range", "Optimizes how entities act when", "they're far away from the player");
+
+ dearEnabled = config.getBoolean("activation-range.enabled", true);
+ startDistance = config.getInt("activation-range.start-distance", 12,
+ "This value determines how far away an entity has to be",
+ "from the player to start being effected by DEAR.");
@ -68,7 +69,7 @@ index ab019b577002677a4ce788106f8e5a1d7757a2ae..0e452ea9c5d098326d22a20aa67e423f
+
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6b6abf401cc7c7c79ffb472c35550596fc8e55b5..ebcb668b7f793d9c19bb098ff54007280c6d07d8 100644
index 89852779fd9cfd19058afe40feb0cf14ca8d2896..5fb3f2968f20e78d76382bec52c9236add4fc060 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -289,6 +289,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@ -82,7 +83,7 @@ index 6b6abf401cc7c7c79ffb472c35550596fc8e55b5..ebcb668b7f793d9c19bb098ff5400728
public float getBukkitYaw() {
return this.yaw;
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
index bd66ee1b93fc776f77218b87717e0915668e7c04..d325b2437887afad634d569e8c6483a14d3b967c 100644
index 7ba59ff9a7ed39bf69c46973a85f874c43134dc1..c67138e6a4dcbe823e894f6bb948742bfb8f9943 100644
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
@@ -201,10 +201,10 @@ public abstract class EntityInsentient extends EntityLiving {
@ -90,11 +91,11 @@ index bd66ee1b93fc776f77218b87717e0915668e7c04..d325b2437887afad634d569e8c6483a1
public void inactiveTick() {
super.inactiveTick();
- if (this.goalSelector.inactiveTick()) {
+ if (this.goalSelector.inactiveTick(this.activatedPriority)) { // Airplane - pass activated priroity
+ if (this.goalSelector.inactiveTick(this.activatedPriority, true)) { // Airplane - pass activated priroity
this.goalSelector.doTick();
}
- if (this.targetSelector.inactiveTick()) {
+ if (this.targetSelector.inactiveTick(this.activatedPriority)) { // Airplane - pass activated priority
+ if (this.targetSelector.inactiveTick(this.activatedPriority, true)) { // Airplane - pass activated priority
this.targetSelector.doTick();
}
}
@ -102,26 +103,27 @@ index bd66ee1b93fc776f77218b87717e0915668e7c04..d325b2437887afad634d569e8c6483a1
this.bo.a();
this.world.getMethodProfiler().exit();
this.world.getMethodProfiler().enter("targetSelector");
+ if (this.targetSelector.inactiveTick(this.activatedPriority)) // Airplane - use this to alternate ticking
+ if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Airplane - use this to alternate ticking
this.targetSelector.doTick();
this.world.getMethodProfiler().exit();
this.world.getMethodProfiler().enter("goalSelector");
+ if (this.goalSelector.inactiveTick(this.activatedPriority)) // Airplane - use this to alternate ticking
+ if (this.goalSelector.inactiveTick(this.activatedPriority, false)) // Airplane - use this to alternate ticking
this.goalSelector.doTick();
this.world.getMethodProfiler().exit();
this.world.getMethodProfiler().enter("navigation");
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java
index 637928664f8c7b1c694a234e507c20724294e450..02e8288473138dcea008d6157318758e8d7ee3be 100644
index 637928664f8c7b1c694a234e507c20724294e450..502f710e1b04d186c539a04b43379bdcd494b0e5 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java
@@ -44,9 +44,14 @@ public class PathfinderGoalSelector {
@@ -44,9 +44,15 @@ public class PathfinderGoalSelector {
}
// Paper start
- public boolean inactiveTick() {
- incRate();
- return getCurRate() % getTickRate() == 0;
+ public boolean inactiveTick(int tickRate) { // Airplane - take tick rate
+ public boolean inactiveTick(int tickRate, boolean inactive) { // Airplane - take tick rate
+ if (inactive && !gg.airplane.AirplaneConfig.dearEnabled) tickRate = 4; // reset to Paper's
+ tickRate = Math.min(tickRate, getTickRate()); // Airplane
+ if (this.curRate++ % tickRate != 0) { // Airplane - use tick rate / increment curRate every tick
+ //incRate();
@ -155,10 +157,10 @@ index ab692de8a5b1411e37251fb545e6f579a9929f91..9aa4850e021076fde306eea7eec104c3
++this.conversionTicks;
if (this.conversionTicks > 300) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
index 9a7bebd77302dbfd07ac802acbe2b9cb80eec26f..4ee979a2771b1c97379a77af34b9e7b6de34d67b 100644
index 9a7bebd77302dbfd07ac802acbe2b9cb80eec26f..99cdcc9a9a7e6227a165c4ef779f8e76a99ec56a 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/EntityPiglin.java
@@ -272,12 +272,16 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow {
@@ -272,12 +272,17 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow {
return !this.cannotHunt;
}
@ -171,12 +173,13 @@ index 9a7bebd77302dbfd07ac802acbe2b9cb80eec26f..4ee979a2771b1c97379a77af34b9e7b6
this.getBehaviorController().a((WorldServer) this.world, (EntityPiglin) this); // CraftBukkit - decompile error
this.world.getMethodProfiler().exit();
PiglinAI.b(this);
+ } // Airplane end
+ }
+ // Airplane end
super.mobTick();
}
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
index 9278b8546a57f21051a65d59c2c01d39afaa68cc..61eaa3e8f961a30e2dc9ae8701ba3b875176e7e0 100644
index 85374ac8f5460790de03b47d7c3ce19ed5596afe..ccb568a5e8501ac5e8901ef3a270cc87471d9ea1 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
@@ -231,11 +231,17 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
@ -199,7 +202,7 @@ index 9278b8546a57f21051a65d59c2c01d39afaa68cc..61eaa3e8f961a30e2dc9ae8701ba3b87
if (this.bF) {
this.bF = false;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 5c2eaca0bc63c7880ee928aba6a24761737aa649..8b36ca5062f8e0e8bd58aa506e91704a747de81b 100644
index 5c2eaca0bc63c7880ee928aba6a24761737aa649..0c86a93a34fdbb65365e81915ac9f54df4dde88b 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -47,6 +47,9 @@ import net.minecraft.world.entity.schedule.Activity;
@ -230,17 +233,21 @@ index 5c2eaca0bc63c7880ee928aba6a24761737aa649..8b36ca5062f8e0e8bd58aa506e91704a
{
// Paper start
Entity[] rawData = chunk.entities.getRawData();
@@ -249,6 +252,15 @@ public class ActivationRange
@@ -249,6 +252,19 @@ public class ActivationRange
//for ( Entity entity : (Collection<Entity>) slice )
// Paper end
{
+ // Airplane start
+ Vec3D entityVec = entity.getPositionVector();
+ double diffX = playerVec.x - entityVec.x, diffY = playerVec.y - entityVec.y, diffZ = playerVec.z - entityVec.z;
+ int squaredDistance = (int) (diffX * diffX + diffY * diffY + diffZ * diffZ);
+ entity.activatedPriority = squaredDistance > gg.airplane.AirplaneConfig.startDistanceSquared ?
+ Math.max(1, Math.min(squaredDistance >> gg.airplane.AirplaneConfig.activationDistanceMod, gg.airplane.AirplaneConfig.maximumActivationPrio)) :
+ 1;
+ if (gg.airplane.AirplaneConfig.dearEnabled) {
+ Vec3D entityVec = entity.getPositionVector();
+ double diffX = playerVec.x - entityVec.x, diffY = playerVec.y - entityVec.y, diffZ = playerVec.z - entityVec.z;
+ int squaredDistance = (int) (diffX * diffX + diffY * diffY + diffZ * diffZ);
+ entity.activatedPriority = squaredDistance > gg.airplane.AirplaneConfig.startDistanceSquared ?
+ Math.max(1, Math.min(squaredDistance >> gg.airplane.AirplaneConfig.activationDistanceMod, gg.airplane.AirplaneConfig.maximumActivationPrio)) :
+ 1;
+ } else {
+ entity.activatedPriority = 1;
+ }
+ // Airplane end
+
if (MinecraftServer.currentTick > entity.activatedTick) {

View File

@ -53,7 +53,7 @@ index e993b1849beb60515c51ee4f37617faab63ca223..4d7b5d47ab6bd3b1408811c3b9c157b1
boolean flag1 = iblockdata.getFluid().a((Tag) TagsFluid.WATER);
diff --git a/src/main/java/net/minecraft/world/level/SpawnerCreature.java b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
index d497006f05f79015cd791849888832bb53f4a414..d98526785ff2fa3b72e8ffffcb89a57a2203a5c8 100644
index 9b55da1f4d40ae36b2d2b8e7b3b18989dc4f6006..ab6812698757c05c2e923006d4e3370a7d6c4e03 100644
--- a/src/main/java/net/minecraft/world/level/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/world/level/SpawnerCreature.java
@@ -415,7 +415,10 @@ public final class SpawnerCreature {

View File

@ -0,0 +1,271 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
Date: Tue, 9 Feb 2021 19:05:58 -0600
Subject: [PATCH] Reduce memory allocations
Airplane
Copyright (C) 2020 Technove LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/core/BlockPosition.java b/src/main/java/net/minecraft/core/BlockPosition.java
index 6a6381e85fef2ae2b9b5e6dff0b7917b92fa01e5..2685a395a2eff9083cd8c654c4b7e2141b0ca99b 100644
--- a/src/main/java/net/minecraft/core/BlockPosition.java
+++ b/src/main/java/net/minecraft/core/BlockPosition.java
@@ -438,12 +438,26 @@ public class BlockPosition extends BaseBlockPosition {
public BlockPosition b(int i, int j, int k) {
return super.b(i, j, k).immutableCopy();
}
+ // Airplane start - version of b that doesn't copy
+ public BlockPosition addValues(int x, int y, int z) {
+ ((BaseBlockPosition)this).a += x;
+ ((BaseBlockPosition)this).b += y;
+ ((BaseBlockPosition)this).e += z;
+ return this;
+ }
+ // Airplane end
@Override
public BlockPosition shift(EnumDirection enumdirection, int i) {
return super.shift(enumdirection, i).immutableCopy();
}
+ // Airplane start - mutable shift method
+ public MutableBlockPosition mutableShift(EnumDirection enumdirection, int i) {
+ return this.setValues(this.getX() + enumdirection.getAdjacentX() * i, this.getY() + enumdirection.getAdjacentY() * i, this.getZ() + enumdirection.getAdjacentZ() * i);
+ }
+ // Airplane end
+
@Override
public BlockPosition a(EnumDirection.EnumAxis enumdirection_enumaxis, int i) {
return super.a(enumdirection_enumaxis, i).immutableCopy();
diff --git a/src/main/java/net/minecraft/core/EnumDirection.java b/src/main/java/net/minecraft/core/EnumDirection.java
index 7918d830a4aef09c9f517284e83a9376299116ad..0a40df2151bd388b6633a6f50b14f1f41ed4ce62 100644
--- a/src/main/java/net/minecraft/core/EnumDirection.java
+++ b/src/main/java/net/minecraft/core/EnumDirection.java
@@ -30,7 +30,7 @@ public enum EnumDirection implements INamable {
private final EnumDirection.EnumAxis k;
private final EnumDirection.EnumAxisDirection l;
private final BaseBlockPosition m;
- private static final EnumDirection[] n = values();
+ private static final EnumDirection[] n = values(); public static EnumDirection[] getValues() { return n; } // Airplane - getter
private static final Map<String, EnumDirection> o = (Map) Arrays.stream(EnumDirection.n).collect(Collectors.toMap(EnumDirection::m, (enumdirection) -> {
return enumdirection;
}));
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
index d827e18d8c3b9b5869dbb1e233f415ba0efb7c1b..fc687515fdfd47e90e11a2832de07d784edeef25 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -705,7 +705,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return d2 * d2 + d3 * d3;
}
- private static int b(ChunkCoordIntPair chunkcoordintpair, EntityPlayer entityplayer, boolean flag) {
+ // Airplane start - create copy that accepts x/z instead of allocating pair
+ private static int b(ChunkCoordIntPair chunkcoordintpair, EntityPlayer entityplayer, boolean flag) { return someDistanceCalculation(chunkcoordintpair.x, chunkcoordintpair.z, entityplayer, flag); }
+ private static int someDistanceCalculation(int x, int z, EntityPlayer entityplayer, boolean flag) {
int i;
int j;
@@ -719,12 +721,16 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
j = MathHelper.floor(entityplayer.locZ() / 16.0D);
}
- return a(chunkcoordintpair, i, j);
+ return someOtherDistanceCalculation(x, z, i, j);
+ // Airplane end
}
- private static int a(ChunkCoordIntPair chunkcoordintpair, int i, int j) {
- int k = chunkcoordintpair.x - i;
- int l = chunkcoordintpair.z - j;
+ // Airplane start - create copy that accepts x/z instead of allocating pair
+ private static int a(ChunkCoordIntPair chunkcoordintpair, int i, int j) { return someOtherDistanceCalculation(chunkcoordintpair.x, chunkcoordintpair.z, i, j); }
+ private static int someOtherDistanceCalculation(int x, int z, int i, int j) {
+ int k = x - i;
+ int l = z - j;
+ // Airplane end
return Math.max(Math.abs(k), Math.abs(l));
}
@@ -2546,11 +2552,17 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
boolean flag1 = this.tracker.attachedToPlayer;
if (!flag1) {
+ // Airplane start - use int/longs instead of ChunkCoordIntPair
+ /*
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
- PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair());
+ */
+ int x = this.tracker.chunkX, z = this.tracker.chunkZ;
+ long chunkcoordintpair = ChunkCoordIntPair.pair(x, z);
+ PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair);
if (playerchunk != null && playerchunk.getSendingChunk() != null && PlayerChunkMap.this.playerChunkManager.isChunkSent(entityplayer, MathHelper.floor(this.tracker.locX()) >> 4, MathHelper.floor(this.tracker.locZ()) >> 4)) { // Paper - no-tick view distance // Tuinity - don't broadcast in chunks the player hasn't received
- flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance;
+ flag1 = PlayerChunkMap.someDistanceCalculation(x, z, entityplayer, false) <= PlayerChunkMap.this.viewDistance;
+ // Airplane end
}
}
@@ -2580,8 +2592,10 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
}
private int b() {
+ // Airplane start
+ int i = this.trackingDistance; // move out of if statement
+ if (!this.tracker.passengers.isEmpty()) {
Collection<Entity> collection = this.tracker.getAllPassengers();
- int i = this.trackingDistance;
Iterator iterator = collection.iterator();
while (iterator.hasNext()) {
@@ -2593,6 +2607,8 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
i = j;
}
}
+ }
+ // Airplane end
return this.a(i);
}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 39b978c6e61e675249743d082699bb9882fd39ff..b4d8fbbc421b3288ae66db2932825b3e2f9b8d98 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1107,7 +1107,28 @@ public class WorldServer extends World implements GeneratorAccessSeed {
gameprofilerfiller.enter("tick");
if (!entity.dead && !(entity instanceof EntityComplexPart)) {
+ // Airplane start - inline this.a to prevent creation of lambda
+ /*
this.a(this::entityJoinedWorld, entity);
+ */
+ boolean doMidTick = false; // usually there's a returns in the catch, so treat it like that
+ try {
+ this.entityJoinedWorld(entity);
+ doMidTick = true;
+ } catch (Throwable throwable) {
+ if (throwable instanceof ThreadDeath) throw throwable; // Paper
+ // Paper start - Prevent tile entity and entity crashes
+ String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
+ System.err.println(msg);
+ throwable.printStackTrace();
+ getServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, throwable)));
+ entity.dead = true;
+ // Paper end
+ }
+ if (doMidTick) {
+ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick
+ }
+ // Airplane end
}
gameprofilerfiller.exit();
@@ -1451,9 +1472,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
++entity.ticksLived;
GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
+ // Airplane start - create debug lambda once, todo do we even WANT the method profiler?
+ /*
gameprofilerfiller.a(() -> {
return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString();
});
+ */
+ gameprofilerfiller.a(entity.getEntityType().getEntityName);
+ // Airplane end
gameprofilerfiller.c("tickNonPassenger");
if (isActive) { // Paper - EAR 2
TimingHistory.activatedEntityTicks++; // Paper
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
index 80c229c1852199fda85c03453d64cae33e413e89..7f70dda656ff9d802200f18139d2695e58c551c7 100644
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
@@ -270,6 +270,8 @@ public class EntityTypes<T extends Entity> {
private MinecraftKey bq;
private final EntitySize br;
+ public java.util.function.Supplier<String> getEntityName = () -> IRegistry.ENTITY_TYPE.getKey(this).toString(); // Airplane - create lambda ones
+
private static <T extends Entity> EntityTypes<T> a(String s, EntityTypes.Builder entitytypes_builder) { // CraftBukkit - decompile error
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
}
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 37da32675f0c00c793cd137c9a7305932cefb705..726d0aec2c40ac8e40dba3a12f17870abae6dca6 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -1110,19 +1110,19 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public void a(Consumer<Entity> consumer, Entity entity) {
try {
- consumer.accept(entity);
+ consumer.accept(entity); // Airplane - error on change
} catch (Throwable throwable) {
if (throwable instanceof ThreadDeath) throw throwable; // Paper
// Paper start - Prevent tile entity and entity crashes
String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ();
System.err.println(msg);
throwable.printStackTrace();
- getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
+ getServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Airplane - error on change
entity.dead = true;
return;
// Paper end
}
- MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick
+ MinecraftServer.getServer().executeMidTickTasks(); // Tuinity - execute chunk tasks mid tick // Airplane - error on change
}
// Paper start - Prevent armor stands from doing entity lookups
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
index 712596420af83e6e1b9d147ae2fd8d8a1f36e1b9..9c29fa3efac7e16df81b8a44934e3286bb37f1f6 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
@@ -54,8 +54,14 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow {
if (worldserver.getLightLevel(blockposition.up()) >= 9) {
IBlockData iblockdata1 = this.getBlockData();
+ // Airplane start - use mutable position
+ BlockPosition.MutableBlockPosition blockposition1 = new BlockPosition.MutableBlockPosition();
for (int i = 0; i < 4; ++i) {
+ blockposition1.setValues(blockposition).addValues(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
+ /*
BlockPosition blockposition1 = blockposition.b(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
+ */
+ // Airplane end
if (worldserver.getType(blockposition1).a(Blocks.DIRT) && c(iblockdata1, (IWorldReader) worldserver, blockposition1)) {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition1, (IBlockData) iblockdata1.set(BlockDirtSnowSpreadable.a, worldserver.getType(blockposition1.up()).a(Blocks.SNOW))); // CraftBukkit
diff --git a/src/main/java/net/minecraft/world/level/block/BlockFire.java b/src/main/java/net/minecraft/world/level/block/BlockFire.java
index 70c32b7a53a1107cced3491ebac19b0eaf4fec2e..3f3e241f3b24d9df9d57760c5515ff021718065a 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockFire.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockFire.java
@@ -340,13 +340,15 @@ public class BlockFire extends BlockFireAbstract {
return 0;
} else {
int i = 0;
- EnumDirection[] aenumdirection = EnumDirection.values();
+ EnumDirection[] aenumdirection = EnumDirection.getValues(); // Airplane - don't allocate new array here
int j = aenumdirection.length;
+ BlockPosition.MutableBlockPosition copy = new BlockPosition.MutableBlockPosition(); // Airplane - single allocation for this method
for (int k = 0; k < j; ++k) {
+ copy.setValues(blockposition); // Airplane - reset values
EnumDirection enumdirection = aenumdirection[k];
// Paper start
- IBlockData iblockdata = iworldreader.getTypeIfLoaded(blockposition.shift(enumdirection));
+ IBlockData iblockdata = iworldreader.getTypeIfLoaded(copy.mutableShift(enumdirection, 1)); // Airplane - mutable shift
if (iblockdata == null) {
continue;
}

View File

@ -20,7 +20,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/pom.xml b/pom.xml
index 65c8a649cb0e4d2d8d1b1c21ec30405f60539b9f..efa2ea6b8422f900643eb2f0f65cf067c034cea3 100644
index 9cac82f2655c55b7374c7b23b1c65cb9958627e2..cb633e69891a57571b7e112eb8556ffaed34dcce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -200,6 +200,13 @@
@ -38,10 +38,10 @@ index 65c8a649cb0e4d2d8d1b1c21ec30405f60539b9f..efa2ea6b8422f900643eb2f0f65cf067
<!-- This builds a completely 'ready to start' jar with all dependencies inside -->
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
index 0e452ea9c5d098326d22a20aa67e423f85843db7..7ec84ef1d1cbb1fabf4c590a2f2c1da3cc181010 100644
index 5077e70e4f408814b1072ceb45c52a322a7662d2..94c18e824695af69e39288195cc2fa83a13029d6 100644
--- a/src/main/java/gg/airplane/AirplaneConfig.java
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
@@ -79,4 +79,27 @@ public class AirplaneConfig {
@@ -80,4 +80,27 @@ public class AirplaneConfig {
dynamicHoglinBehavior = config.getBoolean("behavior-activation.hoglin", true);
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Skip copying unloading tile entities
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 6ab528223682d57bec1cdbd383acd8ab06904e4a..3abea117b29e57013fb556855ef9def023069bf9 100644
index 726d0aec2c40ac8e40dba3a12f17870abae6dca6..334281d4cbdb2d82ca93e862498af961d9abfd31 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -106,7 +106,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@ -17,7 +17,7 @@ index 6ab528223682d57bec1cdbd383acd8ab06904e4a..3abea117b29e57013fb556855ef9def0
public final Thread serverThread;
private final boolean debugWorld;
private int d;
@@ -995,12 +995,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -993,12 +993,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
gameprofilerfiller.enter("blockEntities");
timings.tileEntityTick.startTiming(); // Spigot
if (!this.tileEntityListUnload.isEmpty()) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] More debug for plugins not shutting down tasks
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4d0a9c89ca6838907b25ac4b2b1a849844efa7ec..e476806646c89c22da7e733d8072e0073383bd79 100644
index 507c5255542ba1b958470b4db2c35b1b0b779f17..13b1eb353c22f2935cff7adbb4df725438a46d8f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -995,6 +995,11 @@ public final class CraftServer implements Server {
@@ -994,6 +994,11 @@ public final class CraftServer implements Server {
plugin.getDescription().getName(),
"This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies."
));

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Skip creating hashset for entity track range
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index ebcb668b7f793d9c19bb098ff54007280c6d07d8..2a779f1219de2eb1d2ba7d28110bed4824b1d5c5 100644
index 5fb3f2968f20e78d76382bec52c9236add4fc060..7ddbc56eb2ea8491cd32987843801e9bee9dbe0b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -319,10 +319,39 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Cache climbing check for activation
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index c6d551ad958711dec777902f02c9f5dadac26ff8..a49dbcffecc971f797651984cb72c455d40f9331 100644
index 6b82dffa3d0938a94114ead277b42c71ea3bb52b..88fc16e49076cf5589e27660a388909291447fac 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -1745,6 +1745,19 @@ public abstract class EntityLiving extends Entity {
@ -29,10 +29,10 @@ index c6d551ad958711dec777902f02c9f5dadac26ff8..a49dbcffecc971f797651984cb72c455
return this.world.getType(this.getChunkCoordinates());
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 8b36ca5062f8e0e8bd58aa506e91704a747de81b..94910bf0c53c79588c55b89e4a023273d6c859ef 100644
index 0c86a93a34fdbb65365e81915ac9f54df4dde88b..b9c675ecae8fd87cca3c7475f4901c9d5529ac6b 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -309,7 +309,7 @@ public class ActivationRange
@@ -313,7 +313,7 @@ public class ActivationRange
if ( entity instanceof EntityLiving )
{
EntityLiving living = (EntityLiving) entity;

View File

@ -8,10 +8,10 @@ entities this starts adding up more than it should, and it's already
fairly optimized. Just starts being slow when you have 30k entities.
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
index 7ec84ef1d1cbb1fabf4c590a2f2c1da3cc181010..c9e00334655ccd273ba108a541ed1cb0633f69b7 100644
index 94c18e824695af69e39288195cc2fa83a13029d6..a673eaad4cd80287e8a357f8c45b2add156ff0b9 100644
--- a/src/main/java/gg/airplane/AirplaneConfig.java
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
@@ -102,4 +102,13 @@ public class AirplaneConfig {
@@ -103,4 +103,13 @@ public class AirplaneConfig {
}
@ -26,7 +26,7 @@ index 7ec84ef1d1cbb1fabf4c590a2f2c1da3cc181010..c9e00334655ccd273ba108a541ed1cb0
+
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
index d325b2437887afad634d569e8c6483a14d3b967c..91eecf296905b85d7cc602dbc3a7b14479ec686a 100644
index c67138e6a4dcbe823e894f6bb948742bfb8f9943..0f0bf91a3d01c0eb841db81ac441cf5936a2cdfe 100644
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
@@ -774,8 +774,15 @@ public abstract class EntityInsentient extends EntityLiving {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Config to disable method profiler
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
index c9e00334655ccd273ba108a541ed1cb0633f69b7..65adf3ceda012c8cfdea675c40e2bb27d34ebac7 100644
index a673eaad4cd80287e8a357f8c45b2add156ff0b9..6fc23a85ddd66a69b83684cdb602b6a312e9d72b 100644
--- a/src/main/java/gg/airplane/AirplaneConfig.java
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
@@ -111,4 +111,13 @@ public class AirplaneConfig {
@@ -112,4 +112,13 @@ public class AirplaneConfig {
}
@ -23,7 +23,7 @@ index c9e00334655ccd273ba108a541ed1cb0633f69b7..65adf3ceda012c8cfdea675c40e2bb27
+
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b2ae9d92dd2c93304a282b08099dfb1acd72ef4f..baa6698a2444edc1e9a264eeb8771df47e956849 100644
index 6f90a4182e008b49a4b3328e569311382e4bec0d..1472bbdac9b545c97368df03672b975abf2dbcb4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2200,7 +2200,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@ -39,7 +39,7 @@ index b2ae9d92dd2c93304a282b08099dfb1acd72ef4f..baa6698a2444edc1e9a264eeb8771df4
}
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 3abea117b29e57013fb556855ef9def023069bf9..f8d11a1f0337acf60f2d9f94bd4bbbf6eb77c6de 100644
index 334281d4cbdb2d82ca93e862498af961d9abfd31..d1591f8d0b45126acef5d24ddb41d76293f5b42d 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -18,6 +18,7 @@ import java.util.function.Consumer;
@ -50,7 +50,7 @@ index 3abea117b29e57013fb556855ef9def023069bf9..f8d11a1f0337acf60f2d9f94bd4bbbf6
import net.minecraft.CrashReport;
import net.minecraft.CrashReportSystemDetails;
import net.minecraft.ReportedException;
@@ -1815,6 +1816,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -1813,6 +1814,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
}
public GameProfilerFiller getMethodProfiler() {

View File

@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..36eea0acd815e08e0be10bf55541ea0b
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java
index 02e8288473138dcea008d6157318758e8d7ee3be..697e666a027d5e2ace7d0758909be5a658c480d2 100644
index 502f710e1b04d186c539a04b43379bdcd494b0e5..0c56094b962c7c6e6ab3bf49d2efdcec7faed1c6 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalSelector.java
@@ -28,7 +28,7 @@ public class PathfinderGoalSelector {
@ -58,7 +58,7 @@ index 02e8288473138dcea008d6157318758e8d7ee3be..697e666a027d5e2ace7d0758909be5a6
private final Supplier<GameProfilerFiller> e;
private final EnumSet<PathfinderGoal.Type> f = EnumSet.noneOf(PathfinderGoal.Type.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
private final OptimizedSmallEnumSet<PathfinderGoal.Type> goalTypes = new OptimizedSmallEnumSet<>(PathfinderGoal.Type.class); // Paper - remove streams from pathfindergoalselector
@@ -85,8 +85,11 @@ public class PathfinderGoalSelector {
@@ -86,8 +86,11 @@ public class PathfinderGoalSelector {
gameprofilerfiller.enter("goalCleanup");
// Paper start - remove streams from pathfindergoalselector
@ -72,7 +72,7 @@ index 02e8288473138dcea008d6157318758e8d7ee3be..697e666a027d5e2ace7d0758909be5a6
if (!wrappedGoal.g()) {
continue;
}
@@ -105,8 +108,10 @@ public class PathfinderGoalSelector {
@@ -106,8 +109,10 @@ public class PathfinderGoalSelector {
gameprofilerfiller.exit();
gameprofilerfiller.enter("goalUpdate");
// Paper start - remove streams from pathfindergoalselector
@ -85,7 +85,7 @@ index 02e8288473138dcea008d6157318758e8d7ee3be..697e666a027d5e2ace7d0758909be5a6
if (wrappedGoal.g()) {
continue;
}
@@ -149,8 +154,11 @@ public class PathfinderGoalSelector {
@@ -150,8 +155,11 @@ public class PathfinderGoalSelector {
gameprofilerfiller.exit();
gameprofilerfiller.enter("goalTick");
// Paper start - remove streams from pathfindergoalselector

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Improve container checking with a bitset
diff --git a/src/main/java/gg/airplane/structs/ItemListWithBitset.java b/src/main/java/gg/airplane/structs/ItemListWithBitset.java
new file mode 100644
index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be2ff1fdf7
index 0000000000000000000000000000000000000000..7103aa120d3a27d5579d54bd6f4018dc20cca95c
--- /dev/null
+++ b/src/main/java/gg/airplane/structs/ItemListWithBitset.java
@@ -0,0 +1,105 @@
@ -35,8 +35,8 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be
+
+ private final ItemStack[] items;
+
+ private int bitSet = 0;
+ private final int allBits;
+ private long bitSet = 0;
+ private final long allBits;
+
+ private ItemListWithBitset(NonNullList<ItemStack> list) {
+ this(list.size());
@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be
+ public ItemListWithBitset(int size) {
+ super(null, ItemStack.NULL_ITEM);
+
+ Validate.isTrue(size < Integer.BYTES * 8, "size is too large");
+ Validate.isTrue(size < Long.BYTES * 8, "size is too large");
+
+ this.items = createArray(size);
+ this.allBits = ((1 << size) - 1);
+ this.allBits = ((1L << size) - 1);
+ }
+
+ public boolean isCompletelyEmpty() {
@ -70,9 +70,9 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be
+ this.items[index] = itemStack;
+
+ if (itemStack == ItemStack.NULL_ITEM) {
+ this.bitSet &= ~(1 << index);
+ this.bitSet &= ~(1L << index);
+ } else {
+ this.bitSet |= 1 << index;
+ this.bitSet |= 1L << index;
+ }
+
+ return existing;
@ -116,7 +116,7 @@ index 0000000000000000000000000000000000000000..bd3b58cb1a48da2f5259b0c64290b2be
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index 39b978c6e61e675249743d082699bb9882fd39ff..b11af463045bbd3bab8d269fde34071ca5f026af 100644
index b4d8fbbc421b3288ae66db2932825b3e2f9b8d98..1553be4263f08ae21447ccf2e19e8a30a2932208 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -846,6 +846,22 @@ public class WorldServer extends World implements GeneratorAccessSeed {
@ -269,7 +269,7 @@ index 92818df3689e35b921eb04678c84d2dd4b21ddbe..f6b723062a9cd0667efcc0171df71e9d
public ItemStack splitStack(int i, int j) {
return i >= this.left.getSize() ? this.right.splitStack(i - this.left.getSize(), j) : this.left.splitStack(i, j);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
index 111f62d0e5b40e945793b8f504f2c035c0884a6a..cfabc9047cd3e972af84700725355d0fe149b221 100644
index 111f62d0e5b40e945793b8f504f2c035c0884a6a..324b752c70e0bd7ea06caa98ec15cdd4e6ea40ae 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityChest.java
@@ -36,7 +36,7 @@ import org.bukkit.entity.HumanEntity;
@ -281,8 +281,12 @@ index 111f62d0e5b40e945793b8f504f2c035c0884a6a..cfabc9047cd3e972af84700725355d0f
protected float a;
protected float b;
public int viewingCount;
@@ -75,9 +75,31 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
@@ -73,10 +73,34 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
}
// CraftBukkit end
+ private final boolean isNative = getClass().equals(TileEntityChest.class); // Airplane
+
protected TileEntityChest(TileEntityTypes<?> tileentitytypes) {
super(tileentitytypes);
+ // Airplane start
@ -291,29 +295,28 @@ index 111f62d0e5b40e945793b8f504f2c035c0884a6a..cfabc9047cd3e972af84700725355d0f
+ */
+ this.items = new gg.airplane.structs.ItemListWithBitset(27);
+ // Airplane end
}
+ }
+
+ // Airplane start
+ @Override
+ public boolean hasEmptySlot(EnumDirection enumdirection) {
+ return !this.items.hasFullStacks();
+ return isNative ? !this.items.hasFullStacks() : super.hasEmptySlot(enumdirection);
+ }
+
+ @Override
+ public boolean isCompletelyFull(EnumDirection enumdirection) {
+ return this.items.hasFullStacks() && super.isCompletelyFull(enumdirection);
+ return isNative ? this.items.hasFullStacks() && super.isCompletelyFull(enumdirection) : super.isCompletelyFull(enumdirection);
+ }
+
+ @Override
+ public boolean isCompletelyEmpty(EnumDirection enumdirection) {
+ return this.items.isCompletelyEmpty() || super.isCompletelyEmpty(enumdirection);
+ }
+ return isNative && this.items.isCompletelyEmpty() || super.isCompletelyEmpty(enumdirection);
}
+ // Airplane end
+
public TileEntityChest() {
this(TileEntityTypes.CHEST);
}
@@ -95,7 +117,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
@@ -95,7 +119,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
@Override
public void load(IBlockData iblockdata, NBTTagCompound nbttagcompound) {
super.load(iblockdata, nbttagcompound);
@ -322,7 +325,7 @@ index 111f62d0e5b40e945793b8f504f2c035c0884a6a..cfabc9047cd3e972af84700725355d0f
if (!this.b(nbttagcompound)) {
ContainerUtil.b(nbttagcompound, this.items);
}
@@ -295,7 +317,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
@@ -295,7 +319,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
@Override
protected void a(NonNullList<ItemStack> nonnulllist) {

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Use raw iterator where possible
diff --git a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
index 207a9c3928aad7c6e89a120b54d87e003ebd232c..06864951af539e22f6e459c0f0c097b7c2fb929b 100644
index 0718b80ac82a1cf00519c30c6d2ef78fe3914c71..e31766151450ffa44937feb728f6368e61acd2cd 100644
--- a/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
+++ b/src/main/java/net/minecraft/server/level/ChunkProviderServer.java
@@ -1033,10 +1033,12 @@ public class ChunkProviderServer extends IChunkProvider {
//Collections.shuffle(list); // Paper
@@ -1034,10 +1034,12 @@ public class ChunkProviderServer extends IChunkProvider {
// Paper - moved up
this.world.timings.chunkTicks.startTiming(); // Paper
// Tuinity start - optimise chunk tick iteration
- com.tuinity.tuinity.util.maplist.IteratorSafeOrderedReferenceSet.Iterator<Chunk> iterator = this.entityTickingChunks.iterator();
+ // Airplane start - use raw iterator
@ -24,7 +24,7 @@ index 207a9c3928aad7c6e89a120b54d87e003ebd232c..06864951af539e22f6e459c0f0c097b7
PlayerChunk playerchunk = chunk.playerChunk;
if (playerchunk != null) { // make sure load event has been called along with the load logic we put there
// Tuinity end - optimise chunk tick iteration
@@ -1064,10 +1066,12 @@ public class ChunkProviderServer extends IChunkProvider {
@@ -1065,10 +1067,12 @@ public class ChunkProviderServer extends IChunkProvider {
}
}
}
@ -36,5 +36,5 @@ index 207a9c3928aad7c6e89a120b54d87e003ebd232c..06864951af539e22f6e459c0f0c097b7
}
+ // Airplane end
// Tuinity end - optimise chunk tick iteration
this.world.timings.chunkTicks.stopTiming(); // Paper
this.world.getMethodProfiler().enter("customSpawners");
if (flag1) {

View File

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
Date: Tue, 1 Jun 2021 18:06:29 -0500
Subject: [PATCH] Patch Paper to use fast item merge raytracing
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
index 077990f1d95ded2c8b89c38978ec25a56df3a984..e1581f0616748da885f457c7fa0f1515490c53f4 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
@@ -230,10 +230,16 @@ public class EntityItem extends Entity {
if (entityitem.z()) {
// Paper Start - Fix items merging through walls
if (this.world.paperConfig.fixItemsMergingThroughWalls) {
+ // Airplane start - fast merging!
+ /*
net.minecraft.world.level.RayTrace rayTrace = new net.minecraft.world.level.RayTrace(this.getPositionVector(), entityitem.getPositionVector(),
net.minecraft.world.level.RayTrace.BlockCollisionOption.COLLIDER, net.minecraft.world.level.RayTrace.FluidCollisionOption.NONE, this);
net.minecraft.world.phys.MovingObjectPositionBlock rayTraceResult = world.rayTrace(rayTrace);
if (rayTraceResult.getType() == net.minecraft.world.phys.MovingObjectPosition.EnumMovingObjectType.BLOCK) continue;
+ */
+ if (world.rayTraceDirect(this.getPositionVector(), entityitem.getPositionVector(), net.minecraft.world.phys.shapes.VoxelShapeCollision.a(this)) ==
+ net.minecraft.world.phys.MovingObjectPosition.EnumMovingObjectType.BLOCK) continue;
+ // Airplane end
}
// Paper End
this.a(entityitem);

View File

@ -0,0 +1,44 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paul Sauve <paul@technove.co>
Date: Sun, 6 Jun 2021 17:13:03 -0500
Subject: [PATCH] Simple item block collision toggle
diff --git a/src/main/java/gg/airplane/AirplaneConfig.java b/src/main/java/gg/airplane/AirplaneConfig.java
index 6fc23a85ddd66a69b83684cdb602b6a312e9d72b..e234e2944f9f764f8110c473997d438a9dc66146 100644
--- a/src/main/java/gg/airplane/AirplaneConfig.java
+++ b/src/main/java/gg/airplane/AirplaneConfig.java
@@ -113,11 +113,16 @@ public class AirplaneConfig {
public static boolean disableMethodProfiler;
+ public static boolean simplerItemCollision;
private static void miscSettings() {
config.setComment("misc", "Settings for things that don't belong elsewhere");
disableMethodProfiler = config.getBoolean("misc.disable-method-profiler", true);
+ simplerItemCollision = config.getBoolean("misc.simpler-item-collision", false,
+ "When an item is inside a block, it gets pushed up.",
+ "This option when true makes the check simpler,",
+ "ignoring entities and complex collisions like pistons.");
}
diff --git a/src/main/java/net/minecraft/world/entity/item/EntityItem.java b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
index e1581f0616748da885f457c7fa0f1515490c53f4..cb5c4379bfd16a74debaf23f840dbf1e5535ad7f 100644
--- a/src/main/java/net/minecraft/world/entity/item/EntityItem.java
+++ b/src/main/java/net/minecraft/world/entity/item/EntityItem.java
@@ -110,6 +110,12 @@ public class EntityItem extends Entity {
if (this.world.isClientSide) {
this.noclip = false;
} else {
+ // Airplane start - simpler solid block check
+ if (gg.airplane.AirplaneConfig.simplerItemCollision) {
+ net.minecraft.world.level.block.state.IBlockData block = this.world.getTypeIfLoaded(this.getChunkCoordinates());
+ this.noclip = block != null && block.isOpaque();
+ } else
+ // Airplane end
this.noclip = !this.world.getCubes(this);
if (this.noclip) {
this.l(this.locX(), (this.getBoundingBox().minY + this.getBoundingBox().maxY) / 2.0D, this.locZ());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Disable the Snooper
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f9a5b96bf479c177f6a2f2a45258990c297ea3b8..3f33301c3349c1c04b869a001120d03697afae8d 100644
index 1472bbdac9b545c97368df03672b975abf2dbcb4..4ed2808434d059ad21c01449fb1ca37165061b0a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1454,6 +1454,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1440,6 +1440,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
//} // Paper
this.methodProfiler.enter("snooper");
@ -17,7 +17,7 @@ index f9a5b96bf479c177f6a2f2a45258990c297ea3b8..3f33301c3349c1c04b869a001120d036
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot
this.snooper.a();
}
@@ -1461,6 +1463,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
@@ -1447,6 +1449,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && this.ticks % 6000 == 0) { // Spigot
this.snooper.b();
}

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Swaps the predicate order of collision
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 773b4cd8e0da1c0aff0c6efde6bd9e682b758a6e..f3d1e0bf6b268fffa50181b1901f41539820fe05 100644
index 7ddbc56eb2ea8491cd32987843801e9bee9dbe0b..32372e46103958e985582796964a47120ec9c1a3 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1753,8 +1753,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
@@ -1775,8 +1775,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
public void pickup(EntityHuman entityhuman) {}
public void collide(Entity entity) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] dont load chunks for physics
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index e71f76df887681f48702456378be4e9da86fb658..42933a84c1a52316317188107f5bc3a57f7d7727 100644
index d1591f8d0b45126acef5d24ddb41d76293f5b42d..8ed6ff1c180fe6dd3b29c476799f6b83af0be007 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -878,7 +878,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -830,7 +830,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public void neighborChanged(BlockPosition pos, Block blockIn, BlockPosition fromPos) { a(pos, blockIn, fromPos); } // Paper - OBFHELPER
public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
if (!this.isClientSide) {
@ -19,10 +19,10 @@ index e71f76df887681f48702456378be4e9da86fb658..42933a84c1a52316317188107f5bc3a5
try {
// CraftBukkit start
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
index 0990eb8b2e2d8a5f7c1a2640727d86c37a50298e..d894e7f16d232596ec308f3de3ea5da410588cbe 100644
index 1d82f719440c95765c01a588f4785d630b8b527a..9465bce44f5ac4b448736d9c029ea411c27843ac 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBase.java
@@ -647,7 +647,8 @@ public abstract class BlockBase {
@@ -646,7 +646,8 @@ public abstract class BlockBase {
EnumDirection enumdirection = aenumdirection[l];
blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection);

View File

@ -129,53 +129,53 @@ index 0000000000000000000000000000000000000000..fe7330fabe386966c2d203a190a00a78
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index 42933a84c1a52316317188107f5bc3a57f7d7727..b38ae7942cb1c99ed3d0046a7b813da428d0867c 100644
index 8ed6ff1c180fe6dd3b29c476799f6b83af0be007..1583c8608a34a84b84873dd10668d6a5f67ab416 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -161,6 +161,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -159,6 +159,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config
public final net.pl3x.purpur.PurpurWorldConfig purpurConfig; // Purpur
+ public final de.minebench.origami.OrigamiConfig.WorldConfig origamiConfig; // Origami - World Config
+
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPosition lastPhysicsProblem; // Spigot
private org.spigotmc.TickLimiter entityLimiter;
@@ -301,6 +303,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
@@ -255,6 +257,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName()); // Spigot
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
+ this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName()); // Origami - World Config
this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config
this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()), env); // Purpur
this.generator = gen;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index af3c01156a9a5f6f08fff9db67c9c089a321cb29..560020bf1372f68186f78b53502e3d2c145ab098 100644
index 13b1eb353c22f2935cff7adbb4df725438a46d8f..ca2c46bb22d4aca818f2aad107da42ebe09f2d2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -883,6 +883,7 @@ public final class CraftServer implements Server {
@@ -881,6 +881,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config
net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
+ de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami - Server Config
for (WorldServer world : console.getWorlds()) {
world.worldDataServer.setDifficulty(config.difficulty);
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
@@ -919,6 +920,7 @@ public final class CraftServer implements Server {
@@ -916,6 +917,7 @@ public final class CraftServer implements Server {
world.spigotConfig.init(); // Spigot
world.paperConfig.init(); // Paper
world.tuinityConfig.init(); // Tuinity - Server Config
world.purpurConfig.init(); // Purpur
+ world.origamiConfig.init(); // Origami - World Config
}
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 51cdc7e87413302a73416a5da724d873efb29657..8b344d69b9076e1bf2a5ba310ecf3f8ddd375fdc 100644
index fbeca329f62325aa479f968e7f0f04cde341a009..1345ee267a61caf97e5b4f6ee641cadb10698fb6 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -162,6 +162,14 @@ public class Main {
@@ -154,6 +154,14 @@ public class Main {
.describedAs("Yml file");
// Purpur end
/* Conctete End - Server Config */
+ // Origami Start - Server Config
+ acceptsAll(asList("origami", "origami-settings"), "File for origami settings")
@ -188,7 +188,7 @@ index 51cdc7e87413302a73416a5da724d873efb29657..8b344d69b9076e1bf2a5ba310ecf3f8d
// Paper start
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
@@ -300,6 +308,7 @@ public class Main {
@@ -292,6 +300,7 @@ public class Main {
}
// Paper end
System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Optimize inventory API item handling
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index 922a15097bdfe64be657fdf157145d1e882b6a40..fe648a00d834410837c923ab3c15ecc33b808851 100644
index f6001047ada8308cfa1d9b26677a7a5d7774de51..5efae1af23e7a52571bb18885bd45255fb68f1f4 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -274,11 +274,13 @@ public class CraftInventory implements Inventory {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Don't wake up entities when damage event is cancelled
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index 2f7352d7ae99ecdefe0f7b56cebf008906607d4d..330ff6ff03c6be4d35d4f594e3202209ff584341 100644
index 88fc16e49076cf5589e27660a388909291447fac..d8fb0edceba805b9359d02304751182cd0c5a79f 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -1235,9 +1235,12 @@ public abstract class EntityLiving extends Entity {
@@ -1208,9 +1208,12 @@ public abstract class EntityLiving extends Entity {
} else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
return false;
} else {
@ -24,7 +24,7 @@ index 2f7352d7ae99ecdefe0f7b56cebf008906607d4d..330ff6ff03c6be4d35d4f594e3202209
this.ticksFarFromPlayer = 0;
float f1 = f;
@@ -2006,6 +2009,11 @@ public abstract class EntityLiving extends Entity {
@@ -1961,6 +1964,11 @@ public abstract class EntityLiving extends Entity {
if (event.isCancelled()) {
return false;
}

View File

@ -21,10 +21,10 @@ index f9762c7f40bbb850d14fb7b0c9ff4f3c09921155..9a008acd3e6dd5522d163dfbe09c611f
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
index dfe65943b3a2f744f06b4669590cc203e8419e60..190e37a1b3b5fdbc8bfaaeabb621311503bbc303 100644
index d10d1b768601236b9892461ee41d61c7239d1a07..1331b7525be64ecf5115dcafc6511837eff5b7ec 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
@@ -124,7 +124,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
@@ -88,7 +88,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
protected void mobTick() {
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);

View File

@ -1,23 +0,0 @@
The MIT License (MIT)
=====================
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Tue, 18 Feb 2020 20:30:03 -0600
Subject: [PATCH] Purpur config files
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index d1a9322cf54f57f0d213145aa50c219f0eb2a90b..1a319e2842f4b99951f1cddce8b2b4be9f5373a0 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1603,6 +1603,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Tuinity end - add config to timings report
+ // Purpur start
+ @NotNull
+ public org.bukkit.configuration.file.YamlConfiguration getPurpurConfig() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+
+ @NotNull
+ public java.util.Properties getServerProperties() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ // Purpur end
+
/**
* Sends the component to the player
*

View File

@ -1,113 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 5 Jun 2020 23:32:38 -0500
Subject: [PATCH] Default permissions
diff --git a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
index 7763d6101ac61900db1e2310966b99584539fd0e..d5a42707d365ffd72532bbb1a59a1ca7145f9918 100644
--- a/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
+++ b/src/main/java/org/bukkit/util/permissions/CommandPermissions.java
@@ -18,6 +18,7 @@ public final class CommandPermissions {
DefaultPermissions.registerPermission(PREFIX + "plugins", "Allows the user to view the list of plugins running on this server", PermissionDefault.TRUE, commands);
DefaultPermissions.registerPermission(PREFIX + "reload", "Allows the user to reload the server settings", PermissionDefault.OP, commands);
DefaultPermissions.registerPermission(PREFIX + "version", "Allows the user to view the version of the server", PermissionDefault.TRUE, commands);
+ DefaultPermissions.registerPermission(PREFIX + "purpur", "Allows the user to use the purpur command", PermissionDefault.OP, commands); // Purpur
commands.recalculatePermissibles();
return commands;
diff --git a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
index e1a4ddf2c07cdd242fa8054a0152522fe4039e85..8e481e3815f5645ee92f0d229e5ff25c8fc9a6c2 100644
--- a/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
+++ b/src/main/java/org/bukkit/util/permissions/DefaultPermissions.java
@@ -89,6 +89,8 @@ public final class DefaultPermissions {
CommandPermissions.registerPermissions(parent);
BroadcastPermissions.registerPermissions(parent);
+ PurpurPermissions.registerPermissions(); // Purpur
+
parent.recalculatePermissibles();
}
}
diff --git a/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java b/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java
new file mode 100644
index 0000000000000000000000000000000000000000..deedffb4aca00a9ff27a47a09ec7087e5566ad29
--- /dev/null
+++ b/src/main/java/org/bukkit/util/permissions/PurpurPermissions.java
@@ -0,0 +1,76 @@
+package org.bukkit.util.permissions;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Mob;
+import org.bukkit.permissions.Permission;
+import org.bukkit.permissions.PermissionDefault;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public final class PurpurPermissions {
+ private static final String ROOT = "purpur";
+ private static final String PREFIX = ROOT + ".";
+ private static final Set<String> mobs = new HashSet<>();
+
+ private PurpurPermissions() {
+ for (EntityType mob : EntityType.values()) {
+ Class<? extends Entity> clazz = mob.getEntityClass();
+ if (clazz != null && clazz.isAssignableFrom(Mob.class)) {
+ mobs.add(mob.getName());
+ }
+ }
+ }
+
+ @NotNull
+ public static Permission registerPermissions() {
+ Permission purpur = DefaultPermissions.registerPermission(ROOT, "Gives the user the ability to use all Purpur utilities and commands");
+
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.six", "Gives the user six rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.five", "Gives the user five rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.four", "Gives the user four rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.three", "Gives the user three rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.two", "Gives the user two rows of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
+ DefaultPermissions.registerPermission(PREFIX + "enderchest.rows.one", "Gives the user one row of enderchest space", org.bukkit.permissions.PermissionDefault.FALSE);
+
+ DefaultPermissions.registerPermission(PREFIX + "debug.f3n", "Allows the user to use F3+N keybind to swap gamemodes", PermissionDefault.FALSE, purpur);
+
+ DefaultPermissions.registerPermission(PREFIX + "drop.spawner", "Allows the user to drop spawner cage when broken with diamond pickaxe with silk touch", PermissionDefault.FALSE, purpur);
+ DefaultPermissions.registerPermission(PREFIX + "place.spawner", "Allows the user to place spawner cage in the world", PermissionDefault.FALSE, purpur);
+
+ DefaultPermissions.registerPermission(PREFIX + "anvil.color", "Allows the user to use color codes on anvils", PermissionDefault.FALSE, purpur);
+
+ Permission book = DefaultPermissions.registerPermission(PREFIX + "book", "Allows the user to use color codes on books", PermissionDefault.FALSE, purpur);
+ DefaultPermissions.registerPermission(PREFIX + "book.color.edit", "Allows the user to use color codes on books when editing", PermissionDefault.FALSE, book);
+ DefaultPermissions.registerPermission(PREFIX + "book.color.sign", "Allows the user to use color codes on books when signing", PermissionDefault.FALSE, book);
+ book.recalculatePermissibles();
+
+ Permission sign = DefaultPermissions.registerPermission(PREFIX + "sign", "Allows the user to use all sign abilities", PermissionDefault.FALSE, purpur);
+ DefaultPermissions.registerPermission(PREFIX + "sign.click.opens.editor", "Allows the user to click signs to open sign editor", PermissionDefault.FALSE, sign);
+ DefaultPermissions.registerPermission(PREFIX + "sign.color", "Allows the user to use color codes on signs", PermissionDefault.FALSE, sign);
+ DefaultPermissions.registerPermission(PREFIX + "sign.style", "Allows the user to use style codes on signs", PermissionDefault.FALSE, sign);
+ DefaultPermissions.registerPermission(PREFIX + "sign.magic", "Allows the user to use magic/obfuscate code on signs", PermissionDefault.FALSE, sign);
+ sign.recalculatePermissibles();
+
+ Permission ride = DefaultPermissions.registerPermission("allow.ride", "Allows the user to ride all mobs", PermissionDefault.FALSE);
+ for (String mob : mobs) {
+ DefaultPermissions.registerPermission("allow.ride." + mob, "Allows the user to ride " + mob, PermissionDefault.FALSE, ride);
+ }
+ ride.recalculatePermissibles();
+
+ Permission special = DefaultPermissions.registerPermission("allow.special", "Allows the user to use all mobs special abilities", PermissionDefault.FALSE);
+ for (String mob : mobs) {
+ DefaultPermissions.registerPermission("allow.special." + mob, "Allows the user to use " + mob + " special ability", PermissionDefault.FALSE, special);
+ }
+ special.recalculatePermissibles();
+
+ Permission powered = DefaultPermissions.registerPermission("allow.powered", "Allows the user to toggle all mobs powered state", PermissionDefault.FALSE);
+ DefaultPermissions.registerPermission("allow.powered.creeper", "Allows the user to toggle creeper powered state", PermissionDefault.FALSE, powered);
+ powered.recalculatePermissibles();
+
+ purpur.recalculatePermissibles();
+ return purpur;
+ }
+}

View File

@ -1,32 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Tue, 23 Jul 2019 06:50:55 -0500
Subject: [PATCH] Allow inventory resizing
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index 090d22bd30f7947103771aaaf09a2398970ac337..ca660dde2010098e8c77141d05c2d4d5470adf81 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -132,7 +132,7 @@ public enum InventoryType {
STONECUTTER(2, "Stonecutter")
;
- private final int size;
+ private int size; // Purpur - remove final
private final String title;
private final boolean isCreatable;
@@ -159,6 +159,12 @@ public enum InventoryType {
this.defaultTitleComponent = net.kyori.adventure.text.Component.text(defaultTitle); // Paper - Adventure
}
+ // Purpur start
+ public void setDefaultSize(int size) {
+ this.size = size;
+ }
+ // Purpur end
+
public int getDefaultSize() {
return size;
}

View File

@ -1,123 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 31 May 2019 21:24:21 -0500
Subject: [PATCH] Advancement API
diff --git a/src/main/java/org/bukkit/advancement/Advancement.java b/src/main/java/org/bukkit/advancement/Advancement.java
index 7c5009974ac8d64d0e738e60cec45acb0d4ca89a..432caadba1b08bb94cdb4ccf552e42400e0db338 100644
--- a/src/main/java/org/bukkit/advancement/Advancement.java
+++ b/src/main/java/org/bukkit/advancement/Advancement.java
@@ -3,6 +3,7 @@ package org.bukkit.advancement;
import java.util.Collection;
import org.bukkit.Keyed;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* Represents an advancement that may be awarded to a player. This class is not
@@ -17,4 +18,12 @@ public interface Advancement extends Keyed {
*/
@NotNull
Collection<String> getCriteria();
+
+ /**
+ * Gets the display properties of this advancement
+ *
+ * @return The display properties
+ */
+ @Nullable
+ AdvancementDisplay getDisplay();
}
diff --git a/src/main/java/org/bukkit/advancement/AdvancementDisplay.java b/src/main/java/org/bukkit/advancement/AdvancementDisplay.java
new file mode 100644
index 0000000000000000000000000000000000000000..bca3d112e2397b26ba6ccb6cd41e406caae27c5c
--- /dev/null
+++ b/src/main/java/org/bukkit/advancement/AdvancementDisplay.java
@@ -0,0 +1,53 @@
+package org.bukkit.advancement;
+
+import org.jetbrains.annotations.NotNull;
+
+public interface AdvancementDisplay {
+ /**
+ * Get the title of this advancement
+ *
+ * @return Title text
+ */
+ @NotNull
+ String getTitle();
+
+ /**
+ * Get the description of this advancement
+ *
+ * @return Description text
+ */
+ @NotNull
+ String getDescription();
+
+ /**
+ * Get the frame type of this advancement
+ *
+ * @return Frame type
+ */
+ @NotNull
+ FrameType getFrameType();
+
+ /**
+ * Get if this advancement should be announced in chat when completed
+ *
+ * @return True if should announce when completed
+ */
+ boolean shouldAnnounceToChat();
+
+ /**
+ * Set if this advancement should be announced in chat when completed
+ *
+ * @param announce True or false
+ *
+ */
+ void setShouldAnnounceToChat(boolean announce);
+
+ /**
+ * Get if this advancement (and all it's children) is hidden from the advancement screen until it has been completed
+ * <p>
+ * This has no effect on root advancements themselves, but will alter their children
+ *
+ * @return True if hidden until completed
+ */
+ boolean isHidden();
+}
diff --git a/src/main/java/org/bukkit/advancement/FrameType.java b/src/main/java/org/bukkit/advancement/FrameType.java
new file mode 100644
index 0000000000000000000000000000000000000000..d1757f3d456ff9efce26ce8baa1d16d896908cc2
--- /dev/null
+++ b/src/main/java/org/bukkit/advancement/FrameType.java
@@ -0,0 +1,27 @@
+package org.bukkit.advancement;
+
+import org.bukkit.ChatColor;
+import org.jetbrains.annotations.NotNull;
+
+public enum FrameType {
+ TASK(ChatColor.GREEN),
+ CHALLENGE(ChatColor.DARK_PURPLE),
+ GOAL(ChatColor.GREEN);
+
+ private final ChatColor color;
+
+ FrameType(ChatColor color) {
+ this.color = color;
+ }
+
+ @NotNull
+ public ChatColor getColor() {
+ return color;
+ }
+
+ @NotNull
+ @Override
+ public String toString() {
+ return "FrameType[name=" + name() + ",color=" + color + "]";
+ }
+}

View File

@ -1,191 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 18 Oct 2019 22:50:05 -0500
Subject: [PATCH] Llama API
diff --git a/src/main/java/net/pl3x/purpur/event/entity/LlamaJoinCaravanEvent.java b/src/main/java/net/pl3x/purpur/event/entity/LlamaJoinCaravanEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..6e68c1399bf30eeef6ce0385867f0cf258698eae
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/entity/LlamaJoinCaravanEvent.java
@@ -0,0 +1,61 @@
+package net.pl3x.purpur.event.entity;
+
+import org.bukkit.entity.Llama;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when a Llama tries to join a caravan.
+ * <p>
+ * Cancelling the event will not let the Llama join. To prevent future attempts
+ * at joining a caravan use {@link Llama#setShouldJoinCaravan(boolean)}.
+ */
+public class LlamaJoinCaravanEvent extends EntityEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean canceled;
+ private final Llama head;
+
+ public LlamaJoinCaravanEvent(@NotNull Llama llama, @NotNull Llama head) {
+ super(llama);
+ this.head = head;
+ }
+
+ @Override
+ @NotNull
+ public Llama getEntity() {
+ return (Llama) entity;
+ }
+
+ /**
+ * Get the Llama that this Llama is about to follow
+ *
+ * @return Llama about to be followed
+ */
+ @NotNull
+ public Llama getHead() {
+ return head;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return canceled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ canceled = cancel;
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/net/pl3x/purpur/event/entity/LlamaLeaveCaravanEvent.java b/src/main/java/net/pl3x/purpur/event/entity/LlamaLeaveCaravanEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..ec8d978c22835e2789ebaaeddf0d13588ed1122a
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/entity/LlamaLeaveCaravanEvent.java
@@ -0,0 +1,34 @@
+package net.pl3x.purpur.event.entity;
+
+import org.bukkit.entity.Llama;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when a Llama leaves a caravan
+ */
+public class LlamaLeaveCaravanEvent extends EntityEvent {
+ private static final HandlerList handlers = new HandlerList();
+
+ public LlamaLeaveCaravanEvent(@NotNull Llama llama) {
+ super(llama);
+ }
+
+ @Override
+ @NotNull
+ public Llama getEntity() {
+ return (Llama) entity;
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java
index d23226ccb0f6c25028f000ce31346cd0a8898e6a..1ef9479c962b3f4f6fed46671a1209c34040d16d 100644
--- a/src/main/java/org/bukkit/entity/Llama.java
+++ b/src/main/java/org/bukkit/entity/Llama.java
@@ -3,6 +3,7 @@ package org.bukkit.entity;
import com.destroystokyo.paper.entity.RangedEntity;
import org.bukkit.inventory.LlamaInventory;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable; // Purpur
/**
* Represents a Llama.
@@ -67,4 +68,65 @@ public interface Llama extends ChestedHorse, RangedEntity { // Paper
@NotNull
@Override
LlamaInventory getInventory();
+
+ // Purpur start
+
+ /**
+ * Check if this Llama should attempt to join a caravan
+ *
+ * @return True if Llama is allowed to join a caravan
+ */
+ boolean shouldJoinCaravan();
+
+ /**
+ * Set if this Llama should attempt to join a caravan
+ *
+ * @param shouldJoinCaravan True to allow joining a caravan
+ */
+ void setShouldJoinCaravan(boolean shouldJoinCaravan);
+
+ /**
+ * Check if Llama is in a caravan
+ *
+ * @return True if in caravan
+ */
+ boolean inCaravan();
+
+ /**
+ * Join a caravan
+ *
+ * @param llama Head of caravan to join
+ */
+ void joinCaravan(@NotNull Llama llama);
+
+ /**
+ * Leave current caravan if in one
+ */
+ void leaveCaravan();
+
+ /**
+ * Check if another Llama is following this Llama
+ *
+ * @return True if being followed in the caravan
+ */
+ boolean hasCaravanTail();
+
+ /**
+ * Get the Llama that this Llama is following
+ * <p>
+ * Does not necessarily mean the leader of the entire caravan
+ *
+ * @return The Llama being followed
+ */
+ @Nullable
+ Llama getCaravanHead();
+
+ /**
+ * Get the Llama following this Llama, if any
+ *
+ * @return The Llama following this one
+ */
+ @Nullable
+ Llama getCaravanTail();
+ // Purpur end
}

View File

@ -1,112 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 10 Aug 2019 22:19:56 -0500
Subject: [PATCH] AFK API
diff --git a/src/main/java/net/pl3x/purpur/event/PlayerAFKEvent.java b/src/main/java/net/pl3x/purpur/event/PlayerAFKEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..0c8b3e5e4ba412624357ea5662a78862bd9fc4be
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/PlayerAFKEvent.java
@@ -0,0 +1,70 @@
+package net.pl3x.purpur.event;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class PlayerAFKEvent extends PlayerEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private final boolean setAfk;
+ private boolean shouldKick;
+ private String broadcast;
+ private boolean cancel;
+
+ public PlayerAFKEvent(@NotNull Player player, boolean setAfk, boolean shouldKick, @Nullable String broadcast, boolean async) {
+ super(player, async);
+ this.setAfk = setAfk;
+ this.shouldKick = shouldKick;
+ this.broadcast = broadcast;
+ }
+
+ /**
+ * Whether player is going afk or coming back
+ *
+ * @return True if going afk. False is coming back
+ */
+ public boolean isGoingAfk() {
+ return setAfk;
+ }
+
+ public boolean shouldKick() {
+ return shouldKick;
+ }
+
+ public void setShouldKick(boolean shouldKick) {
+ this.shouldKick = shouldKick;
+ }
+
+ @Nullable
+ public String getBroadcastMsg() {
+ return broadcast;
+ }
+
+ public void setBroadcastMsg(@Nullable String broadcast) {
+ this.broadcast = broadcast;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancel;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancel = cancel;
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 27848ad0eee667e515685a5f1cef3e9bfc7a3f53..09729abc27b6cb3458e19af24137bbbc6e5cb63e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2139,4 +2139,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Override
Spigot spigot();
// Spigot end
+
+ // Purpur start
+ /**
+ * Check if player is AFK
+ *
+ * @return True if AFK
+ */
+ boolean isAfk();
+
+ /**
+ * Set player as AFK
+ *
+ * @param setAfk Whether to set AFK or not
+ */
+ void setAfk(boolean setAfk);
+
+ /**
+ * Reset the idle timer back to 0
+ */
+ void resetIdleTimer();
+ // Purpur end
}

View File

@ -1,44 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 26 May 2019 15:18:40 -0500
Subject: [PATCH] Bring back server name
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 33f04d57b7df3a6f9743246ba9af6d67f4fa4b54..45c64a9e4f20428a9a448194f22697a17dfb8e1f 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1951,4 +1951,15 @@ public final class Bukkit {
public static Server.Spigot spigot() {
return server.spigot();
}
+
+ // Purpur start
+ /**
+ * Get the name of this server
+ * @return the name of the server
+ */
+ @NotNull
+ public static String getServerName() {
+ return server.getServerName();
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 1a319e2842f4b99951f1cddce8b2b4be9f5373a0..91641c358b10219d4098f40b53ea56f1cfa5defc 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1725,4 +1725,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
io.papermc.paper.datapack.DatapackManager getDatapackManager();
// Paper end
+
+ // Purpur start
+ /**
+ * Get the name of this server
+ * @return the name of the server
+ */
+ @NotNull
+ String getServerName();
+ // Purpur end
}

View File

@ -1,175 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 31 May 2019 00:08:28 -0500
Subject: [PATCH] ExecuteCommandEvent
diff --git a/src/main/java/net/pl3x/purpur/event/ExecuteCommandEvent.java b/src/main/java/net/pl3x/purpur/event/ExecuteCommandEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..3250bd4dc29a0cf79b08833d95a3321d1a6733f6
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/ExecuteCommandEvent.java
@@ -0,0 +1,130 @@
+package net.pl3x.purpur.event;
+
+import org.apache.commons.lang.Validate;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * This event is called whenever someone runs a command
+ */
+public class ExecuteCommandEvent extends Event implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancel = false;
+ private CommandSender sender;
+ private Command command;
+ private String label;
+ private String[] args;
+
+ public ExecuteCommandEvent(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @Nullable String[] args) {
+ this.sender = sender;
+ this.command = command;
+ this.label = label;
+ this.args = args;
+ }
+
+ /**
+ * Gets the command that the player is attempting to execute.
+ *
+ * @return Command the player is attempting to execute
+ */
+ @NotNull
+ public Command getCommand() {
+ return command;
+ }
+
+ /**
+ * Sets the command that the player will execute.
+ *
+ * @param command New command that the player will execute
+ * @throws IllegalArgumentException if command is null or empty
+ */
+ public void setCommand(@NotNull Command command) throws IllegalArgumentException {
+ Validate.notNull(command, "Command cannot be null");
+ this.command = command;
+ }
+
+ /**
+ * Gets the sender that this command will be executed as.
+ *
+ * @return Sender this command will be executed as
+ */
+ @NotNull
+ public CommandSender getSender() {
+ return sender;
+ }
+
+ /**
+ * Sets the sender that this command will be executed as.
+ *
+ * @param sender New sender which this event will execute as
+ * @throws IllegalArgumentException if the sender provided is null
+ */
+ public void setSender(@NotNull final CommandSender sender) throws IllegalArgumentException {
+ Validate.notNull(sender, "Sender cannot be null");
+ this.sender = sender;
+ }
+
+ /**
+ * Get the label used to execute this command
+ *
+ * @return Label used to execute this command
+ */
+ @NotNull
+ public String getLabel() {
+ return label;
+ }
+
+ /**
+ * Set the label used to execute this command
+ *
+ * @param label Label used
+ */
+ public void setLabel(@NotNull String label) {
+ this.label = label;
+ }
+
+ /**
+ * Get the args passed to the command
+ *
+ * @return Args passed to the command
+ */
+ @NotNull
+ public String[] getArgs() {
+ return args;
+ }
+
+ /**
+ * Set the args passed to the command
+ *
+ * @param args Args passed to the command
+ */
+ public void setArgs(@NotNull String[] args) {
+ this.args = args;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancel;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancel = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index 460fda05a62b12db2edcfb7ea8b2a5dd8e4b110d..1e0eb099933dded131d3c4db8f3cca2b6ed8e064 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -147,6 +147,19 @@ public class SimpleCommandMap implements CommandMap {
return false;
}
+ // Purpur start
+ String[] parsedArgs = Arrays.copyOfRange(args, 1, args.length);
+ net.pl3x.purpur.event.ExecuteCommandEvent event = new net.pl3x.purpur.event.ExecuteCommandEvent(sender, target, sentCommandLabel, parsedArgs);
+ if (!event.callEvent()) {
+ return true; // cancelled
+ }
+
+ sender = event.getSender();
+ target = event.getCommand();
+ sentCommandLabel = event.getLabel();
+ parsedArgs = event.getArgs();
+ // Purpur end
+
// Paper start - Plugins do weird things to workaround normal registration
if (target.timings == null) {
target.timings = co.aikar.timings.TimingsManager.getCommandTiming(null, target);
@@ -156,7 +169,7 @@ public class SimpleCommandMap implements CommandMap {
try {
try (co.aikar.timings.Timing ignored = target.timings.startTiming()) { // Paper - use try with resources
// Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false)
- target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length));
+ target.execute(sender, sentCommandLabel, parsedArgs); // Purpur
} // target.timings.stopTiming(); // Spigot // Paper
} catch (CommandException ex) {
server.getPluginManager().callEvent(new ServerExceptionEvent(new ServerCommandException(ex, target, sender, args))); // Paper

View File

@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 5 May 2019 12:58:19 -0500
Subject: [PATCH] LivingEntity safeFallDistance
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 9f0645dc5f76ee9ef73d88f768025429e5a9edf7..4ccbb3ef3c597ef9da2c6744f410283a1dc2538c 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -850,4 +850,20 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setHurtDirection(float hurtDirection);
// Paper end
+
+ // Purpur start
+ /**
+ * Gets the distance (in blocks) this entity can safely fall without taking damage
+ *
+ * @return Safe fall distance
+ */
+ float getSafeFallDistance();
+
+ /**
+ * Set the distance (in blocks) this entity can safely fall without taking damage
+ *
+ * @param safeFallDistance Safe fall distance
+ */
+ void setSafeFallDistance(float safeFallDistance);
+ // Purpur end
}

View File

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Tue, 23 Jul 2019 10:07:24 -0500
Subject: [PATCH] Lagging threshold
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 45c64a9e4f20428a9a448194f22697a17dfb8e1f..b3cd3e5288bdcdd928efb8cba97f504d8e3ec58e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1961,5 +1961,14 @@ public final class Bukkit {
public static String getServerName() {
return server.getServerName();
}
+
+ /**
+ * Check if server is lagging according to laggy threshold setting
+ *
+ * @return True if lagging
+ */
+ public static boolean isLagging() {
+ return server.isLagging();
+ }
// Purpur end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 91641c358b10219d4098f40b53ea56f1cfa5defc..f546e3422539d91f1fcb98c94a722c4b17ef0170 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1733,5 +1733,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull
String getServerName();
+
+ /**
+ * Check if server is lagging according to laggy threshold setting
+ *
+ * @return True if lagging
+ */
+ boolean isLagging();
// Purpur end
}

View File

@ -1,26 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 5 Jul 2019 16:37:04 -0500
Subject: [PATCH] ItemFactory#getMonsterEgg
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index ec7c07564608386c3f7d4322d0af4cbb7d92bc74..39323b3151c733392333858a2dbf1f3f8637341e 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -242,4 +242,15 @@ public interface ItemFactory {
@Deprecated
net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @NotNull net.md_5.bungee.api.chat.BaseComponent[] customName);
// Paper end
+
+ // Purpur start
+ /**
+ * Get a monster egg ItemStack from an EntityType
+ *
+ * @param type EntityType
+ * @return ItemStack spawner egg
+ */
+ @Nullable
+ ItemStack getMonsterEgg(@Nullable org.bukkit.entity.EntityType type);
+ // Purpur end
}

View File

@ -1,97 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 5 Jul 2019 18:21:15 -0500
Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent
diff --git a/src/main/java/net/pl3x/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java b/src/main/java/net/pl3x/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c050b75e9a11ac728868fe95e3f89e6b99de6ad2
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/PlayerSetSpawnerTypeWithEggEvent.java
@@ -0,0 +1,85 @@
+package net.pl3x.purpur.event;
+
+import org.bukkit.block.Block;
+import org.bukkit.block.CreatureSpawner;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.NotNull;
+
+public class PlayerSetSpawnerTypeWithEggEvent extends PlayerEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private final Block block;
+ private final CreatureSpawner spawner;
+ private EntityType type;
+ private boolean cancel;
+
+ public PlayerSetSpawnerTypeWithEggEvent(@NotNull Player player, @NotNull Block block, @NotNull CreatureSpawner spawner, @NotNull EntityType type) {
+ super(player);
+ this.block = block;
+ this.spawner = spawner;
+ this.type = type;
+ }
+
+ /**
+ * Get the spawner Block in the world
+ *
+ * @return Spawner Block
+ */
+ @NotNull
+ public Block getBlock() {
+ return block;
+ }
+
+ /**
+ * Get the spawner state
+ *
+ * @return Spawner state
+ */
+ @NotNull
+ public CreatureSpawner getSpawner() {
+ return spawner;
+ }
+
+ /**
+ * Gets the EntityType being set on the spawner
+ *
+ * @return EntityType being set
+ */
+ @NotNull
+ public EntityType getEntityType() {
+ return type;
+ }
+
+ /**
+ * Sets the EntityType being set on the spawner
+ *
+ * @param type EntityType to set
+ */
+ public void setEntityType(@NotNull EntityType type) {
+ this.type = type;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancel;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancel = cancel;
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}

View File

@ -1,79 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 21 Nov 2016 17:02:11 -0500
Subject: [PATCH] EMC - MonsterEggSpawnEvent
diff --git a/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java b/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..8f1c9c421aeeb0ddf331f076a9b646c510ea4337
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/entity/MonsterEggSpawnEvent.java
@@ -0,0 +1,67 @@
+package net.pl3x.purpur.event.entity;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class MonsterEggSpawnEvent extends Event implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean canceled;
+
+ private final Player player;
+ private Entity entity;
+ private final ItemStack item;
+
+ public MonsterEggSpawnEvent(@Nullable HumanEntity player, @NotNull Entity entity, @NotNull ItemStack item) {
+ this.player = (Player) player;
+ this.entity = entity;
+ this.item = item;
+ }
+
+ @Nullable
+ public Player getPlayer() {
+ return player;
+ }
+
+ @NotNull
+ public Entity getEntity() {
+ return entity;
+ }
+
+ public void setEntity(@Nullable Entity entity) {
+ if (entity == null) {
+ canceled = true;
+ return;
+ }
+ this.entity = entity;
+ }
+
+ @NotNull
+ public ItemStack getItem() {
+ return item;
+ }
+
+ public boolean isCancelled() {
+ return canceled;
+ }
+
+ public void setCancelled(boolean cancel) {
+ canceled = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}

View File

@ -1,24 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Mon, 7 Oct 2019 00:15:28 -0500
Subject: [PATCH] Villager#resetOffers
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index c8777a476e38ef5e72b6709761990a339eb43d2b..ed703af452cd7db5e47608b4ff6ec049f76ed03a 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -113,6 +113,13 @@ public interface Villager extends AbstractVillager {
*/
public void wakeup();
+ // Purpur start
+ /**
+ * Reset this villager's trade offers
+ */
+ public void resetOffers();
+ // Purpur end
+
/**
* Represents Villager type, usually corresponding to what biome they spawn
* in.

View File

@ -1,37 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 2 May 2020 20:55:31 -0500
Subject: [PATCH] Player invulnerabilities
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 09729abc27b6cb3458e19af24137bbbc6e5cb63e..d6b6508fd7ab245f657be262c54ae6dfa20415e7 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2159,5 +2159,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Reset the idle timer back to 0
*/
void resetIdleTimer();
+
+ /**
+ * Check if player is invulnerable from recently spawning or accepting a resource pack
+ *
+ * @return True if invulnerable
+ */
+ boolean isSpawnInvulnerable();
+
+ /**
+ * Get invulnerable ticks remaining
+ *
+ * @return Invulnerable ticks
+ */
+ int getSpawnInvulnerableTicks();
+
+ /**
+ * Set invulnerable ticks remaining
+ *
+ * @param invulnerableTicks Invulnerable ticks remaining
+ */
+ void setSpawnInvulnerableTicks(int invulnerableTicks);
// Purpur end
}

View File

@ -1,124 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sun, 19 Apr 2020 00:25:09 -0500
Subject: [PATCH] Anvil API
diff --git a/src/main/java/net/pl3x/purpur/event/inventory/AnvilTakeResultEvent.java b/src/main/java/net/pl3x/purpur/event/inventory/AnvilTakeResultEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..85663c0a44695f7b7f01a68693cac3d99f4b56ca
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/inventory/AnvilTakeResultEvent.java
@@ -0,0 +1,52 @@
+package net.pl3x.purpur.event.inventory;
+
+import org.bukkit.entity.HumanEntity;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.inventory.InventoryEvent;
+import org.bukkit.inventory.AnvilInventory;
+import org.bukkit.inventory.InventoryView;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when a player takes the result item out of an anvil
+ */
+public class AnvilTakeResultEvent extends InventoryEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private final Player player;
+ private final ItemStack result;
+
+ public AnvilTakeResultEvent(@NotNull HumanEntity player, @NotNull InventoryView view, @NotNull ItemStack result) {
+ super(view);
+ this.player = (Player) player;
+ this.result = result;
+ }
+
+ @NotNull
+ public Player getPlayer() {
+ return player;
+ }
+
+ @NotNull
+ public ItemStack getResult() {
+ return result;
+ }
+
+ @NotNull
+ @Override
+ public AnvilInventory getInventory() {
+ return (AnvilInventory) super.getInventory();
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/net/pl3x/purpur/event/inventory/AnvilUpdateResultEvent.java b/src/main/java/net/pl3x/purpur/event/inventory/AnvilUpdateResultEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..2717ad82ccc0d39c5a69b8890303c245e9a17f83
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/inventory/AnvilUpdateResultEvent.java
@@ -0,0 +1,35 @@
+package net.pl3x.purpur.event.inventory;
+
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.inventory.InventoryEvent;
+import org.bukkit.inventory.AnvilInventory;
+import org.bukkit.inventory.InventoryView;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when anvil slots change, triggering the result slot to be updated
+ */
+public class AnvilUpdateResultEvent extends InventoryEvent {
+ private static final HandlerList handlers = new HandlerList();
+
+ public AnvilUpdateResultEvent(@NotNull InventoryView view) {
+ super(view);
+ }
+
+ @NotNull
+ @Override
+ public AnvilInventory getInventory() {
+ return (AnvilInventory) super.getInventory();
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/inventory/AnvilInventory.java b/src/main/java/org/bukkit/inventory/AnvilInventory.java
index b95e563b5454306a9188ae3295309ee86a756477..435026e533ea9edb8c1800d35c63543ca023a904 100644
--- a/src/main/java/org/bukkit/inventory/AnvilInventory.java
+++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java
@@ -109,4 +109,14 @@ public interface AnvilInventory extends Inventory {
setItem(2, result);
}
// Paper end
+
+ // Purpur start
+ boolean canBypassCost();
+
+ void setBypassCost(boolean bypassCost);
+
+ boolean canDoUnsafeEnchants();
+
+ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants);
+ // Purpur end
}

View File

@ -1,701 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sun, 15 Mar 2020 20:52:12 -0500
Subject: [PATCH] ItemStack convenience methods
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index e2b3470e3c9a97671723f5a67f722fb86fb07fbf..560b441ef35e507236e683b04f6a774c5949a078 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -8731,4 +8731,40 @@ public enum Material implements Keyed {
// </editor-fold>
}
}
+
+ // Purpur start
+ public boolean isArmor() {
+ switch (this) {
+ // <editor-fold defaultstate="collapsed" desc="isarmor">
+ case LEATHER_BOOTS:
+ case LEATHER_CHESTPLATE:
+ case LEATHER_HELMET:
+ case LEATHER_LEGGINGS:
+ case CHAINMAIL_BOOTS:
+ case CHAINMAIL_CHESTPLATE:
+ case CHAINMAIL_HELMET:
+ case CHAINMAIL_LEGGINGS:
+ case IRON_BOOTS:
+ case IRON_CHESTPLATE:
+ case IRON_HELMET:
+ case IRON_LEGGINGS:
+ case GOLDEN_BOOTS:
+ case GOLDEN_CHESTPLATE:
+ case GOLDEN_HELMET:
+ case GOLDEN_LEGGINGS:
+ case DIAMOND_BOOTS:
+ case DIAMOND_CHESTPLATE:
+ case DIAMOND_HELMET:
+ case DIAMOND_LEGGINGS:
+ case NETHERITE_BOOTS:
+ case NETHERITE_CHESTPLATE:
+ case NETHERITE_HELMET:
+ case NETHERITE_LEGGINGS:
+ case TURTLE_HELMET:
+ return true;
+ default:
+ return false;
+ }
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 3e2c08641edffcf00b230ad624685aaff30af0e5..fceba6780a15c274c4689eccbeb6dfb2eee25ed9 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.material.MaterialData;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+// Purpur start
+import com.google.common.collect.Multimap;
+import java.util.Collection;
+import org.bukkit.attribute.Attribute;
+import org.bukkit.attribute.AttributeModifier;
+import org.bukkit.block.data.BlockData;
+import org.bukkit.inventory.meta.BlockDataMeta;
+import org.bukkit.inventory.meta.Repairable;
+import org.bukkit.persistence.PersistentDataContainer;
+import org.bukkit.persistence.PersistentDataHolder;
+import com.destroystokyo.paper.Namespaced;
+// Purpur end
/**
* Represents a stack of items.
@@ -914,4 +926,626 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
return Bukkit.getUnsafe().isValidRepairItemStack(toBeRepaired, this);
}
// Paper end
+
+ // Purpur start
+ /**
+ * Gets the display name that is set.
+ * <p>
+ * Plugins should check that hasDisplayName() returns <code>true</code>
+ * before calling this method.
+ *
+ * @return the display name that is set
+ */
+ @NotNull
+ public String getDisplayName() {
+ return getItemMeta().getDisplayName();
+ }
+
+ /**
+ * Sets the display name.
+ *
+ * @param name the name to set
+ */
+ public void setDisplayName(@Nullable String name) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setDisplayName(name);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for existence of a display name.
+ *
+ * @return true if this has a display name
+ */
+ public boolean hasDisplayName() {
+ return hasItemMeta() && getItemMeta().hasDisplayName();
+ }
+
+ /**
+ * Gets the localized display name that is set.
+ * <p>
+ * Plugins should check that hasLocalizedName() returns <code>true</code>
+ * before calling this method.
+ *
+ * @return the localized name that is set
+ */
+ @NotNull
+ public String getLocalizedName() {
+ return getItemMeta().getLocalizedName();
+ }
+
+ /**
+ * Sets the localized name.
+ *
+ * @param name the name to set
+ */
+ public void setLocalizedName(@Nullable String name) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setLocalizedName(name);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for existence of a localized name.
+ *
+ * @return true if this has a localized name
+ */
+ public boolean hasLocalizedName() {
+ return hasItemMeta() && getItemMeta().hasLocalizedName();
+ }
+
+ /**
+ * Checks for existence of lore.
+ *
+ * @return true if this has lore
+ */
+ public boolean hasLore() {
+ return hasItemMeta() && getItemMeta().hasLore();
+ }
+
+ /**
+ * Checks for existence of the specified enchantment.
+ *
+ * @param ench enchantment to check
+ * @return true if this enchantment exists for this meta
+ */
+ public boolean hasEnchant(@NotNull Enchantment ench) {
+ return hasItemMeta() && getItemMeta().hasEnchant(ench);
+ }
+
+ /**
+ * Checks for the level of the specified enchantment.
+ *
+ * @param ench enchantment to check
+ * @return The level that the specified enchantment has, or 0 if none
+ */
+ public int getEnchantLevel(@NotNull Enchantment ench) {
+ return getItemMeta().getEnchantLevel(ench);
+ }
+
+ /**
+ * Returns a copy the enchantments in this ItemMeta. <br>
+ * Returns an empty map if none.
+ *
+ * @return An immutable copy of the enchantments
+ */
+ @NotNull
+ public Map<Enchantment, Integer> getEnchants() {
+ return getItemMeta().getEnchants();
+ }
+
+ /**
+ * Adds the specified enchantment to this item meta.
+ *
+ * @param ench Enchantment to add
+ * @param level Level for the enchantment
+ * @param ignoreLevelRestriction this indicates the enchantment should be
+ * applied, ignoring the level limit
+ * @return true if the item meta changed as a result of this call, false
+ * otherwise
+ */
+ public boolean addEnchant(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.addEnchant(ench, level, ignoreLevelRestriction);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Removes the specified enchantment from this item meta.
+ *
+ * @param ench Enchantment to remove
+ * @return true if the item meta changed as a result of this call, false
+ * otherwise
+ */
+ public boolean removeEnchant(@NotNull Enchantment ench) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeEnchant(ench);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Checks for the existence of any enchantments.
+ *
+ * @return true if an enchantment exists on this meta
+ */
+ public boolean hasEnchants() {
+ return hasItemMeta() && getItemMeta().hasEnchants();
+ }
+
+ /**
+ * Checks if the specified enchantment conflicts with any enchantments in
+ * this ItemMeta.
+ *
+ * @param ench enchantment to test
+ * @return true if the enchantment conflicts, false otherwise
+ */
+ public boolean hasConflictingEnchant(@NotNull Enchantment ench) {
+ return hasItemMeta() && getItemMeta().hasConflictingEnchant(ench);
+ }
+
+ /**
+ * Sets the custom model data.
+ * <p>
+ * CustomModelData is an integer that may be associated client side with a
+ * custom item model.
+ *
+ * @param data the data to set, or null to clear
+ */
+ public void setCustomModelData(@Nullable Integer data) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setCustomModelData(data);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the custom model data that is set.
+ * <p>
+ * CustomModelData is an integer that may be associated client side with a
+ * custom item model.
+ * <p>
+ * Plugins should check that hasCustomModelData() returns <code>true</code>
+ * before calling this method.
+ *
+ * @return the localized name that is set
+ */
+ public int getCustomModelData() {
+ return getItemMeta().getCustomModelData();
+ }
+
+ /**
+ * Checks for existence of custom model data.
+ * <p>
+ * CustomModelData is an integer that may be associated client side with a
+ * custom item model.
+ *
+ * @return true if this has custom model data
+ */
+ public boolean hasCustomModelData() {
+ return hasItemMeta() && getItemMeta().hasCustomModelData();
+ }
+
+ /**
+ * Returns whether the item has block data currently attached to it.
+ *
+ * @return whether block data is already attached
+ */
+ public boolean hasBlockData() {
+ return hasItemMeta() && ((BlockDataMeta) getItemMeta()).hasBlockData();
+ }
+
+ /**
+ * Returns the currently attached block data for this item or creates a new
+ * one if one doesn't exist.
+ *
+ * The state is a copy, it must be set back (or to another item) with
+ * {@link #setBlockData(BlockData)}
+ *
+ * @param material the material we wish to get this data in the context of
+ * @return the attached data or new data
+ */
+ @NotNull
+ public BlockData getBlockData(@NotNull Material material) {
+ return ((BlockDataMeta) getItemMeta()).getBlockData(material);
+ }
+
+ /**
+ * Attaches a copy of the passed block data to the item.
+ *
+ * @param blockData the block data to attach to the block.
+ * @throws IllegalArgumentException if the blockData is null or invalid for
+ * this item.
+ */
+ public void setBlockData(@NotNull BlockData blockData) {
+ ItemMeta itemMeta = getItemMeta();
+ ((BlockDataMeta) itemMeta).setBlockData(blockData);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the repair penalty
+ *
+ * @return the repair penalty
+ */
+ public int getRepairCost() {
+ return ((Repairable) getItemMeta()).getRepairCost();
+ }
+
+ /**
+ * Sets the repair penalty
+ *
+ * @param cost repair penalty
+ */
+ public void setRepairCost(int cost) {
+ ItemMeta itemMeta = getItemMeta();
+ ((Repairable) itemMeta).setRepairCost(cost);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks to see if this has a repair penalty
+ *
+ * @return true if this has a repair penalty
+ */
+ public boolean hasRepairCost() {
+ return hasItemMeta() && ((Repairable) getItemMeta()).hasRepairCost();
+ }
+
+ /**
+ * Return if the unbreakable tag is true. An unbreakable item will not lose
+ * durability.
+ *
+ * @return true if the unbreakable tag is true
+ */
+ public boolean isUnbreakable() {
+ return hasItemMeta() && getItemMeta().isUnbreakable();
+ }
+
+ /**
+ * Sets the unbreakable tag. An unbreakable item will not lose durability.
+ *
+ * @param unbreakable true if set unbreakable
+ */
+ public void setUnbreakable(boolean unbreakable) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setUnbreakable(unbreakable);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for the existence of any AttributeModifiers.
+ *
+ * @return true if any AttributeModifiers exist
+ */
+ public boolean hasAttributeModifiers() {
+ return hasItemMeta() && getItemMeta().hasAttributeModifiers();
+ }
+
+ /**
+ * Return an immutable copy of all Attributes and
+ * their modifiers in this ItemMeta.<br>
+ * Returns null if none exist.
+ *
+ * @return an immutable {@link Multimap} of Attributes
+ * and their AttributeModifiers, or null if none exist
+ */
+ @Nullable
+ public Multimap<Attribute, AttributeModifier> getAttributeModifiers() {
+ return getItemMeta().getAttributeModifiers();
+ }
+
+ /**
+ * Return an immutable copy of all {@link Attribute}s and their
+ * {@link AttributeModifier}s for a given {@link EquipmentSlot}.<br>
+ * Any {@link AttributeModifier} that does have have a given
+ * {@link EquipmentSlot} will be returned. This is because
+ * AttributeModifiers without a slot are active in any slot.<br>
+ * If there are no attributes set for the given slot, an empty map
+ * will be returned.
+ *
+ * @param slot the {@link EquipmentSlot} to check
+ * @return the immutable {@link Multimap} with the
+ * respective Attributes and modifiers, or an empty map
+ * if no attributes are set.
+ */
+ @NotNull
+ public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nullable EquipmentSlot slot) {
+ return getItemMeta().getAttributeModifiers(slot);
+ }
+
+ /**
+ * Return an immutable copy of all {@link AttributeModifier}s
+ * for a given {@link Attribute}
+ *
+ * @param attribute the {@link Attribute}
+ * @return an immutable collection of {@link AttributeModifier}s
+ * or null if no AttributeModifiers exist for the Attribute.
+ * @throws NullPointerException if Attribute is null
+ */
+ @Nullable
+ public Collection<AttributeModifier> getAttributeModifiers(@NotNull Attribute attribute) {
+ return getItemMeta().getAttributeModifiers(attribute);
+ }
+
+ /**
+ * Add an Attribute and it's Modifier.
+ * AttributeModifiers can now support {@link EquipmentSlot}s.
+ * If not set, the {@link AttributeModifier} will be active in ALL slots.
+ * <br>
+ * Two {@link AttributeModifier}s that have the same {@link java.util.UUID}
+ * cannot exist on the same Attribute.
+ *
+ * @param attribute the {@link Attribute} to modify
+ * @param modifier the {@link AttributeModifier} specifying the modification
+ * @return true if the Attribute and AttributeModifier were
+ * successfully added
+ * @throws NullPointerException if Attribute is null
+ * @throws NullPointerException if AttributeModifier is null
+ * @throws IllegalArgumentException if AttributeModifier already exists
+ */
+ public boolean addAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.addAttributeModifier(attribute, modifier);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Set all {@link Attribute}s and their {@link AttributeModifier}s.
+ * To clear all currently set Attributes and AttributeModifiers use
+ * null or an empty Multimap.
+ * If not null nor empty, this will filter all entries that are not-null
+ * and add them to the ItemStack.
+ *
+ * @param attributeModifiers the new Multimap containing the Attributes
+ * and their AttributeModifiers
+ */
+ public void setAttributeModifiers(@Nullable Multimap<Attribute, AttributeModifier> attributeModifiers) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setAttributeModifiers(attributeModifiers);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Remove all {@link AttributeModifier}s associated with the given
+ * {@link Attribute}.
+ * This will return false if nothing was removed.
+ *
+ * @param attribute attribute to remove
+ * @return true if all modifiers were removed from a given
+ * Attribute. Returns false if no attributes were
+ * removed.
+ * @throws NullPointerException if Attribute is null
+ */
+ public boolean removeAttributeModifier(@NotNull Attribute attribute) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeAttributeModifier(attribute);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Remove all {@link Attribute}s and {@link AttributeModifier}s for a
+ * given {@link EquipmentSlot}.<br>
+ * If the given {@link EquipmentSlot} is null, this will remove all
+ * {@link AttributeModifier}s that do not have an EquipmentSlot set.
+ *
+ * @param slot the {@link EquipmentSlot} to clear all Attributes and
+ * their modifiers for
+ * @return true if all modifiers were removed that match the given
+ * EquipmentSlot.
+ */
+ public boolean removeAttributeModifier(@Nullable EquipmentSlot slot) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeAttributeModifier(slot);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Remove a specific {@link Attribute} and {@link AttributeModifier}.
+ * AttributeModifiers are matched according to their {@link java.util.UUID}.
+ *
+ * @param attribute the {@link Attribute} to remove
+ * @param modifier the {@link AttributeModifier} to remove
+ * @return if any attribute modifiers were remove
+ *
+ * @throws NullPointerException if the Attribute is null
+ * @throws NullPointerException if the AttributeModifier is null
+ *
+ * @see AttributeModifier#getUniqueId()
+ */
+ public boolean removeAttributeModifier(@NotNull Attribute attribute, @NotNull AttributeModifier modifier) {
+ ItemMeta itemMeta = getItemMeta();
+ boolean result = itemMeta.removeAttributeModifier(attribute, modifier);
+ setItemMeta(itemMeta);
+ return result;
+ }
+
+ /**
+ * Returns a custom tag container capable of storing tags on the object.
+ *
+ * Note that the tags stored on this container are all stored under their
+ * own custom namespace therefore modifying default tags using this
+ * {@link PersistentDataHolder} is impossible.
+ *
+ * @return the persistent metadata container
+ */
+ @NotNull
+ public PersistentDataContainer getPersistentDataContainer() {
+ return getItemMeta().getPersistentDataContainer();
+ }
+
+ /**
+ * Checks to see if this item has damage
+ *
+ * @return true if this has damage
+ */
+ public boolean hasDamage() {
+ return hasItemMeta() && ((Damageable) getItemMeta()).hasDamage();
+ }
+
+ /**
+ * Gets the damage
+ *
+ * @return the damage
+ */
+ public int getDamage() {
+ return ((Damageable) getItemMeta()).getDamage();
+ }
+
+ /**
+ * Sets the damage
+ *
+ * @param damage item damage
+ */
+ public void setDamage(int damage) {
+ ItemMeta itemMeta = getItemMeta();
+ ((Damageable) itemMeta).setDamage(damage);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public Set<Namespaced> getDestroyableKeys() {
+ return getItemMeta().getDestroyableKeys();
+ }
+
+ /**
+ * Sets the collection of namespaced keys that the item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canDestroy Collection of {@link com.destroystokyo.paper.Namespaced}
+ */
+ public void setDestroyableKeys(@NotNull Collection<Namespaced> canDestroy) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setDestroyableKeys(canDestroy);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Gets the collection of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public Set<Namespaced> getPlaceableKeys() {
+ return getItemMeta().getPlaceableKeys();
+ }
+
+ /**
+ * Sets the set of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canPlaceOn Collection of {@link com.destroystokyo.paper.Namespaced}
+ */
+ @NotNull
+ public void setPlaceableKeys(@NotNull Collection<Namespaced> canPlaceOn) {
+ ItemMeta itemMeta = getItemMeta();
+ itemMeta.setPlaceableKeys(canPlaceOn);
+ setItemMeta(itemMeta);
+ }
+
+ /**
+ * Checks for the existence of any keys that the item can be placed on
+ *
+ * @return true if this item has placeable keys
+ */
+ public boolean hasPlaceableKeys() {
+ return hasItemMeta() && getItemMeta().hasPlaceableKeys();
+ }
+
+ /**
+ * Checks for the existence of any keys that the item can destroy
+ *
+ * @return true if this item has destroyable keys
+ */
+ public boolean hasDestroyableKeys() {
+ return hasItemMeta() && getItemMeta().hasDestroyableKeys();
+ }
+
+ /**
+ * Repairs this item by 1 durability
+ */
+ public void repair() {
+ repair(1);
+ }
+
+ /**
+ * Damages this item by 1 durability
+ *
+ * @return True if damage broke the item
+ */
+ public boolean damage() {
+ return damage(1);
+ }
+
+ /**
+ * Repairs this item's durability by amount
+ *
+ * @param amount Amount of durability to repair
+ */
+ public void repair(int amount) {
+ damage(-amount);
+ }
+
+ /**
+ * Damages this item's durability by amount
+ *
+ * @param amount Amount of durability to damage
+ * @return True if damage broke the item
+ */
+ public boolean damage(int amount) {
+ return damage(amount, false);
+ }
+
+ /**
+ * Damages this item's durability by amount
+ *
+ * @param amount Amount of durability to damage
+ * @param ignoreUnbreaking Ignores unbreaking enchantment
+ * @return True if damage broke the item
+ */
+ public boolean damage(int amount, boolean ignoreUnbreaking) {
+ Damageable damageable = (Damageable) getItemMeta();
+ if (amount > 0) {
+ int unbreaking = getEnchantLevel(Enchantment.DURABILITY);
+ int reduce = 0;
+ for (int i = 0; unbreaking > 0 && i < amount; ++i) {
+ if (reduceDamage(java.util.concurrent.ThreadLocalRandom.current(), unbreaking)) {
+ ++reduce;
+ }
+ }
+ amount -= reduce;
+ if (amount <= 0) {
+ return isBroke(damageable.getDamage());
+ }
+ }
+ int damage = damageable.getDamage() + amount;
+ damageable.setDamage(damage);
+ setItemMeta((ItemMeta) damageable);
+ return isBroke(damage);
+ }
+
+ public boolean isBroke(int damage) {
+ if (damage > getType().getMaxDurability()) {
+ if (getAmount() > 0) {
+ // ensure it "breaks"
+ setAmount(0);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ private boolean reduceDamage(java.util.Random random, int unbreaking) {
+ if (getType().isArmor()) {
+ return random.nextFloat() < 0.6F;
+ }
+ return random.nextInt(unbreaking + 1) > 0;
+ }
+ // Purpur end
}

View File

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sun, 28 Jun 2020 21:50:55 -0500
Subject: [PATCH] Phantoms attracted to crystals and crystals shoot phantoms
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index b42091752981a1f309ab350e9a394092cb334824..83c51bb5e09549a8205d27a53ff0102f9439d60a 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -206,4 +206,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Zombie> ZOMBIE_ATTACK = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack"));
GoalKey<Creature> STROLL_VILLAGE_GOLEM = GoalKey.of(Creature.class, NamespacedKey.minecraft("stroll_village_golem"));
GoalKey<Mob> UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset"));
+ // Purpur start
+ GoalKey<Phantom> FIND_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal_goal"));
+ GoalKey<Phantom> ORBIT_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal_goal"));
+ // Purpur end
}

View File

@ -1,41 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 10 Jul 2020 12:43:25 -0500
Subject: [PATCH] ChatColor conveniences
diff --git a/src/main/java/org/bukkit/ChatColor.java b/src/main/java/org/bukkit/ChatColor.java
index 4594701d77c5d0f744bece871b98d9f6f73eb5a7..499b222dee1f11d497a29a9a263a5596401ca1eb 100644
--- a/src/main/java/org/bukkit/ChatColor.java
+++ b/src/main/java/org/bukkit/ChatColor.java
@@ -413,4 +413,30 @@ public enum ChatColor {
BY_CHAR.put(color.code, color);
}
}
+
+ // Purpur start
+ public static final Pattern HEX_PATTERN = Pattern.compile("(#[A-Fa-f0-9]{6})");
+
+ @Nullable
+ public static String replaceHex(@Nullable String str) {
+ if (str != null) {
+ java.util.regex.Matcher matcher = HEX_PATTERN.matcher(str);
+ while (matcher.find()) {
+ String group = matcher.group(1);
+ str = str.replace(group, net.md_5.bungee.api.ChatColor.of(group).toString());
+ }
+ }
+ return str;
+ }
+
+ @Nullable
+ public static String color(@Nullable String str) {
+ return color(str, true);
+ }
+
+ @Nullable
+ public static String color(@Nullable String str, boolean parseHex) {
+ return str != null ? net.md_5.bungee.api.ChatColor.translateAlternateColorCodes('&', parseHex ? replaceHex(str) : str) : str;
+ }
+ // Purpur end
}

View File

@ -1,210 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sat, 4 May 2019 00:57:16 -0500
Subject: [PATCH] Ridables
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 83c51bb5e09549a8205d27a53ff0102f9439d60a..177143c9764e82981423879ed35625edd25d3ebf 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -209,5 +209,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
// Purpur start
GoalKey<Phantom> FIND_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("find_crystal_goal"));
GoalKey<Phantom> ORBIT_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal_goal"));
+ GoalKey<Mob> HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
+ GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
// Purpur end
}
diff --git a/src/main/java/net/pl3x/purpur/event/entity/RidableMoveEvent.java b/src/main/java/net/pl3x/purpur/event/entity/RidableMoveEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..48e7ac392fe5efac8a4ce549e31a05ed817417e4
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/entity/RidableMoveEvent.java
@@ -0,0 +1,103 @@
+package net.pl3x.purpur.event.entity;
+
+import com.google.common.base.Preconditions;
+import org.bukkit.Location;
+import org.bukkit.entity.Mob;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Triggered when a ridable mob moves with a rider
+ */
+public class RidableMoveEvent extends EntityEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean canceled;
+ private final Player rider;
+ private Location from;
+ private Location to;
+
+ public RidableMoveEvent(@NotNull Mob entity, @NotNull Player rider, @NotNull Location from, @NotNull Location to) {
+ super(entity);
+ this.rider = rider;
+ this.from = from;
+ this.to = to;
+ }
+
+ @Override
+ @NotNull
+ public Mob getEntity() {
+ return (Mob) entity;
+ }
+
+ @NotNull
+ public Player getRider() {
+ return rider;
+ }
+
+ public boolean isCancelled() {
+ return canceled;
+ }
+
+ public void setCancelled(boolean cancel) {
+ canceled = cancel;
+ }
+
+ /**
+ * Gets the location this entity moved from
+ *
+ * @return Location the entity moved from
+ */
+ @NotNull
+ public Location getFrom() {
+ return from;
+ }
+
+ /**
+ * Sets the location to mark as where the entity moved from
+ *
+ * @param from New location to mark as the entity's previous location
+ */
+ public void setFrom(@NotNull Location from) {
+ validateLocation(from);
+ this.from = from;
+ }
+
+ /**
+ * Gets the location this entity moved to
+ *
+ * @return Location the entity moved to
+ */
+ @NotNull
+ public Location getTo() {
+ return to;
+ }
+
+ /**
+ * Sets the location that this entity will move to
+ *
+ * @param to New Location this entity will move to
+ */
+ public void setTo(@NotNull Location to) {
+ validateLocation(to);
+ this.to = to;
+ }
+
+ private void validateLocation(@NotNull Location loc) {
+ Preconditions.checkArgument(loc != null, "Cannot use null location!");
+ Preconditions.checkArgument(loc.getWorld() != null, "Cannot use null location with null world!");
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java b/src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c0ec5a130985e8da4cc9e596a6b70503d2550f77
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/entity/RidableSpacebarEvent.java
@@ -0,0 +1,37 @@
+package net.pl3x.purpur.event.entity;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.NotNull;
+
+public class RidableSpacebarEvent extends EntityEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
+
+ public RidableSpacebarEvent(@NotNull Entity entity) {
+ super(entity);
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ cancelled = cancel;
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 46985eaea3d3b00d1dd88c2dd5a2bc53d518c64f..38c6ecba4a6090ee42180ff52db42bac8e7f95d7 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -704,4 +704,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
public boolean isTicking();
// Paper end
+
+ // Purpur start
+ /**
+ * Get the riding player
+ *
+ * @return Riding player
+ */
+ @Nullable
+ Player getRider();
+
+ /**
+ * Check if entity is being ridden
+ *
+ * @return True if being ridden
+ */
+ boolean hasRider();
+
+ /**
+ * Check if entity is ridable
+ *
+ * @return True if ridable
+ */
+ boolean isRidable();
+
+ /**
+ * Check if entity is ridable in water
+ *
+ * @return True if ridable in water
+ */
+ boolean isRidableInWater();
+ // Purpur end
}

View File

@ -1,27 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 15 Aug 2020 11:18:27 -0500
Subject: [PATCH] Configurable permission message upgrades
This allows the configurable permission message in paper.yml to be blank and also support newlines
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index c10fc8d2386301bc2caddcdb1cd18566bcaa8689..882c565ac2be3df976e7bbeb4dc80c9ac474a8b1 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -184,9 +184,13 @@ public abstract class Command {
return true;
}
+ // Purpur start
+ String permissionMessage = this.permissionMessage;
if (permissionMessage == null) {
- target.sendMessage(Bukkit.getPermissionMessage()); // Paper
- } else if (permissionMessage.length() != 0) {
+ permissionMessage = Bukkit.getPermissionMessage();
+ }
+ if (permissionMessage.length() != 0) {
+ // Purpur end
for (String line : permissionMessage.replace("<permission>", permission).split("\n")) {
target.sendMessage(line);
}

View File

@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Mon, 17 Aug 2020 21:50:32 -0500
Subject: [PATCH] LivingEntity#broadcastItemBreak
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 4ccbb3ef3c597ef9da2c6744f410283a1dc2538c..42811d18ff304082f74f45794344891208599c04 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -865,5 +865,12 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param safeFallDistance Safe fall distance
*/
void setSafeFallDistance(float safeFallDistance);
+
+ /**
+ * Play item break animation for the item in specified equipment slot
+ *
+ * @param slot Equipment slot to play break animation for
+ */
+ void broadcastItemBreak(@NotNull org.bukkit.inventory.EquipmentSlot slot);
// Purpur end
}

View File

@ -1,73 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 22 Aug 2020 17:42:08 -0500
Subject: [PATCH] Item entity immunities
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
index 0ee072645ecf1bf5feb74de6960947ef76db366e..5b9a20e0695218f1239d2bf1d0368291e2a10c06 100644
--- a/src/main/java/org/bukkit/entity/Item.java
+++ b/src/main/java/org/bukkit/entity/Item.java
@@ -120,4 +120,62 @@ public interface Item extends Entity {
*/
public void setWillAge(boolean willAge);
// Paper end
+
+ // Purpur start
+ /**
+ * Set whether or not this item is immune to cactus
+ *
+ * @param immuneToCactus True to make immune to cactus
+ */
+ void setImmuneToCactus(boolean immuneToCactus);
+
+ /**
+ * Check if item is immune to cactus
+ *
+ * @return True if immune to cactus
+ */
+ boolean isImmuneToCactus();
+
+ /**
+ * Set whether or not this item is immune to explosions
+ *
+ * @param immuneToExplosion True to make immune to explosions
+ */
+ void setImmuneToExplosion(boolean immuneToExplosion);
+
+ /**
+ * Check if item is immune to explosions
+ *
+ * @return True if immune to explosions
+ */
+ boolean isImmuneToExplosion();
+
+ /**
+ * Set whether or not this item is immune to fire
+ *
+ * @param immuneToFire True to make immune to fire
+ */
+ void setImmuneToFire(boolean immuneToFire);
+
+ /**
+ * Check if item is immune to fire
+ *
+ * @return True if immune to fire
+ */
+ boolean isImmuneToFire();
+
+ /**
+ * Set whether or not this item is immune to lightning
+ *
+ * @param immuneToLightning True to make immune to lightning
+ */
+ void setImmuneToLightning(boolean immuneToLightning);
+
+ /**
+ * Check if item is immune to lightning
+ *
+ * @return True if immune to lightning
+ */
+ boolean isImmuneToLightning();
+ // Purpur end
}

View File

@ -1,114 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Parker Hawke <hawkeboyz2@hotmail.com>
Date: Sat, 27 Jun 2020 18:43:37 -0400
Subject: [PATCH] Spigot - Improve output of plugins command
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
index 1aa58c59e1e8738bbdc77752885ff3b18b29de42..4974fc518c3645e6e060ff52e71a47a86d52ec5c 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -11,6 +11,15 @@ import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
+// Spigot start
+import net.md_5.bungee.api.chat.BaseComponent;
+import net.md_5.bungee.api.chat.ClickEvent;
+import net.md_5.bungee.api.chat.ComponentBuilder;
+import net.md_5.bungee.api.chat.HoverEvent;
+import net.md_5.bungee.api.chat.ComponentBuilder.FormatRetention;
+import org.bukkit.entity.Player;
+import org.bukkit.plugin.PluginDescriptionFile;
+// Spigot end
public class PluginsCommand extends BukkitCommand {
public PluginsCommand(@NotNull String name) {
@@ -25,7 +34,13 @@ public class PluginsCommand extends BukkitCommand {
public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) {
if (!testPermission(sender)) return true;
- sender.sendMessage("Plugins " + getPluginList());
+ // Spigot start
+ if (sender instanceof Player && sender.hasPermission("bukkit.command.version")) {
+ sender.spigot().sendMessage(getPluginListSpigot());
+ } else {
+ sender.sendMessage("Plugins " + getPluginList());
+ }
+ // Spigot end
return true;
}
@@ -71,4 +86,72 @@ public class PluginsCommand extends BukkitCommand {
// Paper end
}
+ // Spigot start
+ @NotNull
+ private BaseComponent[] getPluginListSpigot() {
+ Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
+ ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.length + "): ");
+
+ int index = 0;
+ for (Plugin plugin : plugins) {
+ if (index++ > 0) {
+ pluginList.append(", ", FormatRetention.NONE).color(net.md_5.bungee.api.ChatColor.WHITE);
+ }
+
+ // Event components
+ PluginDescriptionFile description = plugin.getDescription();
+ ComponentBuilder hoverEventComponents = new ComponentBuilder();
+ hoverEventComponents.append("Version: ").color(net.md_5.bungee.api.ChatColor.WHITE).append(description.getVersion()).color(net.md_5.bungee.api.ChatColor.GREEN);
+
+ if (description.getDescription() != null) {
+ hoverEventComponents.append("\nDescription: ").color(net.md_5.bungee.api.ChatColor.WHITE).append(description.getDescription()).color(net.md_5.bungee.api.ChatColor.GREEN);
+ }
+
+ if (description.getWebsite() != null) {
+ hoverEventComponents.append("\nWebsite: ").color(net.md_5.bungee.api.ChatColor.WHITE).append(description.getWebsite()).color(net.md_5.bungee.api.ChatColor.GREEN);
+ }
+
+ if (!description.getAuthors().isEmpty()) {
+ if (description.getAuthors().size() == 1) {
+ hoverEventComponents.append("\nAuthor: ");
+ } else {
+ hoverEventComponents.append("\nAuthors: ");
+ }
+
+ hoverEventComponents.color(net.md_5.bungee.api.ChatColor.WHITE).append(getAuthors(description));
+ }
+
+ HoverEvent hoverEvent = new HoverEvent(HoverEvent.Action.SHOW_TEXT, hoverEventComponents.create());
+ ClickEvent clickEvent = new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/version " + description.getName());
+
+ // Plugin list entry
+ pluginList.append(plugin.getDescription().getName());
+ pluginList.color(plugin.isEnabled() ? net.md_5.bungee.api.ChatColor.GREEN : net.md_5.bungee.api.ChatColor.RED);
+ pluginList.event(hoverEvent).event(clickEvent);
+
+ if (plugin.getDescription().getProvides().size() > 0) {
+ pluginList.append("( ", FormatRetention.NONE).color(net.md_5.bungee.api.ChatColor.WHITE).append(String.join(", ", plugin.getDescription().getProvides())).append(")");
+ }
+ }
+
+ return pluginList.create();
+ }
+
+ @NotNull
+ private BaseComponent[] getAuthors(@NotNull final PluginDescriptionFile description) {
+ ComponentBuilder result = new ComponentBuilder();
+ List<String> authors = description.getAuthors();
+
+ for (int i = 0; i < authors.size(); i++) {
+ if (i > 0) {
+ result.append(i < authors.size() - 1 ? ", " : " and ", FormatRetention.NONE);
+ result.color(net.md_5.bungee.api.ChatColor.WHITE);
+ }
+
+ result.append(authors.get(i)).color(net.md_5.bungee.api.ChatColor.GREEN);
+ }
+
+ return result.create();
+ }
+ // Spigot end
}

View File

@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nitricspace <nitricspace@users.noreply.github.com>
Date: Wed, 23 Sep 2020 22:14:38 +0100
Subject: [PATCH] Add option to disable zombie aggressiveness towards villagers
when lagging
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 177143c9764e82981423879ed35625edd25d3ebf..da638f9745aceebe4f2ca90823308c6879c75ae7 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -211,5 +211,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Phantom> ORBIT_CRYSTAL_GOAL = GoalKey.of(Phantom.class, NamespacedKey.minecraft("orbit_crystal_goal"));
GoalKey<Mob> HAS_RIDER = GoalKey.of(Mob.class, NamespacedKey.minecraft("has_rider"));
GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
+ GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
+ GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
// Purpur end
}

View File

@ -1,52 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 2 Oct 2020 17:43:24 -0500
Subject: [PATCH] Add predicate to recipe's ExactChoice ingredient
diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java
index 90208bc96085f05a3b657b9467b1670d00b03104..c59d5e4ef9641fd73463b177239226866272745b 100644
--- a/src/main/java/org/bukkit/inventory/RecipeChoice.java
+++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java
@@ -10,6 +10,7 @@ import java.util.function.Predicate;
import org.bukkit.Material;
import org.bukkit.Tag;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable; // Purpur
/**
* Represents a potential item match within a recipe. All choices within a
@@ -152,6 +153,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
public static class ExactChoice implements RecipeChoice {
private List<ItemStack> choices;
+ private Predicate<ItemStack> predicate; // Purpur
public ExactChoice(@NotNull ItemStack stack) {
this(Arrays.asList(stack));
@@ -196,6 +198,7 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
@Override
public boolean test(@NotNull ItemStack t) {
+ if (predicate != null) return predicate.test(t); // Purpur
for (ItemStack match : choices) {
if (t.isSimilar(match)) {
return true;
@@ -205,6 +208,17 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable {
return false;
}
+ // Purpur start
+ @Nullable
+ public Predicate<ItemStack> getPredicate() {
+ return predicate;
+ }
+
+ public void setPredicate(@Nullable Predicate<ItemStack> predicate) {
+ this.predicate = predicate;
+ }
+ // Purpur end
+
@Override
public int hashCode() {
int hash = 7;

View File

@ -1,56 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Tue, 24 Nov 2020 04:30:34 -0600
Subject: [PATCH] Add critical hit check to EntityDamagedByEntityEvent
diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java
index 869bad7405ec7fa67728e90d8b9f2e11b542611f..05fde759bbdf6068f140b4428bbcb355e22d6b28 100644
--- a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java
@@ -10,15 +10,28 @@ import org.jetbrains.annotations.NotNull;
*/
public class EntityDamageByEntityEvent extends EntityDamageEvent {
private final Entity damager;
+ private final boolean isCritical; // Purpur
public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage) {
+ // Purpur start
+ this(damager, damagee, cause, damage, false);
+ }
+ public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage, boolean isCritical) {
+ // Purpur end
super(damagee, cause, damage);
this.damager = damager;
+ this.isCritical = isCritical; // Purpur
}
public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) {
+ // Purpur start
+ this(damager, damagee, cause, modifiers, modifierFunctions, false);
+ }
+ public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map<DamageModifier, Double> modifiers, @NotNull final Map<DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, boolean isCritical) {
+ // Purpur end
super(damagee, cause, modifiers, modifierFunctions);
this.damager = damager;
+ this.isCritical = isCritical; // Purpur
}
/**
@@ -30,4 +43,16 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent {
public Entity getDamager() {
return damager;
}
+
+ // Purpur start
+
+ /**
+ * Whether this damage was done by a critical hit
+ *
+ * @return True if critical hit
+ */
+ public boolean isCritical() {
+ return this.isCritical;
+ }
+ // Purpur end
}

View File

@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Mon, 30 Nov 2020 06:02:54 -0600
Subject: [PATCH] Left handed API
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
index 7d4ce660adb21e579e564796568945ee20f0ca59..4205dc5746dafd966f95103cdd2a1a55e79642f8 100644
--- a/src/main/java/org/bukkit/entity/Mob.java
+++ b/src/main/java/org/bukkit/entity/Mob.java
@@ -146,4 +146,20 @@ public interface Mob extends LivingEntity, Lootable {
* @return whether the mob is aware
*/
public boolean isAware();
+
+ // Purpur start
+ /**
+ * Check if Mob is left-handed
+ *
+ * @return True if left-handed
+ */
+ public boolean isLeftHanded();
+
+ /**
+ * Set if Mob is left-handed
+ *
+ * @param leftHanded True if left-handed
+ */
+ public void setLeftHanded(boolean leftHanded);
+ // Purpur end
}

View File

@ -1,27 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Tue, 8 Dec 2020 09:48:18 -0600
Subject: [PATCH] Alphabetize in-game /plugins list
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
index 4974fc518c3645e6e060ff52e71a47a86d52ec5c..37cc5d7e9db89e4ef7ab16da1b159bd19134a4ff 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -2,6 +2,7 @@ package org.bukkit.command.defaults;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@@ -89,7 +90,7 @@ public class PluginsCommand extends BukkitCommand {
// Spigot start
@NotNull
private BaseComponent[] getPluginListSpigot() {
- Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
+ Plugin[] plugins = Arrays.stream(Bukkit.getPluginManager().getPlugins()).sorted(Comparator.comparing(plugin -> plugin.getName().toLowerCase())).toArray(Plugin[]::new); // Purpur
ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.length + "): ");
int index = 0;

View File

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Tue, 8 Dec 2020 17:15:15 -0500
Subject: [PATCH] Rabid Wolf API
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index da638f9745aceebe4f2ca90823308c6879c75ae7..39f77041133228c4bd4cec2427ad0bae8e739d4a 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -213,5 +213,6 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> HORSE_HAS_RIDER = GoalKey.of(AbstractHorse.class, NamespacedKey.minecraft("horse_has_rider"));
GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
+ GoalKey<Wolf> AVOID_RABID_WOLVES = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolves"));
// Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java
index 0e5decadf31140d6cb121c298f935ccc12c7a7e7..c1fd30fe4cd4eec11eb8298f059d14584b7dd7ec 100644
--- a/src/main/java/org/bukkit/entity/Wolf.java
+++ b/src/main/java/org/bukkit/entity/Wolf.java
@@ -39,4 +39,20 @@ public interface Wolf extends Tameable, Sittable {
* @param color the color to apply
*/
public void setCollarColor(@NotNull DyeColor color);
+
+ // Purpur start
+ /**
+ * Checks if this wolf is rabid
+ *
+ * @return whether the wolf is rabid
+ */
+ public boolean isRabid();
+
+ /**
+ * Sets this wolf to be rabid or not
+ *
+ * @param rabid whether the wolf should be rabid
+ */
+ public void setRabid(boolean rabid);
+ // Purpur end
}

View File

@ -1,23 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Thu, 24 Dec 2020 11:00:04 -0600
Subject: [PATCH] Full netherite armor grants fire resistance
diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
index 16b5fd279b0cb926900247618bcdb381a93f5a35..d592c62aadb3245396865c098c5979f2a162f868 100644
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
@@ -213,6 +213,12 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
* When all effects are removed due to a bucket of milk.
*/
MILK,
+ // Purpur start
+ /**
+ * When a player wears full netherite armor
+ */
+ NETHERITE_ARMOR,
+ // Purpur end
/**
* When a player gets bad omen after killing a patrol captain.
*/

View File

@ -1,141 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Sat, 9 Jan 2021 15:26:04 +0100
Subject: [PATCH] Add EntityTeleportHinderedEvent
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/pl3x/purpur/event/entity/EntityTeleportHinderedEvent.java b/src/main/java/net/pl3x/purpur/event/entity/EntityTeleportHinderedEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..e6fcc4027cb70061b804460b39e00cca273d35ad
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/entity/EntityTeleportHinderedEvent.java
@@ -0,0 +1,117 @@
+package net.pl3x.purpur.event.entity;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Fired when an entity is hindered from teleporting.
+ */
+public class EntityTeleportHinderedEvent extends EntityEvent {
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ private final Reason reason;
+
+ @Nullable
+ private final TeleportCause teleportCause;
+
+ private boolean retry = false;
+
+ public EntityTeleportHinderedEvent(@NotNull Entity what, @NotNull Reason reason,
+ @Nullable TeleportCause teleportCause) {
+ super(what);
+ this.reason = reason;
+ this.teleportCause = teleportCause;
+ }
+
+ /**
+ * @return why the teleport was hindered.
+ */
+ @NotNull
+ public Reason getReason() {
+ return reason;
+ }
+
+ /**
+ * @return why the teleport occurred if cause was given, otherwise {@code null}.
+ */
+ @Nullable
+ public TeleportCause getTeleportCause() {
+ return teleportCause;
+ }
+
+ /**
+ * Whether the teleport should be retried.
+ * <p>
+ * Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack
+ * overflow. Do not retry more than necessary.
+ * </p>
+ *
+ * @return whether the teleport should be retried.
+ */
+ public boolean shouldRetry() {
+ return retry;
+ }
+
+ /**
+ * Sets whether the teleport should be retried.
+ * <p>
+ * Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack
+ * overflow. Do not retry more than necessary.
+ * </p>
+ *
+ * @param retry whether the teleport should be retried.
+ */
+ public void setShouldRetry(boolean retry) {
+ this.retry = retry;
+ }
+
+ /**
+ * Calls the event and tests if should retry.
+ *
+ * @return whether the teleport should be retried.
+ */
+ @Override
+ public boolean callEvent() {
+ super.callEvent();
+ return shouldRetry();
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ /**
+ * Reason for hindrance in teleports.
+ */
+ public enum Reason {
+ /**
+ * The teleported entity is a passenger of another entity.
+ */
+ IS_PASSENGER,
+
+ /**
+ * The teleported entity has passengers.
+ */
+ IS_VEHICLE,
+
+ /**
+ * The teleport event was cancelled.
+ * <p>
+ * This is only caused by players teleporting.
+ * </p>
+ */
+ EVENT_CANCELLED,
+ }
+}

View File

@ -1,112 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nahuel <nahueldolores@hotmail.com>
Date: Sat, 9 Jan 2021 15:33:52 +0100
Subject: [PATCH] Add StructureGenerateEvent
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
diff --git a/src/main/java/net/pl3x/purpur/event/world/StructureGenerateEvent.java b/src/main/java/net/pl3x/purpur/event/world/StructureGenerateEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..e77f45f761368da9b230c425d975a717cf4d10fd
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/event/world/StructureGenerateEvent.java
@@ -0,0 +1,68 @@
+package net.pl3x.purpur.event.world;
+
+import org.bukkit.Bukkit;
+import org.bukkit.StructureType;
+import org.bukkit.World;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.world.WorldEvent;
+import org.jetbrains.annotations.NotNull;
+
+public class StructureGenerateEvent extends WorldEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ private final StructureType structureType;
+ private final int chunkX;
+ private final int chunkZ;
+
+ private boolean cancel = false;
+
+ public StructureGenerateEvent(@NotNull World world,
+ @NotNull StructureType structureType, int chunkX, int chunkZ) {
+ super(!Bukkit.isPrimaryThread(), world); // Structure generation is not necessarily on the main thread as of 1.16.
+ this.structureType = structureType;
+ this.chunkX = chunkX;
+ this.chunkZ = chunkZ;
+ }
+
+ @NotNull
+ @Override
+ public World getWorld() {
+ return super.getWorld();
+ }
+
+ @NotNull
+ public StructureType getStructureType() {
+ return structureType;
+ }
+
+ public int getChunkX() {
+ return chunkX;
+ }
+
+ public int getChunkZ() {
+ return chunkZ;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancel = cancel;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return this.cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
diff --git a/src/main/java/org/bukkit/event/world/WorldEvent.java b/src/main/java/org/bukkit/event/world/WorldEvent.java
index cffeff33f007d3b03b7c862b25be453f705da739..1fa083d53dce161ef9e9f19407f230c94b2d7d15 100644
--- a/src/main/java/org/bukkit/event/world/WorldEvent.java
+++ b/src/main/java/org/bukkit/event/world/WorldEvent.java
@@ -10,6 +10,13 @@ import org.jetbrains.annotations.NotNull;
public abstract class WorldEvent extends Event {
private final World world;
+ // Purpur start
+ public WorldEvent(boolean isAsync, @NotNull final World world) {
+ super(isAsync);
+ this.world = world;
+ }
+ // Purpur end
+
public WorldEvent(@NotNull final World world) {
this.world = world;
}

View File

@ -1,80 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Sat, 9 Jan 2021 21:21:27 +0100
Subject: [PATCH] Add unsafe Entity serialization API
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index ef3011d74ce9acf02d0ee857033816854134ec0e..b2502aaab690b1414a1adffdf64e5a5456feb99c 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -194,4 +194,28 @@ public interface UnsafeValues {
*/
int getProtocolVersion();
// Paper end
+
+ // Purpur start
+
+ /**
+ * Serialize entity to byte array
+ *
+ * @param entity entity to serialize
+ * @return serialized entity
+ */
+ byte[] serializeEntity(org.bukkit.entity.Entity entity);
+
+ /**
+ * Deserialize an entity from byte array
+ * <p>
+ * The entity is not automatically spawned in the world. You will have to spawn
+ * the entity yourself with {@link org.bukkit.entity.Entity#spawnAt(Location)} or
+ * {@link org.bukkit.entity.Entity#spawnAt(Location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason)}
+ *
+ * @param data serialized entity
+ * @param world world entity belongs in
+ * @return deserialized entity
+ */
+ org.bukkit.entity.Entity deserializeEntity(byte[] data, org.bukkit.World world);
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index b47e31d2b9b41b39b46892fe10bf36d82c5d8e1b..7fa5242bd44c9b19648d79fa8fecbb7ee125288e 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -751,5 +751,24 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return True if ridable in water
*/
boolean isRidableInWater();
+
+ /**
+ * Spawn this entity in the world at the given {@link Location} with the default spawn reason.
+ *
+ * @param location The location at which to spawn the entity.
+ * @return Whether the entity was successfully spawned.
+ */
+ default boolean spawnAt(@NotNull Location location) {
+ return spawnAt(location, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT);
+ }
+
+ /**
+ * Spawn this entity in the world at the given {@link Location} with the reason given.
+ *
+ * @param location The location at which to spawn the entity.
+ * @param spawnReason The reason for which the entity was spawned.
+ * @return Whether the entity was successfully spawned.
+ */
+ boolean spawnAt(@NotNull Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason);
// Purpur end
}

View File

@ -1,867 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Wed, 17 Mar 2021 15:56:47 -0500
Subject: [PATCH] Conflict on change for adventure deprecations
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index b3cd3e5288bdcdd928efb8cba97f504d8e3ec58e..8036c66af0bc6b11ffd0f716138901bcfea007e1 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -303,7 +303,7 @@ public final class Bukkit {
* @return the number of players
* @deprecated in favour of {@link Server#sendMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public static int broadcastMessage(@NotNull String message) {
return server.broadcastMessage(message);
}
@@ -935,7 +935,7 @@ public final class Bukkit {
* @return number of message recipients
* @deprecated in favour of {@link #broadcast(net.kyori.adventure.text.Component, String)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public static int broadcast(@NotNull String message, @NotNull String permission) {
return server.broadcast(message, permission);
}
@@ -1212,7 +1212,7 @@ public final class Bukkit {
*
* @see InventoryType#isCreatable()
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
public static Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title) {
return server.createInventory(owner, type, title);
@@ -1262,7 +1262,7 @@ public final class Bukkit {
* @throws IllegalArgumentException if the size is not a multiple of 9
* @deprecated in favour of {@link #createInventory(InventoryHolder, InventoryType, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
public static Inventory createInventory(@Nullable InventoryHolder owner, int size, @NotNull String title) throws IllegalArgumentException {
return server.createInventory(owner, size, title);
@@ -1289,7 +1289,7 @@ public final class Bukkit {
* @deprecated in favour of {@link #createMerchant(net.kyori.adventure.text.Component)}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public static Merchant createMerchant(@Nullable String title) {
return server.createMerchant(title);
}
@@ -1378,7 +1378,7 @@ public final class Bukkit {
* @deprecated in favour of {@link #motd()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public static String getMotd() {
return server.getMotd();
}
@@ -1400,7 +1400,7 @@ public final class Bukkit {
* @deprecated in favour of {@link #shutdownMessage()}
*/
@Nullable
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public static String getShutdownMessage() {
return server.getShutdownMessage();
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index a126581c74da8fae4c86fde2f28a850150c408cd..0f66655541dbb0dbb05a13a3612bb46cfb2b538a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -250,7 +250,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the number of players
* @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public int broadcastMessage(@NotNull String message);
// Paper start
@@ -773,7 +773,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return number of message recipients
* @deprecated in favour of {@link #broadcast(net.kyori.adventure.text.Component, String)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public int broadcast(@NotNull String message, @NotNull String permission);
// Paper start
/**
@@ -1024,7 +1024,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*
* @see InventoryType#isCreatable()
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title);
@@ -1068,7 +1068,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @throws IllegalArgumentException if the size is not a multiple of 9
* @deprecated in favour of {@link #createInventory(InventoryHolder, int, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, int size, @NotNull String title) throws IllegalArgumentException;
@@ -1091,7 +1091,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @deprecated in favour of {@link #createMerchant(net.kyori.adventure.text.Component)}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
Merchant createMerchant(@Nullable String title);
/**
@@ -1164,7 +1164,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @deprecated in favour of {@link #motd()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
String getMotd();
// Paper start
@@ -1182,7 +1182,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @deprecated in favour of {@link #shutdownMessage()}
*/
@Nullable
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
String getShutdownMessage();
/**
diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java
index 6ea9b54d95d80070c01a612c0ce2ab37f0b4ad41..fe9ec9cb7875df4a40d1c4155e13cca9b3628b30 100644
--- a/src/main/java/org/bukkit/block/Sign.java
+++ b/src/main/java/org/bukkit/block/Sign.java
@@ -48,7 +48,7 @@ public interface Sign extends TileState, Colorable {
* @deprecated in favour of {@link #lines()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String[] getLines();
/**
@@ -62,7 +62,7 @@ public interface Sign extends TileState, Colorable {
* @deprecated in favour of {@link #line(int)}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getLine(int index) throws IndexOutOfBoundsException;
/**
@@ -76,7 +76,7 @@ public interface Sign extends TileState, Colorable {
* @throws IndexOutOfBoundsException If the index is out of the range 0..3
* @deprecated in favour of {@link #line(int, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException;
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 25252bad38ca35b81b225b57c4b6ce77ad6de166..9f289576d97c3406d506d3f4fa7287bc74e5b425 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -72,7 +72,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @return the friendly name
* @deprecated in favour of {@link #displayName()}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
public String getDisplayName();
@@ -86,7 +86,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param name The new display name.
* @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setDisplayName(@Nullable String name);
// Paper start
@@ -127,7 +127,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @deprecated in favour of {@link #playerListName()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getPlayerListName();
/**
@@ -138,7 +138,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param name new player list name
* @deprecated in favour of {@link #playerListName(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setPlayerListName(@Nullable String name);
/**
@@ -147,7 +147,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @return player list header or null
* @deprecated in favour of {@link #playerListHeader()}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@Nullable
public String getPlayerListHeader();
@@ -157,7 +157,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @return player list header or null
* @deprecated in favour of {@link #playerListFooter()}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@Nullable
public String getPlayerListFooter();
@@ -167,7 +167,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param header player list header, null for empty
* @deprecated in favour of {@link #sendPlayerListHeader(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setPlayerListHeader(@Nullable String header);
/**
@@ -176,7 +176,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param footer player list footer, null for empty
* @deprecated in favour of {@link #sendPlayerListFooter(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setPlayerListFooter(@Nullable String footer);
/**
@@ -187,7 +187,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param footer player list footer, null for empty
* @deprecated in favour of {@link #sendPlayerListHeaderAndFooter(net.kyori.adventure.text.Component, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setPlayerListHeaderFooter(@Nullable String header, @Nullable String footer);
/**
@@ -227,7 +227,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param message kick message
* @deprecated in favour of {@link #kick(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void kickPlayer(@Nullable String message);
// Paper start
@@ -598,7 +598,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
* @deprecated in favour of {@link #sendSignChange(org.bukkit.Location, java.util.List)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException;
@@ -620,7 +620,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
* @deprecated in favour of {@link #sendSignChange(org.bukkit.Location, java.util.List, org.bukkit.DyeColor)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException;
/**
@@ -1769,7 +1769,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @deprecated in favour of {@link #locale()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getLocale();
// Paper start
diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
index 078228106b299a8e38495f7f881d38de4f87bc95..bd5b3142a88c31a676c08fa3e8175f81f4259835 100644
--- a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
+++ b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
@@ -37,7 +37,7 @@ public interface CommandMinecart extends Minecart {
* @param name New name for this CommandMinecart.
* @deprecated in favour of {@link #customName(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setName(@Nullable String name);
}
diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
index 1f79f704abf339150df08900b8ea7da4cefef258..004106913655446774f875015cb79863d21263c8 100644
--- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java
+++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
@@ -90,7 +90,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
* @deprecated in favour of {@link #lines()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String[] getLines() {
return adventure$lines.stream().map(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer()::serialize).toArray(String[]::new); // Paper
}
@@ -106,7 +106,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
* @deprecated in favour of {@link #line(int)}
*/
@Nullable
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getLine(int index) throws IndexOutOfBoundsException {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.adventure$lines.get(index)); // Paper
}
@@ -120,7 +120,7 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
* or < 0}
* @deprecated in favour of {@link #line(int, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setLine(int index, @Nullable String line) throws IndexOutOfBoundsException {
adventure$lines.set(index, line != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(line) : null); // Paper
}
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
index 3d45d2e41aad6992b40a22030f2a63baeec78757..3cecfe9f7c253ab474829c612cca2dc05fd5d111 100644
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
@@ -151,7 +151,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
* @param deathMessage Message to appear to other players on the server.
* @deprecated in favour of {@link #deathMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setDeathMessage(@Nullable String deathMessage) {
this.deathMessage = deathMessage;
this.adventure$deathMessage = deathMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
@@ -164,7 +164,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
* @deprecated in favour of {@link #deathMessage()}
*/
@Nullable
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getDeathMessage() {
return this.deathMessage != null ? this.deathMessage : (this.adventure$deathMessage != null ? getDeathMessageString(this.adventure$deathMessage) : null); // Paper
}
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryType.java b/src/main/java/org/bukkit/event/inventory/InventoryType.java
index 129eac25da4f27489038fb15ab1aeecb172b60cc..670aca11bbaa2d155cd9d2105ac94c9df71d7d8d 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryType.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryType.java
@@ -170,7 +170,7 @@ public enum InventoryType {
}
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getDefaultTitle() {
return title;
}
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index 77aefda5aac4602bf5bf71c29600e7450defdd4e..240552d61ae12fbec826f771f0f366500e72d941 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -179,7 +179,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
* @deprecated in favour of {@link #kickMessage()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getKickMessage() {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
}
@@ -190,7 +190,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
* @param message New kick message
* @deprecated in favour of {@link #kickMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setKickMessage(@NotNull final String message) {
this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
}
@@ -210,7 +210,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
* @param message Kick message to display to the user
* @deprecated in favour of {@link #disallow(org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void disallow(@NotNull final Result result, @NotNull final String message) {
this.result = result;
this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
diff --git a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java
index 851a189d42e271679abc78f95049d8badf7a2b64..7057c2e95267ad32190c5666f20a0566f7fe32fa 100644
--- a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java
@@ -17,7 +17,7 @@ public class PlayerJoinEvent extends PlayerEvent {
this.joinMessage = joinMessage;
}
- @Deprecated // Paper end
+ @Deprecated // Paper end // Purpur - conflict on change
public PlayerJoinEvent(@NotNull final Player playerJoined, @Nullable final String joinMessage) {
super(playerJoined);
this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper end
@@ -50,7 +50,7 @@ public class PlayerJoinEvent extends PlayerEvent {
* @deprecated in favour of {@link #joinMessage()}
*/
@Nullable
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getJoinMessage() {
return this.joinMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.joinMessage); // Paper
}
@@ -61,7 +61,7 @@ public class PlayerJoinEvent extends PlayerEvent {
* @param joinMessage join message. If null, no message will be sent
* @deprecated in favour of {@link #joinMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setJoinMessage(@Nullable String joinMessage) {
this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper
}
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
index 02914c0743852e9e4fd2c085fd4b735e74d8875b..94688093671949551992a8c80904cd6042deb83b 100644
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
@@ -85,7 +85,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
* @deprecated in favour of {@link #reason()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getReason() {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.kickReason); // Paper
}
@@ -97,7 +97,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
* @deprecated in favour of {@link #leaveMessage()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getLeaveMessage() {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.leaveMessage); // Paper
}
@@ -118,7 +118,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
* @param kickReason kick reason
* @deprecated in favour of {@link #reason(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setReason(@NotNull String kickReason) {
this.kickReason = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(kickReason); // Paper
}
@@ -129,7 +129,7 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
* @param leaveMessage leave message
* @deprecated in favour of {@link #leaveMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setLeaveMessage(@NotNull String leaveMessage) {
this.leaveMessage = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(leaveMessage); // Paper
}
diff --git a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
index 84521186404b8e43c81a2f9513dce2be40d27840..8c65e9e1476d27fc55419290fb53e46dee9b304d 100644
--- a/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLocaleChangeEvent.java
@@ -37,7 +37,7 @@ public class PlayerLocaleChangeEvent extends PlayerEvent {
* @deprecated in favour of {@link #locale()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getLocale() {
return locale;
}
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
index 75cc54739ef841cd90568d74927d6002d4cfa7e0..712900c9afc3b79806d2b564c0734facf969a6fe 100644
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
@@ -139,7 +139,7 @@ public class PlayerLoginEvent extends PlayerEvent {
* @deprecated in favour of {@link #kickMessage()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getKickMessage() {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
}
@@ -150,7 +150,7 @@ public class PlayerLoginEvent extends PlayerEvent {
* @param message New kick message
* @deprecated in favour of {@link #kickMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setKickMessage(@NotNull final String message) {
this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
}
@@ -181,7 +181,7 @@ public class PlayerLoginEvent extends PlayerEvent {
* @param message Kick message to display to the user
* @deprecated in favour of {@link #disallow(Result, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper start
+ @Deprecated // Paper start // Purpur - conflict on change
public void disallow(@NotNull final Result result, @NotNull final String message) {
this.result = result;
this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message);
diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
index 123979ed64939d615b061f91c19c630e1e1db8c7..5b85579964dc6a6150f0c0be650a4bf731414838 100644
--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
@@ -95,7 +95,7 @@ public class PlayerPreLoginEvent extends Event {
* @return Current kick message
* @deprecated in favour of {@link #kickMessage()}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
public String getKickMessage() {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
@@ -107,7 +107,7 @@ public class PlayerPreLoginEvent extends Event {
* @param message New kick message
* @deprecated in favour of {@link #kickMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setKickMessage(@NotNull final String message) {
this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
}
@@ -127,7 +127,7 @@ public class PlayerPreLoginEvent extends Event {
* @param message Kick message to display to the user
* @deprecated in favour of {@link #disallow(org.bukkit.event.player.PlayerPreLoginEvent.Result, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void disallow(@NotNull final Result result, @NotNull final String message) {
this.result = result;
this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
diff --git a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java
index e43acfb570036adb73d195136573620378cc6a61..1826d11d8b18702ee12c669b50df7f538c324582 100644
--- a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java
@@ -61,7 +61,7 @@ public class PlayerQuitEvent extends PlayerEvent {
* @deprecated in favour of {@link #quitMessage()}
*/
@Nullable
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getQuitMessage() {
return this.quitMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.quitMessage); // Paper
}
@@ -72,7 +72,7 @@ public class PlayerQuitEvent extends PlayerEvent {
* @param quitMessage quit message
* @deprecated in favour of {@link #quitMessage(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setQuitMessage(@Nullable String quitMessage) {
this.quitMessage = quitMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(quitMessage) : null; // Paper
}
diff --git a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
index 4f8c85222c7bd33217c7db0ff5f47bf397f8f3e5..c18d6d979bd22814ebdc52b995d2cc7ed46dd87f 100644
--- a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
+++ b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
@@ -73,7 +73,7 @@ public class BroadcastMessageEvent extends ServerEvent implements Cancellable {
* @deprecated in favour of {@link #message()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getMessage() {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
}
@@ -84,7 +84,7 @@ public class BroadcastMessageEvent extends ServerEvent implements Cancellable {
* @param message New message to broadcast
* @deprecated in favour of {@link #message(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setMessage(@NotNull String message) {
this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
}
diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
index ede5a41bc071a9c9cea369b227b37a50222f295d..6c6501d73041a6c69e78f34d3bf2a96a7de5f690 100644
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
@@ -109,7 +109,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
* @deprecated in favour of {@link #motd()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getMotd() {
return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.motd); // Paper
}
@@ -120,7 +120,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
* @param motd the message of the day
* @deprecated in favour of {@link #motd(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setMotd(@NotNull String motd) {
this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper
}
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
index b06995aa57aa9cba0bb59f1d26d81015619a08e6..5e33fe46ab9bb034acc6a38a3c00c33c8f029ca6 100644
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
@@ -464,7 +464,7 @@ public abstract class InventoryView {
* @return The title.
* @deprecated in favour of {@link #title()}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
public abstract String getTitle();
}
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index 7357c166115f346a1efebd0f0f2d5491de6a9a39..b90cb7aa98ea40573557a80ca5c7be7c5c494956 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -242,7 +242,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book {
* @deprecated in favour of {@link #page(int)}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
String getPage(int page);
/**
@@ -258,7 +258,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book {
* @param data the data to set for that page
* @deprecated in favour of {@link #page(int, net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setPage(int page, @NotNull String data);
/**
@@ -268,7 +268,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book {
* @deprecated in favour of {@link #pages()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
List<String> getPages();
/**
@@ -278,7 +278,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book {
* @param pages A list of pages to set the book to use
* @deprecated in favour of {@link #pages(List)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setPages(@NotNull List<String> pages);
/**
@@ -288,7 +288,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book {
* @param pages A list of strings, each being a page
* @deprecated in favour of {@link #pages(net.kyori.adventure.text.Component...)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setPages(@NotNull String... pages);
/**
@@ -298,7 +298,7 @@ public interface BookMeta extends ItemMeta, net.kyori.adventure.inventory.Book {
* @param pages A list of strings, each being a page
* @deprecated in favour of {@link #addPages(net.kyori.adventure.text.Component...)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void addPage(@NotNull String... pages);
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index f093f991f1fedd20fcef041b093398250b7fb286..49d8b1bdad79f452c863f83557ffde7e8f4749c6 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -59,7 +59,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @return the display name that is set
* @deprecated in favour of {@link #displayName()}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@NotNull
String getDisplayName();
@@ -83,7 +83,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @param name the name to set
* @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setDisplayName(@Nullable String name);
// Paper start
@@ -155,7 +155,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @return a list of lore that is set
* @deprecated in favour of {@link #lore()}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
@Nullable
List<String> getLore();
@@ -179,7 +179,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* @param lore the lore that will be set
* @deprecated in favour of {@link #lore(List)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setLore(@Nullable List<String> lore);
/**
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index ed0bc2024a0bb85837e25f75ae89d1fe257b2e60..f6e831f844e1fe99a2617bd64c2290d1f2e96d81 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -259,7 +259,7 @@ public final class MapCursor {
* @deprecated in favour of {@link #caption()}
*/
@Nullable
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public String getCaption() {
return this.caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.caption); // Paper
}
@@ -270,7 +270,7 @@ public final class MapCursor {
* @param caption new caption
* @deprecated in favour of {@link #caption(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
public void setCaption(@Nullable String caption) {
this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
}
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
index 58bddb11fd534e7c33a4ffd7b72b055ba92c767a..a1b6b1123808378d58c855cacac391ce97df6f19 100644
--- a/src/main/java/org/bukkit/scoreboard/Objective.java
+++ b/src/main/java/org/bukkit/scoreboard/Objective.java
@@ -47,7 +47,7 @@ public interface Objective {
* @deprecated in favour of {@link #displayName()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
String getDisplayName() throws IllegalStateException;
/**
@@ -60,7 +60,7 @@ public interface Objective {
* characters.
* @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setDisplayName(@NotNull String displayName) throws IllegalStateException, IllegalArgumentException;
/**
diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
index f09ff32cc3ffc16af379a378b1948991435393e8..e9db79d10522895e6f119c0cc87eec1cbc45ba6e 100644
--- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java
+++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
@@ -89,7 +89,7 @@ public interface Scoreboard {
* @deprecated in favour of {@link #registerNewObjective(String, String, net.kyori.adventure.text.Component)}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @NotNull String displayName) throws IllegalArgumentException;
/**
@@ -113,7 +113,7 @@ public interface Scoreboard {
* @deprecated in favour of {@link #registerNewObjective(String, String, net.kyori.adventure.text.Component, RenderType)}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @NotNull String displayName, @NotNull RenderType renderType) throws IllegalArgumentException;
/**
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
index f0af10a5b9ad048be197ed5ec6c8ed2672eb3dd5..705b2268b1c227b34852c14601381230dc626a08 100644
--- a/src/main/java/org/bukkit/scoreboard/Team.java
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
@@ -110,7 +110,7 @@ public interface Team {
* @deprecated in favour of {@link #displayName()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
String getDisplayName() throws IllegalStateException;
/**
@@ -122,7 +122,7 @@ public interface Team {
* @throws IllegalStateException if this team has been unregistered
* @deprecated in favour of {@link #displayName(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setDisplayName(@NotNull String displayName) throws IllegalStateException, IllegalArgumentException;
/**
@@ -133,7 +133,7 @@ public interface Team {
* @deprecated in favour of {@link #prefix()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
String getPrefix() throws IllegalStateException;
/**
@@ -146,7 +146,7 @@ public interface Team {
* @throws IllegalStateException if this team has been unregistered
* @deprecated in favour of {@link #prefix(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setPrefix(@NotNull String prefix) throws IllegalStateException, IllegalArgumentException;
/**
@@ -157,7 +157,7 @@ public interface Team {
* @deprecated in favour of {@link #suffix()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
String getSuffix() throws IllegalStateException;
/**
@@ -170,7 +170,7 @@ public interface Team {
* @throws IllegalStateException if this team has been unregistered
* @deprecated in favour of {@link #suffix(net.kyori.adventure.text.Component)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setSuffix(@NotNull String suffix) throws IllegalStateException, IllegalArgumentException;
/**
@@ -184,7 +184,7 @@ public interface Team {
* @deprecated in favour of {@link #color()}
*/
@NotNull
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
ChatColor getColor() throws IllegalStateException;
/**
@@ -197,7 +197,7 @@ public interface Team {
* no color
* @deprecated in favour of {@link #color(net.kyori.adventure.text.format.NamedTextColor)}
*/
- @Deprecated // Paper
+ @Deprecated // Paper // Purpur - conflict on change
void setColor(@NotNull ChatColor color);
/**

View File

@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Tue, 23 Mar 2021 15:01:03 -0500
Subject: [PATCH] Add enchantment target for bows and crossbows
diff --git a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
index 635e07a6b0e255c4fdad58ba9d281c807af4e229..93d5fad641c5afa679b59dc712f0d0faaddcfe2e 100644
--- a/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
+++ b/src/main/java/org/bukkit/enchantments/EnchantmentTarget.java
@@ -226,6 +226,18 @@ public enum EnchantmentTarget {
public boolean includes(@NotNull Material item) {
return BREAKABLE.includes(item) || (WEARABLE.includes(item) && !item.equals(Material.ELYTRA)) || item.equals(Material.COMPASS);
}
+ // Purpur start
+ },
+
+ /**
+ * Allow the Enchantment to be placed on bows and crossbows.
+ */
+ BOW_AND_CROSSBOW {
+ @Override
+ public boolean includes(@NotNull Material item) {
+ return item.equals(Material.BOW) || item.equals(Material.CROSSBOW);
+ }
+ // Purpur end
};
/**

View File

@ -1,17 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
Date: Thu, 13 May 2021 21:38:01 -0500
Subject: [PATCH] Iron golem poppy calms anger
diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 39f77041133228c4bd4cec2427ad0bae8e739d4a..29144c0e325a3efbef05670a6fb2e849bbed6bba 100644
--- a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -214,5 +214,6 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Drowned> DROWNED_ATTACK_VILLAGER = GoalKey.of(Drowned.class, NamespacedKey.minecraft("drowned_attack_villager"));
GoalKey<Zombie> ZOMBIE_ATTACK_VILLAGER = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack_villager"));
GoalKey<Wolf> AVOID_RABID_WOLVES = GoalKey.of(Wolf.class, NamespacedKey.minecraft("avoid_rabid_wolves"));
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
// Purpur end
}

View File

@ -1,48 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Kerllenevich <me@notom3ga.me>
Date: Tue, 25 May 2021 16:30:30 -0400
Subject: [PATCH] API for any mob to burn daylight
Co-authored by: Encode42 <me@encode42.dev>
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 7fa5242bd44c9b19648d79fa8fecbb7ee125288e..62d8d7dbd4d602ca8cb00ff0cf1331583b398323 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -770,5 +770,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return Whether the entity was successfully spawned.
*/
boolean spawnAt(@NotNull Location location, @NotNull org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason);
+
+ /**
+ * Checks if the entity is in daylight
+ *
+ * @return True if in daylight
+ */
+ boolean isInDaylight();
// Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 42811d18ff304082f74f45794344891208599c04..ebe10b5612835d22dfcf8b30b0f028022e47216e 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -872,5 +872,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param slot Equipment slot to play break animation for
*/
void broadcastItemBreak(@NotNull org.bukkit.inventory.EquipmentSlot slot);
+
+ /**
+ * If this mob will burn in the sunlight
+ *
+ * @return True if mob will burn in sunlight
+ */
+ boolean shouldBurnInDay();
+
+ /**
+ * Set if this mob should burn in the sunlight
+ *
+ * @param shouldBurnInDay True to burn in sunlight
+ */
+ void setShouldBurnInDay(boolean shouldBurnInDay);
// Purpur end
}

File diff suppressed because it is too large Load Diff

View File

@ -1,424 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Thu, 9 May 2019 18:09:43 -0500
Subject: [PATCH] Purpur config files
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index b480bd3044370b8eb733166f0c4b737344475993..4d8740678049aa749b42618470e9cc838555528d 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Airplane", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane
+ Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -602,8 +602,8 @@ public class Metrics {
}));
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
- metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() || PaperConfig.isProxyOnlineMode() ? "online" : "offline"));
- metrics.addCustomChart(new Metrics.SimplePie("airplane_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane
+ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (PaperConfig.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
+ metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index efc1e42d606e1c9feb1a4871c0714933ae92a1b2..a0ed8ed1d6b89a4f10dff645e09eaff303fb3f8a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -118,6 +118,11 @@ public class PaperConfig {
}
}
+ // Purpur start - public save method for config migration
+ saveConfig();
+ }
+ public static void saveConfig() {
+ // Purpur end
try {
config.save(CONFIG_FILE);
} catch (IOException ex) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 3e21bd029131ceeaac9cb46bef8d238617ca76ea..c2932e739a607e4ed3f94632ca45bdb2b0954ecb 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -212,6 +212,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
return false;
}
com.destroystokyo.paper.PaperConfig.registerCommands();
+ // Purpur start
+ try {
+ net.pl3x.purpur.PurpurConfig.init((java.io.File) options.valueOf("purpur-settings"));
+ } catch (Exception e) {
+ DedicatedServer.LOGGER.error("Unable to load server configuration", e);
+ return false;
+ }
+ net.pl3x.purpur.PurpurConfig.registerCommands();
+ // Purpur end
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
// Paper end
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
index f8d11a1f0337acf60f2d9f94bd4bbbf6eb77c6de..0ede4766117e0bc28127baf1b14535370d8ea878 100644
--- a/src/main/java/net/minecraft/world/level/World.java
+++ b/src/main/java/net/minecraft/world/level/World.java
@@ -158,6 +158,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config
+ public final net.pl3x.purpur.PurpurWorldConfig purpurConfig; // Purpur
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPosition lastPhysicsProblem; // Spigot
@@ -259,6 +260,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(((net.minecraft.world.level.storage.WorldDataServer) worlddatamutable).getName(), this.spigotConfig); // Paper
this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray
this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config
+ this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName())); // Purpur
this.generator = gen;
this.world = new CraftWorld((WorldServer) this, gen, env);
this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..74fc4fc2216cf82e1546ef3d567f2750b1240df1
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -0,0 +1,130 @@
+package net.pl3x.purpur;
+
+import com.google.common.base.Throwables;
+import net.minecraft.server.MinecraftServer;
+import net.pl3x.purpur.command.PurpurCommand;
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
+import org.bukkit.configuration.InvalidConfigurationException;
+import org.bukkit.configuration.file.YamlConfiguration;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+
+public class PurpurConfig {
+ private static final String HEADER = "This is the main configuration file for Purpur.\n"
+ + "As you can see, there's tons to configure. Some options may impact gameplay, so use\n"
+ + "with caution, and make sure you know what each option does before configuring.\n"
+ + "\n"
+ + "If you need help with the configuration or have any questions related to Purpur,\n"
+ + "join us in our Discord guild.\n"
+ + "\n"
+ + "Website: https://github.com/pl3xgaming/Purpur \n"
+ + "Wiki: https://github.com/pl3xgaming/Purpur/wiki \n";
+ private static File CONFIG_FILE;
+ public static YamlConfiguration config;
+
+ private static Map<String, Command> commands;
+
+ static int version;
+ static boolean verbose;
+
+ public static void init(File configFile) {
+ CONFIG_FILE = configFile;
+ config = new YamlConfiguration();
+ try {
+ config.load(CONFIG_FILE);
+ } catch (IOException ignore) {
+ } catch (InvalidConfigurationException ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Could not load purpur.yml, please correct your syntax errors", ex);
+ throw Throwables.propagate(ex);
+ }
+ config.options().header(HEADER);
+ config.options().copyDefaults(true);
+ verbose = getBoolean("verbose", false);
+
+ commands = new HashMap<>();
+ commands.put("purpur", new PurpurCommand("purpur"));
+
+ version = getInt("config-version", 13);
+ set("config-version", 13);
+
+ readConfig(PurpurConfig.class, null);
+ }
+
+ protected static void log(String s) {
+ if (verbose) {
+ log(Level.INFO, s);
+ }
+ }
+
+ protected static void log(Level level, String s) {
+ Bukkit.getLogger().log(level, s);
+ }
+
+ public static void registerCommands() {
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Purpur", entry.getValue());
+ }
+ }
+
+ static void readConfig(Class<?> clazz, Object instance) {
+ for (Method method : clazz.getDeclaredMethods()) {
+ if (Modifier.isPrivate(method.getModifiers())) {
+ if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
+ try {
+ method.setAccessible(true);
+ method.invoke(instance);
+ } catch (InvocationTargetException ex) {
+ throw Throwables.propagate(ex.getCause());
+ } catch (Exception ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
+ }
+ }
+ }
+ }
+
+ try {
+ config.save(CONFIG_FILE);
+ } catch (IOException ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex);
+ }
+ }
+
+ private static void set(String path, Object val) {
+ config.addDefault(path, val);
+ config.set(path, val);
+ }
+
+ private static boolean getBoolean(String path, boolean def) {
+ config.addDefault(path, def);
+ return config.getBoolean(path, config.getBoolean(path));
+ }
+
+ private static double getDouble(String path, double def) {
+ config.addDefault(path, def);
+ return config.getDouble(path, config.getDouble(path));
+ }
+
+ private static int getInt(String path, int def) {
+ config.addDefault(path, def);
+ return config.getInt(path, config.getInt(path));
+ }
+
+ private static <T> List getList(String path, T def) {
+ config.addDefault(path, def);
+ return config.getList(path, config.getList(path));
+ }
+
+ private static String getString(String path, String def) {
+ config.addDefault(path, def);
+ return config.getString(path, config.getString(path));
+ }
+}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..361f7857e461578e90cb71e15027dadaf794cb69
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -0,0 +1,59 @@
+package net.pl3x.purpur;
+
+import org.bukkit.configuration.ConfigurationSection;
+import java.util.List;
+import static net.pl3x.purpur.PurpurConfig.log;
+
+public class PurpurWorldConfig {
+
+ private final String worldName;
+
+ public PurpurWorldConfig(String worldName) {
+ this.worldName = worldName;
+ init();
+ }
+
+ public void init() {
+ log("-------- World Settings For [" + worldName + "] --------");
+ PurpurConfig.readConfig(PurpurWorldConfig.class, this);
+ }
+
+ private void set(String path, Object val) {
+ PurpurConfig.config.addDefault("world-settings.default." + path, val);
+ PurpurConfig.config.set("world-settings.default." + path, val);
+ if (PurpurConfig.config.get("world-settings." + worldName + "." + path) != null) {
+ PurpurConfig.config.addDefault("world-settings." + worldName + "." + path, val);
+ PurpurConfig.config.set("world-settings." + worldName + "." + path, val);
+ }
+ }
+
+ private ConfigurationSection getConfigurationSection(String path) {
+ ConfigurationSection section = PurpurConfig.config.getConfigurationSection("world-settings." + worldName + "." + path);
+ return section != null ? section : PurpurConfig.config.getConfigurationSection("world-settings.default." + path);
+ }
+
+ private boolean getBoolean(String path, boolean def) {
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
+ return PurpurConfig.config.getBoolean("world-settings." + worldName + "." + path, PurpurConfig.config.getBoolean("world-settings.default." + path));
+ }
+
+ private double getDouble(String path, double def) {
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
+ return PurpurConfig.config.getDouble("world-settings." + worldName + "." + path, PurpurConfig.config.getDouble("world-settings.default." + path));
+ }
+
+ private int getInt(String path, int def) {
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
+ return PurpurConfig.config.getInt("world-settings." + worldName + "." + path, PurpurConfig.config.getInt("world-settings.default." + path));
+ }
+
+ private <T> List<?> getList(String path, T def) {
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
+ return PurpurConfig.config.getList("world-settings." + worldName + "." + path, PurpurConfig.config.getList("world-settings.default." + path));
+ }
+
+ private String getString(String path, String def) {
+ PurpurConfig.config.addDefault("world-settings.default." + path, def);
+ return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
+ }
+}
diff --git a/src/main/java/net/pl3x/purpur/command/PurpurCommand.java b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..536955124afaec5c8a070249c7432cb99bf43d67
--- /dev/null
+++ b/src/main/java/net/pl3x/purpur/command/PurpurCommand.java
@@ -0,0 +1,65 @@
+package net.pl3x.purpur.command;
+
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.level.WorldServer;
+import net.pl3x.purpur.PurpurConfig;
+import org.bukkit.ChatColor;
+import org.bukkit.Location;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class PurpurCommand extends Command {
+ public PurpurCommand(String name) {
+ super(name);
+ this.description = "Purpur related commands";
+ this.usageMessage = "/purpur [reload | version]";
+ this.setPermission("bukkit.command.purpur");
+ }
+
+ @Override
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
+ if (args.length == 1) {
+ return Stream.of("reload", "version")
+ .filter(arg -> arg.startsWith(args[0].toLowerCase()))
+ .collect(Collectors.toList());
+ }
+ return Collections.emptyList();
+ }
+
+ @Override
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
+ if (!testPermission(sender)) return true;
+
+ if (args.length != 1) {
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
+ return false;
+ }
+
+ if (args[0].equalsIgnoreCase("reload")) {
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
+
+ MinecraftServer console = MinecraftServer.getServer();
+ PurpurConfig.init((File) console.options.valueOf("purpur-settings"));
+ for (WorldServer world : console.getWorlds()) {
+ world.purpurConfig.init();
+ }
+ console.server.reloadCount++;
+
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Purpur config reload complete.");
+ } else if (args[0].equalsIgnoreCase("version")) {
+ Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
+ if (verCmd != null) {
+ return verCmd.execute(sender, commandLabel, new String[0]);
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c8e2f682746cd94c2f02a452bbeb672c36a916a1..f53389a49e62f54faa6af19226589305b597d1ae 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -882,6 +882,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config
+ net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
for (WorldServer world : console.getWorlds()) {
world.worldDataServer.setDifficulty(config.difficulty);
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
@@ -917,6 +918,7 @@ public final class CraftServer implements Server {
world.spigotConfig.init(); // Spigot
world.paperConfig.init(); // Paper
world.tuinityConfig.init(); // Tuinity - Server Config
+ world.purpurConfig.init(); // Purpur
}
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -935,6 +937,7 @@ public final class CraftServer implements Server {
reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
com.destroystokyo.paper.PaperConfig.registerCommands(); // Paper
+ net.pl3x.purpur.PurpurConfig.registerCommands(); // Purpur
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2385,6 +2388,18 @@ public final class CraftServer implements Server {
}
// Tuinity end - add config to timings report
+ // Purpur start
+ @Override
+ public YamlConfiguration getPurpurConfig() {
+ return net.pl3x.purpur.PurpurConfig.config;
+ }
+
+ @Override
+ public java.util.Properties getServerProperties() {
+ return getProperties().properties;
+ }
+ // Purpur end
+
@Override
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 57180e164ac51b1aac070c00d820792d13d67258..09168bced10094c2058ffe7a10613b83360d998b 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -154,6 +154,14 @@ public class Main {
.describedAs("Yml file");
/* Conctete End - Server Config */
+ // Purpur Start
+ acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("purpur.yml"))
+ .describedAs("Yml file");
+ // Purpur end
+
// Paper start
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()

View File

@ -1,73 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 5 Jun 2020 21:30:19 -0500
Subject: [PATCH] Timings stuff
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 35810f42d7a0cd50a4cbe90e8d698fe57914c889..5e672a0660d0aceffcdb26d185590ca18aa4f023 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -227,10 +227,14 @@ public class TimingsExport extends Thread {
// Information on the users Config
parent.put("config", createObject(
- pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
- pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
- pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report
- pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report
+ // Purpur start
+ pair("server.properties", mapAsJSON(Bukkit.spigot().getServerProperties())),
+ pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
+ pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
+ pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)),
+ pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)), // Tuinity - add config to timings report
+ pair("purpur", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null))
+ // Purpur end
));
new TimingsExport(listeners, parent, history).start();
@@ -271,6 +275,19 @@ public class TimingsExport extends Thread {
return timingsCost;
}
+ // Purpur start
+ private static JSONObject mapAsJSON(java.util.Properties properties) {
+ JSONObject object = new JSONObject();
+ for (String key : properties.stringPropertyNames()) {
+ if (key.startsWith("rcon") || key.startsWith("query") || key.equals("level-seed") || TimingsManager.hiddenConfigs.contains(key)) {
+ continue;
+ }
+ object.put(key, valAsJSON(properties.get(key), key));
+ }
+ return object;
+ }
+ // Purpur end
+
private static JSONObject mapAsJSON(ConfigurationSection config, String parentKey) {
JSONObject object = new JSONObject();
@@ -307,7 +324,7 @@ public class TimingsExport extends Thread {
String response = null;
String timingsURL = null;
try {
- HttpURLConnection con = (HttpURLConnection) new URL("http://timings.aikar.co/post").openConnection();
+ HttpURLConnection con = (HttpURLConnection) new URL(net.pl3x.purpur.PurpurConfig.timingsUrl + "/post").openConnection(); // Purpur
con.setDoOutput(true);
String hostName = "BrokenHost";
try {
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 74fc4fc2216cf82e1546ef3d567f2750b1240df1..108be36fc37c04eece6ccb93d19e58a31326ceb0 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -127,4 +127,10 @@ public class PurpurConfig {
config.addDefault(path, def);
return config.getString(path, config.getString(path));
}
+
+ public static String timingsUrl = "https://timings.pl3x.net";
+ private static void timingsSettings() {
+ timingsUrl = getString("settings.timings.url", timingsUrl);
+ if (!TimingsManager.hiddenConfigs.contains("server-ip")) TimingsManager.hiddenConfigs.add("server-ip");
+ }
}

View File

@ -1,189 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Thu, 23 May 2019 21:50:37 -0500
Subject: [PATCH] Barrels and enderchests 6 rows
diff --git a/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java b/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java
index 85b9eba1dba3de69ab65b0e1c5ebb8740ce6e9e5..97f6ba97a4b2a35c0b8a003e1e27ad38831d859d 100644
--- a/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java
+++ b/src/main/java/net/minecraft/world/inventory/InventoryEnderChest.java
@@ -28,11 +28,34 @@ public class InventoryEnderChest extends InventorySubcontainer {
}
public InventoryEnderChest(EntityHuman owner) {
- super(27);
+ super(net.pl3x.purpur.PurpurConfig.enderChestSixRows ? 54 : 27); // Purpur
this.owner = owner;
// CraftBukkit end
}
+ // Purpur start
+ @Override
+ public int getSize() {
+ if (net.pl3x.purpur.PurpurConfig.enderChestSixRows && net.pl3x.purpur.PurpurConfig.enderChestPermissionRows && owner != null && owner.getProfile() != null) {
+ org.bukkit.craftbukkit.entity.CraftHumanEntity bukkit = owner.getBukkitEntity();
+ if (bukkit.hasPermission("purpur.enderchest.rows.six")) {
+ return 54;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.five")) {
+ return 45;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.four")) {
+ return 36;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.three")) {
+ return 27;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.two")) {
+ return 18;
+ } else if (bukkit.hasPermission("purpur.enderchest.rows.one")) {
+ return 9;
+ }
+ }
+ return super.getSize();
+ }
+ // Purpur end
+
public void a(TileEntityEnderChest tileentityenderchest) {
this.a = tileentityenderchest;
}
diff --git a/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java b/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java
index 70d10c492b6ba893d56a463c0e71ac6aa8707f81..34ea9d2aeb9d606d487be796283c9d5ed614a6af 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockEnderChest.java
@@ -11,6 +11,7 @@ import net.minecraft.world.TileInventory;
import net.minecraft.world.entity.monster.piglin.PiglinAI;
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.inventory.ContainerChest;
+import net.minecraft.world.inventory.Containers;
import net.minecraft.world.inventory.InventoryEnderChest;
import net.minecraft.world.item.context.BlockActionContext;
import net.minecraft.world.level.GeneratorAccess;
@@ -81,6 +82,27 @@ public class BlockEnderChest extends BlockChestAbstract<TileEntityEnderChest> im
inventoryenderchest.a(tileentityenderchest);
entityhuman.openContainer(new TileInventory((i, playerinventory, entityhuman1) -> {
+ // Purpur start
+ if (net.pl3x.purpur.PurpurConfig.enderChestSixRows) {
+ if (net.pl3x.purpur.PurpurConfig.enderChestPermissionRows) {
+ org.bukkit.craftbukkit.entity.CraftHumanEntity player = entityhuman.getBukkitEntity();
+ if (player.hasPermission("purpur.enderchest.rows.six")) {
+ return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, inventoryenderchest, 6);
+ } else if (player.hasPermission("purpur.enderchest.rows.five")) {
+ return new ContainerChest(Containers.GENERIC_9X5, i, playerinventory, inventoryenderchest, 5);
+ } else if (player.hasPermission("purpur.enderchest.rows.four")) {
+ return new ContainerChest(Containers.GENERIC_9X4, i, playerinventory, inventoryenderchest, 4);
+ } else if (player.hasPermission("purpur.enderchest.rows.three")) {
+ return new ContainerChest(Containers.GENERIC_9X3, i, playerinventory, inventoryenderchest, 3);
+ } else if (player.hasPermission("purpur.enderchest.rows.two")) {
+ return new ContainerChest(Containers.GENERIC_9X2, i, playerinventory, inventoryenderchest, 2);
+ } else if (player.hasPermission("purpur.enderchest.rows.one")) {
+ return new ContainerChest(Containers.GENERIC_9X1, i, playerinventory, inventoryenderchest, 1);
+ }
+ }
+ return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, inventoryenderchest, 6);
+ }
+ // Purpur end
return ContainerChest.a(i, playerinventory, inventoryenderchest);
}, BlockEnderChest.e));
entityhuman.a(StatisticList.OPEN_ENDERCHEST);
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java
index 7a6f150490bc3ef8a5ed43c401fd70bcc67f40f0..449d2c38abdd35b782a6732006eebb381815bcba 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBarrel.java
@@ -14,6 +14,7 @@ import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.entity.player.PlayerInventory;
import net.minecraft.world.inventory.Container;
import net.minecraft.world.inventory.ContainerChest;
+import net.minecraft.world.inventory.Containers;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.BlockBarrel;
import net.minecraft.world.level.block.Blocks;
@@ -68,7 +69,7 @@ public class TileEntityBarrel extends TileEntityLootable {
private TileEntityBarrel(TileEntityTypes<?> tileentitytypes) {
super(tileentitytypes);
- this.items = NonNullList.a(27, ItemStack.b);
+ this.items = NonNullList.a(net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27, ItemStack.b); // Purpur
}
public TileEntityBarrel() {
@@ -97,7 +98,7 @@ public class TileEntityBarrel extends TileEntityLootable {
@Override
public int getSize() {
- return 27;
+ return net.pl3x.purpur.PurpurConfig.barrelSixRows ? 54 : 27; // Purpur
}
@Override
@@ -117,6 +118,7 @@ public class TileEntityBarrel extends TileEntityLootable {
@Override
protected Container createContainer(int i, PlayerInventory playerinventory) {
+ if (net.pl3x.purpur.PurpurConfig.barrelSixRows) return new ContainerChest(Containers.GENERIC_9X6, i, playerinventory, this, 6); // Purpur
return ContainerChest.a(i, playerinventory, this);
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 108be36fc37c04eece6ccb93d19e58a31326ceb0..2f329bae9f09d0ed21a4538fba6b95919ec35887 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -7,6 +7,7 @@ import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
+import org.bukkit.event.inventory.InventoryType;
import java.io.File;
import java.io.IOException;
@@ -133,4 +134,23 @@ public class PurpurConfig {
timingsUrl = getString("settings.timings.url", timingsUrl);
if (!TimingsManager.hiddenConfigs.contains("server-ip")) TimingsManager.hiddenConfigs.add("server-ip");
}
+
+ public static boolean barrelSixRows = false;
+ public static boolean enderChestSixRows = false;
+ public static boolean enderChestPermissionRows = false;
+ private static void blockSettings() {
+ if (version < 3) {
+ boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
+ set("settings.blocks.barrel.six-rows", oldValue);
+ set("settings.packed-barrels", null);
+ oldValue = getBoolean("settings.large-ender-chests", true);
+ set("settings.blocks.ender_chest.six-rows", oldValue);
+ set("settings.large-ender-chests", null);
+ }
+ barrelSixRows = getBoolean("settings.blocks.barrel.six-rows", barrelSixRows);
+ InventoryType.BARREL.setDefaultSize(barrelSixRows ? 54 : 27);
+ enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
+ InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
+ enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
index 614ab2d73db2293116f2272f6cd5c16da446132d..2885dc250f171917393c0356a005b476b23f9c5f 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
@@ -212,8 +212,10 @@ public class CraftContainer extends Container {
case PLAYER:
case CHEST:
case ENDER_CHEST:
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.enderChestSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
+ break; // Purpur
case BARREL:
- delegate = new ContainerChest(Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9);
+ delegate = new ContainerChest(net.pl3x.purpur.PurpurConfig.barrelSixRows ? Containers.GENERIC_9X6 : Containers.GENERIC_9X3, windowId, bottom, top, top.getSize() / 9); // Purpur
break;
case DISPENSER:
case DROPPER:
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
index f6001047ada8308cfa1d9b26677a7a5d7774de51..922a15097bdfe64be657fdf157145d1e882b6a40 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
@@ -82,7 +82,7 @@ public class CraftInventory implements Inventory {
@Override
public void setContents(ItemStack[] items) {
- if (getSize() < items.length) {
+ if (false && getSize() < items.length) { // Purpur
throw new IllegalArgumentException("Invalid inventory size; expected " + getSize() + " or less");
}

View File

@ -1,180 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 31 May 2019 21:24:33 -0500
Subject: [PATCH] Advancement API
diff --git a/src/main/java/net/minecraft/advancements/Advancement.java b/src/main/java/net/minecraft/advancements/Advancement.java
index 2f3d9e5b849093027d3c2ef434494cd600f52a31..23567430901284ab9d4d4873e53a1c8a06da6862 100644
--- a/src/main/java/net/minecraft/advancements/Advancement.java
+++ b/src/main/java/net/minecraft/advancements/Advancement.java
@@ -78,7 +78,7 @@ public class Advancement {
public final @Nullable AdvancementDisplay getAdvancementDisplay() { return this.c(); } // Paper - OBFHELPER
@Nullable
- public AdvancementDisplay c() {
+ public AdvancementDisplay c() { return getDisplay(); } public AdvancementDisplay getDisplay() { // Purpur
return this.display;
}
diff --git a/src/main/java/net/minecraft/advancements/AdvancementDisplay.java b/src/main/java/net/minecraft/advancements/AdvancementDisplay.java
index adc6779e53e7b2ee04a80e2ea714e3378b8e6f39..3335c96ec15eb8d8f0b67f51846038f728f6f9fc 100644
--- a/src/main/java/net/minecraft/advancements/AdvancementDisplay.java
+++ b/src/main/java/net/minecraft/advancements/AdvancementDisplay.java
@@ -25,10 +25,11 @@ public class AdvancementDisplay {
private final MinecraftKey d;
private final AdvancementFrameType e;
private final boolean f;
- private final boolean g;
- private final boolean h;
+ private boolean g; // Purpur - un-finalize
+ private boolean h; // Purpur - un-finalize
private float i;
private float j;
+ public final org.bukkit.advancement.AdvancementDisplay bukkit = new org.bukkit.craftbukkit.advancement.CraftAdvancementDisplay(this); // Purpur
public AdvancementDisplay(ItemStack itemstack, IChatBaseComponent ichatbasecomponent, IChatBaseComponent ichatbasecomponent1, @Nullable MinecraftKey minecraftkey, AdvancementFrameType advancementframetype, boolean flag, boolean flag1, boolean flag2) {
this.a = ichatbasecomponent;
@@ -46,10 +47,12 @@ public class AdvancementDisplay {
this.j = f1;
}
+ public IChatBaseComponent getTitle() { return a(); } // Purpur - OBFHELPER
public IChatBaseComponent a() {
return this.a;
}
+ public IChatBaseComponent getDescription() { return b(); } // Purpur - OBFHELPER
public IChatBaseComponent b() {
return this.b;
}
@@ -59,11 +62,14 @@ public class AdvancementDisplay {
return this.e;
}
+ public final void setShouldAnnounceToChat(boolean announce) { this.g = announce; } // Purpur - OBFHELPER
public final boolean shouldAnnounceToChat() { return this.i(); } // Paper - OBFHELPER
public boolean i() {
return this.g;
}
+ public void setHidden(boolean hidden) { this.h = hidden; } // Purpur - OBFHELPER
+ public boolean isHidden() { return j(); } // Purpur - OBFHELPER
public boolean j() {
return this.h;
}
diff --git a/src/main/java/net/minecraft/advancements/AdvancementFrameType.java b/src/main/java/net/minecraft/advancements/AdvancementFrameType.java
index 32380346555e194227423999a79f1ebcbbe38d3b..173266c81be66f85db06dd28d9c9d720e21f8bc4 100644
--- a/src/main/java/net/minecraft/advancements/AdvancementFrameType.java
+++ b/src/main/java/net/minecraft/advancements/AdvancementFrameType.java
@@ -4,16 +4,27 @@ import net.minecraft.EnumChatFormat;
import net.minecraft.network.chat.ChatMessage;
import net.minecraft.network.chat.IChatBaseComponent;
+import org.bukkit.advancement.FrameType; // Purpur
+
public enum AdvancementFrameType {
- TASK("task", 0, EnumChatFormat.GREEN), CHALLENGE("challenge", 26, EnumChatFormat.DARK_PURPLE), GOAL("goal", 52, EnumChatFormat.GREEN);
+ // Purpur start
+ TASK("task", 0, EnumChatFormat.GREEN, FrameType.TASK),
+ CHALLENGE("challenge", 26, EnumChatFormat.DARK_PURPLE, FrameType.CHALLENGE),
+ GOAL("goal", 52, EnumChatFormat.GREEN, FrameType.GOAL);
+ // Purpur end
private final String d;
private final int e;
private final EnumChatFormat f;
private final IChatBaseComponent g;
- private AdvancementFrameType(String s, int i, EnumChatFormat enumchatformat) {
+ // Purpur start
+ public final FrameType bukkit;
+
+ AdvancementFrameType(String s, int i, EnumChatFormat enumchatformat, FrameType bukkit) {
+ this.bukkit = bukkit;
+ // Purpur end
this.d = s;
this.e = i;
this.f = enumchatformat;
diff --git a/src/main/java/net/minecraft/advancements/CriterionTrigger.java b/src/main/java/net/minecraft/advancements/CriterionTrigger.java
index f2d74473caf96ca6e871311ef87afa128cd4d0bf..851e69a2f5155d9fa2e5652abdea9aee59e4b20a 100644
--- a/src/main/java/net/minecraft/advancements/CriterionTrigger.java
+++ b/src/main/java/net/minecraft/advancements/CriterionTrigger.java
@@ -29,6 +29,7 @@ public interface CriterionTrigger<T extends CriterionInstance> {
this.c = s;
}
+ public T getInstance() { return a(); } // Purpur - OBFHELPER
public T a() {
return this.a;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
index 77abcd6de43302985cdbb2085abece4f621068d4..c859fc16c263e0c50cb01fc722b6f6723d682481 100644
--- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
+++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
@@ -27,4 +27,11 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement {
public Collection<String> getCriteria() {
return Collections.unmodifiableCollection(handle.getCriteria().keySet());
}
+
+ // Purpur start
+ @Override
+ public org.bukkit.advancement.AdvancementDisplay getDisplay() {
+ return getHandle().getDisplay() == null ? null : getHandle().getDisplay().bukkit;
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java
new file mode 100644
index 0000000000000000000000000000000000000000..0b4ff544e04ec314e78a7a48b5bf90ee699b2ad6
--- /dev/null
+++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementDisplay.java
@@ -0,0 +1,47 @@
+package org.bukkit.craftbukkit.advancement;
+
+import net.minecraft.advancements.AdvancementDisplay;
+import org.bukkit.advancement.FrameType;
+import org.bukkit.craftbukkit.util.CraftChatMessage;
+
+public class CraftAdvancementDisplay implements org.bukkit.advancement.AdvancementDisplay {
+ private final AdvancementDisplay handle;
+
+ public CraftAdvancementDisplay(AdvancementDisplay handle) {
+ this.handle = handle;
+ }
+
+ public AdvancementDisplay getHandle() {
+ return handle;
+ }
+
+ @Override
+ public String getTitle() {
+ return CraftChatMessage.fromComponent(handle.getTitle());
+ }
+
+ @Override
+ public String getDescription() {
+ return CraftChatMessage.fromComponent(handle.getDescription());
+ }
+
+ @Override
+ public FrameType getFrameType() {
+ return handle.getFrameType().bukkit;
+ }
+
+ @Override
+ public boolean shouldAnnounceToChat() {
+ return handle.shouldAnnounceToChat();
+ }
+
+ @Override
+ public void setShouldAnnounceToChat(boolean announce) {
+ handle.setShouldAnnounceToChat(announce);
+ }
+
+ @Override
+ public boolean isHidden() {
+ return handle.isHidden();
+ }
+}

View File

@ -1,156 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 18 Oct 2019 22:50:12 -0500
Subject: [PATCH] Llama API
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java
index 4fd1744f13b87c79ae3f46b28a56daeaba343aa6..34a854131dd939693a6df4d52103714ebe373dc3 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow.java
@@ -11,7 +11,7 @@ import net.minecraft.world.phys.Vec3D;
public class PathfinderGoalLlamaFollow extends PathfinderGoal {
- public final EntityLlama a;
+ public final EntityLlama a; public EntityLlama getLlama() { return a; } // Purpur
private double b;
private int c;
@@ -23,6 +23,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal {
@Override
public boolean a() {
+ if (!getLlama().shouldJoinCaravan) return false; // Purpur
if (!this.a.isLeashed() && !this.a.fC()) {
List<Entity> list = this.a.world.getEntities(this.a, this.a.getBoundingBox().grow(9.0D, 4.0D, 9.0D), (entity) -> {
EntityTypes<?> entitytypes = entity.getEntityType();
@@ -82,6 +83,7 @@ public class PathfinderGoalLlamaFollow extends PathfinderGoal {
@Override
public boolean b() {
+ if (!getLlama().shouldJoinCaravan) return false; // Purpur
if (this.a.fC() && this.a.fD().isAlive() && this.a(this.a, 0)) {
double d0 = this.a.h((Entity) this.a.fD());
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java
index 2005cb484ba6b5929ad81d3d120521f247f3d4cf..1c6435bf2cd870b795f87368057d8dfc1e1c938a 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityLlama.java
@@ -63,7 +63,8 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
@Nullable
private EntityLlama bB;
@Nullable
- private EntityLlama bC;
+ private EntityLlama bC; public EntityLlama getCaravanTail() { return bC; } // Purpur - OBFHELPER
+ public boolean shouldJoinCaravan = true; // Purpur
public EntityLlama(EntityTypes<? extends EntityLlama> entitytypes, World world) {
super(entitytypes, world);
@@ -92,6 +93,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
nbttagcompound.set("DecorItem", this.inventoryChest.getItem(1).save(new NBTTagCompound()));
}
+ nbttagcompound.setBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan); // Purpur
}
@Override
@@ -103,6 +105,11 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
this.inventoryChest.setItem(1, ItemStack.a(nbttagcompound.getCompound("DecorItem")));
}
+ // Purpur start
+ if (nbttagcompound.hasKey("Purpur.ShouldJoinCaravan")) {
+ nbttagcompound.setBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan);
+ }
+ // Purpur end
this.fe();
}
@@ -437,19 +444,24 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
}
}
+ public void leaveCaravan() { fA(); } // Purpur - OBFHELPER
public void fA() {
if (this.bB != null) {
+ new net.pl3x.purpur.event.entity.LlamaLeaveCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity()).callEvent(); // Purpur
this.bB.bC = null;
}
this.bB = null;
}
+ public void joinCaravan(EntityLlama entitiyllama) { a(entitiyllama); } // Purpur - OBFHELPER
public void a(EntityLlama entityllama) {
+ if (!shouldJoinCaravan || !new net.pl3x.purpur.event.entity.LlamaJoinCaravanEvent((org.bukkit.entity.Llama) getBukkitEntity(), (org.bukkit.entity.Llama) entityllama.getBukkitEntity()).callEvent()) return; // Purpur
this.bB = entityllama;
this.bB.bC = this;
}
+ public boolean hasCaravanTail() { return fB(); } // Purpur - OBFHELPER
public boolean fB() {
return this.bC != null;
}
@@ -460,7 +472,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn
}
@Nullable
- public EntityLlama fD() {
+ public EntityLlama fD() { return getCaravanHead(); } public EntityLlama getCaravanHead() { // Purpur - OBFHELPER
return this.bB;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
index 818034c62893a71808e3af0aa33393605611acdd..71536b6ae6a423e33667efcf584a0020f36fb189 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLlama.java
@@ -66,4 +66,48 @@ public class CraftLlama extends CraftChestedHorse implements Llama, CraftRangedE
public EntityType getType() {
return EntityType.LLAMA;
}
+
+ // Purpur start
+ @Override
+ public boolean shouldJoinCaravan() {
+ return getHandle().shouldJoinCaravan;
+ }
+
+ @Override
+ public void setShouldJoinCaravan(boolean shouldJoinCaravan) {
+ getHandle().shouldJoinCaravan = shouldJoinCaravan;
+ }
+
+ @Override
+ public boolean inCaravan() {
+ return getHandle().inCaravan();
+ }
+
+ @Override
+ public void joinCaravan(Llama llama) {
+ if (llama != null) {
+ getHandle().joinCaravan(((CraftLlama) llama).getHandle());
+ }
+ }
+
+ @Override
+ public void leaveCaravan() {
+ getHandle().leaveCaravan();
+ }
+
+ @Override
+ public boolean hasCaravanTail() {
+ return getHandle().hasCaravanTail();
+ }
+
+ @Override
+ public Llama getCaravanHead() {
+ return getHandle().getCaravanHead() == null ? null : (Llama) getHandle().getCaravanHead().getBukkitEntity();
+ }
+
+ @Override
+ public Llama getCaravanTail() {
+ return getHandle().getCaravanTail() == null ? null : (Llama) getHandle().getCaravanTail().getBukkitEntity();
+ }
+ // Purpur end
}

View File

@ -1,302 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Thu, 8 Aug 2019 15:29:15 -0500
Subject: [PATCH] AFK API
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index 32e400632ec1e61374f772c6262580f84a5b2288..aee1946f96ec6007caef63b2183c5218ffe71836 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -2102,8 +2102,54 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void resetIdleTimer() {
this.ca = SystemUtils.getMonotonicMillis();
+ setAfk(false); // Purpur
}
+ // Purpur start
+ private boolean isAfk = false;
+
+ @Override
+ public void setAfk(boolean setAfk) {
+ if (this.isAfk == setAfk) {
+ return;
+ }
+
+ String msg = setAfk ? net.pl3x.purpur.PurpurConfig.afkBroadcastAway : net.pl3x.purpur.PurpurConfig.afkBroadcastBack;
+
+ net.pl3x.purpur.event.PlayerAFKEvent event = new net.pl3x.purpur.event.PlayerAFKEvent(getBukkitEntity(), setAfk, world.purpurConfig.idleTimeoutKick, msg, !Bukkit.isPrimaryThread());
+ if (!event.callEvent() || event.shouldKick()) {
+ return;
+ }
+
+ this.isAfk = setAfk;
+
+ if (!setAfk) {
+ resetIdleTimer();
+ }
+
+ msg = event.getBroadcastMsg();
+ if (msg != null && !msg.isEmpty()) {
+ server.getPlayerList().sendMessage(org.bukkit.craftbukkit.util.CraftChatMessage.fromStringOrNull(String.format(msg, getProfile().getName())));
+ }
+
+ if (world.purpurConfig.idleTimeoutUpdateTabList) {
+ getBukkitEntity().setPlayerListName((setAfk ? net.pl3x.purpur.PurpurConfig.afkTabListPrefix : "") + getName());
+ }
+
+ ((WorldServer) world).everyoneSleeping();
+ }
+
+ @Override
+ public boolean isAfk() {
+ return isAfk;
+ }
+
+ @Override
+ public boolean isCollidable() {
+ return !isAfk() && super.isCollidable();
+ }
+ // Purpur end
+
public ServerStatisticManager getStatisticManager() {
return this.serverStatisticManager;
}
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
index b11af463045bbd3bab8d269fde34071ca5f026af..6433ce5a5b951334efb3d8d7199f784f23392e0e 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
@@ -1018,7 +1018,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
// CraftBukkit end
if (this.everyoneSleeping && this.players.stream().noneMatch((entityplayer) -> {
- return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping; // CraftBukkit
+ return !entityplayer.isSpectator() && !entityplayer.isDeeplySleeping() && !entityplayer.fauxSleeping && !(purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk()); // CraftBukkit // Purpur
})) {
// CraftBukkit start
long l = this.worldData.getDayTime() + 24000L;
@@ -1363,7 +1363,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
- if (entityplayer.isSpectator() || (entityplayer.fauxSleeping && !entityplayer.isSleeping())) { // CraftBukkit
+ if (entityplayer.isSpectator() || (entityplayer.fauxSleeping && !entityplayer.isSleeping()) || (purpurConfig.idleTimeoutCountAsSleeping && entityplayer.isAfk())) { // CraftBukkit // Purpur
++i;
} else if (entityplayer.isSleeping()) {
++j;
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index 8513795943497ca80232e7d47066a6944c2f45ec..de72ebb94052efe8c63bf28f6741a4645b3ee721 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -399,6 +399,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
}
if (this.player.F() > 0L && this.minecraftServer.getIdleTimeout() > 0 && SystemUtils.getMonotonicMillis() - this.player.F() > (long) (this.minecraftServer.getIdleTimeout() * 1000 * 60)) {
+ // Purpur start
+ this.player.setAfk(true);
+ if (!this.player.world.purpurConfig.idleTimeoutKick) {
+ return;
+ }
+ // Purpur end
this.player.resetIdleTimer(); // CraftBukkit - SPIGOT-854
this.disconnect(new ChatMessage("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
}
@@ -682,6 +688,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
+
// Skip the first time we do this
if (true) { // Spigot - don't skip any move events
Location oldTo = to.clone();
@@ -1429,7 +1437,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
if (!this.player.H() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.playerInteractManager.isCreative() && this.player.playerInteractManager.getGameMode() != EnumGamemode.SPECTATOR) { // Spigot
flag1 = true; // Tuinity - diff on change, this should be moved wrongly
- PlayerConnection.LOGGER.warn("{} moved wrongly!", this.player.getDisplayName().getString());
+ PlayerConnection.LOGGER.warn("{} moved wrongly! ({})", this.player.getDisplayName().getString(), d11); // Purpur
}
this.player.setLocation(d4, d5, d6, f, f1);
@@ -1479,6 +1487,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
+ if (!to.getWorld().getUID().equals(from.getWorld().getUID()) || to.getBlockX() != from.getBlockX() || to.getBlockY() != from.getBlockY() || to.getBlockZ() != from.getBlockZ() || to.getYaw() != from.getYaw() || to.getPitch() != from.getPitch()) this.player.resetIdleTimer(); // Purpur
+
// Skip the first time we do this
if (from.getX() != Double.MAX_VALUE) {
Location oldTo = to.clone();
diff --git a/src/main/java/net/minecraft/world/entity/IEntitySelector.java b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
index f5e32faeb6d937cf90b1f3ea251b5cfc91f2338d..f9908fb7cc27a8947030c2100dccf1dc1a4e24f7 100644
--- a/src/main/java/net/minecraft/world/entity/IEntitySelector.java
+++ b/src/main/java/net/minecraft/world/entity/IEntitySelector.java
@@ -15,6 +15,7 @@ import net.minecraft.world.scores.ScoreboardTeamBase;
public final class IEntitySelector {
public static final Predicate<Entity> a = Entity::isAlive;
+ public static Predicate<EntityLiving> isLivingAlive() { return b; } // Purpur - OBFHELPER
public static final Predicate<EntityLiving> b = EntityLiving::isAlive;
public static final Predicate<Entity> c = (entity) -> {
return entity.isAlive() && !entity.isVehicle() && !entity.isPassenger();
@@ -35,6 +36,7 @@ public final class IEntitySelector {
return !entity.isSpectator();
};
public static Predicate<EntityHuman> isInsomniac = (player) -> MathHelper.clamp(((EntityPlayer) player).getStatisticManager().getStatisticValue(StatisticList.CUSTOM.get(StatisticList.TIME_SINCE_REST)), 1, Integer.MAX_VALUE) >= 72000; // Paper
+ public static Predicate<EntityHuman> notAfk = (player) -> !player.isAfk(); // Purpur
// Paper start
public static final Predicate<Entity> affectsSpawning = (entity) -> {
diff --git a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
index 5f9e64df007ebc40f7bcb50be495b10e51d5b87a..17e6f476e60a4f5dc278894a0a874ca5ae45ee22 100644
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
@@ -182,6 +182,15 @@ public abstract class EntityHuman extends EntityLiving {
}
// CraftBukkit end
+ // Purpur start
+ public void setAfk(boolean setAfk){
+ }
+
+ public boolean isAfk() {
+ return false;
+ }
+ // Purpur end
+
public EntityHuman(World world, BlockPosition blockposition, float f, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world);
this.bL = ItemStack.b;
diff --git a/src/main/java/net/minecraft/world/level/IEntityAccess.java b/src/main/java/net/minecraft/world/level/IEntityAccess.java
index a7f2304acf8ee0a15d6eae8c42060e003be13ae7..fd56b2f15e570f266a79c25823a3b3530a693510 100644
--- a/src/main/java/net/minecraft/world/level/IEntityAccess.java
+++ b/src/main/java/net/minecraft/world/level/IEntityAccess.java
@@ -183,28 +183,18 @@ public interface IEntityAccess {
}
// Paper end
- default boolean isPlayerNearby(double d0, double d1, double d2, double d3) {
- Iterator iterator = this.getPlayers().iterator();
-
- double d4;
-
- do {
- EntityHuman entityhuman;
-
- do {
- do {
- if (!iterator.hasNext()) {
- return false;
- }
-
- entityhuman = (EntityHuman) iterator.next();
- } while (!IEntitySelector.g.test(entityhuman));
- } while (!IEntitySelector.b.test(entityhuman));
-
- d4 = entityhuman.h(d0, d1, d2);
- } while (d3 >= 0.0D && d4 >= d3 * d3);
-
- return true;
+ // Purpur start
+ default boolean isPlayerNearby(double x, double y, double z, double distance) {
+ double distanceSq = distance * distance;
+ for (EntityHuman player : getPlayers()) {
+ if (IEntitySelector.notSpectator().test(player) && IEntitySelector.isLivingAlive().test(player) && IEntitySelector.notAfk.test(player)) {
+ if (distance < 0.0D || player.getDistanceSquared(x, y, z) < distanceSq) {
+ return true;
+ }
+ }
+ }
+ return false;
+ // Purpur end
}
@Nullable
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 2f329bae9f09d0ed21a4538fba6b95919ec35887..95b55fb93049c6686e13aab78ba1ae2b2fd5785b 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -1,6 +1,7 @@
package net.pl3x.purpur;
import com.google.common.base.Throwables;
+import net.minecraft.locale.LocaleLanguage;
import net.minecraft.server.MinecraftServer;
import net.pl3x.purpur.command.PurpurCommand;
import org.bukkit.Bukkit;
@@ -129,6 +130,15 @@ public class PurpurConfig {
return config.getString(path, config.getString(path));
}
+ public static String afkBroadcastAway = "§e§o%s is now AFK";
+ public static String afkBroadcastBack = "§e§o%s is no longer AFK";
+ public static String afkTabListPrefix = "[AFK] ";
+ private static void messages() {
+ afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
+ afkBroadcastBack = getString("settings.messages.afk-broadcast-back", afkBroadcastBack);
+ afkTabListPrefix = getString("settings.messages.afk-tab-list-prefix", afkTabListPrefix);
+ }
+
public static String timingsUrl = "https://timings.pl3x.net";
private static void timingsSettings() {
timingsUrl = getString("settings.timings.url", timingsUrl);
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 361f7857e461578e90cb71e15027dadaf794cb69..2578a4677d1ee060f687be531e696b7c7be89e84 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -56,4 +56,15 @@ public class PurpurWorldConfig {
PurpurConfig.config.addDefault("world-settings.default." + path, def);
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
}
+
+ public boolean idleTimeoutKick = true;
+ public boolean idleTimeoutTickNearbyEntities = true;
+ public boolean idleTimeoutCountAsSleeping = false;
+ public boolean idleTimeoutUpdateTabList = false;
+ private void playerIdleTimeoutSettings() {
+ idleTimeoutKick = getBoolean("gameplay-mechanics.player.idle-timeout.kick-if-idle", idleTimeoutKick);
+ idleTimeoutTickNearbyEntities = getBoolean("gameplay-mechanics.player.idle-timeout.tick-nearby-entities", idleTimeoutTickNearbyEntities);
+ idleTimeoutCountAsSleeping = getBoolean("gameplay-mechanics.player.idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
+ idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index ed1bb89ae7b85bf4017315d6189d6cbf595aefe5..f3fb405c92a35796baa30cafcd96df2d8bf162e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2499,4 +2499,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return spigot;
}
// Spigot end
+
+ // Purpur start
+ @Override
+ public boolean isAfk() {
+ return getHandle().isAfk();
+ }
+
+ @Override
+ public void setAfk(boolean setAfk) {
+ getHandle().setAfk(setAfk);
+ }
+
+ @Override
+ public void resetIdleTimer() {
+ getHandle().resetIdleTimer();
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index 94910bf0c53c79588c55b89e4a023273d6c859ef..a57473fb8815545977ff08bf46d6463d2b7a9d78 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -207,6 +207,7 @@ public class ActivationRange
{
player.activatedTick = MinecraftServer.currentTick;
+ if (!player.world.purpurConfig.idleTimeoutTickNearbyEntities && player.isAfk()) continue; // Purpur
maxBB = player.getBoundingBox().grow( maxRange, 256, maxRange );
ActivationType.MISC.boundingBox = player.getBoundingBox().grow( miscActivationRange, 256, miscActivationRange );
ActivationType.RAIDER.boundingBox = player.getBoundingBox().grow( raiderActivationRange, 256, raiderActivationRange );

View File

@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 26 May 2019 15:19:14 -0500
Subject: [PATCH] Bring back server name
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 1fab9b9c7d41a0d2a551096c2c15f741a887fa2d..f33309f4c1ad92960d0634f3f5b8105c284f26a2 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -20,6 +20,7 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr
public final boolean onlineMode = this.getBoolean("online-mode", true);
public final boolean preventProxyConnections = this.getBoolean("prevent-proxy-connections", false);
public final String serverIp = this.getString("server-ip", "");
+ public final String serverName = this.getString("server-name", "Unknown Server"); // Purpur
public final boolean spawnAnimals = this.getBoolean("spawn-animals", true);
public final boolean spawnNpcs = this.getBoolean("spawn-npcs", true);
public final boolean pvp = this.getBoolean("pvp", true);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f53389a49e62f54faa6af19226589305b597d1ae..3efe2a4eff95349107134b097033bf978f083d56 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2554,4 +2554,11 @@ public final class CraftServer implements Server {
}
// Paper end
+
+ // Purpur start
+ @Override
+ public String getServerName() {
+ return getProperties().serverName;
+ }
+ // Purpur end
}

View File

@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 21 Mar 2020 11:47:39 -0500
Subject: [PATCH] Configurable server mod name
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 53eca53bfcb1ea66d8cc2ecad34466f932a23866..3d42dbf9008f63cdd1458366fd87c7994cf722ca 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1650,7 +1650,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
}
public String getServerModName() {
- return "Purpur"; // Purpur // Airplane // Tuinity // Paper // Spigot // CraftBukkit
+ return net.pl3x.purpur.PurpurConfig.serverModName; // Purpur // Airplane // Tuinity // Paper // Spigot // CraftBukkit
}
public CrashReport b(CrashReport crashreport) {
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 95b55fb93049c6686e13aab78ba1ae2b2fd5785b..2442309843bb62e08ae13c46d335c65f7d072510 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -139,6 +139,11 @@ public class PurpurConfig {
afkTabListPrefix = getString("settings.messages.afk-tab-list-prefix", afkTabListPrefix);
}
+ public static String serverModName = "Purpur";
+ private static void serverModName() {
+ serverModName = getString("settings.server-mod-name", serverModName);
+ }
+
public static String timingsUrl = "https://timings.pl3x.net";
private static void timingsSettings() {
timingsUrl = getString("settings.timings.url", timingsUrl);

View File

@ -1,84 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 5 May 2019 12:58:45 -0500
Subject: [PATCH] LivingEntity safeFallDistance
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index a49dbcffecc971f797651984cb72c455d40f9331..bb030f5b258d82a1a3e60151b42a113b8f8022f1 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -228,6 +228,7 @@ public abstract class EntityLiving extends Entity {
// CraftBukkit start
public int expToDrop;
public int maxAirTicks = 300;
+ public float safeFallDistance = 3.0F; // Purpur
public boolean forceDrops;
public ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
@@ -322,8 +323,8 @@ public abstract class EntityLiving extends Entity {
this.cR();
}
- if (!this.world.isClientSide && this.fallDistance > 3.0F && flag) {
- float f = (float) MathHelper.f(this.fallDistance - 3.0F);
+ if (!this.world.isClientSide && this.fallDistance > this.safeFallDistance && flag) { // Purpur
+ float f = (float) MathHelper.f(this.fallDistance - this.safeFallDistance); // Purpur
if (!iblockdata.isAir()) {
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
@@ -1803,7 +1804,7 @@ public abstract class EntityLiving extends Entity {
MobEffect mobeffect = this.getEffect(MobEffects.JUMP);
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
- return MathHelper.f((f - 3.0F - f2) * f1);
+ return MathHelper.f((f - this.safeFallDistance - f2) * f1); // Purpur
}
protected void playBlockStepSound() {
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
index 1e41c45af6dbcf097d7d6104e63db637f199301a..cb6e2053d1315b65812e7bff8a17988b5b8ab0e4 100644
--- a/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/EntityHorseAbstract.java
@@ -272,7 +272,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
@Override
protected int e(float f, float f1) {
- return MathHelper.f((f * 0.5F - 3.0F) * f1);
+ return MathHelper.f((f * 0.5F - this.safeFallDistance) * f1); // Purpur
}
protected int getChestSlots() {
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
index 3b004160da9a2aed440a3ccda538d78f91c61e87..5e6a92dcdbca686d5a8cfc4aaff72b70b81b111f 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
@@ -13,6 +13,7 @@ public class EntityGiantZombie extends EntityMonster {
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
super(entitytypes, world);
+ this.safeFallDistance = 10.0F; // Purpur
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 4545bac9309f5a3aad617f48f7808d8ae829602d..d99ab01298c7e35eae806af8fc60d5beba89c826 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -859,4 +859,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
}
// Paper end
+
+ // Purpur start
+ @Override
+ public float getSafeFallDistance() {
+ return getHandle().safeFallDistance;
+ }
+
+ @Override
+ public void setSafeFallDistance(float safeFallDistance) {
+ getHandle().safeFallDistance = safeFallDistance;
+ }
+ // Purpur end
}

View File

@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Tue, 23 Jul 2019 10:07:16 -0500
Subject: [PATCH] Lagging threshold
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3d42dbf9008f63cdd1458366fd87c7994cf722ca..4a5290a4d9bf8cf0ad48af135231cbef2d8d36f8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -280,6 +280,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
public static final int TICK_TIME = 1000000000 / TPS;
private static final int SAMPLE_INTERVAL = 20; // Paper
public final double[] recentTps = new double[ 3 ];
+ public boolean lagging = false; // Purpur
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
// Spigot end
@@ -1118,6 +1119,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
recentTps[1] = tps5.getAverage();
recentTps[2] = tps15.getAverage();
// Paper end
+ lagging = recentTps[0] < net.pl3x.purpur.PurpurConfig.laggingThreshold; // Purpur
tickSection = curTime;
}
// Tuinity - replace logic
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 2442309843bb62e08ae13c46d335c65f7d072510..089ae62c2189fe774796ecc6caf9961d3edb5ea3 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -150,6 +150,11 @@ public class PurpurConfig {
if (!TimingsManager.hiddenConfigs.contains("server-ip")) TimingsManager.hiddenConfigs.add("server-ip");
}
+ public static double laggingThreshold = 19.0D;
+ private static void tickLoopSettings() {
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
+ }
+
public static boolean barrelSixRows = false;
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 3efe2a4eff95349107134b097033bf978f083d56..d46e5819bd0bc6ac16b536ee3abe5a0142995bf3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2560,5 +2560,10 @@ public final class CraftServer implements Server {
public String getServerName() {
return getProperties().serverName;
}
+
+ @Override
+ public boolean isLagging() {
+ return getServer().lagging;
+ }
// Purpur end
}

View File

@ -1,42 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 5 Jul 2019 16:36:55 -0500
Subject: [PATCH] ItemFactory#getMonsterEgg
diff --git a/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java b/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java
index 4d965e504a40eb52777575df839856c825a0900a..addddb64956c63563fc072b35cc511d31c9afd45 100644
--- a/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java
+++ b/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java
@@ -35,7 +35,7 @@ import net.minecraft.world.phys.Vec3D;
public class ItemMonsterEgg extends Item {
- private static final Map<EntityTypes<?>, ItemMonsterEgg> a = Maps.newIdentityHashMap();
+ public static final Map<EntityTypes<?>, ItemMonsterEgg> a = Maps.newIdentityHashMap(); // Purpur - private -> public
private final int b;
private final int c;
private final EntityTypes<?> d;
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 347c23d4b7d47198f214c3f95354e8abb660b191..4ec0e93d93936080d876ffa017ebe181d2896b22 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -401,4 +401,18 @@ public final class CraftItemFactory implements ItemFactory {
new net.md_5.bungee.api.chat.TextComponent(customName));
}
// Paper end
+
+ // Purpur start
+ @Override
+ public ItemStack getMonsterEgg(org.bukkit.entity.EntityType type) {
+ if (type == null) {
+ return null;
+ }
+ String name = type.getKey().toString();
+ net.minecraft.resources.MinecraftKey key = new net.minecraft.resources.MinecraftKey(name);
+ net.minecraft.world.entity.EntityTypes types = net.minecraft.world.entity.EntityTypes.getFromKey(key);
+ net.minecraft.world.item.ItemMonsterEgg egg = net.minecraft.world.item.ItemMonsterEgg.a.get(types);
+ return new net.minecraft.world.item.ItemStack(egg).asBukkitMirror();
+ }
+ // Purpur end
}

View File

@ -1,86 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 5 Jul 2019 18:21:00 -0500
Subject: [PATCH] PlayerSetSpawnerTypeWithEggEvent
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
index 80c229c1852199fda85c03453d64cae33e413e89..6335e9046a6288f7bcf945ad8c381e080744653d 100644
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
@@ -274,6 +274,16 @@ public class EntityTypes<T extends Entity> {
return (EntityTypes) IRegistry.a((IRegistry) IRegistry.ENTITY_TYPE, s, (Object) entitytypes_builder.a(s));
}
+ // Purpur start
+ public static EntityTypes getFromBukkitType(org.bukkit.entity.EntityType bukkitType) {
+ return getFromKey(new MinecraftKey(bukkitType.getKey().toString()));
+ }
+
+ public static EntityTypes getFromKey(MinecraftKey key) {
+ return IRegistry.ENTITY_TYPE.get(key);
+ }
+ // Purpur end
+
public static MinecraftKey getName(EntityTypes<?> entitytypes) {
return IRegistry.ENTITY_TYPE.getKey(entitytypes);
}
@@ -439,6 +449,16 @@ public class EntityTypes<T extends Entity> {
return this.bg;
}
+ // Purpur start
+ public String getName() {
+ return IRegistry.ENTITY_TYPE.getKey(this).getKey();
+ }
+
+ public String getTranslatedName() {
+ return getNameComponent().getString();
+ }
+ // Purpur end
+
public String getDescriptionId() { return f(); } // Paper - OBFHELPER
public String f() {
if (this.bo == null) {
@@ -448,6 +468,7 @@ public class EntityTypes<T extends Entity> {
return this.bo;
}
+ public IChatBaseComponent getNameComponent() { return g(); } // Purpur - OBFHELPER
public IChatBaseComponent g() {
if (this.bp == null) {
this.bp = new ChatMessage(this.f());
diff --git a/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java b/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java
index addddb64956c63563fc072b35cc511d31c9afd45..5e2d0246146af8bf1de1038f6a1953451b99f0f5 100644
--- a/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java
+++ b/src/main/java/net/minecraft/world/item/ItemMonsterEgg.java
@@ -33,6 +33,13 @@ import net.minecraft.world.phys.MovingObjectPosition;
import net.minecraft.world.phys.MovingObjectPositionBlock;
import net.minecraft.world.phys.Vec3D;
+// Purpur start
+import net.pl3x.purpur.event.PlayerSetSpawnerTypeWithEggEvent;
+import org.bukkit.block.CreatureSpawner;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
+// Purpur end
+
public class ItemMonsterEgg extends Item {
public static final Map<EntityTypes<?>, ItemMonsterEgg> a = Maps.newIdentityHashMap(); // Purpur - private -> public
@@ -67,6 +74,15 @@ public class ItemMonsterEgg extends Item {
MobSpawnerAbstract mobspawnerabstract = ((TileEntityMobSpawner) tileentity).getSpawner();
EntityTypes<?> entitytypes = this.a(itemstack.getTag());
+ // Purpur start
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ PlayerSetSpawnerTypeWithEggEvent event = new PlayerSetSpawnerTypeWithEggEvent((Player) itemactioncontext.getEntity().getBukkitEntity(), bukkitBlock, (CreatureSpawner) bukkitBlock.getState(), EntityType.fromName(entitytypes.getName()));
+ if (!event.callEvent()) {
+ return EnumInteractionResult.FAIL;
+ }
+ entitytypes = EntityTypes.getFromBukkitType(event.getEntityType());
+ // Purpur end
+
mobspawnerabstract.setMobName(entitytypes);
tileentity.update();
world.notify(blockposition, iblockdata, iblockdata, 3);

View File

@ -1,63 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 20 Jul 2013 22:40:56 -0400
Subject: [PATCH] EMC - MonsterEggSpawnEvent
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
index 6335e9046a6288f7bcf945ad8c381e080744653d..1bfde4cfc0f27705238abf7852ad9bb7997e23e6 100644
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
@@ -318,13 +318,20 @@ public class EntityTypes<T extends Entity> {
@Nullable
public Entity spawnCreature(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
- return this.spawnCreature(worldserver, itemstack == null ? null : itemstack.getTag(), itemstack != null && itemstack.hasName() ? itemstack.getName() : null, entityhuman, blockposition, enummobspawn, flag, flag1);
+ return this.spawnCreature(worldserver, itemstack, itemstack == null ? null : itemstack.getTag(), itemstack != null && itemstack.hasName() ? itemstack.getName() : null, entityhuman, blockposition, enummobspawn, flag, flag1); // Purpur
}
@Nullable
public T spawnCreature(WorldServer worldserver, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
+ // Purpur start
+ return spawnCreature(worldserver, null, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1);
+ }
+
+ @Nullable
+ public T spawnCreature(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1) {
+ // Purpur end
// CraftBukkit start
- return this.spawnCreature(worldserver, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG);
+ return this.spawnCreature(worldserver, itemstack, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG, null); // Purpur
}
@Nullable
@@ -349,9 +356,29 @@ public class EntityTypes<T extends Entity> {
}
}
// Paper end
+ // Purpur start
+ return spawnCreature(worldserver, null, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1, spawnReason, op);
+ }
+
+ @Nullable
+ public T spawnCreature(WorldServer worldserver, @Nullable ItemStack itemstack, @Nullable NBTTagCompound nbttagcompound, @Nullable IChatBaseComponent ichatbasecomponent, @Nullable EntityHuman entityhuman, BlockPosition blockposition, EnumMobSpawn enummobspawn, boolean flag, boolean flag1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason, @Nullable java.util.function.Consumer<T> op) {
+ // Purpur end
T t0 = this.createCreature(worldserver, nbttagcompound, ichatbasecomponent, entityhuman, blockposition, enummobspawn, flag, flag1);
if (t0 != null && op != null) op.accept(t0); // Paper
+ // Purpur start
+ if (spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG && itemstack != null && t0 != null) {
+ final net.pl3x.purpur.event.entity.MonsterEggSpawnEvent event = new net.pl3x.purpur.event.entity.MonsterEggSpawnEvent(entityhuman != null ? entityhuman.getBukkitEntity() : null, t0.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack));
+ if (!event.callEvent()) {
+ worldserver.removeEntity(t0);
+ return null;
+ }
+ if (event.getEntity().getEntityId() != t0.getId()) {
+ return (T) ((org.bukkit.craftbukkit.entity.CraftEntity) event.getEntity()).getHandle();
+ }
+ }
+ // Purpur end
+
if (t0 != null) {
worldserver.addAllEntities(t0, spawnReason);
return !t0.dead ? t0 : null; // Don't return an entity when CreatureSpawnEvent is canceled

View File

@ -1,134 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 2 May 2020 20:55:44 -0500
Subject: [PATCH] Player invulnerabilities
diff --git a/src/main/java/net/minecraft/server/level/EntityPlayer.java b/src/main/java/net/minecraft/server/level/EntityPlayer.java
index aee1946f96ec6007caef63b2183c5218ffe71836..e65a3e3e7bf6a366c30b44e166e2085966ebc933 100644
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
@@ -285,6 +285,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.canPickUpLoot = true;
this.maxHealthCache = this.getMaxHealth();
this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper
+
+ this.invulnerableTicks = world.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
}
// Paper start
public BlockPosition getPointInFront(double inFront) {
@@ -1129,6 +1131,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
+ // Purpur start
+ public boolean isSpawnInvulnerable() {
+ return invulnerableTicks > 0 || frozen;
+ }
+ // Purpur end
+
@Override
public boolean damageEntity(DamageSource damagesource, float f) {
if (this.isInvulnerable(damagesource)) {
@@ -1136,7 +1144,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
} else {
boolean flag = this.server.j() && this.canPvP() && "fall".equals(damagesource.translationIndex);
- if (!flag && this.invulnerableTicks > 0 && damagesource != DamageSource.OUT_OF_WORLD) {
+ if (!flag && isSpawnInvulnerable() && damagesource != DamageSource.OUT_OF_WORLD) { // Purpur
return false;
} else {
if (damagesource instanceof EntityDamageSource) {
@@ -1312,6 +1320,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
// Paper end
+ this.invulnerableTicks = worldserver.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
return this;
}
}
@@ -2520,9 +2529,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
@Override
public boolean isFrozen() { // Paper - protected > public
- return super.isFrozen() || (this.playerConnection != null && this.playerConnection.isDisconnected()); // Paper
+ return super.isFrozen() || frozen || (this.playerConnection != null && this.playerConnection.isDisconnected()); // Paper // Purpur
}
+ // Purpur start
+ private boolean frozen = false;
+
+ public void setFrozen(boolean frozen) {
+ this.frozen = frozen;
+ }
+ // Purpur end
+
@Override
public Scoreboard getScoreboard() {
return getBukkitEntity().getScoreboard().getHandle();
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index de72ebb94052efe8c63bf28f6741a4645b3ee721..d1fe1242272a422b7b528876da0d76e1aa6f3eaa 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -1910,6 +1910,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer());
// Paper start
PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packetplayinresourcepackstatus.status.ordinal()];
+ if (player.world.purpurConfig.playerInvulnerableWhileAcceptingResourcePack) player.setFrozen(packStatus == PlayerResourcePackStatusEvent.Status.ACCEPTED); // Purpur
player.getBukkitEntity().setResourcePackStatus(packStatus);
this.server.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), packStatus));
// Paper end
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 5936075251ef3d6dda3e93866009d0e996598698..5897e4e02dad470174a31d3710520d04d4b87fb4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1015,6 +1015,8 @@ public abstract class PlayerList {
}
// Paper end
+ entityplayer1.invulnerableTicks = entityplayer1.world.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
+
// CraftBukkit end
return entityplayer1;
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 2578a4677d1ee060f687be531e696b7c7be89e84..c441fcea9b2b5a77b801c8a69541cf42050927dc 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -67,4 +67,11 @@ public class PurpurWorldConfig {
idleTimeoutCountAsSleeping = getBoolean("gameplay-mechanics.player.idle-timeout.count-as-sleeping", idleTimeoutCountAsSleeping);
idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
}
+
+ public int playerSpawnInvulnerableTicks = 60;
+ public boolean playerInvulnerableWhileAcceptingResourcePack = false;
+ private void playerInvulnerabilities() {
+ playerSpawnInvulnerableTicks = getInt("gameplay-mechanics.player.spawn-invulnerable-ticks", playerSpawnInvulnerableTicks);
+ playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index f3fb405c92a35796baa30cafcd96df2d8bf162e6..b7180dea1d71a68e4025388916600093dfd000c7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2515,5 +2515,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void resetIdleTimer() {
getHandle().resetIdleTimer();
}
+
+ @Override
+ public boolean isSpawnInvulnerable() {
+ return getHandle().isSpawnInvulnerable();
+ }
+
+ @Override
+ public int getSpawnInvulnerableTicks() {
+ return getHandle().invulnerableTicks;
+ }
+
+ @Override
+ public void setSpawnInvulnerableTicks(int invulnerableTicks) {
+ getHandle().invulnerableTicks = invulnerableTicks;
+ }
// Purpur end
}

View File

@ -1,147 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sun, 19 Apr 2020 00:17:56 -0500
Subject: [PATCH] Anvil API
diff --git a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
index ae5674ae9c539720a657838a640050cd3b4dc5b5..1b2d633f3d5d735039f18f27fb1387bd5a74f0d8 100644
--- a/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
+++ b/src/main/java/net/minecraft/world/inventory/ContainerAnvil.java
@@ -2,8 +2,13 @@ package net.minecraft.world.inventory;
import java.util.Iterator;
import java.util.Map;
+
+import net.minecraft.nbt.NBTTagInt;
import net.minecraft.network.chat.ChatComponentText;
import net.minecraft.network.chat.IChatBaseComponent;
+import net.minecraft.network.protocol.game.PacketPlayOutSetSlot;
+import net.minecraft.network.protocol.game.PacketPlayOutWindowData;
+import net.minecraft.server.level.EntityPlayer;
import net.minecraft.tags.Tag;
import net.minecraft.tags.TagsBlock;
import net.minecraft.world.entity.player.EntityHuman;
@@ -33,6 +38,8 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
public int maximumRepairCost = 40;
private CraftInventoryView bukkitEntity;
// CraftBukkit end
+ public boolean bypassCost = false; // Purpur
+ public boolean canDoUnsafeEnchants = false; // Purpur
public ContainerAnvil(int i, PlayerInventory playerinventory) {
this(i, playerinventory, ContainerAccess.a);
@@ -51,12 +58,14 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
@Override
protected boolean b(EntityHuman entityhuman, boolean flag) {
- return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= this.levelCost.get()) && this.levelCost.get() > 0;
+ return (entityhuman.abilities.canInstantlyBuild || entityhuman.expLevel >= this.levelCost.get()) && (bypassCost || this.levelCost.get() > 0); // Purpur
}
@Override
protected ItemStack a(EntityHuman entityhuman, ItemStack itemstack) {
+ if (net.pl3x.purpur.event.inventory.AnvilTakeResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilTakeResultEvent(entityhuman.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack)).callEvent(); // Purpur
if (!entityhuman.abilities.canInstantlyBuild) {
+ if (bypassCost) ((EntityPlayer) entityhuman).lastSentExp = -1; else // Purpur
entityhuman.levelDown(-this.levelCost.get());
}
@@ -107,6 +116,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
@Override
public void e() {
+ // Purpur start
+ bypassCost = false;
+ canDoUnsafeEnchants = false;
+ if (net.pl3x.purpur.event.inventory.AnvilUpdateResultEvent.getHandlerList().getRegisteredListeners().length > 0) new net.pl3x.purpur.event.inventory.AnvilUpdateResultEvent(getBukkitView()).callEvent();
+ // Purpur end
+
ItemStack itemstack = this.repairInventory.getItem(0);
this.levelCost.set(1);
@@ -183,7 +198,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
int i2 = (Integer) map1.get(enchantment);
i2 = l1 == i2 ? i2 + 1 : Math.max(i2, l1);
- boolean flag3 = enchantment.canEnchant(itemstack);
+ boolean flag3 = canDoUnsafeEnchants || enchantment.canEnchant(itemstack); // Purpur
if (this.player.abilities.canInstantlyBuild || itemstack.getItem() == Items.ENCHANTED_BOOK) {
flag3 = true;
@@ -195,7 +210,7 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
Enchantment enchantment1 = (Enchantment) iterator1.next();
if (enchantment1 != enchantment && !enchantment.isCompatible(enchantment1)) {
- flag3 = false;
+ flag3 = canDoUnsafeEnchants; // Purpur
++i;
}
}
@@ -266,6 +281,13 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
this.levelCost.set(maximumRepairCost - 1); // CraftBukkit
}
+ // Purpur start
+ if (bypassCost && levelCost.get() >= maximumRepairCost) {
+ itemstack.getOrCreateTagAndSet("Purpur.realCost", NBTTagInt.a(levelCost.get()));
+ levelCost.set(maximumRepairCost - 1);
+ }
+ // Purpur end
+
if (this.levelCost.get() >= maximumRepairCost && !this.player.abilities.canInstantlyBuild) { // CraftBukkit
itemstack1 = ItemStack.b;
}
@@ -287,6 +309,12 @@ public class ContainerAnvil extends ContainerAnvilAbstract {
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(getBukkitView(), itemstack1); // CraftBukkit
this.c();
+ // Purpur start
+ if (canDoUnsafeEnchants && itemstack1 != ItemStack.NULL_ITEM) {
+ ((EntityPlayer) player).playerConnection.sendPacket(new PacketPlayOutSetSlot(windowId, 2, itemstack1));
+ ((EntityPlayer) player).playerConnection.sendPacket(new PacketPlayOutWindowData(windowId, 0, levelCost.get()));
+ }
+ // Purpur end
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
index fd59f77d78a97898657919a77405b39ca24cddc9..151c478c6cb19d88000da46b6fbb952e97e58c95 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java
@@ -9,7 +9,7 @@ import org.bukkit.inventory.AnvilInventory;
public class CraftInventoryAnvil extends CraftResultInventory implements AnvilInventory {
private final Location location;
- private final ContainerAnvil container;
+ public final ContainerAnvil container; // Purpur - private -> public
public CraftInventoryAnvil(Location location, IInventory inventory, IInventory resultInventory, ContainerAnvil container) {
super(inventory, resultInventory);
@@ -47,4 +47,26 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn
Preconditions.checkArgument(levels >= 0, "Maximum repair cost must be positive (or 0)");
container.maximumRepairCost = levels;
}
+
+ // Purpur start
+ @Override
+ public boolean canBypassCost() {
+ return container.bypassCost;
+ }
+
+ @Override
+ public void setBypassCost(boolean bypassCost) {
+ container.bypassCost = bypassCost;
+ }
+
+ @Override
+ public boolean canDoUnsafeEnchants() {
+ return container.canDoUnsafeEnchants;
+ }
+
+ @Override
+ public void setDoUnsafeEnchants(boolean canDoUnsafeEnchants) {
+ container.canDoUnsafeEnchants = canDoUnsafeEnchants;
+ }
+ // Purpur end
}

View File

@ -1,53 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Tue, 23 Jul 2019 08:28:21 -0500
Subject: [PATCH] Configurable villager brain ticks
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
index 61eaa3e8f961a30e2dc9ae8701ba3b875176e7e0..891f0ab9d66454f0b9456ecb1f2ab36b9562d236 100644
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillager.java
@@ -127,6 +127,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
}, MemoryModuleType.MEETING_POINT, (entityvillager, villageplacetype) -> {
return villageplacetype == VillagePlaceType.s;
});
+ private final int brainTickOffset; // Purpur
public EntityVillager(EntityTypes<? extends EntityVillager> entitytypes, World world) {
this(entitytypes, world, VillagerType.PLAINS);
@@ -139,6 +140,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
this.getNavigation().d(true);
this.setCanPickupLoot(true);
this.setVillagerData(this.getVillagerData().withType(villagertype).withProfession(VillagerProfession.NONE));
+ this.brainTickOffset = getRandom().nextInt(100); // Purpur
}
@Override
@@ -237,6 +239,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
protected void mobTick() { mobTick(false); }
protected void mobTick(boolean inactive) {
this.world.getMethodProfiler().enter("villagerBrain");
+ // Purpur start
+ boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
+ if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
+ // Purpur end
if (!inactive) {
if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) {
this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index c441fcea9b2b5a77b801c8a69541cf42050927dc..c7fb5a737cab0083c39732247acb8f4e87562894 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -74,4 +74,11 @@ public class PurpurWorldConfig {
playerSpawnInvulnerableTicks = getInt("gameplay-mechanics.player.spawn-invulnerable-ticks", playerSpawnInvulnerableTicks);
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
}
+
+ public int villagerBrainTicks = 1;
+ public boolean villagerUseBrainTicksOnlyWhenLagging = true;
+ private void villagerSettings() {
+ villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
+ villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
+ }
}

View File

@ -1,85 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 11 Oct 2019 00:17:39 -0500
Subject: [PATCH] Alternative Keepalive Handling
diff --git a/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java b/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java
index b4c37287362907b8507d156b978ba5b9d961bb7b..9e6e6636539702507abb78515e002819661027af 100644
--- a/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java
+++ b/src/main/java/net/minecraft/network/protocol/game/PacketPlayInKeepAlive.java
@@ -24,6 +24,7 @@ public class PacketPlayInKeepAlive implements Packet<PacketListenerPlayIn> {
packetdataserializer.writeLong(this.a);
}
+ public long getId() { return b(); } // Purpur - OBFHELPER
public long b() {
return this.a;
}
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
index d1fe1242272a422b7b528876da0d76e1aa6f3eaa..8856ee8e0e7a3efda7921c0c8df9a2eb4213b1ce 100644
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
@@ -233,6 +233,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
private long lastKeepAlive = SystemUtils.getMonotonicMillis(); private void setLastPing(long lastPing) { this.lastKeepAlive = lastPing;}; private long getLastPing() { return this.lastKeepAlive;}; // Paper - OBFHELPER
private boolean awaitingKeepAlive; private void setPendingPing(boolean isPending) { this.awaitingKeepAlive = isPending;}; private boolean isPendingPing() { return this.awaitingKeepAlive;}; // Paper - OBFHELPER
private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER
+ private java.util.List<Long> keepAlives = new java.util.ArrayList<>(); // Purpur
// CraftBukkit start - multithreaded fields
private volatile int chatThrottle;
private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle");
@@ -367,6 +368,21 @@ public class PlayerConnection implements PacketListenerPlayIn {
long currentTime = SystemUtils.getMonotonicMillis();
long elapsedTime = currentTime - this.getLastPing();
+ // Purpur start
+ if (net.pl3x.purpur.PurpurConfig.useAlternateKeepAlive) {
+ if (elapsedTime >= 1000L) { // 1 second
+ if (!processedDisconnect && keepAlives.size() > KEEPALIVE_LIMIT) {
+ PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", player.getName());
+ disconnect(new ChatMessage("disconnect.timeout"));
+ } else {
+ setLastPing(currentTime); // hijack this field for 1 second intervals
+ keepAlives.add(currentTime); // currentTime is ID
+ sendPacket(new PacketPlayOutKeepAlive(currentTime));
+ }
+ }
+ } else
+ // Purpur end
+
if (this.isPendingPing()) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
PlayerConnection.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getName()); // more info
@@ -3093,6 +3109,16 @@ public class PlayerConnection implements PacketListenerPlayIn {
@Override
public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
+ // Purpur start
+ if (net.pl3x.purpur.PurpurConfig.useAlternateKeepAlive) {
+ long id = packetplayinkeepalive.getId();
+ if (keepAlives.size() > 0 && keepAlives.contains(id)) {
+ int ping = (int) (SystemUtils.getMonotonicMillis() - id);
+ player.ping = (player.ping * 3 + ping) / 4;
+ keepAlives.clear(); // we got a valid response, lets roll with it and forget the rest
+ }
+ } else
+ // Purpur end
//PlayerConnectionUtils.ensureMainThread(packetplayinkeepalive, this, this.player.getWorldServer()); // CraftBukkit // Paper - This shouldn't be on the main thread
if (this.awaitingKeepAlive && packetplayinkeepalive.b() == this.h) {
int i = (int) (SystemUtils.getMonotonicMillis() - this.lastKeepAlive);
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 089ae62c2189fe774796ecc6caf9961d3edb5ea3..afd0c577069f2a856caf41bd2dd5187db4866fa3 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -155,6 +155,11 @@ public class PurpurConfig {
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
}
+ public static boolean useAlternateKeepAlive = false;
+ private static void useAlternateKeepAlive() {
+ useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
+ }
+
public static boolean barrelSixRows = false;
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;

View File

@ -1,235 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Thu, 9 May 2019 14:27:37 -0500
Subject: [PATCH] Silk touch spawners
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
index c60457e9240c33a4721b82a00cef081fb320c8a7..5b5460c66291f1242ac7a20bc38514e214920739 100644
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
@@ -81,6 +81,7 @@ public final class PaperAdventure {
})
.build();
public static final LegacyComponentSerializer LEGACY_SECTION_UXRC = LegacyComponentSerializer.builder().flattener(FLATTENER).hexColors().useUnusualXRepeatedCharacterHexFormat().build();
+ public static final LegacyComponentSerializer LEGACY_AMPERSAND = LegacyComponentSerializer.builder().character(LegacyComponentSerializer.AMPERSAND_CHAR).hexColors().build(); // Purpur
public static final PlainComponentSerializer PLAIN = PlainComponentSerializer.builder().flattener(FLATTENER).build();
public static final GsonComponentSerializer GSON = GsonComponentSerializer.builder()
.legacyHoverEventSerializer(NBTLegacyHoverEventSerializer.INSTANCE)
diff --git a/src/main/java/net/minecraft/server/ItemSpawner.java b/src/main/java/net/minecraft/server/ItemSpawner.java
new file mode 100644
index 0000000000000000000000000000000000000000..599672ed4d0fc412ad3c0fa2e9d9df7035694fa2
--- /dev/null
+++ b/src/main/java/net/minecraft/server/ItemSpawner.java
@@ -0,0 +1,35 @@
+package net.minecraft.server;
+
+import net.minecraft.core.BlockPosition;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.entity.EntityTypes;
+import net.minecraft.world.entity.player.EntityHuman;
+import net.minecraft.world.item.ItemBlock;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.level.World;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.entity.TileEntity;
+import net.minecraft.world.level.block.entity.TileEntityMobSpawner;
+import net.minecraft.world.level.block.state.IBlockData;
+
+public class ItemSpawner extends ItemBlock {
+ public ItemSpawner(Block block, Info info) {
+ super(block, info);
+ }
+
+ @Override
+ protected boolean a(BlockPosition blockposition, World world, EntityHuman entityhuman, ItemStack itemstack, IBlockData iblockdata) {
+ boolean handled = super.a(blockposition, world, entityhuman, itemstack, iblockdata);
+ if (world.purpurConfig.silkTouchEnabled && entityhuman.getBukkitEntity().hasPermission("purpur.place.spawners")) {
+ TileEntity spawner = world.getTileEntity(blockposition);
+ if (spawner instanceof TileEntityMobSpawner && itemstack.hasTag()) {
+ NBTTagCompound tag = itemstack.getTag();
+ if (tag.hasKey("Purpur.mob_type")) {
+ EntityTypes.getByName(tag.getString("Purpur.mob_type")).ifPresent(type ->
+ ((TileEntityMobSpawner) spawner).getSpawner().setMobName(type));
+ }
+ }
+ }
+ return handled;
+ }
+}
diff --git a/src/main/java/net/minecraft/world/item/Items.java b/src/main/java/net/minecraft/world/item/Items.java
index fc5cc610e7ea584ce72600b9d9f47543265725bb..8e9a25495d76251a86268d3059e2960a86dc46b3 100644
--- a/src/main/java/net/minecraft/world/item/Items.java
+++ b/src/main/java/net/minecraft/world/item/Items.java
@@ -2,6 +2,7 @@ package net.minecraft.world.item;
import net.minecraft.core.IRegistry;
import net.minecraft.resources.MinecraftKey;
+import net.minecraft.server.ItemSpawner;
import net.minecraft.sounds.SoundEffects;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.EnumItemSlot;
@@ -193,7 +194,7 @@ public class Items {
public static final Item ct = a(Blocks.PURPUR_BLOCK, CreativeModeTab.b);
public static final Item cu = a(Blocks.PURPUR_PILLAR, CreativeModeTab.b);
public static final Item cv = a(Blocks.PURPUR_STAIRS, CreativeModeTab.b);
- public static final Item cw = a(Blocks.SPAWNER);
+ public static final Item cw = a(Blocks.SPAWNER, new ItemSpawner(Blocks.SPAWNER, new Item.Info().a(EnumItemRarity.EPIC))); // Purpur
public static final Item cx = a(Blocks.OAK_STAIRS, CreativeModeTab.b);
public static final Item cy = a(Blocks.CHEST, CreativeModeTab.c);
public static final Item cz = a(Blocks.DIAMOND_ORE, CreativeModeTab.b);
diff --git a/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java b/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java
index 287dd5f1b2b913df4029966860cd1a426947b187..af3c1a6307fb9e244226794508382d2ffa2aeb4b 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockMobSpawner.java
@@ -1,14 +1,35 @@
package net.minecraft.world.level.block;
import net.minecraft.core.BlockPosition;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.nbt.NBTTagString;
+import net.minecraft.resources.MinecraftKey;
import net.minecraft.server.level.WorldServer;
+import net.minecraft.world.entity.EntityTypes;
+import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.enchantment.EnchantmentManager;
+import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.level.IBlockAccess;
+import net.minecraft.world.level.World;
import net.minecraft.world.level.block.entity.TileEntity;
import net.minecraft.world.level.block.entity.TileEntityMobSpawner;
import net.minecraft.world.level.block.state.BlockBase;
import net.minecraft.world.level.block.state.IBlockData;
+// Purpur start
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.TextReplacementConfig;
+import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
+
+import java.util.List;
+
+import static net.kyori.adventure.text.format.TextDecoration.ITALIC;
+// Purpur end
+
public class BlockMobSpawner extends BlockTileEntity {
protected BlockMobSpawner(BlockBase.Info blockbase_info) {
@@ -20,6 +41,59 @@ public class BlockMobSpawner extends BlockTileEntity {
return new TileEntityMobSpawner();
}
+ // Purpur start
+ @Override
+ public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, TileEntity tileentity, ItemStack itemstack) {
+ if (world.purpurConfig.silkTouchEnabled && entityhuman.getBukkitEntity().hasPermission("purpur.drop.spawners") && isSilkTouch(world, itemstack)) {
+ MinecraftKey type = ((TileEntityMobSpawner) tileentity).getSpawner().getMobName();
+ if (type != null) {
+ final Component mobName = PaperAdventure.asAdventure(EntityTypes.getFromKey(type).getNameComponent());
+ final TextReplacementConfig config = TextReplacementConfig.builder()
+ .matchLiteral("{mob}")
+ .replacement(mobName)
+ .build();
+
+ NBTTagCompound display = new NBTTagCompound();
+ boolean customDisplay = false;
+
+ String name = world.purpurConfig.silkTouchSpawnerName;
+ if (name != null && !name.isEmpty() && !name.equals("Spawner")) {
+ final Component displayName = PaperAdventure.LEGACY_AMPERSAND.deserialize(name).replaceText(config).decoration(ITALIC, false);
+ display.set("Name", NBTTagString.create(GsonComponentSerializer.gson().serialize(displayName)));
+ customDisplay = true;
+ }
+
+ List<String> lore = world.purpurConfig.silkTouchSpawnerLore;
+ if (lore != null && !lore.isEmpty()) {
+ NBTTagList list = new NBTTagList();
+ for (String line : lore) {
+ final Component lineComponent = PaperAdventure.LEGACY_AMPERSAND.deserialize(line).replaceText(config).decoration(ITALIC, false);
+ list.add(NBTTagString.create(GsonComponentSerializer.gson().serialize(lineComponent)));
+ }
+ display.set("Lore", list);
+ customDisplay = true;
+ }
+
+ NBTTagCompound tag = new NBTTagCompound();
+ if (customDisplay) {
+ tag.set("display", display);
+ }
+ tag.setString("Purpur.mob_type", type.toString());
+
+ ItemStack item = new ItemStack(Blocks.SPAWNER.getItem());
+ item.setTag(tag);
+
+ dropItem(world, blockposition, item);
+ }
+ }
+ super.a(world, entityhuman, blockposition, iblockdata, tileentity, itemstack);
+ }
+
+ private boolean isSilkTouch(World world, ItemStack itemstack) {
+ return itemstack != null && world.purpurConfig.silkTouchTools.contains(itemstack.getItem()) && EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) > 0;
+ }
+ // Purpur end
+
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);
@@ -32,6 +106,7 @@ public class BlockMobSpawner extends BlockTileEntity {
@Override
public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
+ if (isSilkTouch(worldserver, itemstack)) return 0; // Purpur
int i = 15 + worldserver.random.nextInt(15) + worldserver.random.nextInt(15);
return i;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index c7fb5a737cab0083c39732247acb8f4e87562894..10a6fcd70869719ed2b2d1442a83ab912e00c898 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -1,6 +1,12 @@
package net.pl3x.purpur;
+import net.minecraft.core.IRegistry;
+import net.minecraft.world.item.Item;
+import net.minecraft.world.item.Items;
+import net.minecraft.resources.MinecraftKey;
import org.bukkit.configuration.ConfigurationSection;
+
+import java.util.ArrayList;
import java.util.List;
import static net.pl3x.purpur.PurpurConfig.log;
@@ -75,6 +81,29 @@ public class PurpurWorldConfig {
playerInvulnerableWhileAcceptingResourcePack = getBoolean("gameplay-mechanics.player.invulnerable-while-accepting-resource-pack", playerInvulnerableWhileAcceptingResourcePack);
}
+ public boolean silkTouchEnabled = false;
+ public String silkTouchSpawnerName = "Spawner";
+ public List<String> silkTouchSpawnerLore = new ArrayList<>();
+ public List<Item> silkTouchTools = new ArrayList<>();
+ private void silkTouchSettings() {
+ silkTouchEnabled = getBoolean("gameplay-mechanics.silk-touch.enabled", silkTouchEnabled);
+ silkTouchSpawnerName = getString("gameplay-mechanics.silk-touch.spawner-name", silkTouchSpawnerName);
+ silkTouchSpawnerLore.clear();
+ getList("gameplay-mechanics.silk-touch.spawner-lore", new ArrayList<String>(){{
+ add("Spawns a {mob}");
+ }}).forEach(line -> silkTouchSpawnerLore.add(line.toString()));
+ silkTouchTools.clear();
+ getList("gameplay-mechanics.silk-touch.tools", new ArrayList<String>(){{
+ add("minecraft:iron_pickaxe");
+ add("minecraft:golden_pickaxe");
+ add("minecraft:diamond_pickaxe");
+ add("minecraft:netherite_pickaxe");
+ }}).forEach(key -> {
+ Item item = IRegistry.ITEM.get(new MinecraftKey(key.toString()));
+ if (item != Items.AIR) silkTouchTools.add(item);
+ });
+ }
+
public int villagerBrainTicks = 1;
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
private void villagerSettings() {

View File

@ -1,71 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Thu, 6 Jun 2019 22:15:46 -0500
Subject: [PATCH] MC-168772 Fix - Add turtle egg block options
diff --git a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java
index 6093d4c7431a286477c9be97163ea8d64168c3b0..04504901b1933ed760b34b8abb994de8ec340a4e 100644
--- a/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java
+++ b/src/main/java/net/minecraft/world/level/block/BlockTurtleEgg.java
@@ -9,12 +9,15 @@ import net.minecraft.sounds.SoundEffects;
import net.minecraft.tags.Tag;
import net.minecraft.tags.TagsBlock;
import net.minecraft.world.entity.Entity;
+import net.minecraft.world.entity.EntityExperienceOrb;
import net.minecraft.world.entity.EntityLiving;
import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.entity.ambient.EntityBat;
import net.minecraft.world.entity.animal.EntityTurtle;
+import net.minecraft.world.entity.item.EntityItem;
import net.minecraft.world.entity.monster.EntityZombie;
import net.minecraft.world.entity.player.EntityHuman;
+import net.minecraft.world.entity.vehicle.EntityMinecartAbstract;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockActionContext;
import net.minecraft.world.level.GameRules;
@@ -189,6 +192,23 @@ public class BlockTurtleEgg extends Block {
}
private boolean a(World world, Entity entity) {
- return !(entity instanceof EntityTurtle) && !(entity instanceof EntityBat) ? (!(entity instanceof EntityLiving) ? false : entity instanceof EntityHuman || world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) : false;
+ // Purpur start - fix MC-168772
+ if (entity instanceof EntityTurtle) {
+ return false;
+ }
+ if (!world.purpurConfig.turtleEggsBreakFromExpOrbs && entity instanceof EntityExperienceOrb) {
+ return false;
+ }
+ if (!world.purpurConfig.turtleEggsBreakFromItems && entity instanceof EntityItem) {
+ return false;
+ }
+ if (!world.purpurConfig.turtleEggsBreakFromMinecarts && entity instanceof EntityMinecartAbstract) {
+ return false;
+ }
+ if (entity instanceof EntityLiving && !(entity instanceof EntityHuman)) {
+ return world.getGameRules().getBoolean(GameRules.MOB_GRIEFING);
+ }
+ return true;
+ // Purpur end
}
}
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 10a6fcd70869719ed2b2d1442a83ab912e00c898..2f18ca7ae23e913155f25fd07627f376e401ab0f 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -104,6 +104,15 @@ public class PurpurWorldConfig {
});
}
+ public boolean turtleEggsBreakFromExpOrbs = true;
+ public boolean turtleEggsBreakFromItems = true;
+ public boolean turtleEggsBreakFromMinecarts = true;
+ private void turtleEggSettings() {
+ turtleEggsBreakFromExpOrbs = getBoolean("blocks.turtle_egg.break-from-exp-orbs", turtleEggsBreakFromExpOrbs);
+ turtleEggsBreakFromItems = getBoolean("blocks.turtle_egg.break-from-items", turtleEggsBreakFromItems);
+ turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
+ }
+
public int villagerBrainTicks = 1;
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
private void villagerSettings() {

View File

@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Sat, 28 Mar 2020 01:51:32 -0500
Subject: [PATCH] Fix vanilla command permission handler
diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java
index c0fac7369b111e65b896a15848ae22457e5e8914..5278997e522b495b83e53cac5968388d6eca45e4 100644
--- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java
+++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java
@@ -35,6 +35,7 @@ public abstract class CommandNode<S> implements Comparable<CommandNode<S>> {
private final RedirectModifier<S> modifier;
private final boolean forks;
private Command<S> command;
+ private String permission = null; public String getPermission() { return permission; } public void setPermission(String permission) { this.permission = permission; } // Purpur
// CraftBukkit start
public void removeCommand(String name) {
children.remove(name);
diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
index 56a0665127c7c55049b8438c91e72b6881ed11e0..575bc7d8a433cd6d4755757d82fe3a18da184d5a 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java
@@ -87,6 +87,7 @@ public final class VanillaCommandWrapper extends BukkitCommand {
}
public static String getPermission(CommandNode<CommandListenerWrapper> vanillaCommand) {
+ if (vanillaCommand.getPermission() != null) return vanillaCommand.getPermission(); // Purpur
return "minecraft.command." + ((vanillaCommand.getRedirect() == null) ? vanillaCommand.getName() : vanillaCommand.getRedirect().getName());
}

Some files were not shown because too many files have changed in this diff Show More