mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-22 10:35:42 +01:00
bring purpur back
This commit is contained in:
parent
6bf2b9226a
commit
b0a577043f
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -32,3 +32,6 @@
|
||||
|
||||
[submodule "Yatopia-Server"]
|
||||
path = Yatopia-Server
|
||||
[submodule "upstream/Purpur"]
|
||||
path = upstream/Purpur
|
||||
url = https://github.com/pl3xgaming/Purpur
|
||||
|
264
PATCHES.md
264
PATCHES.md
@ -8,52 +8,185 @@ # Patches
|
||||
|
||||
| Side | Patch | Author | CoAuthors |
|
||||
| ----- | ------------- |:-------------:| -----:|
|
||||
| server | AFK API | William Blake Galbreath | |
|
||||
| api | AFK API | William Blake Galbreath | |
|
||||
| server | API for any mob to burn daylight | Ben Kerllenevich | |
|
||||
| api | 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 | |
|
||||
| server | Add EntityTeleportHinderedEvent | Mariell Hoversholm | |
|
||||
| api | 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 | |
|
||||
| server | Add StructureGenerateEvent | Nahuel | Mariell Hoversholm |
|
||||
| api | 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 | |
|
||||
| server | Add critical hit check to EntityDamagedByEntityEvent | BillyGalbreath | |
|
||||
| api | 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 certain block updates | William Blake Galbreath | |
|
||||
| server | Add option to disable dolphin treasure searching | William Blake Galbreath | |
|
||||
| server | Add option to disable observer clocks | Phoenix616 | |
|
||||
| server | Add option to disable zombie aggressiveness towards villagers | nitricspace | |
|
||||
| api | 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 | |
|
||||
| server | Add predicate to recipe's ExactChoice ingredient | William Blake Galbreath | |
|
||||
| api | 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 toggle for end portal safe teleporting | BillyGalbreath | |
|
||||
| server | Add toggle for sand duping fix | BillyGalbreath | |
|
||||
| server | Add twisting and weeping vines growth rates | BillyGalbreath | |
|
||||
| server | Add unsafe Entity serialization API | Mariell Hoversholm | |
|
||||
| api | 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 | |
|
||||
| server | Advancement API | William Blake Galbreath | |
|
||||
| api | Advancement API | William Blake Galbreath | |
|
||||
| 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 | |
|
||||
| server | Anvil API | William Blake Galbreath | |
|
||||
| api | 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 | Beacon Activation Range Configurable | DoctaEnkoda | |
|
||||
| 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 | |
|
||||
| server | Bring back server name | William Blake Galbreath | |
|
||||
| api | 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 MobEffect by world | DoctaEnkoda | |
|
||||
| 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 | |
|
||||
@ -69,49 +202,120 @@ # Patches
|
||||
| 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 | |
|
||||
| server | EMC - MonsterEggSpawnEvent | Aikar | |
|
||||
| api | 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 Fall Damage API | TreyRuffy | |
|
||||
| api | Flying Fall Damage API | TreyRuffy | |
|
||||
| server | Flying squids! Oh my! | William Blake Galbreath | |
|
||||
| server | Full netherite armor grants fire resistance | BillyGalbreath | |
|
||||
| api | 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 | |
|
||||
| server | Iron golem poppy calms anger | BillyGalbreath | |
|
||||
| api | Iron golem poppy calms anger | BillyGalbreath | |
|
||||
| server | Item entity immunities | William Blake Galbreath | |
|
||||
| api | Item entity immunities | William Blake Galbreath | |
|
||||
| server | Item stuck sleep config | tr7zw | |
|
||||
| server | ItemFactory#getMonsterEgg | William Blake Galbreath | |
|
||||
| api | 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 | |
|
||||
| server | Lagging threshold | William Blake Galbreath | |
|
||||
| api | Lagging threshold | William Blake Galbreath | |
|
||||
| server | Left handed API | BillyGalbreath | |
|
||||
| api | Left handed API | BillyGalbreath | |
|
||||
| server | Lithium: CompactSineLUT | JellySquid | |
|
||||
| server | LivingEntity safeFallDistance | William Blake Galbreath | |
|
||||
| api | LivingEntity safeFallDistance | William Blake Galbreath | |
|
||||
| server | LivingEntity#broadcastItemBreak | William Blake Galbreath | |
|
||||
| api | LivingEntity#broadcastItemBreak | William Blake Galbreath | |
|
||||
| server | Llama API | William Blake Galbreath | |
|
||||
| api | 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 | |
|
||||
@ -129,25 +333,55 @@ # Patches
|
||||
| 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 | |
|
||||
| server | Phantoms attracted to crystals and crystals shoot phantoms | William Blake Galbreath | |
|
||||
| api | 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 | |
|
||||
| server | Player invulnerabilities | William Blake Galbreath | |
|
||||
| api | Player invulnerabilities | William Blake Galbreath | |
|
||||
| api | PlayerAttackEntityEvent | Ivan Pekov | |
|
||||
| server | PlayerAttackEntityEvent | Ivan Pekov | |
|
||||
| server | PlayerBookTooLargeEvent | BillyGalbreath | |
|
||||
| api | PlayerBookTooLargeEvent | BillyGalbreath | |
|
||||
| server | PlayerSetSpawnerTypeWithEggEvent | William Blake Galbreath | |
|
||||
| api | 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 | |
|
||||
| server | Purpur config files | William Blake Galbreath | |
|
||||
| api | 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 | 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 | |
|
||||
@ -167,38 +401,68 @@ # Patches
|
||||
| server | Revert getChunkAt(Async) retaining chunks for long periods of | Spottedleaf | |
|
||||
| server | Rework PlayerChunk main thread checks | Spottedleaf | |
|
||||
| server | Rewrite the light engine | Spottedleaf | |
|
||||
| server | Ridables | William Blake Galbreath | |
|
||||
| api | 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 |
|
||||
|
@ -19,44 +19,6 @@ 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/world/entity/monster/hoglin/EntityHoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java
|
||||
index 375409f4b72edc7990da90460b30486fb2980fb6..ab692de8a5b1411e37251fb545e6f579a9929f91 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java
|
||||
@@ -54,7 +54,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin {
|
||||
public int conversionTicks = 0;
|
||||
public boolean cannotBeHunted = false;
|
||||
protected static final ImmutableList<? extends SensorType<? extends Sensor<? super EntityHoglin>>> bo = ImmutableList.of(SensorType.c, SensorType.d, SensorType.n, SensorType.m);
|
||||
- protected static final ImmutableList<? extends MemoryModuleType<?>> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED});
|
||||
+ protected static final ImmutableList<MemoryModuleType<?>> bp = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLIN, new MemoryModuleType[]{MemoryModuleType.AVOID_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_ADULT_HOGLINS, MemoryModuleType.NEAREST_VISIBLE_ADULY, MemoryModuleType.NEAREST_REPELLENT, MemoryModuleType.PACIFIED}); // Airplane - decompile error
|
||||
|
||||
public EntityHoglin(EntityTypes<? extends EntityHoglin> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -118,13 +118,13 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin {
|
||||
|
||||
@Override
|
||||
public BehaviorController<EntityHoglin> getBehaviorController() {
|
||||
- return super.getBehaviorController();
|
||||
+ return (BehaviorController<EntityHoglin>) super.getBehaviorController(); // Airplane - decompile error
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
this.world.getMethodProfiler().enter("hoglinBrain");
|
||||
- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this);
|
||||
+ this.getBehaviorController().a((WorldServer) this.world, (EntityHoglin) this); // Airplane - decompile error
|
||||
this.world.getMethodProfiler().exit();
|
||||
HoglinAI.a(this);
|
||||
if (this.isConverting()) {
|
||||
@@ -300,7 +300,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin {
|
||||
|
||||
@Override
|
||||
protected SoundEffect getSoundAmbient() {
|
||||
- return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse((Object) null);
|
||||
+ return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null); // Airplane - decompile error
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java b/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java
|
||||
index 95d0c9f22d79194ca83ca6f6a8e6d91180a3c8da..5c712af849abf1e5f58a7760b19c543474559f77 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootTableInfo.java
|
||||
|
@ -183,10 +183,10 @@ index 0000000000000000000000000000000000000000..807cf274619b8f7be839e249cb62b981
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 3713a110a64fa686e785b9789c33dd09cacc2f48..0d27af452fc6a72646a4a168fc827fed5072fab9 100644
|
||||
index 9e4b83bc106acbc9d40a07ad7a47488325e4b4ed..d7e65fc294538bce09580ec1b9090538783c63ad 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -216,6 +216,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -225,6 +225,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
|
||||
// Paper end
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
|
@ -55,10 +55,10 @@ 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 2ff3297fb8c0e4f8c969ba2727eecb7fe06525c4..56812a96b57586d91c0f218f4720807e2d957627 100644
|
||||
index 158388410ea14b2df95635914844952bd52b8f87..84e1ef0716559f7de4ea580269fa7ca17894cf10 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;
|
||||
@@ -112,6 +112,7 @@ import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.MovingObjectPosition;
|
||||
import net.minecraft.world.phys.MovingObjectPositionEntity;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
@ -66,7 +66,7 @@ index 2ff3297fb8c0e4f8c969ba2727eecb7fe06525c4..56812a96b57586d91c0f218f4720807e
|
||||
import net.minecraft.world.scores.ScoreboardTeam;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -3102,7 +3103,10 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -3225,7 +3226,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
|
||||
@ -112,10 +112,10 @@ 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 cb8064df7e9f1b8b4d4292486e2193680d83663c..37da32675f0c00c793cd137c9a7305932cefb705 100644
|
||||
index cb58d2635650c20da21583ead18e9f380323205b..904dfb7c337b1d583df80533ba5c59478f560c85 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;
|
||||
@@ -70,6 +70,8 @@ import net.minecraft.world.level.saveddata.maps.WorldMap;
|
||||
import net.minecraft.world.level.storage.WorldData;
|
||||
import net.minecraft.world.level.storage.WorldDataMutable;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
@ -124,7 +124,7 @@ index cb8064df7e9f1b8b4d4292486e2193680d83663c..37da32675f0c00c793cd137c9a730593
|
||||
import net.minecraft.world.phys.shapes.OperatorBoolean;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
@@ -385,6 +387,91 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -431,6 +433,91 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -23,10 +23,10 @@ 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/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index 6fc215df5ed3aa6ef0c23a57e8444602ff9309e8..239af30d85bff561d14a96de97e1215378018f85 100644
|
||||
index fbc7f3e489be0ac5939af29a9aef75a56c38eb4a..ce13d159e9519e352e348fb064d7f6ca3f69bacb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -1212,7 +1212,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1260,7 +1260,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
gameprofilerfiller.enter("thunder");
|
||||
final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
|
||||
|
||||
|
@ -46,10 +46,10 @@ index 1b86c032fde3409cb89b849b9ba094af82cd9269..0718b80ac82a1cf00519c30c6d2ef78f
|
||||
boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index 239af30d85bff561d14a96de97e1215378018f85..39b978c6e61e675249743d082699bb9882fd39ff 100644
|
||||
index ce13d159e9519e352e348fb064d7f6ca3f69bacb..d7a19e6c03b440bc46385868e83a00110dfdc0b1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -1202,6 +1202,8 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1250,6 +1250,8 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
private final BiomeBase[] biomeBaseCache = new BiomeBase[1];
|
||||
// Tuinity end - optimise chunk ice snow ticking
|
||||
|
||||
@ -58,7 +58,7 @@ index 239af30d85bff561d14a96de97e1215378018f85..39b978c6e61e675249743d082699bb98
|
||||
public void a(Chunk chunk, int i) { final int randomTickSpeed = i; // Paper
|
||||
ChunkCoordIntPair chunkcoordintpair = chunk.getPos();
|
||||
boolean flag = this.isRaining();
|
||||
@@ -1212,7 +1214,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1260,7 +1262,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
gameprofilerfiller.enter("thunder");
|
||||
final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
|
||||
|
||||
@ -67,7 +67,7 @@ index 239af30d85bff561d14a96de97e1215378018f85..39b978c6e61e675249743d082699bb98
|
||||
blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper
|
||||
if (this.isRainingAt(blockposition)) {
|
||||
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
|
||||
@@ -1236,7 +1238,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1290,7 +1292,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
}
|
||||
|
||||
gameprofilerfiller.exitEnter("iceandsnow");
|
||||
|
@ -20,10 +20,10 @@ 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 56812a96b57586d91c0f218f4720807e2d957627..6b82dffa3d0938a94114ead277b42c71ea3bb52b 100644
|
||||
index 84e1ef0716559f7de4ea580269fa7ca17894cf10..59b85551533d332880b154039a5cc3683b17a962 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 {
|
||||
@@ -925,11 +925,13 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
if (entity != null) {
|
||||
@ -39,4 +39,4 @@ index 56812a96b57586d91c0f218f4720807e2d957627..6b82dffa3d0938a94114ead277b42c71
|
||||
+ // Airplane end
|
||||
d0 *= 0.5D;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ index ab019b577002677a4ce788106f8e5a1d7757a2ae..5077e70e4f408814b1072ceb45c52a32
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 89852779fd9cfd19058afe40feb0cf14ca8d2896..5fb3f2968f20e78d76382bec52c9236add4fc060 100644
|
||||
index 18e5110047f13c213e70d3e094b94fecb4408d18..6c898bf36edbc50018f4795b8c51fc3fbbcc5641 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
|
||||
@ -83,7 +83,7 @@ index 89852779fd9cfd19058afe40feb0cf14ca8d2896..5fb3f2968f20e78d76382bec52c9236a
|
||||
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 7ba59ff9a7ed39bf69c46973a85f874c43134dc1..c67138e6a4dcbe823e894f6bb948742bfb8f9943 100644
|
||||
index b4afd71340a0c7e1b6aa2e3f01a6a4fc998f3f16..35a6a786474fb95082a2d1ca41697c2b1febe55a 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 {
|
||||
@ -99,7 +99,7 @@ index 7ba59ff9a7ed39bf69c46973a85f874c43134dc1..c67138e6a4dcbe823e894f6bb948742b
|
||||
this.targetSelector.doTick();
|
||||
}
|
||||
}
|
||||
@@ -829,9 +829,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -865,9 +865,11 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.bo.a();
|
||||
this.world.getMethodProfiler().exit();
|
||||
this.world.getMethodProfiler().enter("targetSelector");
|
||||
@ -135,20 +135,21 @@ index 637928664f8c7b1c694a234e507c20724294e450..502f710e1b04d186c539a04b43379bdc
|
||||
public boolean hasTasks() {
|
||||
for (PathfinderGoalWrapped task : getTasks()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java
|
||||
index ab692de8a5b1411e37251fb545e6f579a9929f91..9aa4850e021076fde306eea7eec104c31086c57f 100644
|
||||
index e9b466bb3172fcae1dee81e7e1b8c069b0a23944..6d43c4679a6a27b03d128f4dd2671b33b7d8c6cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/EntityHoglin.java
|
||||
@@ -121,12 +121,17 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin {
|
||||
return (BehaviorController<EntityHoglin>) super.getBehaviorController(); // Airplane - decompile error
|
||||
@@ -143,13 +143,18 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin {
|
||||
return (BehaviorController<EntityHoglin>) super.getBehaviorController(); // Purpur decompile error
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Airplane
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
this.world.getMethodProfiler().enter("hoglinBrain");
|
||||
if (getPurpurRider() == null) // Purpur - only use brain if no rider
|
||||
+ // Airplane - dynamic tick
|
||||
+ if (!gg.airplane.AirplaneConfig.dynamicHoglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) {
|
||||
this.world.getMethodProfiler().enter("hoglinBrain");
|
||||
this.getBehaviorController().a((WorldServer) this.world, (EntityHoglin) this); // Airplane - decompile error
|
||||
this.getBehaviorController().a((WorldServer) this.world, this); // Purpour - decompile error
|
||||
this.world.getMethodProfiler().exit();
|
||||
HoglinAI.a(this);
|
||||
+ }
|
||||
@ -157,19 +158,20 @@ 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..99cdcc9a9a7e6227a165c4ef779f8e76a99ec56a 100644
|
||||
index 77af7152a2e5ff99e98a0063947427c0d18aabcb..220933e776504599e7ed68520ec433e74c9dd882 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,17 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow {
|
||||
@@ -289,13 +289,18 @@ public class EntityPiglin extends EntityPiglinAbstract implements ICrossbow {
|
||||
return !this.cannotHunt;
|
||||
}
|
||||
|
||||
+ private int behaviorTick; // Airplane
|
||||
@Override
|
||||
protected void mobTick() {
|
||||
this.world.getMethodProfiler().enter("piglinBrain");
|
||||
if (getPurpurRider() == null) // Purpur - only use brain if no rider
|
||||
+ // Airplane - dynamic tick
|
||||
+ if (!gg.airplane.AirplaneConfig.dynamicPiglinBehavior || this.behaviorTick++ % this.activatedPriority == 0) {
|
||||
this.world.getMethodProfiler().enter("piglinBrain");
|
||||
this.getBehaviorController().a((WorldServer) this.world, (EntityPiglin) this); // CraftBukkit - decompile error
|
||||
this.world.getMethodProfiler().exit();
|
||||
PiglinAI.b(this);
|
||||
@ -179,33 +181,29 @@ index 9a7bebd77302dbfd07ac802acbe2b9cb80eec26f..99cdcc9a9a7e6227a165c4ef779f8e76
|
||||
}
|
||||
|
||||
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 85374ac8f5460790de03b47d7c3ce19ed5596afe..ccb568a5e8501ac5e8901ef3a270cc87471d9ea1 100644
|
||||
index 66863b31687a41f84f722c611064f7ad31e02488..df29b574db306fd722d8470db4a5321230c837d5 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
|
||||
}
|
||||
// Spigot End
|
||||
|
||||
+ private int behaviorTick = 0;
|
||||
+
|
||||
@Override
|
||||
protected void mobTick() { mobTick(false); }
|
||||
protected void mobTick(boolean inactive) {
|
||||
this.world.getMethodProfiler().enter("villagerBrain");
|
||||
@@ -295,7 +295,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
|
||||
// Purpur end
|
||||
- if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
+ if (!inactive) {
|
||||
+ if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) {
|
||||
+ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
+ // Airplane start
|
||||
+ if (!inactive) {
|
||||
+ if (!gg.airplane.AirplaneConfig.dynamicVillagerBehavior || behaviorTick++ % this.activatedPriority == 0) {
|
||||
+ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Airplane end
|
||||
else if (shouldRestock()) doRestock(); // Purpur
|
||||
this.world.getMethodProfiler().exit();
|
||||
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..0c86a93a34fdbb65365e81915ac9f54df4dde88b 100644
|
||||
index 2fbc24a6907c06bbc12815a89b507d4479be6dc5..3a76d9d90531ed889a0fc92674bd1719aacdb159 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;
|
||||
@@ -48,6 +48,9 @@ import net.minecraft.world.entity.schedule.Activity;
|
||||
import net.minecraft.world.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.world.entity.projectile.EntityEnderSignal;
|
||||
// Paper end
|
||||
@ -215,7 +213,7 @@ index 5c2eaca0bc63c7880ee928aba6a24761737aa649..0c86a93a34fdbb65365e81915ac9f54d
|
||||
|
||||
public class ActivationRange
|
||||
{
|
||||
@@ -227,7 +230,7 @@ public class ActivationRange
|
||||
@@ -229,7 +232,7 @@ public class ActivationRange
|
||||
Chunk chunk = chunkProvider.getChunkAtIfLoadedMainThreadNoCache( i1, j1 ); // Paper
|
||||
if ( chunk != null )
|
||||
{
|
||||
@ -224,7 +222,7 @@ index 5c2eaca0bc63c7880ee928aba6a24761737aa649..0c86a93a34fdbb65365e81915ac9f54d
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,7 +243,7 @@ public class ActivationRange
|
||||
@@ -242,7 +245,7 @@ public class ActivationRange
|
||||
*
|
||||
* @param chunk
|
||||
*/
|
||||
@ -233,7 +231,7 @@ index 5c2eaca0bc63c7880ee928aba6a24761737aa649..0c86a93a34fdbb65365e81915ac9f54d
|
||||
{
|
||||
// Paper start
|
||||
Entity[] rawData = chunk.entities.getRawData();
|
||||
@@ -249,6 +252,19 @@ public class ActivationRange
|
||||
@@ -251,6 +254,19 @@ public class ActivationRange
|
||||
//for ( Entity entity : (Collection<Entity>) slice )
|
||||
// Paper end
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ index a6937366cd9c9d708edb5cd1ab3ac096e7b2032e..a579c5bf9e20c74aa3bf8ef6bc005764
|
||||
for (int j = 0; j < 4096; ++j) {
|
||||
T t1 = this.a(j);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
||||
index ec2b238480413ba9c123d9ddeaa787d9520e1b74..bf96f9e538fc29ca914536e8a7ce727ebe43a8b2 100644
|
||||
index 3fbeb01275a48b4173f98ae0c7f09e4c0e6445e7..5997f3e47f3d509c271f38eb2785f126066f5c6e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkRegionLoader.java
|
||||
@@ -468,6 +468,7 @@ public class ChunkRegionLoader {
|
||||
|
@ -20,10 +20,10 @@ 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/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
index e993b1849beb60515c51ee4f37617faab63ca223..4d7b5d47ab6bd3b1408811c3b9c157b1eb5c30ae 100644
|
||||
index 3bb5b360be98ac2f20793c0eb126e39eb2201331..bd03e91861237eeda50e607af4e26c1ad2d71297 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
||||
@@ -57,6 +57,7 @@ import net.minecraft.world.level.World;
|
||||
@@ -59,6 +59,7 @@ import net.minecraft.world.level.World;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
@ -31,7 +31,7 @@ index e993b1849beb60515c51ee4f37617faab63ca223..4d7b5d47ab6bd3b1408811c3b9c157b1
|
||||
import net.minecraft.world.level.pathfinder.PathType;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
@@ -314,11 +315,18 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
@@ -335,11 +336,18 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
||||
private boolean p(double d0, double d1, double d2) {
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(d0, d1, d2);
|
||||
|
||||
@ -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 9b55da1f4d40ae36b2d2b8e7b3b18989dc4f6006..ab6812698757c05c2e923006d4e3370a7d6c4e03 100644
|
||||
index 050651462390f0896f0629408d0f7d29d35bdb7f..0af062f54b8c5d1f8286a1e303ddaed14897aea8 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 {
|
||||
|
@ -20,10 +20,10 @@ 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
|
||||
index 17d63cd4ca152adc66ffe9ffd3227a0770738a29..c2706c752f6ff5c131b6db469ae85dd703d5d381 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 {
|
||||
@@ -444,12 +444,26 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
public BlockPosition b(int i, int j, int k) {
|
||||
return super.b(i, j, k).immutableCopy();
|
||||
}
|
||||
@ -51,7 +51,7 @@ index 6a6381e85fef2ae2b9b5e6dff0b7917b92fa01e5..2685a395a2eff9083cd8c654c4b7e214
|
||||
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
|
||||
index 9f1ea11d0bc15b8b0069fcf46ea2f6751c5e3064..19bc37143140b4e3a06a87297205b702548b0fa3 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 {
|
||||
@ -64,7 +64,7 @@ index 7918d830a4aef09c9f517284e83a9376299116ad..0a40df2151bd388b6633a6f50b14f1f4
|
||||
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
|
||||
index d876c5037b4704a174606629c80ba1142c77a50c..92db19451317ed02fba526328f97dec1dbbf85bd 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 {
|
||||
@ -141,10 +141,10 @@ index d827e18d8c3b9b5869dbb1e233f415ba0efb7c1b..fc687515fdfd47e90e11a2832de07d78
|
||||
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
|
||||
index d7a19e6c03b440bc46385868e83a00110dfdc0b1..d80378780d1cb83b37124509d34344e323b828bb 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 {
|
||||
@@ -1135,7 +1135,28 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
||||
gameprofilerfiller.enter("tick");
|
||||
if (!entity.dead && !(entity instanceof EntityComplexPart)) {
|
||||
@ -173,7 +173,7 @@ index 39b978c6e61e675249743d082699bb9882fd39ff..b4d8fbbc421b3288ae66db2932825b3e
|
||||
}
|
||||
|
||||
gameprofilerfiller.exit();
|
||||
@@ -1451,9 +1472,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@@ -1505,9 +1526,14 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
++entity.ticksLived;
|
||||
GameProfilerFiller gameprofilerfiller = this.getMethodProfiler();
|
||||
|
||||
@ -189,12 +189,12 @@ index 39b978c6e61e675249743d082699bb9882fd39ff..b4d8fbbc421b3288ae66db2932825b3e
|
||||
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
|
||||
index c166e0a8e7eadb4f714078f764ef35f7afca543b..778c981d4458957533fc3ac44095051b279c74e3 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;
|
||||
@@ -271,6 +271,8 @@ public class EntityTypes<T extends Entity> {
|
||||
public void setEntitySize(EntitySize entitySize) { this.br = entitySize; } // Purpur - OBFHELPER
|
||||
private EntitySize br; // Purpur - remove final
|
||||
|
||||
+ public java.util.function.Supplier<String> getEntityName = () -> IRegistry.ENTITY_TYPE.getKey(this).toString(); // Airplane - create lambda ones
|
||||
+
|
||||
@ -202,10 +202,10 @@ index 80c229c1852199fda85c03453d64cae33e413e89..7f70dda656ff9d802200f18139d2695e
|
||||
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
|
||||
index 904dfb7c337b1d583df80533ba5c59478f560c85..d7ec4c6917433ef38b3460c6dae6b954d013890f 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 {
|
||||
@@ -1156,19 +1156,19 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
public void a(Consumer<Entity> consumer, Entity entity) {
|
||||
try {
|
||||
|
@ -32,10 +32,10 @@ index bc8786e2aaeab4dbae4e9c7666ad816bc5bfac3f..09133c5822bc1386bc3d8a5f3c941964
|
||||
|
||||
this.g.long2ObjectEntrySet().removeIf((entry) -> {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
|
||||
index 148bdbc2cffb002d8b6dd05e70854ab503804949..48e6a4c588ef39a4bde067d79b96a656c68750ce 100644
|
||||
index a1b7ba4f2cef36e9ac7e21c22060090944ba943b..ac7bad10697c6fde7d512753992d59710aa1e032 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/NavigationAbstract.java
|
||||
@@ -433,6 +433,7 @@ public abstract class NavigationAbstract {
|
||||
@@ -434,6 +434,7 @@ public abstract class NavigationAbstract {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,10 @@ 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 726d0aec2c40ac8e40dba3a12f17870abae6dca6..334281d4cbdb2d82ca93e862498af961d9abfd31 100644
|
||||
index d7ec4c6917433ef38b3460c6dae6b954d013890f..bdedb30970d66fa1b75d185b9d1120de7718a706 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 {
|
||||
@@ -107,7 +107,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
//public final List<TileEntity> tileEntityList = Lists.newArrayList(); // Paper - remove unused list
|
||||
public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
|
||||
protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
|
||||
@ -17,7 +17,7 @@ index 726d0aec2c40ac8e40dba3a12f17870abae6dca6..334281d4cbdb2d82ca93e862498af961
|
||||
public final Thread serverThread;
|
||||
private final boolean debugWorld;
|
||||
private int d;
|
||||
@@ -993,12 +993,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -1039,12 +1039,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
gameprofilerfiller.enter("blockEntities");
|
||||
timings.tileEntityTick.startTiming(); // Spigot
|
||||
if (!this.tileEntityListUnload.isEmpty()) {
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Cache entityhuman display name
|
||||
|
||||
|
||||
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 5bce47fa8f191bc1d33c04c9865cb0efd492a9a2..5f9e64df007ebc40f7bcb50be495b10e51d5b87a 100644
|
||||
index be7c38c54311d6ea99a4ce2eec63863b649de3b2..176f092828a938c0d5036fbc594dbc26623b1713 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
@@ -162,7 +162,8 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -161,7 +161,8 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
protected int bG;
|
||||
protected final float bH = 0.02F;
|
||||
private int g;
|
||||
@ -18,7 +18,7 @@ index 5bce47fa8f191bc1d33c04c9865cb0efd492a9a2..5f9e64df007ebc40f7bcb50be495b10e
|
||||
private ItemStack bL;
|
||||
private final ItemCooldown bM;
|
||||
@Nullable
|
||||
@@ -1840,7 +1841,12 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -1877,7 +1878,12 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
||||
@Override
|
||||
public IChatBaseComponent getDisplayName() {
|
||||
|
@ -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 507c5255542ba1b958470b4db2c35b1b0b779f17..13b1eb353c22f2935cff7adbb4df725438a46d8f 100644
|
||||
index e7e75bc7aaa77c70530fd00f89777f35c614f792..b8727573d768cab51da07a370c606a798a022edb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -994,6 +994,11 @@ public final class CraftServer implements Server {
|
||||
@@ -997,6 +997,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."
|
||||
));
|
||||
|
@ -150,10 +150,10 @@ index 0000000000000000000000000000000000000000..aa8467b9dda1f7707e41f50ac7b3e9d7
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index 7279893d599351785652279c8827fe0efbd72f12..96d7990c66bd569b1b5ee287c0238c7dbb4c503e 100644
|
||||
index f65201f8cbf6d402b4366d63bfa03aacf329860f..a835285d230ea0dffa1b28c2a7a006041f2e6b2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -392,6 +392,7 @@ public class Block extends BlockBase implements IMaterial {
|
||||
@@ -441,6 +441,7 @@ public class Block extends BlockBase implements IMaterial {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ index 7279893d599351785652279c8827fe0efbd72f12..96d7990c66bd569b1b5ee287c0238c7d
|
||||
return this.aA;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java b/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java
|
||||
index 6bb4ec00e40795ced73648fefcd1f5027e0113cd..3b8fa837db21c5f67eab2ff8752e906ea97c288d 100644
|
||||
index 963b7edab813cd32f04c51fd2c6c137988e2a754..c735bcea9e8b1fa5a77c5c247584b8007f52e0d3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/material/FluidTypeFlowing.java
|
||||
@@ -45,6 +45,8 @@ public abstract class FluidTypeFlowing extends FluidType {
|
||||
|
@ -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 5fb3f2968f20e78d76382bec52c9236add4fc060..7ddbc56eb2ea8491cd32987843801e9bee9dbe0b 100644
|
||||
index 6c898bf36edbc50018f4795b8c51fc3fbbcc5641..18cc6e729e092511369299c452716f4dbcd1e8dd 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
|
||||
|
@ -5,10 +5,10 @@ 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 6b82dffa3d0938a94114ead277b42c71ea3bb52b..88fc16e49076cf5589e27660a388909291447fac 100644
|
||||
index 59b85551533d332880b154039a5cc3683b17a962..515268d0ce80759835669af16f1aafdb721b5b24 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 {
|
||||
@@ -1790,6 +1790,19 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,10 +29,10 @@ index 6b82dffa3d0938a94114ead277b42c71ea3bb52b..88fc16e49076cf5589e27660a3889092
|
||||
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 0c86a93a34fdbb65365e81915ac9f54df4dde88b..b9c675ecae8fd87cca3c7475f4901c9d5529ac6b 100644
|
||||
index 3a76d9d90531ed889a0fc92674bd1719aacdb159..2e22c06584c50e32497a2a65b03f5e96063dadc0 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -313,7 +313,7 @@ public class ActivationRange
|
||||
@@ -315,7 +315,7 @@ public class ActivationRange
|
||||
if ( entity instanceof EntityLiving )
|
||||
{
|
||||
EntityLiving living = (EntityLiving) entity;
|
||||
|
@ -26,10 +26,10 @@ index 94c18e824695af69e39288195cc2fa83a13029d6..a673eaad4cd80287e8a357f8c45b2add
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
index c67138e6a4dcbe823e894f6bb948742bfb8f9943..0f0bf91a3d01c0eb841db81ac441cf5936a2cdfe 100644
|
||||
index 35a6a786474fb95082a2d1ca41697c2b1febe55a..409deae8b301b8cdcb38a498f69584f6b808748d 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 {
|
||||
@@ -809,8 +809,15 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -23,10 +23,10 @@ index a673eaad4cd80287e8a357f8c45b2add156ff0b9..6fc23a85ddd66a69b83684cdb602b6a3
|
||||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 6f90a4182e008b49a4b3328e569311382e4bec0d..1472bbdac9b545c97368df03672b975abf2dbcb4 100644
|
||||
index ee75fe091f7fd28426b9af329358ea0deb24d589..349a8b5682c09b93c675ac0275fe46125597aaa3 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
|
||||
@@ -2215,7 +2215,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ index 6f90a4182e008b49a4b3328e569311382e4bec0d..1472bbdac9b545c97368df03672b975a
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/World.java b/src/main/java/net/minecraft/world/level/World.java
|
||||
index 334281d4cbdb2d82ca93e862498af961d9abfd31..d1591f8d0b45126acef5d24ddb41d76293f5b42d 100644
|
||||
index bdedb30970d66fa1b75d185b9d1120de7718a706..2108ba779bbe4d3a060c494f54909952f659ddea 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 334281d4cbdb2d82ca93e862498af961d9abfd31..d1591f8d0b45126acef5d24ddb41d762
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportSystemDetails;
|
||||
import net.minecraft.ReportedException;
|
||||
@@ -1813,6 +1814,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -1860,6 +1861,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
}
|
||||
|
||||
public GameProfilerFiller getMethodProfiler() {
|
||||
|
@ -116,10 +116,10 @@ index 0000000000000000000000000000000000000000..7103aa120d3a27d5579d54bd6f4018dc
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index b4d8fbbc421b3288ae66db2932825b3e2f9b8d98..1553be4263f08ae21447ccf2e19e8a30a2932208 100644
|
||||
index d80378780d1cb83b37124509d34344e323b828bb..0ec132efc49880d9b230e176bce79732b7231765 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 {
|
||||
@@ -874,6 +874,22 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ index b4d8fbbc421b3288ae66db2932825b3e2f9b8d98..1553be4263f08ae21447ccf2e19e8a30
|
||||
this.getServer().getLogger().log(Level.SEVERE, "Block at {0}, {1}, {2} is {3} but has {4}" + ". "
|
||||
+ "Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.", new Object[]{pos.getX(), pos.getY(), pos.getZ(), type, found});
|
||||
diff --git a/src/main/java/net/minecraft/world/IInventory.java b/src/main/java/net/minecraft/world/IInventory.java
|
||||
index 774ba6a923f7e329f6af5efc17e1c46e87ed2d77..8faf3850f4c965feec42f6998563b7265a8f599e 100644
|
||||
index b8c73cd0ba916b7bf166a6d2f6b7ab68cd9c939b..96f814a2946a69e53cc1bcbf5499c5058ff982af 100644
|
||||
--- a/src/main/java/net/minecraft/world/IInventory.java
|
||||
+++ b/src/main/java/net/minecraft/world/IInventory.java
|
||||
@@ -1,6 +1,8 @@
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Better checking for useless move packets
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
|
||||
index 67ca28463f5add7c18f7f16b918c3f36f8feeeda..6aad662d823e0a64b8e18156b5f084399bc4f228 100644
|
||||
index b8f9238c598a55ba796951cb775cd35f3a401fa8..ecbc865fa34c9218678c2be666b0d758fad8e98d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/EntityTrackerEntry.java
|
||||
@@ -186,6 +186,7 @@ public class EntityTrackerEntry {
|
||||
|
@ -5,10 +5,10 @@ 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
|
||||
index dd4997e7ffac4773e01add88efec7c0dcd7b4df0..d05d874d54fdf821429814b7b20a3676d426303c 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 {
|
||||
@@ -236,10 +236,16 @@ public class EntityItem extends Entity {
|
||||
if (entityitem.z()) {
|
||||
// Paper Start - Fix items merging through walls
|
||||
if (this.world.paperConfig.fixItemsMergingThroughWalls) {
|
||||
|
@ -26,10 +26,10 @@ index 6fc23a85ddd66a69b83684cdb602b6a312e9d72b..e234e2944f9f764f8110c473997d438a
|
||||
|
||||
|
||||
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
|
||||
index d05d874d54fdf821429814b7b20a3676d426303c..c207cc8727ba4dc1ed8715720991db0640f63c80 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 {
|
||||
@@ -116,6 +116,12 @@ public class EntityItem extends Entity {
|
||||
if (this.world.isClientSide) {
|
||||
this.noclip = false;
|
||||
} else {
|
||||
|
@ -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 1472bbdac9b545c97368df03672b975abf2dbcb4..4ed2808434d059ad21c01449fb1ca37165061b0a 100644
|
||||
index 349a8b5682c09b93c675ac0275fe46125597aaa3..868c5cf064fe1a47d69a9712f44b1b9ccd7ac9d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1440,6 +1440,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1454,6 +1454,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
//} // Paper
|
||||
|
||||
this.methodProfiler.enter("snooper");
|
||||
@ -17,7 +17,7 @@ index 1472bbdac9b545c97368df03672b975abf2dbcb4..4ed2808434d059ad21c01449fb1ca371
|
||||
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot
|
||||
this.snooper.a();
|
||||
}
|
||||
@@ -1447,6 +1449,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1461,6 +1463,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && this.ticks % 6000 == 0) { // Spigot
|
||||
this.snooper.b();
|
||||
}
|
||||
|
@ -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 7ddbc56eb2ea8491cd32987843801e9bee9dbe0b..32372e46103958e985582796964a47120ec9c1a3 100644
|
||||
index 18cc6e729e092511369299c452716f4dbcd1e8dd..39677ae033fff7d80eb4e250855cef9fee71b951 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1775,8 +1775,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
@@ -1784,8 +1784,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
public void pickup(EntityHuman entityhuman) {}
|
||||
|
||||
public void collide(Entity entity) {
|
||||
|
@ -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 d1591f8d0b45126acef5d24ddb41d76293f5b42d..8ed6ff1c180fe6dd3b29c476799f6b83af0be007 100644
|
||||
index 2108ba779bbe4d3a060c494f54909952f659ddea..ebdc5731c574d683a0dffcabcbf8e16037e09648 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -830,7 +830,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -876,7 +876,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 d1591f8d0b45126acef5d24ddb41d76293f5b42d..8ed6ff1c180fe6dd3b29c476799f6b83
|
||||
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 1d82f719440c95765c01a588f4785d630b8b527a..9465bce44f5ac4b448736d9c029ea411c27843ac 100644
|
||||
index 0990eb8b2e2d8a5f7c1a2640727d86c37a50298e..d894e7f16d232596ec308f3de3ea5da410588cbe 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
|
||||
@@ -646,7 +646,8 @@ public abstract class BlockBase {
|
||||
@@ -647,7 +647,8 @@ public abstract class BlockBase {
|
||||
EnumDirection enumdirection = aenumdirection[l];
|
||||
|
||||
blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, enumdirection);
|
||||
|
@ -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 8ed6ff1c180fe6dd3b29c476799f6b83af0be007..1583c8608a34a84b84873dd10668d6a5f67ab416 100644
|
||||
index ebdc5731c574d683a0dffcabcbf8e16037e09648..8de35f1acf057218e8debcfa4fee66f8cc3ddc2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -159,6 +159,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
|
||||
@@ -161,6 +161,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;
|
||||
@@ -255,6 +257,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
|
||||
@@ -299,6 +301,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.generator = gen;
|
||||
this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((net.minecraft.world.level.storage.WorldDataServer)worlddatamutable).getName()), env); // Purpur
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 13b1eb353c22f2935cff7adbb4df725438a46d8f..ca2c46bb22d4aca818f2aad107da42ebe09f2d2f 100644
|
||||
index b8727573d768cab51da07a370c606a798a022edb..188365768dcaf0df6805eca065501572f7f9f501 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -881,6 +881,7 @@ public final class CraftServer implements Server {
|
||||
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
@@ -882,6 +882,7 @@ public final class CraftServer implements Server {
|
||||
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);
|
||||
@@ -916,6 +917,7 @@ public final class CraftServer implements Server {
|
||||
world.spigotConfig.init(); // Spigot
|
||||
@@ -918,6 +919,7 @@ public final class CraftServer implements Server {
|
||||
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 fbeca329f62325aa479f968e7f0f04cde341a009..1345ee267a61caf97e5b4f6ee641cadb10698fb6 100644
|
||||
index 73513638dd024cb1cdd49c705921f0bcf1935968..cbdcc06c03ea1a206e035a41c13242b00b5062a5 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 {
|
||||
@@ -162,6 +162,14 @@ public class Main {
|
||||
.describedAs("Yml file");
|
||||
/* Conctete End - Server Config */
|
||||
// Purpur end
|
||||
|
||||
+ // Origami Start - Server Config
|
||||
+ acceptsAll(asList("origami", "origami-settings"), "File for origami settings")
|
||||
@ -188,7 +188,7 @@ index fbeca329f62325aa479f968e7f0f04cde341a009..1345ee267a61caf97e5b4f6ee641cadb
|
||||
// Paper start
|
||||
acceptsAll(asList("server-name"), "Name of the server")
|
||||
.withRequiredArg()
|
||||
@@ -292,6 +300,7 @@ public class Main {
|
||||
@@ -300,6 +308,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
|
||||
|
@ -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 f6001047ada8308cfa1d9b26677a7a5d7774de51..5efae1af23e7a52571bb18885bd45255fb68f1f4 100644
|
||||
index 922a15097bdfe64be657fdf157145d1e882b6a40..fe648a00d834410837c923ab3c15ecc33b808851 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 {
|
||||
|
@ -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 88fc16e49076cf5589e27660a388909291447fac..d8fb0edceba805b9359d02304751182cd0c5a79f 100644
|
||||
index 515268d0ce80759835669af16f1aafdb721b5b24..13f660bb60b539cba924b75342f9a4189d7b2d63 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -1208,9 +1208,12 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -1235,9 +1235,12 @@ public abstract class EntityLiving extends Entity {
|
||||
} else if (damagesource.isFire() && this.hasEffect(MobEffects.FIRE_RESISTANCE)) {
|
||||
return false;
|
||||
} else {
|
||||
@ -24,7 +24,7 @@ index 88fc16e49076cf5589e27660a388909291447fac..d8fb0edceba805b9359d02304751182c
|
||||
|
||||
this.ticksFarFromPlayer = 0;
|
||||
float f1 = f;
|
||||
@@ -1961,6 +1964,11 @@ public abstract class EntityLiving extends Entity {
|
||||
@@ -2006,6 +2009,11 @@ public abstract class EntityLiving extends Entity {
|
||||
if (event.isCancelled()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -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 d10d1b768601236b9892461ee41d61c7239d1a07..1331b7525be64ecf5115dcafc6511837eff5b7ec 100644
|
||||
index dfe65943b3a2f744f06b4669590cc203e8419e60..190e37a1b3b5fdbc8bfaaeabb621311503bbc303 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityPigZombie.java
|
||||
@@ -88,7 +88,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
|
||||
@@ -124,7 +124,7 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
|
||||
protected void mobTick() {
|
||||
AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
|
||||
|
29
patches/Purpur/patches/api/0001-Purpur-config-files.patch
Normal file
29
patches/Purpur/patches/api/0001-Purpur-config-files.patch
Normal file
@ -0,0 +1,29 @@
|
||||
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 f55ae8275c297c4c86215fba8d7197ffe9715879..0888165f2327bad2125d9cbe9b72e3282d44e072 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1614,6 +1614,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
|
||||
*
|
113
patches/Purpur/patches/api/0002-Default-permissions.patch
Normal file
113
patches/Purpur/patches/api/0002-Default-permissions.patch
Normal file
@ -0,0 +1,113 @@
|
||||
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;
|
||||
+ }
|
||||
+}
|
@ -0,0 +1,32 @@
|
||||
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;
|
||||
}
|
123
patches/Purpur/patches/api/0004-Advancement-API.patch
Normal file
123
patches/Purpur/patches/api/0004-Advancement-API.patch
Normal file
@ -0,0 +1,123 @@
|
||||
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 + "]";
|
||||
+ }
|
||||
+}
|
191
patches/Purpur/patches/api/0005-Llama-API.patch
Normal file
191
patches/Purpur/patches/api/0005-Llama-API.patch
Normal file
@ -0,0 +1,191 @@
|
||||
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
|
||||
}
|
112
patches/Purpur/patches/api/0006-AFK-API.patch
Normal file
112
patches/Purpur/patches/api/0006-AFK-API.patch
Normal file
@ -0,0 +1,112 @@
|
||||
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
|
||||
}
|
44
patches/Purpur/patches/api/0007-Bring-back-server-name.patch
Normal file
44
patches/Purpur/patches/api/0007-Bring-back-server-name.patch
Normal file
@ -0,0 +1,44 @@
|
||||
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 e8414592b3afeb1e5db2b817b8fb7c13e073b9aa..281c5a72cf59dd5cb3dee47541641483d434aeb0 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1963,4 +1963,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 0888165f2327bad2125d9cbe9b72e3282d44e072..eebaee3f3e01f39c0378cc89381eb97d95f31152 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1736,4 +1736,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
|
||||
}
|
175
patches/Purpur/patches/api/0008-ExecuteCommandEvent.patch
Normal file
175
patches/Purpur/patches/api/0008-ExecuteCommandEvent.patch
Normal file
@ -0,0 +1,175 @@
|
||||
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
|
@ -0,0 +1,31 @@
|
||||
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 ccb81ceee74fff50ec3ed88ae0a41f790c40ae87..b96edbf7e5a2bf66a9ebf9300368e8f6a8d561f9 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -873,4 +873,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
|
||||
}
|
42
patches/Purpur/patches/api/0010-Lagging-threshold.patch
Normal file
42
patches/Purpur/patches/api/0010-Lagging-threshold.patch
Normal file
@ -0,0 +1,42 @@
|
||||
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 281c5a72cf59dd5cb3dee47541641483d434aeb0..a60c8bd89d14e47d3243307241458e907249a99b 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -1973,5 +1973,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 eebaee3f3e01f39c0378cc89381eb97d95f31152..f24d00951cd6951023f1ff34312ae0438107fc22 100644
|
||||
--- a/src/main/java/org/bukkit/Server.java
|
||||
+++ b/src/main/java/org/bukkit/Server.java
|
||||
@@ -1744,5 +1744,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
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
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;
|
||||
+ }
|
||||
+}
|
@ -0,0 +1,79 @@
|
||||
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;
|
||||
+ }
|
||||
+}
|
24
patches/Purpur/patches/api/0014-Villager-resetOffers.patch
Normal file
24
patches/Purpur/patches/api/0014-Villager-resetOffers.patch
Normal file
@ -0,0 +1,24 @@
|
||||
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.
|
@ -0,0 +1,37 @@
|
||||
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
|
||||
}
|
124
patches/Purpur/patches/api/0016-Anvil-API.patch
Normal file
124
patches/Purpur/patches/api/0016-Anvil-API.patch
Normal file
@ -0,0 +1,124 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,701 @@
|
||||
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 a7909406e9d54c1ab4789b984ed6b1da50837fce..ac2967eac165d74c8ee7e0e9ac63124a10851a0e 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.
|
||||
@@ -921,4 +933,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
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
41
patches/Purpur/patches/api/0019-ChatColor-conveniences.patch
Normal file
41
patches/Purpur/patches/api/0019-ChatColor-conveniences.patch
Normal file
@ -0,0 +1,41 @@
|
||||
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
|
||||
}
|
210
patches/Purpur/patches/api/0020-Ridables.patch
Normal file
210
patches/Purpur/patches/api/0020-Ridables.patch
Normal file
@ -0,0 +1,210 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
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);
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
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 b96edbf7e5a2bf66a9ebf9300368e8f6a8d561f9..f64cd3a467ccb4f773138542a6beb61ab2e1ae40 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -888,5 +888,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
|
||||
}
|
73
patches/Purpur/patches/api/0023-Item-entity-immunities.patch
Normal file
73
patches/Purpur/patches/api/0023-Item-entity-immunities.patch
Normal file
@ -0,0 +1,73 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
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;
|
@ -0,0 +1,56 @@
|
||||
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
|
||||
}
|
31
patches/Purpur/patches/api/0028-Left-handed-API.patch
Normal file
31
patches/Purpur/patches/api/0028-Left-handed-API.patch
Normal file
@ -0,0 +1,31 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
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;
|
42
patches/Purpur/patches/api/0030-Rabid-Wolf-API.patch
Normal file
42
patches/Purpur/patches/api/0030-Rabid-Wolf-API.patch
Normal file
@ -0,0 +1,42 @@
|
||||
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
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,77 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Date: Wed, 23 Dec 2020 00:43:27 -0600
|
||||
Subject: [PATCH] PlayerBookTooLargeEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/event/player/PlayerBookTooLargeEvent.java b/src/main/java/net/pl3x/purpur/event/player/PlayerBookTooLargeEvent.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..39378ee2bfadf42ff358cc7b42dd75ac61615e15
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/net/pl3x/purpur/event/player/PlayerBookTooLargeEvent.java
|
||||
@@ -0,0 +1,65 @@
|
||||
+package net.pl3x.purpur.event.player;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.entity.Player;
|
||||
+import org.bukkit.event.HandlerList;
|
||||
+import org.bukkit.event.player.PlayerEvent;
|
||||
+import org.bukkit.inventory.ItemStack;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+
|
||||
+/**
|
||||
+ * Called when a player tries to bypass book limitations
|
||||
+ */
|
||||
+public class PlayerBookTooLargeEvent extends PlayerEvent {
|
||||
+ private static final HandlerList handlers = new HandlerList();
|
||||
+ private final ItemStack book;
|
||||
+ private boolean kickPlayer = true;
|
||||
+
|
||||
+ /**
|
||||
+ * @param player The player
|
||||
+ * @param book The book
|
||||
+ */
|
||||
+ public PlayerBookTooLargeEvent(@NotNull Player player, @NotNull ItemStack book) {
|
||||
+ super(player, !Bukkit.isPrimaryThread());
|
||||
+ this.book = book;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Get the book containing the wanted edits
|
||||
+ *
|
||||
+ * @return The book
|
||||
+ */
|
||||
+ @NotNull
|
||||
+ public ItemStack getBook() {
|
||||
+ return book;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Whether server should kick the player or not
|
||||
+ *
|
||||
+ * @return True to kick player
|
||||
+ */
|
||||
+ public boolean shouldKickPlayer() {
|
||||
+ return kickPlayer;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Whether server should kick the player or not
|
||||
+ *
|
||||
+ * @param kickPlayer True to kick player
|
||||
+ */
|
||||
+ public void setShouldKickPlayer(boolean kickPlayer) {
|
||||
+ this.kickPlayer = kickPlayer;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ @NotNull
|
||||
+ public HandlerList getHandlers() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+
|
||||
+ @NotNull
|
||||
+ public static HandlerList getHandlerList() {
|
||||
+ return handlers;
|
||||
+ }
|
||||
+}
|
@ -0,0 +1,23 @@
|
||||
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.
|
||||
*/
|
@ -0,0 +1,141 @@
|
||||
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,
|
||||
+ }
|
||||
+}
|
112
patches/Purpur/patches/api/0035-Add-StructureGenerateEvent.patch
Normal file
112
patches/Purpur/patches/api/0035-Add-StructureGenerateEvent.patch
Normal file
@ -0,0 +1,112 @@
|
||||
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;
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,867 @@
|
||||
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 a60c8bd89d14e47d3243307241458e907249a99b..194261bf20bb727d207a2429fa59abf0acf61b19 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#broadcast(net.kyori.adventure.text.Component)}
|
||||
*/
|
||||
- @Deprecated // Paper
|
||||
+ @Deprecated // Paper // Purpur - conflict on change
|
||||
public static int broadcastMessage(@NotNull String message) {
|
||||
return server.broadcastMessage(message);
|
||||
}
|
||||
@@ -947,7 +947,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);
|
||||
}
|
||||
@@ -1224,7 +1224,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);
|
||||
@@ -1274,7 +1274,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);
|
||||
@@ -1301,7 +1301,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);
|
||||
}
|
||||
@@ -1390,7 +1390,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();
|
||||
}
|
||||
@@ -1412,7 +1412,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 3ee71225eb67ec728b414a8cdc0570d48d5603e3..a7fcd00ae37f9a2026759642562b1059c9dd9526 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 {@link #broadcast(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
|
||||
/**
|
||||
@@ -1035,7 +1035,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);
|
||||
|
||||
@@ -1079,7 +1079,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;
|
||||
|
||||
@@ -1102,7 +1102,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);
|
||||
|
||||
/**
|
||||
@@ -1175,7 +1175,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
|
||||
@@ -1193,7 +1193,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 248cd6faa72a91ceaf6f74d06c05d05bd26f5fbc..6ec728854333cd473528162b6381e7a5a83532d8 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
|
||||
@@ -244,7 +244,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);
|
||||
|
||||
/**
|
||||
@@ -260,7 +260,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);
|
||||
|
||||
/**
|
||||
@@ -270,7 +270,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();
|
||||
|
||||
/**
|
||||
@@ -280,7 +280,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);
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,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);
|
||||
|
||||
/**
|
||||
@@ -300,7 +300,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);
|
||||
|
||||
/**
|
@ -0,0 +1,29 @@
|
||||
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
|
||||
};
|
||||
|
||||
/**
|
@ -0,0 +1,17 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
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 f64cd3a467ccb4f773138542a6beb61ab2e1ae40..41f91ab59e34b2b15432d3941e4ee5658b24f10e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -895,5 +895,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
|
||||
}
|
30
patches/Purpur/patches/api/0041-Flying-Fall-Damage-API.patch
Normal file
30
patches/Purpur/patches/api/0041-Flying-Fall-Damage-API.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: TreyRuffy <TreyRuffy@users.noreply.github.com>
|
||||
Date: Wed, 9 Jun 2021 16:31:15 -0600
|
||||
Subject: [PATCH] Flying Fall Damage API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 9f289576d97c3406d506d3f4fa7287bc74e5b425..df1da8a7dec072ddc33a884973bcad67152576fe 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -2185,5 +2185,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* @param invulnerableTicks Invulnerable ticks remaining
|
||||
*/
|
||||
void setSpawnInvulnerableTicks(int invulnerableTicks);
|
||||
+
|
||||
+ /**
|
||||
+ * Allows you to enable fall damage while {@link #getAllowFlight()} is {@code true}
|
||||
+ *
|
||||
+ * @param flyingFallDamage Enables fall damage when {@link #getAllowFlight()} is true
|
||||
+ */
|
||||
+ public void setFlyingFallDamage(boolean flyingFallDamage);
|
||||
+
|
||||
+ /**
|
||||
+ * Allows you get if fall damage is enabled while {@link #getAllowFlight()} is {@code true}
|
||||
+ *
|
||||
+ * @return True if fall damage is enabled when {@link #getAllowFlight()} is true
|
||||
+ */
|
||||
+ public boolean hasFlyingFallDamage();
|
||||
// Purpur end
|
||||
}
|
424
patches/Purpur/patches/server/0001-Purpur-config-files.patch
Normal file
424
patches/Purpur/patches/server/0001-Purpur-config-files.patch
Normal file
@ -0,0 +1,424 @@
|
||||
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 52c0ab1ce46e1f3233ef746d9bc699356fa9fae4..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("Tuinity", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page
|
||||
+ 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("tuinity_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page
|
||||
+ 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 7acf077bc131af718c7548cc29deef558c04e463..10126cb1c3efa2e6c84f20c0da701a131a5dd4cb 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 3713a110a64fa686e785b9789c33dd09cacc2f48..8db809fdaf1e18a54a21812ff5688095f6ffd6f4 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 cb8064df7e9f1b8b4d4292486e2193680d83663c..22d91a970c7376aa6349bb6cd9cb174e89bc8a09 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/World.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/World.java
|
||||
@@ -155,6 +155,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
|
||||
@@ -254,6 +255,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 507c5255542ba1b958470b4db2c35b1b0b779f17..04f81eafed1af281222e961f9fa8a4b2736cc2e3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -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
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
world.worldDataServer.setDifficulty(config.difficulty);
|
||||
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -934,6 +936,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");
|
||||
|
||||
@@ -2384,6 +2387,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 fbeca329f62325aa479f968e7f0f04cde341a009..424d55f51a36d9033db3dfbf2f7a86749b0e3b91 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()
|
73
patches/Purpur/patches/server/0002-Timings-stuff.patch
Normal file
73
patches/Purpur/patches/server/0002-Timings-stuff.patch
Normal file
@ -0,0 +1,73 @@
|
||||
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");
|
||||
+ }
|
||||
}
|
@ -0,0 +1,189 @@
|
||||
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");
|
||||
}
|
||||
|
180
patches/Purpur/patches/server/0004-Advancement-API.patch
Normal file
180
patches/Purpur/patches/server/0004-Advancement-API.patch
Normal file
@ -0,0 +1,180 @@
|
||||
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();
|
||||
+ }
|
||||
+}
|
156
patches/Purpur/patches/server/0005-Llama-API.patch
Normal file
156
patches/Purpur/patches/server/0005-Llama-API.patch
Normal file
@ -0,0 +1,156 @@
|
||||
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
|
||||
}
|
302
patches/Purpur/patches/server/0006-AFK-API.patch
Normal file
302
patches/Purpur/patches/server/0006-AFK-API.patch
Normal file
@ -0,0 +1,302 @@
|
||||
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 c813077455a463dd558076d1d7474829f76b905a..b302d1f7c86a8df2ede46871397189f6f2e6b912 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/EntityPlayer.java
|
||||
@@ -2103,8 +2103,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 6fc215df5ed3aa6ef0c23a57e8444602ff9309e8..a97b8d8116920237964cc3a887525f8c3804c640 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -1002,7 +1002,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;
|
||||
@@ -1345,7 +1345,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 5bce47fa8f191bc1d33c04c9865cb0efd492a9a2..afa14eddb6a21d4747689af6d70551f10d304be7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
||||
@@ -181,6 +181,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 5c2eaca0bc63c7880ee928aba6a24761737aa649..2bbbd4a7ae87c2ead3dc2fd5520adfaefe2776b8 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -204,6 +204,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 );
|
@ -0,0 +1,34 @@
|
||||
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 04f81eafed1af281222e961f9fa8a4b2736cc2e3..4bbe29316e96629119bae4658bb025381e28a366 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2553,4 +2553,11 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public String getServerName() {
|
||||
+ return getProperties().serverName;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
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 6f90a4182e008b49a4b3328e569311382e4bec0d..2f3d6acf497b6fa6b497a1b94ba96977ce2e6008 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 net.pl3x.purpur.PurpurConfig.serverModName; // Purpur // 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);
|
@ -0,0 +1,84 @@
|
||||
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 2ff3297fb8c0e4f8c969ba2727eecb7fe06525c4..7d0bb706fb106709432c3fae8758d2cea1d14db8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -227,6 +227,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;
|
||||
@@ -321,8 +322,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);
|
||||
@@ -1787,7 +1788,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 592dacf8cc924caac339a8810ba5b0d85448ed90..75af4d5385d4366e562a53716e020ba20ccbea94 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -875,4 +875,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
|
||||
}
|
57
patches/Purpur/patches/server/0010-Lagging-threshold.patch
Normal file
57
patches/Purpur/patches/server/0010-Lagging-threshold.patch
Normal file
@ -0,0 +1,57 @@
|
||||
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 2f3d6acf497b6fa6b497a1b94ba96977ce2e6008..991ac5baf3f10631edb0e60d17c714af1f406a29 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 4bbe29316e96629119bae4658bb025381e28a366..e6fe2f63c9789a3f37aea0c211b22bd1d413282f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2559,5 +2559,10 @@ public final class CraftServer implements Server {
|
||||
public String getServerName() {
|
||||
return getProperties().serverName;
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean isLagging() {
|
||||
+ return getServer().lagging;
|
||||
+ }
|
||||
// Purpur end
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
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);
|
@ -0,0 +1,63 @@
|
||||
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
|
@ -0,0 +1,134 @@
|
||||
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 b302d1f7c86a8df2ede46871397189f6f2e6b912..79ff69f9e2dc92ffb4880cf1e059cd1d6a7bdc8a 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) {
|
||||
@@ -1313,6 +1321,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
+ this.invulnerableTicks = worldserver.purpurConfig.playerSpawnInvulnerableTicks; // Purpur
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -2521,9 +2530,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
|
||||
}
|
147
patches/Purpur/patches/server/0015-Anvil-API.patch
Normal file
147
patches/Purpur/patches/server/0015-Anvil-API.patch
Normal file
@ -0,0 +1,147 @@
|
||||
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
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
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 85374ac8f5460790de03b47d7c3ce19ed5596afe..c45e6ae3f912ac582c6ba693517e05cd8fbf33e2 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
|
||||
@@ -235,6 +237,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) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
this.world.getMethodProfiler().exit();
|
||||
if (this.bF) {
|
||||
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);
|
||||
+ }
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
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;
|
235
patches/Purpur/patches/server/0018-Silk-touch-spawners.patch
Normal file
235
patches/Purpur/patches/server/0018-Silk-touch-spawners.patch
Normal file
@ -0,0 +1,235 @@
|
||||
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 7b14b3c2486f03778d4673cf9684aa576dc2724a..822ffa8e4b554fd6aa7ce1b2bb68c198c863d86c 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() {
|
@ -0,0 +1,71 @@
|
||||
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() {
|
@ -0,0 +1,30 @@
|
||||
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());
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 00:52:12 -0500
|
||||
Subject: [PATCH] Logger settings (suppressing pointless logs)
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
index dfdbc028f68ced197ad179248ed3b1e9d70ba057..a1ee1066108985a95abddb03ff447b5a14f4f85f 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -190,6 +190,7 @@ public class AdvancementDataPlayer {
|
||||
if (advancement == null) {
|
||||
// CraftBukkit start
|
||||
if (entry.getKey().getNamespace().equals("minecraft")) {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressIgnoredAdvancementWarnings) // Purpur
|
||||
AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.f);
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index afd0c577069f2a856caf41bd2dd5187db4866fa3..c7755cea5e8337af7acc96c6a34afa547b391035 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -178,4 +178,11 @@ public class PurpurConfig {
|
||||
InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
}
|
||||
+
|
||||
+ public static boolean loggerSuppressInitLegacyMaterialError = false;
|
||||
+ public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
||||
+ private static void loggerSettings() {
|
||||
+ loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError);
|
||||
+ loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
index b86604cbf3543b978df000d8f74c6185aa2ae7ec..5df82b0409278bd298e837aa43941247de3f94fe 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/legacy/CraftLegacy.java
|
||||
@@ -254,6 +254,7 @@ public final class CraftLegacy {
|
||||
}
|
||||
|
||||
static {
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.loggerSuppressInitLegacyMaterialError) // Purpur
|
||||
System.err.println("Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!");
|
||||
if (MinecraftServer.getServer() != null && MinecraftServer.getServer().isDebugging()) {
|
||||
new Exception().printStackTrace();
|
@ -0,0 +1,19 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Sun, 15 Dec 2019 12:53:59 -0600
|
||||
Subject: [PATCH] Disable outdated build check
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 424d55f51a36d9033db3dfbf2f7a86749b0e3b91..73513638dd024cb1cdd49c705921f0bcf1935968 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -272,7 +272,7 @@ public class Main {
|
||||
System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper
|
||||
}
|
||||
|
||||
- if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
|
||||
+ if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { // Purpur - break on change
|
||||
Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
Calendar deadline = Calendar.getInstance();
|
215
patches/Purpur/patches/server/0023-Giants-AI-settings.patch
Normal file
215
patches/Purpur/patches/server/0023-Giants-AI-settings.patch
Normal file
@ -0,0 +1,215 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 12 May 2019 00:43:12 -0500
|
||||
Subject: [PATCH] Giants AI settings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 89852779fd9cfd19058afe40feb0cf14ca8d2896..611a2c34c80462826564705eb5a079bd6fdda4e1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -228,7 +228,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
||||
public double D;
|
||||
public double E;
|
||||
public double F;
|
||||
- public float G; public final float getStepHeight() { return this.G; } // Tuinity - OBFHELPER
|
||||
+ public float G; public final float getStepHeight() { return this.G; } public void setStepHeight(float stepHeight) { this.G = stepHeight; } // Tuinity - OBFHELPER // Purpur - OBFHELPER
|
||||
public boolean noclip;
|
||||
public float I;
|
||||
protected final Random random;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
index 7ba59ff9a7ed39bf69c46973a85f874c43134dc1..46e9a232ca5df81cafd4c3fc6af43b933c95d04f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
|
||||
@@ -1021,6 +1021,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return f;
|
||||
}
|
||||
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { a(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void a(DifficultyDamageScaler difficultydamagescaler) {
|
||||
if (this.random.nextFloat() < 0.15F * difficultydamagescaler.d()) {
|
||||
int i = this.random.nextInt(2);
|
||||
@@ -1128,6 +1129,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
}
|
||||
}
|
||||
|
||||
+ protected void setEnchantmentBasedOnDifficulty(DifficultyDamageScaler difficultydamagescaler) { b(difficultydamagescaler); } // Purpur - OBFHELPER
|
||||
protected void b(DifficultyDamageScaler difficultydamagescaler) {
|
||||
float f = difficultydamagescaler.d();
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index 7d0bb706fb106709432c3fae8758d2cea1d14db8..032b1a519de56583990fe47a216665ce71cf93ab 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -260,6 +260,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.activeItem = ItemStack.b;
|
||||
this.by = Optional.empty();
|
||||
this.attributeMap = new AttributeMapBase(AttributeDefaults.a(entitytypes));
|
||||
+ this.initAttributes(); // Purpur
|
||||
this.craftAttributes = new CraftAttributeMap(attributeMap); // CraftBukkit
|
||||
// CraftBukkit - setHealth(getMaxHealth()) inlined and simplified to skip the instanceof check for EntityPlayer, as getBukkitEntity() is not initialized in constructor
|
||||
this.datawatcher.set(EntityLiving.HEALTH, (float) this.getAttributeInstance(GenericAttributes.MAX_HEALTH).getValue());
|
||||
@@ -275,6 +276,8 @@ public abstract class EntityLiving extends Entity {
|
||||
this.bg = this.a(new Dynamic(dynamicopsnbt, dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), dynamicopsnbt.emptyMap()))));
|
||||
}
|
||||
|
||||
+ protected void initAttributes() {} // Purpur
|
||||
+
|
||||
public BehaviorController<?> getBehaviorController() {
|
||||
return this.bg;
|
||||
}
|
||||
@@ -2273,7 +2276,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.enderTeleportTo(vec3d.x, vec3d.y, vec3d.z);
|
||||
}
|
||||
|
||||
- protected float dJ() {
|
||||
+ protected float dJ() { return getJumpHeight(); } public float getJumpHeight() { // Purpur - OBFHELPER
|
||||
return 0.42F * this.getBlockJumpFactor();
|
||||
}
|
||||
|
||||
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 5e6a92dcdbca686d5a8cfc4aaff72b70b81b111f..a188a89143cb1b0243dacdec33c446ca4120219f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityGiantZombie.java
|
||||
@@ -1,21 +1,99 @@
|
||||
package net.minecraft.world.entity.monster;
|
||||
|
||||
import net.minecraft.core.BlockPosition;
|
||||
+import net.minecraft.nbt.NBTTagCompound;
|
||||
+import net.minecraft.world.DifficultyDamageScaler;
|
||||
+import net.minecraft.world.EnumDifficulty;
|
||||
import net.minecraft.world.entity.EntityPose;
|
||||
import net.minecraft.world.entity.EntitySize;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
+import net.minecraft.world.entity.EnumItemSlot;
|
||||
+import net.minecraft.world.entity.EnumMobSpawn;
|
||||
+import net.minecraft.world.entity.GroupDataEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeProvider;
|
||||
import net.minecraft.world.entity.ai.attributes.GenericAttributes;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalLookAtPlayer;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalMeleeAttack;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalMoveTowardsRestriction;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomLookaround;
|
||||
+import net.minecraft.world.entity.ai.goal.PathfinderGoalRandomStrollLand;
|
||||
+import net.minecraft.world.entity.ai.goal.target.PathfinderGoalHurtByTarget;
|
||||
+import net.minecraft.world.entity.ai.goal.target.PathfinderGoalNearestAttackableTarget;
|
||||
+import net.minecraft.world.entity.animal.EntityIronGolem;
|
||||
+import net.minecraft.world.entity.animal.EntityTurtle;
|
||||
+import net.minecraft.world.entity.npc.EntityVillager;
|
||||
+import net.minecraft.world.entity.player.EntityHuman;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.IWorldReader;
|
||||
import net.minecraft.world.level.World;
|
||||
+import net.minecraft.world.level.WorldAccess;
|
||||
|
||||
public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
- this.safeFallDistance = 10.0F; // Purpur
|
||||
+ // Purpur start
|
||||
+ this.safeFallDistance = 10.0F;
|
||||
+ setStepHeight(world.purpurConfig.giantStepHeight);
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initPathfinder() {
|
||||
+ if (world.purpurConfig.giantHaveAI) {
|
||||
+ this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
+ this.goalSelector.a(7, new PathfinderGoalRandomStrollLand(this, 1.0D));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 16.0F));
|
||||
+ this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
|
||||
+ this.goalSelector.a(5, new PathfinderGoalMoveTowardsRestriction(this, 1.0D));
|
||||
+ if (world.purpurConfig.giantHaveHostileAI) {
|
||||
+ this.goalSelector.a(2, new PathfinderGoalMeleeAttack(this, 1.0D, false));
|
||||
+ this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this).a(EntityPigZombie.class));
|
||||
+ this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true));
|
||||
+ this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillager.class, false));
|
||||
+ this.targetSelector.a(4, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true));
|
||||
+ this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, true));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void initAttributes() {
|
||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.giantMaxHealth);
|
||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.world.purpurConfig.giantMovementSpeed);
|
||||
+ this.getAttributeInstance(GenericAttributes.ATTACK_DAMAGE).setValue(this.world.purpurConfig.giantAttackDamage);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @javax.annotation.Nullable GroupDataEntity groupdataentity, @javax.annotation.Nullable NBTTagCompound nbttagcompound) {
|
||||
+ GroupDataEntity groupData = super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
||||
+ if (groupData == null) {
|
||||
+ setEquipmentBasedOnDifficulty(difficultydamagescaler);
|
||||
+ setEnchantmentBasedOnDifficulty(difficultydamagescaler);
|
||||
+ }
|
||||
+ return groupData;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected void setEquipmentBasedOnDifficulty(DifficultyDamageScaler difficulty) {
|
||||
+ super.setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ // TODO make configurable
|
||||
+ if (random.nextFloat() < (world.getDifficulty() == EnumDifficulty.HARD ? 0.1F : 0.05F)) {
|
||||
+ setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.IRON_SWORD));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float getJumpHeight() {
|
||||
+ // make giants jump as high as everything else relative to their size
|
||||
+ // 1.0 makes bottom of feet about as high as their waist when they jump
|
||||
+ return world.purpurConfig.giantJumpHeight;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
return 10.440001F;
|
||||
@@ -27,6 +105,6 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
@Override
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
- return iworldreader.y(blockposition) - 0.5F;
|
||||
+ return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 2f18ca7ae23e913155f25fd07627f376e401ab0f..1c87c929aaae17631100d1aa30b3e7ecce52686f 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -113,6 +113,28 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public float giantStepHeight = 2.0F;
|
||||
+ public float giantJumpHeight = 1.0F;
|
||||
+ public double giantMovementSpeed = 0.5D;
|
||||
+ public double giantAttackDamage = 50.0D;
|
||||
+ public boolean giantHaveAI = false;
|
||||
+ public boolean giantHaveHostileAI = false;
|
||||
+ public double giantMaxHealth = 100.0D;
|
||||
+ private void giantSettings() {
|
||||
+ giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
+ giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
+ giantMovementSpeed = getDouble("mobs.giant.movement-speed", giantMovementSpeed);
|
||||
+ giantAttackDamage = getDouble("mobs.giant.attack-damage", giantAttackDamage);
|
||||
+ giantHaveAI = getBoolean("mobs.giant.have-ai", giantHaveAI);
|
||||
+ giantHaveHostileAI = getBoolean("mobs.giant.have-hostile-ai", giantHaveHostileAI);
|
||||
+ if (PurpurConfig.version < 8) {
|
||||
+ double oldValue = getDouble("mobs.giant.max-health", giantMaxHealth);
|
||||
+ set("mobs.giant.attributes.max-health", oldValue);
|
||||
+ set("mobs.giant.max-health", null);
|
||||
+ }
|
||||
+ giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Fri, 5 Jul 2019 11:09:25 -0500
|
||||
Subject: [PATCH] Illusioners AI settings
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
||||
index fee9a5140f097225b5da58b18bfbd528dffdc77b..cb092bee9d6827d4b0276bfa9b033cf7ca86ead4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityIllagerIllusioner.java
|
||||
@@ -56,6 +56,15 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initAttributes() {
|
||||
+ this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(this.world.purpurConfig.illusionerMovementSpeed);
|
||||
+ this.getAttributeInstance(GenericAttributes.FOLLOW_RANGE).setValue(this.world.purpurConfig.illusionerFollowRange);
|
||||
+ this.getAttributeInstance(GenericAttributes.MAX_HEALTH).setValue(this.world.purpurConfig.illusionerMaxHealth);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
super.initPathfinder();
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 1c87c929aaae17631100d1aa30b3e7ecce52686f..d6bd971a62af7341f8dc8b3afe32786ced6fcd41 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -135,6 +135,20 @@ public class PurpurWorldConfig {
|
||||
giantMaxHealth = getDouble("mobs.giant.attributes.max-health", giantMaxHealth);
|
||||
}
|
||||
|
||||
+ public double illusionerMovementSpeed = 0.5D;
|
||||
+ public double illusionerFollowRange = 18.0D;
|
||||
+ public double illusionerMaxHealth = 32.0D;
|
||||
+ private void illusionerSettings() {
|
||||
+ illusionerMovementSpeed = getDouble("mobs.illusioner.movement-speed", illusionerMovementSpeed);
|
||||
+ illusionerFollowRange = getDouble("mobs.illusioner.follow-range", illusionerFollowRange);
|
||||
+ if (PurpurConfig.version < 8) {
|
||||
+ double oldValue = getDouble("mobs.illusioner.max-health", illusionerMaxHealth);
|
||||
+ set("mobs.illusioner.attributes.max-health", oldValue);
|
||||
+ set("mobs.illusioner.max-health", null);
|
||||
+ }
|
||||
+ illusionerMaxHealth = getDouble("mobs.illusioner.attributes.max-health", illusionerMaxHealth);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
@ -0,0 +1,57 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sun, 7 Jul 2019 19:52:16 -0500
|
||||
Subject: [PATCH] Zombie horse naturally spawn
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index a97b8d8116920237964cc3a887525f8c3804c640..a0c731af6dffa30832b321f8fd86cef76ec06522 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -96,6 +96,7 @@ import net.minecraft.world.entity.ai.village.poi.VillagePlace;
|
||||
import net.minecraft.world.entity.ai.village.poi.VillagePlaceType;
|
||||
import net.minecraft.world.entity.animal.EntityAnimal;
|
||||
import net.minecraft.world.entity.animal.EntityWaterAnimal;
|
||||
+import net.minecraft.world.entity.animal.horse.EntityHorseAbstract;
|
||||
import net.minecraft.world.entity.animal.horse.EntityHorseSkeleton;
|
||||
import net.minecraft.world.entity.boss.EntityComplexPart;
|
||||
import net.minecraft.world.entity.boss.enderdragon.EntityEnderDragon;
|
||||
@@ -1219,12 +1220,18 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
|
||||
|
||||
if (flag1) {
|
||||
- EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);
|
||||
-
|
||||
- entityhorseskeleton.t(true);
|
||||
- entityhorseskeleton.setAgeRaw(0);
|
||||
- entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ());
|
||||
- this.addEntity(entityhorseskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
+ // Purpur start
|
||||
+ EntityHorseAbstract horse;
|
||||
+ if (purpurConfig.zombieHorseSpawnChance > 0D && random.nextDouble() <= purpurConfig.zombieHorseSpawnChance) {
|
||||
+ horse = EntityTypes.ZOMBIE_HORSE.create(this);
|
||||
+ } else {
|
||||
+ horse = EntityTypes.SKELETON_HORSE.create(this);
|
||||
+ ((EntityHorseSkeleton) horse).setTrap(true);
|
||||
+ }
|
||||
+ horse.setAgeRaw(0);
|
||||
+ horse.setPosition(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+ addEntity(horse, CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
EntityLightning entitylightning = (EntityLightning) EntityTypes.LIGHTNING_BOLT.a((World) this);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index d6bd971a62af7341f8dc8b3afe32786ced6fcd41..81b0e17a4bc5022ea757f03c2546808148d6e957 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -155,4 +155,9 @@ public class PurpurWorldConfig {
|
||||
villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
|
||||
villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
|
||||
}
|
||||
+
|
||||
+ public double zombieHorseSpawnChance = 0.0D;
|
||||
+ private void zombieHorseSettings() {
|
||||
+ zombieHorseSpawnChance = getDouble("mobs.zombie_horse.spawn-chance", zombieHorseSpawnChance);
|
||||
+ }
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 29 Nov 2019 22:37:44 -0600
|
||||
Subject: [PATCH] Charged creeper naturally spawn
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
index b47f71ca1f1c8bbd1a521836d9cb5d676a33ec76..63a6b1820f60db9eea49a3a589dd50ad25a3c0a2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.network.syncher.DataWatcherRegistry;
|
||||
import net.minecraft.server.level.WorldServer;
|
||||
import net.minecraft.sounds.SoundEffect;
|
||||
import net.minecraft.sounds.SoundEffects;
|
||||
+import net.minecraft.world.DifficultyDamageScaler;
|
||||
import net.minecraft.world.EnumHand;
|
||||
import net.minecraft.world.EnumInteractionResult;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
@@ -17,6 +18,8 @@ import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityAreaEffectCloud;
|
||||
import net.minecraft.world.entity.EntityLightning;
|
||||
import net.minecraft.world.entity.EntityTypes;
|
||||
+import net.minecraft.world.entity.EnumMobSpawn;
|
||||
+import net.minecraft.world.entity.GroupDataEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeProvider;
|
||||
import net.minecraft.world.entity.ai.attributes.GenericAttributes;
|
||||
import net.minecraft.world.entity.ai.goal.PathfinderGoalAvoidTarget;
|
||||
@@ -39,6 +42,7 @@ import net.minecraft.world.level.IMaterial;
|
||||
import net.minecraft.world.level.World;
|
||||
|
||||
// CraftBukkit start
|
||||
+import net.minecraft.world.level.WorldAccess;
|
||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||
import org.bukkit.event.entity.CreatureSpawnEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
@@ -59,6 +63,17 @@ public class EntityCreeper extends EntityMonster {
|
||||
super(entitytypes, world);
|
||||
}
|
||||
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @javax.annotation.Nullable GroupDataEntity groupdataentity, @javax.annotation.Nullable NBTTagCompound nbttagcompound) {
|
||||
+ double chance = worldaccess.getMinecraftWorld().purpurConfig.creeperChargedChance;
|
||||
+ if (chance > 0D && random.nextDouble() <= chance) {
|
||||
+ setPowered(true);
|
||||
+ }
|
||||
+ return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
this.goalSelector.a(1, new PathfinderGoalFloat(this));
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 81b0e17a4bc5022ea757f03c2546808148d6e957..638ee71a78d9e75de6ddd7f0aec67a023bb8c06a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -113,6 +113,11 @@ public class PurpurWorldConfig {
|
||||
turtleEggsBreakFromMinecarts = getBoolean("blocks.turtle_egg.break-from-minecarts", turtleEggsBreakFromMinecarts);
|
||||
}
|
||||
|
||||
+ public double creeperChargedChance = 0.0D;
|
||||
+ private void creeperSettings() {
|
||||
+ creeperChargedChance = getDouble("mobs.creeper.naturally-charged-chance", creeperChargedChance);
|
||||
+ }
|
||||
+
|
||||
public float giantStepHeight = 2.0F;
|
||||
public float giantJumpHeight = 1.0F;
|
||||
public double giantMovementSpeed = 0.5D;
|
@ -0,0 +1,56 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 31 Aug 2019 17:47:11 -0500
|
||||
Subject: [PATCH] Rabbit naturally spawn toast and killer
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
index dcbb07fb6ab799d4526a2da0614c193c7abba715..180fc927074dc683ad4d482a00dd4e04ff7923d0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/EntityRabbit.java
|
||||
@@ -352,6 +352,10 @@ public class EntityRabbit extends EntityAnimal {
|
||||
if (!this.hasCustomName()) {
|
||||
this.setCustomName(new ChatMessage(SystemUtils.a("entity", EntityRabbit.bp)));
|
||||
}
|
||||
+ // Purpur start
|
||||
+ } else if (i == 98) {
|
||||
+ setCustomName(new ChatMessage("Toast"));
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
this.datawatcher.set(EntityRabbit.bo, i);
|
||||
@@ -373,6 +377,16 @@ public class EntityRabbit extends EntityAnimal {
|
||||
}
|
||||
|
||||
private int a(GeneratorAccess generatoraccess) {
|
||||
+ // Purpur start
|
||||
+ World world = generatoraccess.getMinecraftWorld();
|
||||
+ if (world.purpurConfig.rabbitNaturalKiller > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalKiller) {
|
||||
+ return 99;
|
||||
+ }
|
||||
+ if (world.purpurConfig.rabbitNaturalToast > 0D && random.nextDouble() <= world.purpurConfig.rabbitNaturalToast) {
|
||||
+ return 98;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
BiomeBase biomebase = generatoraccess.getBiome(this.getChunkCoordinates());
|
||||
int i = this.random.nextInt(100);
|
||||
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 638ee71a78d9e75de6ddd7f0aec67a023bb8c06a..6dcfbebd850d71587da5a78a3acf09d8ae413072 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -154,6 +154,13 @@ public class PurpurWorldConfig {
|
||||
illusionerMaxHealth = getDouble("mobs.illusioner.attributes.max-health", illusionerMaxHealth);
|
||||
}
|
||||
|
||||
+ public double rabbitNaturalToast = 0.0D;
|
||||
+ public double rabbitNaturalKiller = 0.0D;
|
||||
+ private void rabbitSettings() {
|
||||
+ rabbitNaturalToast = getDouble("mobs.rabbit.spawn-toast-chance", rabbitNaturalToast);
|
||||
+ rabbitNaturalKiller = getDouble("mobs.rabbit.spawn-killer-rabbit-chance", rabbitNaturalKiller);
|
||||
+ }
|
||||
+
|
||||
public int villagerBrainTicks = 1;
|
||||
public boolean villagerUseBrainTicksOnlyWhenLagging = true;
|
||||
private void villagerSettings() {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user