├── .dockerignore ├── .github └── workflows │ └── docker.yml ├── .gitignore ├── .gitlab-ci.yml ├── .gitmodules ├── .travis.yml ├── Benchmarks ├── .gitignore ├── pom.xml └── src │ └── main │ └── java │ ├── net │ └── minecraft │ │ └── server │ │ └── ChunkCollectionsBenchmark.java │ └── org │ └── bukkit │ ├── block │ └── Block.java │ ├── metadata │ └── BlockMetadataStoreBenchmark.java │ └── plugin │ └── Plugin.java ├── Bukkit-Patches ├── 0001-POM-Changes.patch ├── 0002-Spigot-Timings.patch ├── 0003-Add-PlayerItemDamageEvent.patch ├── 0004-BungeeCord-Support.patch ├── 0005-Add-Arrow-API.patch ├── 0006-Add-Particle-API.patch ├── 0007-Define-EntitySpawnEvent-and-SpawnerSpawnEvent.patch ├── 0008-Entity-Mount-and-Dismount-Events.patch ├── 0009-InventoryClickEvent-getClickedInventory.patch ├── 0010-Added-getAllSessionData-to-the-Conversation-API.patch ├── 0011-Catch-Conversation-API-Errors.patch ├── 0012-Player-Collision-API.patch ├── 0013-Expand-Boolean-Prompt-Values.patch ├── 0014-Add-Getter-for-Entity-Invulnerability.patch ├── 0015-Add-respawn-API.patch ├── 0016-Fix-Plugin-Message-API-Disconnects.patch ├── 0017-Fix-Tab-Completion-for-Some-Commands.patch ├── 0018-Implement-Locale-Getter-for-Players.patch ├── 0019-Add-support-for-fetching-hidden-players.patch ├── 0020-Silenceable-Lightning-API.patch ├── 0021-Remove-deprecation-on-some-player-lookup-methods.patch ├── 0022-Add-Score.isScoreSet-Z-API.patch ├── 0023-Add-PlayerSpawnLocationEvent.patch ├── 0024-Ease-ClassLoader-Deadlocks-Where-Possible.patch ├── 0025-Fix-slow-tab-complete-for-some-commands.patch ├── 0026-Undeprecate-Player-updateInventory-V.patch ├── 0027-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch ├── 0028-BungeeCord-Chat-API.patch └── 0029-Add-restart-API.patch ├── Contributing.md ├── CraftBukkit-Patches ├── 0001-POM-Changes.patch ├── 0002-mc-dev-imports.patch ├── 0003-Skeleton-API-Implementations.patch ├── 0004-Obfuscation-Helpers.patch ├── 0005-Spigot-Configuration.patch ├── 0006-Better-Chunk-Tick-Selection.patch ├── 0007-Crop-Growth-Rates.patch ├── 0008-Merge-tweaks-and-configuration.patch ├── 0009-Async-Operation-Catching.patch ├── 0010-View-Distance.patch ├── 0011-Spigot-Timings.patch ├── 0012-Fix-Mob-Spawning-Relative-to-View-Distance.patch ├── 0013-Handle-Null-Tile-Entities.patch ├── 0014-Entity-Activation-Range.patch ├── 0015-Metrics.patch ├── 0016-PlayerItemDamageEvent.patch ├── 0017-Prevent-NPE-in-CraftSign.patch ├── 0018-Entity-Tracking-Ranges.patch ├── 0019-Thread-Naming-and-Tweaks.patch ├── 0020-Close-Unloaded-Save-Files.patch ├── 0021-Remove-o-Option.patch ├── 0022-Recipe-Deconstruction.patch ├── 0023-Implement-Arrow-API.patch ├── 0024-Hopper-Customisations.patch ├── 0025-Implement-SpawnerSpawnEvent.patch ├── 0026-Firework-Meta-Crash-Fix.patch ├── 0027-Allow-Disabling-of-Command-Logging.patch ├── 0028-Allow-Disabling-of-Command-TabComplete.patch ├── 0029-Configurable-Messages.patch ├── 0030-Allow-Disabling-of-Random-Lighting-Updates.patch ├── 0031-Properly-Close-Inventories.patch ├── 0032-Disallow-Interaction-With-Self.patch ├── 0033-Entity-Mount-and-Dismount-Events.patch ├── 0034-Prevent-Ghost-Players-Caused-by-Plugins.patch ├── 0035-Plug-World-Unload-Memory-Leak.patch ├── 0036-Player-Collision-API.patch ├── 0037-Fully-Disable-Snooper-When-Not-Required.patch ├── 0038-Add-Getter-for-Entity-Invulnerability.patch ├── 0039-Cap-Minimum-Player-Speed.patch ├── 0040-Update-Inventory-and-Health-for-PlayerConsumeItemEve.patch ├── 0041-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch ├── 0042-Allow-Disabling-of-1.6.3-Structure-Saving.patch ├── 0043-Item-Despawn-Rate.patch ├── 0044-Don-t-Special-Case-X-Move-Value.patch ├── 0045-Implement-respawn-API.patch ├── 0046-Arrow-Despawn-Rate.patch ├── 0047-Fix-packed-ice-generation.patch ├── 0048-Watchdog-Thread.patch ├── 0049-Clear-Flower-Pot-on-Drop.patch ├── 0050-Fix-some-chunks-not-being-sent-to-the-client.patch ├── 0051-Fix-Broken-Async-Chat.patch ├── 0052-Orebfuscator.patch ├── 0053-Optimize-DataWatcher.patch ├── 0054-Fire-PreLogin-Events-in-Offline-Mode.patch ├── 0055-BungeeCord-Support.patch ├── 0056-Allow-Disabling-Zombie-Villager-Aggression.patch ├── 0057-Configurable-Amount-of-Netty-Threads.patch ├── 0058-Prevent-Mineshaft-Saving.patch ├── 0059-Log-Cause-of-Unexpected-Exceptions.patch ├── 0060-Particle-API.patch ├── 0061-Save-ticks-lived-to-nbttag.patch ├── 0062-More-Efficient-GetCubes.patch ├── 0063-Add-Option-to-Nerf-Mobs-from-Spawner-s.patch ├── 0064-Warn-if-PermGen-may-be-insufficient.patch ├── 0065-Disable-Connected-Check-on-setScoreboard.patch ├── 0066-Add-Late-Bind-Option.patch ├── 0067-Allow-statistics-to-be-disabled-forced.patch ├── 0068-Fix-ItemStack-Unbreakable-Code.patch ├── 0069-Try-and-Debug-Crash-Reports-Crashing.patch ├── 0070-Improve-AutoSave-Mechanism.patch ├── 0071-Catch-stalling-on-corrupted-map-data-NBT-arrays.patch ├── 0072-Allow-toggling-of-ZombiePigmen-spawning-in-portal-bl.patch ├── 0073-Highly-Optimized-Tick-Loop.patch ├── 0074-Configurable-Ping-Sample-Size.patch ├── 0075-Add-Optional-Tick-Shuffling.patch ├── 0076-Allow-Configuring-Chunks-per-Packet.patch ├── 0077-Implement-Locale-Getter-for-Players.patch ├── 0078-Cap-Entity-Collisions.patch ├── 0079-Fix-dispensing-bone-meal-not-having-the-correct-data.patch ├── 0080-Spam-Filter-Exclusions.patch ├── 0081-Add-Option-to-Silence-CommandBlock-Console.patch ├── 0082-Add-support-for-fetching-hidden-players.patch ├── 0083-Allow-Disabling-Creative-Item-Filter.patch ├── 0084-Cap-Channel-Registrations.patch ├── 0085-Allow-vanilla-commands-to-be-the-main-version-of-a-c.patch ├── 0086-Unfinalize-the-isDisconnected-method-by-bukkit.patch ├── 0087-Implement-Silenceable-Lightning-API.patch ├── 0088-Use-one-PermissibleBase-for-all-Command-Blocks.patch ├── 0089-Prevent-hoppers-from-loading-chunks.patch ├── 0090-Guard-Entity-List.patch ├── 0091-Fix-ConcurrentModificationException-while-being-idle.patch ├── 0092-Cancellable-WitherSkull-potion-effect.patch ├── 0093-Descriptive-kick-reasons-instead-of-Nope.patch ├── 0094-Configurable-dragon-death-and-wither-spawn-sounds.patch ├── 0095-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch ├── 0096-Treat-Bungee-as-Online-Mode.patch ├── 0097-Add-Conversion-Message.patch ├── 0098-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch ├── 0099-Print-Stack-on-InternalException.patch ├── 0100-Use-Offline-Player-Data-Once-if-Required.patch ├── 0101-Use-Provided-Case-for-Non-Existent-Offline-Players.patch ├── 0102-Check-for-blank-OfflinePlayer-Names.patch ├── 0103-Fix-Player-Banning.patch ├── 0104-Fix-ban-expire-dates.patch ├── 0105-Correct-Ban-Expiration.patch ├── 0106-Convert-Horses-owner-to-UUID.patch ├── 0107-Add-Score.isScoreSet-Z-API.patch ├── 0108-Log-null-TileEntity-Owner.patch ├── 0109-Don-t-special-case-invalid-usernames-for-UUIDs.patch ├── 0110-Convert-player-skulls-async.patch ├── 0111-Prevent-NoClassDefError-crash-and-notify-on-crash.patch ├── 0112-Check-Skull-canPlace.patch ├── 0113-Fix-race-condition-that-could-kill-connections-befor.patch ├── 0114-Configurable-UserCache-cap.patch ├── 0115-Implement-PlayerSpawnLocationEvent.patch ├── 0116-Cap-Objective-Score-Length.patch ├── 0117-Process-conversation-input-on-the-main-thread.-Fixes.patch ├── 0118-Configurable-save-on-stop-only-for-UserCache.patch ├── 0119-Prevent-Unbounded-IntCache-Growth.patch ├── 0120-Add-damager-to-the-unhandled-error.patch ├── 0121-Cross-World-Entity-Teleportation.patch ├── 0122-Limit-block-placement-interaction-packets.patch ├── 0123-Better-item-validation.patch ├── 0124-Further-Seed-Customisation.patch ├── 0125-Disable-ResourceLeakDetector.patch ├── 0126-Add-More-Information-to-session.lock-Errors.patch ├── 0127-Safer-JSON-Loading.patch ├── 0128-Fix-Slow-Loading-Libraries.patch ├── 0129-Add-CommandLine-EULA-Flag.patch ├── 0130-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch ├── 0131-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch ├── 0132-Prevent-a-crash-involving-attributes.patch ├── 0133-Make-moved-wrongly-limit-configurable.patch ├── 0134-Fix-Null-Tile-Entity-Worlds.patch ├── 0135-Make-moved-too-quickly-limit-configurable.patch ├── 0136-Apply-NBTReadLimiter-to-more-things.patch ├── 0137-Allow-Attribute-Capping.patch ├── 0138-Only-fetch-an-online-UUID-in-online-mode.patch ├── 0139-Filter-attribute-modifiers-which-cause-the-attribute.patch ├── 0140-Plug-WorldMap-Memory-Leak.patch ├── 0141-Fix-Corrupted-Trapped-Chest.patch ├── 0142-Remove-uneeded-validation.patch ├── 0143-Add-Hunger-Config-Values.patch ├── 0144-Make-debug-logging-togglable.patch ├── 0145-Skip-invalid-enchants-in-CraftMetaItem.patch ├── 0146-Limit-TNT-Detonations-per-tick.patch ├── 0147-Added-isUnbreakable-and-setUnbreakable-to-ItemMeta.patch ├── 0148-Configurable-Hanging-Tick.patch ├── 0149-Refactor-ItemDoor-Place.patch ├── 0150-BungeeCord-Chat-API.patch ├── 0151-Use-Standard-List-for-EntitySlices.patch ├── 0152-Allow-Capping-Tile-Entity-Tick-Time.patch ├── 0153-Use-FastMatches-for-ItemStack-Dirty-Check.patch ├── 0154-Use-CLQ-for-main-thread-tasks.patch ├── 0155-map-decoration-fix.patch ├── 0156-Use-Map-for-getPlayer-String-lookup.patch ├── 0157-Clear-Packet-Queue-on-Disconnect.patch ├── 0158-Optimize-Chunk-Saving-Memory-Allocation-and-Compress.patch ├── 0159-More-effecient-RegionFile-zero-ing.patch └── 0160-Don-t-sleep-between-chunk-saves.patch ├── Dockerfile ├── README.md ├── Spigot-API-Patches ├── 0001-POM-changes.patch ├── 0002-Add-float-methods-to-configs.patch ├── 0003-Stop-using-spigot-s-website-for-timings.patch ├── 0004-Player-affects-spawning-API.patch ├── 0005-Add-getTPS-method.patch ├── 0006-Add-async-chunk-load-API.patch ├── 0007-Add-TNT-source-location-API.patch ├── 0008-Check-PaperSpigot-versions.patch ├── 0009-Add-FallingBlock-source-location-API.patch ├── 0010-Add-PlayerLocaleChangeEvent.patch ├── 0011-Add-player-view-distance-API.patch ├── 0012-Add-BeaconEffectEvent.patch ├── 0013-Add-PlayerInitialSpawnEvent.patch ├── 0014-Timings-v2.patch ├── 0015-Add-Location-support-to-tab-completers-vanilla-featu.patch ├── 0016-Made-EntityDismountEvent-Cancellable.patch ├── 0017-Automatically-disable-plugins-that-fail-to-load.patch ├── 0018-Expose-server-CommandMap.patch ├── 0019-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch ├── 0020-Player-Tab-List-and-Title-APIs.patch ├── 0021-Add-exception-reporting-event.patch ├── 0021-Fix-ServerListPingEvent-flagging-as-Async.patch ├── 0022-Fix-ServerListPingEvent-flagging-as-Async.patch ├── 0023-Make-the-permission-message-configurable.patch ├── 0024-Allow-disabling-of-namespaced-commands.patch ├── 0025-Custom-Projectile-trails.patch ├── 0026-Projectile-Effects-API.patch ├── 0027-Update-POM-with-my-repos.patch ├── 0028-Item-Projectile-effects.patch ├── 0029-Nickname-player-info-injection.patch ├── 0030-Skin-cache-API.patch ├── 0031-Nickname-tabcomplete-integration.patch ├── 0032-Player-list-entry-self-update.patch ├── 0033-Custom-Knockback-API.patch ├── 0034-Knockback-friction-API.patch ├── 0035-Allow-entities-to-be-immune-to-stuck-arrows.patch ├── 0036-Dynamic-server-player-limit.patch ├── 0037-Add-dismount-cause-to-EntityDismountEvent.patch ├── 0038-Add-World-getTileEntities.patch ├── 0039-Fix-Entity-and-Command-Block-memory-leaks.patch ├── 0040-Add-EntityExtinguishEvent.patch ├── 0041-Better-Async-Chunk-API.patch ├── 0042-Allow-disabling-cursors-in-CraftMapRenderer.patch ├── 0043-Add-MapView-Unload-API.patch ├── 0044-ItemStack-max-stack-size-API.patch ├── 0045-ItemStack-max-stack-size-API.patch ├── 0046-Add-Actionbar-API.patch ├── 0047-Add-World-getEntityById-API.patch ├── 0048-Add-LivingEntity-clear-last-attacked-API.patch ├── 0049-Add-yaw-and-pitch-to-World-spawn-location.patch ├── 0050-Add-particle-emitter-API-to-World.Spigot-playEffect.patch ├── 0051-Add-exit-code-to-shutdown-API.patch ├── 0052-Add-setType-without-lighting-update-API.patch ├── 0053-Spoof-UUID-for-nicks.patch ├── 0054-Add-Player-last-activity-API.patch ├── 0055-Add-DisconnectReason-to-PlayerKickEvent.patch ├── 0056-Sink-player-entities.patch ├── 0057-Player-DisconnectReason-kick-API.patch ├── 0058-PlayerMoveEvent-accurate-time.patch ├── 0059-Player-register-plugin-channel-API.patch ├── 0060-Add-ProjectileCollideEvent.patch ├── 0061-Add-Player-invulnerability-API.patch ├── 0062-Don-t-check-for-version-in-version.patch ├── 0063-javadoc-Fix-syntax-and-outdated-refs.patch ├── 0064-Add-PlayerInteractUpdateEvent.patch ├── 0065-Make-tracking-range-configurable-per-entity.patch ├── 0066-Add-Guardian-sounds-in-Sound.patch ├── 0067-event-Add-PreSignChangeEvent.patch ├── 0068-Add-API-to-trigger-score-update.patch ├── 0069-build-Update-JUnit4-and-Guava-dependencies.patch ├── 0070-security-Prevent-billion-laughs-attacks.patch ├── 0071-Add-PlayerCheckCriticalEvent.patch ├── 0072-Fix-Java-17-imports.patch ├── 0073-Update-source-target-JRE-to-17.patch ├── 0074-Don-t-use-the-Eclipse-compiler-for-J17.patch └── 0075-Upgrade-to-Java-21-upgrade-Netty-to-4.2.0.Final.patch ├── Spigot-Server-Patches ├── 0001-POM-Changes.patch ├── 0002-PaperSpigot-config-files.patch ├── 0003-mc-dev-imports.patch ├── 0004-Vanished-players-don-t-have-rights.patch ├── 0005-Allow-undead-horse-types-to-be-leashed.patch ├── 0006-Configurable-squid-spawn-ranges.patch ├── 0007-Configurable-damage-multiplier-for-PvP-blocking.patch ├── 0008-Configurable-cactus-and-reed-natural-growth-heights.patch ├── 0009-Configurable-baby-zombie-movement-speed.patch ├── 0010-Configurable-fishing-time-ranges.patch ├── 0011-Allow-nerfed-mobs-to-jump.patch ├── 0012-Toggle-for-player-interact-limiter.patch ├── 0013-Player-Exhaustion-Multipliers.patch ├── 0014-Add-configurable-despawn-distances-for-living-entiti.patch ├── 0015-Allow-for-toggling-of-spawn-chunks.patch ├── 0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch ├── 0017-Configurable-speed-for-water-flowing-over-lava.patch ├── 0018-Player-affects-spawning-API.patch ├── 0019-Show-PaperSpigot-in-client-crashes-server-lists-and-.patch ├── 0020-Metrics.patch ├── 0021-Remove-invalid-mob-spawner-tile-entities.patch ├── 0022-Optimize-TileEntity-Ticking.patch ├── 0023-Remove-certain-entities-that-fly-through-unloaded-ch.patch ├── 0024-Configurable-strength-and-weakness-effect-modifiers.patch ├── 0025-Further-improve-server-tick-loop.patch ├── 0026-Only-refresh-abilities-if-needed.patch ├── 0027-Configurable-game-mechanics-changes.patch ├── 0028-Add-async-chunk-load-API.patch ├── 0029-Allow-specified-ItemStacks-to-retain-their-invalid-d.patch ├── 0030-Add-TNT-source-location-API.patch ├── 0031-Prevent-tile-entity-and-entity-crashes.patch ├── 0032-Configurable-top-of-nether-void-damage.patch ├── 0033-Enderman-drop-the-block-they-re-holding-when-they-di.patch ├── 0034-Check-online-mode-before-converting-and-renaming-pla.patch ├── 0035-Fix-redstone-lag-issues.patch ├── 0036-Always-tick-falling-blocks.patch ├── 0037-Add-FallingBlock-source-location-API.patch ├── 0038-Configurable-async-light-updates.patch ├── 0039-Optimize-draining.patch ├── 0040-Toggleable-player-crits-helps-mitigate-hacked-client.patch ├── 0041-Add-PlayerLocaleChangeEvent.patch ├── 0042-Fix-jar-being-shaded-multiple-times.patch ├── 0043-Configurable-end-credits-when-leaving-the-end.patch ├── 0044-Force-load-chunks-for-specific-entities-that-fly-thr.patch ├── 0045-Stackable-Buckets.patch ├── 0046-Fix-lag-from-explosions-processing-dead-entities.patch ├── 0047-Generator-Settings.patch ├── 0048-Configurable-TNT-cannon-fix.patch ├── 0049-FallingBlock-and-TNT-entities-collide-with-specific-.patch ├── 0050-Optimize-explosions.patch ├── 0051-Stop-updating-flowing-block-if-material-has-changed.patch ├── 0052-Fast-draining.patch ├── 0053-Configurable-lava-flow-speed.patch ├── 0054-Add-player-view-distance-API.patch ├── 0055-Disable-explosion-knockback.patch ├── 0056-Disable-thunder.patch ├── 0057-Disable-ice-and-snow.patch ├── 0058-Disable-mood-sounds.patch ├── 0059-Configurable-mob-spawner-tick-rate.patch ├── 0060-Optimize-getCubes.patch ├── 0061-ChunkMap-caching.patch ├── 0062-Send-absolute-position-the-first-time-an-entity-is-s.patch ├── 0063-Optimize-Spigot-s-Anti-X-Ray.patch ├── 0064-Add-BeaconEffectEvent.patch ├── 0065-Configurable-container-update-tick-rate.patch ├── 0066-Configurable-TNT-explosion-volume.patch ├── 0067-Fix-lava-water-some-times-creating-air-instead-of-co.patch ├── 0068-Use-UserCache-for-player-heads.patch ├── 0069-Re-add-Spigot-s-hopper-check-feature.patch ├── 0070-Disable-spigot-tick-limiters.patch ├── 0071-Don-t-damage-already-dead-ArmorStands.patch ├── 0072-Bump-thread-count-for-chunk-loading.patch ├── 0073-Don-t-create-Region-File-s-when-checking-if-chunk-ex.patch ├── 0074-Don-t-create-a-chunk-just-to-unload-it.patch ├── 0075-EAR-Fix-bug-with-teleporting-entities.patch ├── 0076-Add-PlayerInitialSpawnEvent.patch ├── 0077-Process-Entity-Chunk-Registration-on-Teleport.patch ├── 0078-SPIGOT-1387-Resolve-bed-issues-on-unloaded-chunks.patch ├── 0079-Timings-v2.patch ├── 0080-Disable-chest-cat-detection.patch ├── 0081-Ensure-commands-are-not-ran-async.patch ├── 0082-All-chunks-are-slime-spawn-chunks-toggle.patch ├── 0083-Speedup-BlockPos-by-fixing-inlining.patch ├── 0084-Remove-completely-invalid-Redstone-event-for-Netherr.patch ├── 0085-Add-Location-support-to-tab-completers-vanilla-featu.patch ├── 0086-Made-EntityDismountEvent-Cancellable.patch ├── 0087-Optimize-Pathfinding.patch ├── 0088-Optimize-getBlockData.patch ├── 0089-Avoid-hopper-searches-if-there-are-no-items.patch ├── 0090-Expose-server-CommandMap.patch ├── 0091-Fix-FurnaceMinecarts-losing-all-of-their-velocity-on.patch ├── 0092-Be-a-bit-more-informative-in-maxHealth-exception.patch ├── 0093-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch ├── 0094-Player-Tab-List-and-Title-APIs.patch ├── 0095-Ensure-inv-drag-is-in-bounds.patch ├── 0096-Change-implementation-of-tile-entity-removal-list.patch ├── 0097-Add-configurable-portal-search-radius.patch ├── 0098-Add-velocity-warnings.patch ├── 0099-Fix-inter-world-teleportation-glitches.patch ├── 0100-Add-exception-reporting-event.patch ├── 0101-PaperMC-Paper-GH-166.patch ├── 0102-Allow-hidden-player-to-be-hit-by-projectiles.patch ├── 0103-This-is-KigPaper.patch ├── 0104-Only-trigger-EntityDismountEvent-if-triggered-by-sne.patch ├── 0105-Make-the-permission-message-configurable.patch ├── 0106-Allow-arrows-to-fly-through-invis-armor-stands.patch ├── 0107-Disable-world-saving-on-shutdown-if-auto-save-is-dis.patch ├── 0108-Fix-CraftPlayer-setFlying-not-working.patch ├── 0109-Backport-from-Spigot-Enforce-proper-limits-on-books.patch ├── 0110-Backport-from-Spigot-Enforce-cooldowns-on-book-edits.patch ├── 0111-Make-cacti-physics-break-trigger-BlockPhysicsEvent.patch ├── 0112-Only-trigger-PlayerConnection-disconnect-once.patch ├── 0113-Allow-disabling-of-namespaced-commands.patch ├── 0114-Projectile-Effects-API.patch ├── 0115-Item-Projectile-effects.patch ├── 0116-Player-nickname-framework.patch ├── 0117-Nickname-player-info-injection.patch ├── 0118-Skin-cache-API.patch ├── 0119-Nickname-tabcomplete-integration.patch ├── 0120-Player-list-entry-self-update.patch ├── 0121-Nicknames-in-server-ping.patch ├── 0122-Custom-Knockback-API.patch ├── 0123-Knockback-friction-API.patch ├── 0124-Allow-entities-to-be-immune-to-stuck-arrows.patch ├── 0125-Dynamic-server-player-limit.patch ├── 0126-Add-dismount-cause-to-EntityDismountEvent.patch ├── 0127-Add-World-getTileEntities.patch ├── 0128-Fix-Entity-and-Command-Block-memory-leaks.patch ├── 0129-Better-Player-Vehicle-Hitboxes.patch ├── 0130-Fix-CraftLivingEntity-damage-not-calling-EntityDamag.patch ├── 0131-Set-last-attacked-entity-on-projectile-hit.patch ├── 0132-Add-EntityExtinguishEvent.patch ├── 0133-Fix-EntityCombustByBlockEvent.patch ├── 0134-Fix-extinguish-event-implementation.patch ├── 0135-Better-Async-Chunk-API.patch ├── 0136-Make-forced-chunk-saving-configurable.patch ├── 0137-Allow-disabling-cursors-in-CraftMapRenderer.patch ├── 0138-Fix-some-more-memory-leaks.patch ├── 0139-Add-MapView-Unload-API.patch ├── 0140-Fix-NPE-from-0138-and-logging-from-0139.patch ├── 0141-Make-Netty-timeout-kick-configurable.patch ├── 0142-ItemStack-max-stack-size-API.patch ├── 0143-Add-Actionbar-API.patch ├── 0144-Fix-tick-loop-precision.patch ├── 0145-Paper-0117-Better-synchronization-on-new-connections.patch ├── 0146-Set-traffic-class-in-Netty.patch ├── 0147-Backport-NetworkManager-Tuinity-patches-0017-0018.patch ├── 0148-Fix-chunk-leak-on-world-unload.patch ├── 0149-Paper-0098-Reduce-IO-ops-opening-a-new-region-file.patch ├── 0150-Paper-0321-Cleanup-allocated-favicon-ByteBuf.patch ├── 0151-Paper-0344-Start-entity-IDs-at-1.patch ├── 0152-Akarin-0001-Avoid-double-I-O-operation-on-load-playe.patch ├── 0153-Hitting-in-the-air-will-always-load-the-chunk-at-0-0.patch ├── 0153-Spigot-2380-Hitting-in-the-air-will-always-load-the-.patch ├── 0154-Fix-canFlush-from-0147.patch ├── 0155-Add-experimental-conditional-auto-flush-for-regular-.patch ├── 0156-Fix-rotation-packets-being-broadcasted.patch ├── 0157-Only-wakeup-when-flushing-NetworkManager.patch ├── 0158-Add-World-getEntityById-API.patch ├── 0159-Add-LivingEntity-clear-last-attacked-API.patch ├── 0160-Add-yaw-and-pitch-to-World-spawn-location.patch ├── 0161-Fix-CraftingManager-memory-leak.patch ├── 0162-Debloat-join-leave-messages.patch ├── 0163-Add-particle-emitter-API-to-World.Spigot-playEffect.patch ├── 0164-Allow-teleporting-vehicles-when-PlayerMoveEvent-is-c.patch ├── 0165-Add-exit-code-to-shutdown-API.patch ├── 0166-Add-option-to-disable-player-files.patch ├── 0167-Add-setType-without-lighting-update-API.patch ├── 0168-Tighter-limits-on-books.patch ├── 0169-Disable-book-deserialization-by-default.patch ├── 0170-Kick-after-receiving-invalid-creative-action-packet.patch ├── 0171-Use-better-regex-in-CraftChatMessage.patch ├── 0172-NBT-no-op-reader-for-block-place-packet.patch ├── 0173-Block-place-item-update-fix.patch ├── 0174-Add-custom-property-in-nick-skins.patch ├── 0175-Spoof-UUID-for-nicks.patch ├── 0176-Fix-update-packet-not-being-sent-on-right-click.patch ├── 0177-Send-player-info-using-real-UUID-for-self.patch ├── 0178-Fix-player-info-cloning.patch ├── 0179-Don-t-make-PlayerInfoData-static.patch ├── 0180-Add-Player-last-activity-API.patch ├── 0181-Add-DisconnectReason-to-PlayerKickEvent.patch ├── 0182-Sink-player-entities.patch ├── 0183-Player-DisconnectReason-kick-API.patch ├── 0184-Update-pom-to-new-Paper-repo.patch ├── 0185-PlayerMoveEvent-accurate-time.patch ├── 0186-Player-register-plugin-channel-API.patch ├── 0187-Add-ProjectileCollideEvent.patch ├── 0188-Add-compatibility-to-PlayerConnection.patch ├── 0189-Respect-player-visibility-for-certain-sounds.patch ├── 0190-Ensure-sounds-are-played-to-self.patch ├── 0191-Don-t-calculate-initial-light-if-not-requested.patch ├── 0192-Fix-more-EnchantmentManager-leaks.patch ├── 0193-Add-chunk-conditional-block-update.patch ├── 0194-Allow-players-to-hit-others-while-being-ridden.patch ├── 0195-Add-Player-invulnerability-API.patch ├── 0196-Add-fake-textures-to-skin-cache.patch ├── 0197-Cache-User-Authenticator-Threads.patch ├── 0198-Only-save-user-cache-if-saving-player-files-is-on.patch ├── 0199-Spoof-ping-for-nicked-players.patch ├── 0200-Change-metadata-to-be-non-global.patch ├── 0201-Accurate-block-collisions-for-fall-damage.patch ├── 0202-javadoc-Fix-syntax-and-outdated-refs.patch ├── 0203-Only-change-min-y-for-bounding-box-water-check.patch ├── 0204-Reset-reader-index-for-sink-players-and-write-ID.patch ├── 0205-Remove-sink-players-on-death.patch ├── 0206-Add-PlayerInteractUpdateEvent.patch ├── 0207-accurate-collisions-Fix-water.patch ├── 0208-accurate-movement-Fix-collisions-for-webs.patch ├── 0209-accurate-collisions-Switch-to-Deque.patch ├── 0210-accurate-collisions-Only-apply-for-players.patch ├── 0211-Better-accurate-block-detection-for-non-liquids.patch ├── 0212-accurate-collisions-Move-collision-check.patch ├── 0213-accurate-collisions-Fix-collision-for-puddles.patch ├── 0214-Use-alternative-region-compression.patch ├── 0215-Add-zstd-region-compression.patch ├── 0216-Make-tracking-range-configurable-per-entity.patch ├── 0217-patch-Add-bed-message-action-option.patch ├── 0218-Update-entity-head-yaw-on-teleport.patch ├── 0219-Fix-custom-item-despawn-rate-in-unloaded-chunks.patch ├── 0220-entity-Use-EnumMap-in-CraftPlayer-playEffect.patch ├── 0221-Update-log4j-to-2.15.0.patch ├── 0222-Add-Guardian-sounds-in-Sound.patch ├── 0223-Update-log4j-to-2.16.0.patch ├── 0224-deps-update-log4j-to-2.17.0.patch ├── 0225-Better-handling-of-oversized-chat-messages.patch ├── 0226-Update-log4j-to-2.17.1.patch ├── 0227-event-Add-PreSignChangeEvent.patch ├── 0228-Make-creeper-explosions-consistent-with-TNTs.patch ├── 0229-Make-ChunkCoordComparator-package-private.patch ├── 0230-Add-API-to-trigger-score-update.patch ├── 0231-build-Update-JUnit4-and-Guava-dependencies.patch ├── 0232-Add-specialized-BlockMetadataStore.patch ├── 0233-craftbukkit-Prevent-billion-laughs-attacks.patch ├── 0234-Use-effective-name-for-health-score-updates.patch ├── 0235-Extend-hit-recalculation-to-intangible-entities.patch ├── 0236-Prevent-xp-orbs-from-following-intangible-players.patch ├── 0237-world-Add-doWaterFreezing-game-rule.patch ├── 0238-Add-PlayerCheckCriticalEvent.patch ├── 0239-Update-Netty-to-4.1.x.patch ├── 0240-Update-source-target-JRE-to-17.patch ├── 0241-Don-t-use-the-Eclipse-compiler-for-J17.patch ├── 0242-Add-CraftMapView-getHandle.patch ├── 0243-Disable-kick-for-tab-complete-packet-spam.patch ├── 0244-Do-not-use-removeQueue-for-sink-players.patch ├── 0245-Broadcast-more-packets-to-sink-players.patch ├── 0246-Do-not-call-onPlace-when-block-physics-are-off.patch ├── 0247-Send-ping-and-game-mode-updates-to-sink-players.patch ├── 0248-Send-player-list-name-to-sink-players.patch ├── 0249-Send-CraftWorld-effects-to-sink-players.patch ├── 0250-Send-time-updates-to-sink-players.patch └── 0251-Upgrade-to-Java-21-upgrade-Netty-to-4.1.119.Final.patch ├── api_ci_pom.xml ├── applyPatches.sh ├── build.sh ├── ci_pom.xml ├── ci_settings.xml ├── decompile.sh ├── docker ├── build.Dockerfile ├── entrypoint.sh └── j9.Dockerfile ├── init.sh ├── newApplyPatches.sh ├── newRebuildPatches.sh ├── nms-patches ├── BlockBed.patch ├── BlockState.patch ├── BlockStateList.patch ├── EnumProtocol.patch ├── GameRules.patch ├── ShapeDetector.patch ├── StructureBoundingBox.patch └── WorldGenCaves.patch ├── paperclip.sh ├── pom.xml ├── rebuildPatches.sh ├── remap.sh ├── server_ci_pom.xml └── upstreamMerge.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | /PaperSpigot-API/target/ 2 | /PaperSpigot-Server/target/ 3 | /Paperclip/target/ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse stuff 2 | .classpath 3 | .project 4 | .settings/ 5 | 6 | # netbeans 7 | nbproject/ 8 | nbactions.xml 9 | 10 | # we use maven! 11 | build.xml 12 | 13 | # maven 14 | target/ 15 | dependency-reduced-pom.xml 16 | 17 | # vim 18 | .*.sw[a-p] 19 | 20 | # various other potential build files 21 | build/ 22 | bin/ 23 | dist/ 24 | manifest.mf 25 | work/ 26 | 27 | # Mac filesystem dust 28 | .DS_Store/ 29 | 30 | # intellij 31 | *.iml 32 | *.ipr 33 | *.iws 34 | .idea/ 35 | 36 | # Linux temp files 37 | *~ 38 | 39 | # other stuff 40 | Spigot-API 41 | Spigot-Server 42 | PaperSpigot-Server 43 | PaperSpigot-API 44 | Bukkit 45 | CraftBukkit 46 | Paperclip 47 | Paperclip.jar -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | stages: 3 | - publish 4 | 5 | image: maven:3.8.1-jdk-8 6 | 7 | maven build: 8 | stage: publish 9 | before_script: 10 | - apt update && apt install patch 11 | script: 12 | - git config --global user.name 'KIG CI Builds' 13 | - git config --global user.email 'contact+ci-builds@playkig.com' 14 | - git submodule update --init 15 | - ./remap.sh &&./decompile.sh && ./init.sh && ./newApplyPatches.sh 16 | - cp server_ci_pom.xml PaperSpigot-Server/pom.xml 17 | - cp api_ci_pom.xml PaperSpigot-API/pom.xml 18 | - mvn package deploy -f ci_pom.xml -s ci_settings.xml 19 | ... 20 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Bukkit"] 2 | path = Bukkit 3 | url = https://hub.spigotmc.org/stash/scm/spigot/bukkit.git 4 | [submodule "CraftBukkit"] 5 | path = CraftBukkit 6 | url = https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git 7 | [submodule "BuildData"] 8 | path = BuildData 9 | url = https://github.com/ProjectKig/BuildData.git 10 | branch = ver/1.8.8 11 | [submodule "Paperclip"] 12 | path = Paperclip 13 | url = https://github.com/ProjectKig/Old-Paperclip.git 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk8 4 | before_install: 5 | - git config --global user.email "travis-ci@destroystokyo.com" 6 | - git config --global user.name "Travis CI" 7 | - git submodule update --init 8 | - ./remap.sh 9 | - ./decompile.sh 10 | - ./init.sh 11 | - ./newApplyPatches.sh 12 | after_success: 13 | - ./paperclip.sh 14 | cache: 15 | directories: 16 | - '$HOME/.m2/repository' 17 | - 'work' -------------------------------------------------------------------------------- /Benchmarks/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse stuff 2 | /.classpath 3 | /.project 4 | /.settings 5 | 6 | # netbeans 7 | /nbproject 8 | 9 | # we use maven! 10 | /build.xml 11 | 12 | # maven 13 | /target 14 | 15 | # vim 16 | .*.sw[a-p] 17 | 18 | # various other potential build files 19 | /build 20 | /bin 21 | /dist 22 | /manifest.mf 23 | 24 | # Mac filesystem dust 25 | .DS_Store 26 | 27 | # intellij 28 | *.iml 29 | *.ipr 30 | *.iws 31 | .idea/ 32 | -------------------------------------------------------------------------------- /Benchmarks/src/main/java/org/bukkit/block/Block.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.block; 2 | 3 | import org.bukkit.World; 4 | 5 | /** 6 | * Overwritten to only use the methods we need 7 | */ 8 | public interface Block { 9 | int getX(); 10 | 11 | int getY(); 12 | 13 | int getZ(); 14 | 15 | World getWorld(); 16 | } 17 | -------------------------------------------------------------------------------- /Benchmarks/src/main/java/org/bukkit/plugin/Plugin.java: -------------------------------------------------------------------------------- 1 | package org.bukkit.plugin; 2 | 3 | /** 4 | * Overwritten to only use the methods we need 5 | */ 6 | public interface Plugin { 7 | } 8 | -------------------------------------------------------------------------------- /Bukkit-Patches/0001-POM-Changes.patch: -------------------------------------------------------------------------------- 1 | From 43ea4b8812178c2ba6431f28b9b492138335538e Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 2 Jun 2013 10:36:24 +1000 4 | Subject: [PATCH] POM Changes 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index a2bdfbc..70d5ff8 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -9,14 +9,14 @@ 12 | 9 13 | 14 | 15 | - org.bukkit 16 | - bukkit 17 | + org.spigotmc 18 | + spigot-api 19 | 1.8.8-R0.1-SNAPSHOT 20 | jar 21 | 22 | - Bukkit 23 | - http://www.bukkit.org/ 24 | - A plugin API for Minecraft servers. 25 | + Spigot-API 26 | + http://www.spigotmc.org/ 27 | + An enhanced plugin API for Minecraft servers. 28 | 29 | 30 | 1.6 31 | -- 32 | 2.1.4 33 | 34 | -------------------------------------------------------------------------------- /Bukkit-Patches/0005-Add-Arrow-API.patch: -------------------------------------------------------------------------------- 1 | From 5a6f3e6ac8d2c3b6a5600e89231a293af7ce03c8 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 2 Jun 2013 15:08:24 +1000 4 | Subject: [PATCH] Add Arrow API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java 8 | index e49eef0..e7a32f7 100644 9 | --- a/src/main/java/org/bukkit/entity/Arrow.java 10 | +++ b/src/main/java/org/bukkit/entity/Arrow.java 11 | @@ -39,4 +39,20 @@ public interface Arrow extends Projectile { 12 | * @param critical whether or not it should be critical 13 | */ 14 | public void setCritical(boolean critical); 15 | + 16 | + public class Spigot extends Entity.Spigot 17 | + { 18 | + 19 | + public double getDamage() 20 | + { 21 | + throw new UnsupportedOperationException( "Not supported yet." ); 22 | + } 23 | + 24 | + public void setDamage(double damage) 25 | + { 26 | + throw new UnsupportedOperationException( "Not supported yet." ); 27 | + } 28 | + } 29 | + 30 | + Spigot spigot(); 31 | } 32 | -- 33 | 2.1.4 34 | 35 | -------------------------------------------------------------------------------- /Bukkit-Patches/0010-Added-getAllSessionData-to-the-Conversation-API.patch: -------------------------------------------------------------------------------- 1 | From 0244c6a138d2d14eebedef0b3fa06570d1772e87 Mon Sep 17 00:00:00 2001 2 | From: Alex Bennett 3 | Date: Thu, 11 Jul 2013 15:31:32 -0500 4 | Subject: [PATCH] Added getAllSessionData() to the Conversation API. 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/conversations/ConversationContext.java b/src/main/java/org/bukkit/conversations/ConversationContext.java 8 | index 4f33ff4..7390a77 100644 9 | --- a/src/main/java/org/bukkit/conversations/ConversationContext.java 10 | +++ b/src/main/java/org/bukkit/conversations/ConversationContext.java 11 | @@ -46,6 +46,14 @@ public class ConversationContext { 12 | } 13 | 14 | /** 15 | + * Gets the entire sessionData map. 16 | + * @return The full sessionData map. 17 | + */ 18 | + public Map getAllSessionData() { 19 | + return sessionData; 20 | + } 21 | + 22 | + /** 23 | * Gets session data shared between all {@link Prompt} invocations. Use 24 | * this as a way to pass data through each Prompt as the conversation 25 | * develops. 26 | -- 27 | 2.1.4 28 | 29 | -------------------------------------------------------------------------------- /Bukkit-Patches/0011-Catch-Conversation-API-Errors.patch: -------------------------------------------------------------------------------- 1 | From f58f3bf04a2bb21880cc76e09196a57eddc44c6d Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 22 Jul 2013 19:09:43 +1000 4 | Subject: [PATCH] Catch Conversation API Errors 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/conversations/Conversation.java b/src/main/java/org/bukkit/conversations/Conversation.java 8 | index d4c1f6d..46912c8 100644 9 | --- a/src/main/java/org/bukkit/conversations/Conversation.java 10 | +++ b/src/main/java/org/bukkit/conversations/Conversation.java 11 | @@ -209,6 +209,7 @@ public class Conversation { 12 | * @param input The user's chat text. 13 | */ 14 | public void acceptInput(String input) { 15 | + try { // Spigot 16 | if (currentPrompt != null) { 17 | 18 | // Echo the user's input 19 | @@ -228,6 +229,12 @@ public class Conversation { 20 | currentPrompt = currentPrompt.acceptInput(context, input); 21 | outputNextPrompt(); 22 | } 23 | + // Spigot Start 24 | + } catch ( Throwable t ) 25 | + { 26 | + org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.SEVERE, "Error handling conversation prompt", t ); 27 | + } 28 | + // Spigot End 29 | } 30 | 31 | /** 32 | -- 33 | 2.1.4 34 | 35 | -------------------------------------------------------------------------------- /Bukkit-Patches/0012-Player-Collision-API.patch: -------------------------------------------------------------------------------- 1 | From 6cac32aab7e7270acc0c3a3802a833007301a755 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 3 Aug 2013 19:20:50 +1000 4 | Subject: [PATCH] Player Collision API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index c136208..2d054ba 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1096,6 +1096,27 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | { 13 | throw new UnsupportedOperationException( "Not supported yet." ); 14 | } 15 | + 16 | + /** 17 | + * Gets whether the player collides with entities 18 | + * 19 | + * @return the player's collision toggle state 20 | + */ 21 | + public boolean getCollidesWithEntities() 22 | + { 23 | + throw new UnsupportedOperationException( "Not supported yet." ); 24 | + } 25 | + 26 | + /** 27 | + * Sets whether the player collides with entities 28 | + * 29 | + * @param collides whether the player should collide with entities or 30 | + * not. 31 | + */ 32 | + public void setCollidesWithEntities(boolean collides) 33 | + { 34 | + throw new UnsupportedOperationException( "Not supported yet." ); 35 | + } 36 | } 37 | 38 | Spigot spigot(); 39 | -- 40 | 2.1.4 41 | 42 | -------------------------------------------------------------------------------- /Bukkit-Patches/0013-Expand-Boolean-Prompt-Values.patch: -------------------------------------------------------------------------------- 1 | From cbb9593827fba7ecf040fab1fc0a0794a78345c2 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 3 Aug 2013 19:42:16 +1000 4 | Subject: [PATCH] Expand Boolean Prompt Values 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/conversations/BooleanPrompt.java b/src/main/java/org/bukkit/conversations/BooleanPrompt.java 8 | index 3f2c97f..81ef78c 100644 9 | --- a/src/main/java/org/bukkit/conversations/BooleanPrompt.java 10 | +++ b/src/main/java/org/bukkit/conversations/BooleanPrompt.java 11 | @@ -15,12 +15,13 @@ public abstract class BooleanPrompt extends ValidatingPrompt{ 12 | 13 | @Override 14 | protected boolean isInputValid(ConversationContext context, String input) { 15 | - String[] accepted = {"true", "false", "on", "off", "yes", "no"}; 16 | + String[] accepted = {"true", "false", "on", "off", "yes", "no" /* Spigot: */, "y", "n", "1", "0", "right", "wrong", "correct", "incorrect", "valid", "invalid"}; // Spigot 17 | return ArrayUtils.contains(accepted, input.toLowerCase()); 18 | } 19 | 20 | @Override 21 | protected Prompt acceptValidatedInput(ConversationContext context, String input) { 22 | + if (input.equalsIgnoreCase("y") || input.equals("1") || input.equalsIgnoreCase("right") || input.equalsIgnoreCase("correct") || input.equalsIgnoreCase("valid")) input = "true"; // Spigot 23 | return acceptValidatedInput(context, BooleanUtils.toBoolean(input)); 24 | } 25 | 26 | -- 27 | 2.1.4 28 | 29 | -------------------------------------------------------------------------------- /Bukkit-Patches/0014-Add-Getter-for-Entity-Invulnerability.patch: -------------------------------------------------------------------------------- 1 | From 3058e4ccec6de64c7c0a94fefecebaf76cae104c Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 3 Aug 2013 19:49:36 +1000 4 | Subject: [PATCH] Add Getter for Entity Invulnerability 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java 8 | index de7815f..7fb08af 100644 9 | --- a/src/main/java/org/bukkit/entity/Entity.java 10 | +++ b/src/main/java/org/bukkit/entity/Entity.java 11 | @@ -342,4 +342,22 @@ public interface Entity extends Metadatable, CommandSender { 12 | * @return if the custom name is displayed 13 | */ 14 | public boolean isCustomNameVisible(); 15 | + 16 | + // Spigot Start 17 | + public class Spigot 18 | + { 19 | + 20 | + /** 21 | + * Returns whether this entity is invulnerable. 22 | + * 23 | + * @return True if the entity is invulnerable. 24 | + */ 25 | + public boolean isInvulnerable() 26 | + { 27 | + throw new UnsupportedOperationException( "Not supported yet." ); 28 | + } 29 | + } 30 | + 31 | + Spigot spigot(); 32 | + // Spigot End 33 | } 34 | -- 35 | 2.1.4 36 | 37 | -------------------------------------------------------------------------------- /Bukkit-Patches/0015-Add-respawn-API.patch: -------------------------------------------------------------------------------- 1 | From 76c4f71d40ca15b885666c5425f5b3c8a6269b26 Mon Sep 17 00:00:00 2001 2 | From: ninja- 3 | Date: Tue, 8 Oct 2013 14:35:58 +0200 4 | Subject: [PATCH] Add respawn API. 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index 2d054ba..b7f4e9e 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1117,6 +1117,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | { 13 | throw new UnsupportedOperationException( "Not supported yet." ); 14 | } 15 | + 16 | + /** 17 | + * Respawns the player if dead. 18 | + */ 19 | + public void respawn() 20 | + { 21 | + throw new UnsupportedOperationException( "Not supported yet." ); 22 | + } 23 | } 24 | 25 | Spigot spigot(); 26 | -- 27 | 2.1.4 28 | 29 | -------------------------------------------------------------------------------- /Bukkit-Patches/0016-Fix-Plugin-Message-API-Disconnects.patch: -------------------------------------------------------------------------------- 1 | From 32283d1dd78f712e95675f00ae2241651ec87068 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 19 Oct 2013 12:59:42 +1100 4 | Subject: [PATCH] Fix Plugin Message API Disconnects 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java 8 | index a906f8d..4c171e8 100644 9 | --- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java 10 | +++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java 11 | @@ -421,7 +421,15 @@ public class StandardMessenger implements Messenger { 12 | Set registrations = getIncomingChannelRegistrations(channel); 13 | 14 | for (PluginMessageListenerRegistration registration : registrations) { 15 | - registration.getListener().onPluginMessageReceived(channel, source, message); 16 | + // Spigot Start 17 | + try 18 | + { 19 | + registration.getListener().onPluginMessageReceived( channel, source, message ); 20 | + } catch ( Throwable t ) 21 | + { 22 | + org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.WARNING, "Could not pass incoming plugin message to " + registration.getPlugin(), t ); 23 | + } 24 | + // Spigot End 25 | } 26 | } 27 | 28 | -- 29 | 2.1.4 30 | 31 | -------------------------------------------------------------------------------- /Bukkit-Patches/0018-Implement-Locale-Getter-for-Players.patch: -------------------------------------------------------------------------------- 1 | From 32427451524d58b5096de3be5a98c1a9041dcacd Mon Sep 17 00:00:00 2001 2 | From: Smove 3 | Date: Sat, 1 Feb 2014 18:10:49 +1100 4 | Subject: [PATCH] Implement Locale Getter for Players 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index b7f4e9e..41b7b3c 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1125,6 +1125,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | { 13 | throw new UnsupportedOperationException( "Not supported yet." ); 14 | } 15 | + 16 | + /** 17 | + * Gets player locale language. 18 | + * 19 | + * @return the player's client language settings 20 | + */ 21 | + public String getLocale() 22 | + { 23 | + throw new UnsupportedOperationException( "Not supported yet." ); 24 | + } 25 | } 26 | 27 | Spigot spigot(); 28 | -- 29 | 2.1.4 30 | 31 | -------------------------------------------------------------------------------- /Bukkit-Patches/0019-Add-support-for-fetching-hidden-players.patch: -------------------------------------------------------------------------------- 1 | From ced760bab62605d3cccbf4886a70d3d9f0e272a5 Mon Sep 17 00:00:00 2001 2 | From: Tux 3 | Date: Sun, 9 Feb 2014 14:02:11 -0500 4 | Subject: [PATCH] Add support for fetching hidden players 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index 41b7b3c..0f59c07 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1135,6 +1135,16 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | { 13 | throw new UnsupportedOperationException( "Not supported yet." ); 14 | } 15 | + 16 | + /** 17 | + * Gets all players hidden with {@link hidePlayer(org.bukkit.entity.Player)}. 18 | + * 19 | + * @return a Set with all hidden players 20 | + */ 21 | + public java.util.Set getHiddenPlayers() 22 | + { 23 | + throw new UnsupportedOperationException( "Not supported yet." ); 24 | + } 25 | } 26 | 27 | Spigot spigot(); 28 | -- 29 | 2.1.4 30 | 31 | -------------------------------------------------------------------------------- /Bukkit-Patches/0022-Add-Score.isScoreSet-Z-API.patch: -------------------------------------------------------------------------------- 1 | From e9305a7a4988acd7f73e0c444d1237409bb51db4 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Thu, 17 Apr 2014 19:35:13 +1000 4 | Subject: [PATCH] Add Score.isScoreSet()Z API. 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/scoreboard/Score.java b/src/main/java/org/bukkit/scoreboard/Score.java 8 | index 4c10346..2410cbd 100644 9 | --- a/src/main/java/org/bukkit/scoreboard/Score.java 10 | +++ b/src/main/java/org/bukkit/scoreboard/Score.java 11 | @@ -51,6 +51,17 @@ public interface Score { 12 | */ 13 | void setScore(int score) throws IllegalStateException; 14 | 15 | + // Spigot start 16 | + /** 17 | + * Shows if this score has been set at any point in time. 18 | + * 19 | + * @return if this score has been set before 20 | + * @throws IllegalStateException if the associated objective has been 21 | + * unregistered 22 | + */ 23 | + boolean isScoreSet() throws IllegalStateException; 24 | + // Spigot end 25 | + 26 | /** 27 | * Gets the scoreboard for the associated objective. 28 | * 29 | -- 30 | 2.1.4 31 | 32 | -------------------------------------------------------------------------------- /Bukkit-Patches/0025-Fix-slow-tab-complete-for-some-commands.patch: -------------------------------------------------------------------------------- 1 | From f68a6b171088758dfab21917b1028246fcbfd6af Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Tue, 22 Jul 2014 21:01:32 +1000 4 | Subject: [PATCH] Fix slow tab complete for some commands. 5 | 6 | Use online players instead of offline players, which is very slow. 7 | 8 | diff --git a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java 9 | index 92de43c..855f560 100644 10 | --- a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java 11 | +++ b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java 12 | @@ -105,7 +105,7 @@ public class WhitelistCommand extends VanillaCommand { 13 | } else if (args.length == 2) { 14 | if (args[0].equalsIgnoreCase("add")) { 15 | List completions = new ArrayList(); 16 | - for (OfflinePlayer player : Bukkit.getOfflinePlayers()) { 17 | + for (OfflinePlayer player : Bukkit.getOnlinePlayers()) { // Spigot - well maybe sometimes you haven't turned the whitelist on just yet. 18 | String name = player.getName(); 19 | if (StringUtil.startsWithIgnoreCase(name, args[1]) && !player.isWhitelisted()) { 20 | completions.add(name); 21 | -- 22 | 2.1.4 23 | 24 | -------------------------------------------------------------------------------- /Bukkit-Patches/0026-Undeprecate-Player-updateInventory-V.patch: -------------------------------------------------------------------------------- 1 | From 9cb8116240b7afad0bf933eae153b6c61daf6921 Mon Sep 17 00:00:00 2001 2 | From: drXor 3 | Date: Wed, 23 Jul 2014 15:50:36 -0400 4 | Subject: [PATCH] Undeprecate Player#updateInventory()V 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index 0f59c07..d429074 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -333,10 +333,8 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | /** 13 | * Forces an update of the player's entire inventory. 14 | * 15 | - * @deprecated This method should not be relied upon as it is a temporary 16 | - * work-around for a larger, more complicated issue. 17 | */ 18 | - @Deprecated 19 | + //@Deprecated // Spigot - undeprecate 20 | public void updateInventory(); 21 | 22 | /** 23 | -- 24 | 2.1.4 25 | 26 | -------------------------------------------------------------------------------- /Bukkit-Patches/0029-Add-restart-API.patch: -------------------------------------------------------------------------------- 1 | From 948e11f2b713bbda226ef75d98763a488ffeaecb Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 13 Jul 2015 19:10:15 +1000 4 | Subject: [PATCH] Add restart API. 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java 8 | index 7aa374f..169008a 100644 9 | --- a/src/main/java/org/bukkit/Server.java 10 | +++ b/src/main/java/org/bukkit/Server.java 11 | @@ -949,6 +949,13 @@ public interface Server extends PluginMessageRecipient { 12 | public void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { 13 | throw new UnsupportedOperationException("Not supported yet."); 14 | } 15 | + 16 | + /** 17 | + * Restart the server. If the server administrator has not configured restarting, the server will stop. 18 | + */ 19 | + public void restart() { 20 | + throw new UnsupportedOperationException("Not supported yet."); 21 | + } 22 | } 23 | 24 | Spigot spigot(); 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0004-Obfuscation-Helpers.patch: -------------------------------------------------------------------------------- 1 | From c32e02f99891c045b408e3b5b922fa1bda94b672 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 14 Apr 2014 10:38:04 +1000 4 | Subject: [PATCH] Obfuscation Helpers 5 | 6 | Provides several friendly named methods which map to a obfuscated method. Obfuscated methods which are used frequently should be added to this file to ease with updates to new Minecraft versions. 7 | 8 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 9 | index 352409d..b79a2e7 100644 10 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 11 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 12 | @@ -1287,6 +1287,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs 13 | 14 | } 15 | 16 | + // Spigot Start 17 | + public ServerConnection getServerConnection() 18 | + { 19 | + return this.q; 20 | + } 21 | + // Spigot End 22 | public ServerConnection aq() { 23 | return this.q; 24 | } 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0013-Handle-Null-Tile-Entities.patch: -------------------------------------------------------------------------------- 1 | From 5846865ec3ebf4fcc2d6c35617cc6dddc6bc18a2 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 3 Feb 2013 09:20:19 +1100 4 | Subject: [PATCH] Handle Null Tile Entities 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java 8 | index e34964f..275856f 100644 9 | --- a/src/main/java/net/minecraft/server/World.java 10 | +++ b/src/main/java/net/minecraft/server/World.java 11 | @@ -1365,6 +1365,13 @@ public abstract class World implements IBlockAccess { 12 | 13 | while (iterator.hasNext()) { 14 | TileEntity tileentity = (TileEntity) iterator.next(); 15 | + // Spigot start 16 | + if (tileentity == null) { 17 | + getServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash"); 18 | + iterator.remove(); 19 | + continue; 20 | + } 21 | + // Spigot end 22 | 23 | if (!tileentity.x() && tileentity.t()) { 24 | BlockPosition blockposition = tileentity.getPosition(); 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0017-Prevent-NPE-in-CraftSign.patch: -------------------------------------------------------------------------------- 1 | From 6c4714ec822f04f5edd10bd57cc8db50df6d3b17 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 18 Mar 2013 20:01:44 +1100 4 | Subject: [PATCH] Prevent NPE in CraftSign 5 | 6 | This commit prevents the constructor of CraftSign throwing an NPE when it cannot get the sign tile entity. Instead it will fallback to a 4 empty lined sign, and not try to do anything to those lines on .update(). 7 | 8 | diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java 9 | index 42a6f9a..43adfcc 100644 10 | --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java 11 | +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java 12 | @@ -18,6 +18,12 @@ public class CraftSign extends CraftBlockState implements Sign { 13 | 14 | CraftWorld world = (CraftWorld) block.getWorld(); 15 | sign = (TileEntitySign) world.getTileEntityAt(getX(), getY(), getZ()); 16 | + // Spigot start 17 | + if (sign == null) { 18 | + lines = new String[]{"", "", "", ""}; 19 | + return; 20 | + } 21 | + // Spigot end 22 | lines = new String[sign.lines.length]; 23 | System.arraycopy(revertComponents(sign.lines), 0, lines, 0, lines.length); 24 | } 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0019-Thread-Naming-and-Tweaks.patch: -------------------------------------------------------------------------------- 1 | From 11b631871b5943607fc15ec70a841a8af7020aa9 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Tue, 23 Apr 2013 11:50:27 +1000 4 | Subject: [PATCH] Thread Naming and Tweaks 5 | 6 | Removes the sleep forever thread and adds useful names for debugging to all staged thread files. 7 | 8 | diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java 9 | index 8442ecb..93d8d42 100644 10 | --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java 11 | +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java 12 | @@ -72,7 +72,7 @@ public class CraftScheduler implements BukkitScheduler { 13 | */ 14 | private final ConcurrentHashMap runners = new ConcurrentHashMap(); 15 | private volatile int currentTick = -1; 16 | - private final Executor executor = Executors.newCachedThreadPool(); 17 | + private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot 18 | private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}}; 19 | private CraftAsyncDebugger debugTail = debugHead; 20 | private static final int RECENT_TICKS; 21 | -- 22 | 2.1.4 23 | 24 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0021-Remove-o-Option.patch: -------------------------------------------------------------------------------- 1 | From 561aaac2d5dc20515d3b4161fa880b9ba70962b0 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 19 May 2013 18:29:48 +1000 4 | Subject: [PATCH] Remove -o Option 5 | 6 | Serves no purpose other than to confuse users. 7 | 8 | diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java 9 | index 856ae39..0ee7fe8 100644 10 | --- a/src/main/java/net/minecraft/server/PropertyManager.java 11 | +++ b/src/main/java/net/minecraft/server/PropertyManager.java 12 | @@ -54,7 +54,7 @@ public class PropertyManager { 13 | } 14 | 15 | private T getOverride(String name, T value) { 16 | - if ((this.options != null) && (this.options.has(name))) { 17 | + if ((this.options != null) && (this.options.has(name)) && !name.equals( "online-mode")) { // Spigot 18 | return (T) this.options.valueOf(name); 19 | } 20 | 21 | -- 22 | 2.1.4 23 | 24 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0023-Implement-Arrow-API.patch: -------------------------------------------------------------------------------- 1 | From b362f88b396a1220b9e55a48ec6ee08fb400db39 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 2 Jun 2013 15:16:05 +1000 4 | Subject: [PATCH] Implement Arrow API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java 8 | index bf48e6e..ad489cc 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java 11 | @@ -75,6 +75,17 @@ public class CraftArrow extends AbstractProjectile implements Arrow { 12 | // Spigot start 13 | private final Arrow.Spigot spigot = new Arrow.Spigot() 14 | { 15 | + @Override 16 | + public double getDamage() 17 | + { 18 | + return getHandle().j(); 19 | + } 20 | + 21 | + @Override 22 | + public void setDamage(double damage) 23 | + { 24 | + getHandle().b( damage ); 25 | + } 26 | }; 27 | 28 | public Arrow.Spigot spigot() 29 | -- 30 | 2.1.4 31 | 32 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0026-Firework-Meta-Crash-Fix.patch: -------------------------------------------------------------------------------- 1 | From 7de3bb97d2030311993a14f4e59c30569956d16e Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 15 Jun 2013 21:34:48 +1000 4 | Subject: [PATCH] Firework Meta Crash Fix 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java 8 | index 0f7da6b..5a409ae 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaFirework.java 11 | @@ -145,7 +145,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { 12 | case BURST: 13 | return 4; 14 | default: 15 | - throw new AssertionError(type); 16 | + throw new IllegalStateException(type.toString()); // Spigot 17 | } 18 | } 19 | 20 | @@ -162,7 +162,7 @@ class CraftMetaFirework extends CraftMetaItem implements FireworkMeta { 21 | case 4: 22 | return Type.BURST; 23 | default: 24 | - throw new AssertionError(nbt); 25 | + throw new IllegalStateException(Integer.toString(nbt)); // Spigot 26 | } 27 | } 28 | 29 | -- 30 | 2.1.4 31 | 32 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0032-Disallow-Interaction-With-Self.patch: -------------------------------------------------------------------------------- 1 | From 416a5d8363e7e87d07ceff5d97e61f547e87cf86 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Fri, 28 Jun 2013 19:52:54 +1000 4 | Subject: [PATCH] Disallow Interaction With Self 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java 8 | index 9ff5828..8d6d3c7 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerConnection.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerConnection.java 11 | @@ -1227,6 +1227,13 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList 12 | PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.u()); 13 | WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); 14 | Entity entity = packetplayinuseentity.a((World) worldserver); 15 | + // Spigot Start 16 | + if ( entity == player && !player.isSpectator() ) 17 | + { 18 | + disconnect( "Cannot interact with self!" ); 19 | + return; 20 | + } 21 | + // Spigot End 22 | 23 | this.player.resetIdleTimer(); 24 | if (entity != null) { 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0034-Prevent-Ghost-Players-Caused-by-Plugins.patch: -------------------------------------------------------------------------------- 1 | From d828c679ff0cacc857fe380616c5e9753e3f9b32 Mon Sep 17 00:00:00 2001 2 | From: Alex Ciuba 3 | Date: Tue, 11 Jun 2013 15:23:03 -0400 4 | Subject: [PATCH] Prevent Ghost Players Caused by Plugins 5 | 6 | Check if the player is still connected after firing event. Fixes BUKKIT-4327 7 | 8 | diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java 9 | index 49b908d..747d708 100644 10 | --- a/src/main/java/net/minecraft/server/PlayerList.java 11 | +++ b/src/main/java/net/minecraft/server/PlayerList.java 12 | @@ -548,6 +548,11 @@ public abstract class PlayerList { 13 | Player respawnPlayer = cserver.getPlayer(entityplayer1); 14 | PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn); 15 | cserver.getPluginManager().callEvent(respawnEvent); 16 | + // Spigot Start 17 | + if (entityplayer.playerConnection.isDisconnected()) { 18 | + return entityplayer; 19 | + } 20 | + // Spigot End 21 | 22 | location = respawnEvent.getRespawnLocation(); 23 | entityplayer.reset(); 24 | -- 25 | 2.1.4 26 | 27 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0035-Plug-World-Unload-Memory-Leak.patch: -------------------------------------------------------------------------------- 1 | From fc446e6747d22f32433ee0fcd83002cd7b16968b Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 3 Aug 2013 19:02:59 +1000 4 | Subject: [PATCH] Plug World Unload Memory Leak 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java 8 | index 125cefe..6a7e7b3 100644 9 | --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java 10 | +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java 11 | @@ -10,7 +10,7 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit 12 | 13 | public class BlockRedstoneTorch extends BlockTorch { 14 | 15 | - private static Map> b = Maps.newHashMap(); 16 | + private static Map> b = new java.util.WeakHashMap(); // Spigot 17 | private final boolean isOn; 18 | 19 | private boolean a(World world, BlockPosition blockposition, boolean flag) { 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0037-Fully-Disable-Snooper-When-Not-Required.patch: -------------------------------------------------------------------------------- 1 | From fd42204f5757b7af9451bdc9dcf68d7eafa22901 Mon Sep 17 00:00:00 2001 2 | From: agentk20 3 | Date: Sat, 3 Aug 2013 19:28:48 +1000 4 | Subject: [PATCH] Fully Disable Snooper When Not Required 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 8 | index 5d1aa0b..2acf3bd 100644 9 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 10 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 11 | @@ -656,11 +656,11 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs 12 | this.h[this.ticks % 100] = System.nanoTime() - i; 13 | this.methodProfiler.b(); 14 | this.methodProfiler.a("snooper"); 15 | - if (!this.n.d() && this.ticks > 100) { 16 | + if (getSnooperEnabled() && !this.n.d() && this.ticks > 100) { // Spigot 17 | this.n.a(); 18 | } 19 | 20 | - if (this.ticks % 6000 == 0) { 21 | + if (getSnooperEnabled() && this.ticks % 6000 == 0) { // Spigot 22 | this.n.b(); 23 | } 24 | 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0038-Add-Getter-for-Entity-Invulnerability.patch: -------------------------------------------------------------------------------- 1 | From e5bb74a1c2832936bc46cb42915f39abebc51a94 Mon Sep 17 00:00:00 2001 2 | From: DerFlash 3 | Date: Sat, 3 Aug 2013 19:53:48 +1000 4 | Subject: [PATCH] Add Getter for Entity Invulnerability 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 8 | index 4c0ac67..0234fe3 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 11 | @@ -542,6 +542,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { 12 | // Spigot start 13 | private final Spigot spigot = new Spigot() 14 | { 15 | + @Override 16 | + public boolean isInvulnerable() 17 | + { 18 | + return getHandle().isInvulnerable(net.minecraft.server.DamageSource.GENERIC); 19 | + } 20 | }; 21 | 22 | public Spigot spigot() 23 | -- 24 | 2.1.4 25 | 26 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0039-Cap-Minimum-Player-Speed.patch: -------------------------------------------------------------------------------- 1 | From aae347ac688cad34a2bf4684deb4b14a185fde1b Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 5 Aug 2013 20:17:20 +1000 4 | Subject: [PATCH] Cap Minimum Player Speed 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 3a07a7b..9d240c9 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -1178,7 +1178,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | public void setFlySpeed(float value) { 13 | validateSpeed(value); 14 | EntityPlayer player = getHandle(); 15 | - player.abilities.flySpeed = value / 2f; 16 | + player.abilities.flySpeed = Math.max( value, 0.0001f ) / 2f; // Spigot 17 | player.updateAbilities(); 18 | 19 | } 20 | @@ -1187,7 +1187,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 21 | public void setWalkSpeed(float value) { 22 | validateSpeed(value); 23 | EntityPlayer player = getHandle(); 24 | - player.abilities.walkSpeed = value / 2f; 25 | + player.abilities.walkSpeed = Math.max( value, 0.0001f ) / 2f; // Spigot 26 | player.updateAbilities(); 27 | } 28 | 29 | -- 30 | 2.1.4 31 | 32 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0040-Update-Inventory-and-Health-for-PlayerConsumeItemEve.patch: -------------------------------------------------------------------------------- 1 | From 4a01fe5baa2c8bc6ff8b4ddabe047dde8f3231e0 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 14 Sep 2013 10:16:38 +1000 4 | Subject: [PATCH] Update Inventory and Health for PlayerConsumeItemEvent 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java 8 | index c93a5da..17c9f64 100644 9 | --- a/src/main/java/net/minecraft/server/EntityHuman.java 10 | +++ b/src/main/java/net/minecraft/server/EntityHuman.java 11 | @@ -300,6 +300,10 @@ public abstract class EntityHuman extends EntityLiving { 12 | // Update client 13 | if (this instanceof EntityPlayer) { 14 | ((EntityPlayer) this).playerConnection.sendPacket(new PacketPlayOutSetSlot((byte) 0, activeContainer.getSlot((IInventory) this.inventory, this.inventory.itemInHandIndex).index, this.g)); 15 | + // Spigot Start 16 | + ((EntityPlayer) this).getBukkitEntity().updateInventory(); 17 | + ((EntityPlayer) this).getBukkitEntity().updateScaledHealth(); 18 | + // Spigot End 19 | } 20 | return; 21 | } 22 | -- 23 | 2.1.4 24 | 25 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0041-Call-EntityChangeBlockEvent-for-Fire-Arrows-hitting-.patch: -------------------------------------------------------------------------------- 1 | From 4b13a7bb4f86b86b104d512f730b058734df7ff4 Mon Sep 17 00:00:00 2001 2 | From: BlackHole 3 | Date: Tue, 16 Jul 2013 22:34:50 +0200 4 | Subject: [PATCH] Call EntityChangeBlockEvent for Fire Arrows hitting TNT 5 | 6 | Adds BUKKIT-4355 7 | 8 | diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java 9 | index f15b199..40c0a87 100644 10 | --- a/src/main/java/net/minecraft/server/BlockTNT.java 11 | +++ b/src/main/java/net/minecraft/server/BlockTNT.java 12 | @@ -77,6 +77,11 @@ public class BlockTNT extends Block { 13 | EntityArrow entityarrow = (EntityArrow) entity; 14 | 15 | if (entityarrow.isBurning()) { 16 | + // CraftBukkit start 17 | + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, blockposition.getX(), blockposition.getY(), blockposition.getZ(), Blocks.AIR, 0).isCancelled()) { 18 | + return; 19 | + } 20 | + // CraftBukkit end 21 | this.a(world, blockposition, world.getType(blockposition).set(BlockTNT.EXPLODE, Boolean.valueOf(true)), entityarrow.shooter instanceof EntityLiving ? (EntityLiving) entityarrow.shooter : null); 22 | world.setAir(blockposition); 23 | } 24 | -- 25 | 2.1.4 26 | 27 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0045-Implement-respawn-API.patch: -------------------------------------------------------------------------------- 1 | From abebbbac98d7d10cdd59763777a847de2eb81b3b Mon Sep 17 00:00:00 2001 2 | From: ninja- 3 | Date: Tue, 8 Oct 2013 14:34:49 +0200 4 | Subject: [PATCH] Implement respawn API. 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 9d240c9..6c1a092 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -1358,6 +1358,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | getHandle().collidesWithEntities = collides; 13 | getHandle().k = collides; // First boolean of Entity 14 | } 15 | + 16 | + @Override 17 | + public void respawn() 18 | + { 19 | + if ( getHealth() <= 0 && isOnline() ) 20 | + { 21 | + server.getServer().getPlayerList().moveToWorld( getHandle(), 0, false ); 22 | + } 23 | + } 24 | }; 25 | 26 | public Player.Spigot spigot() 27 | -- 28 | 2.1.4 29 | 30 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0049-Clear-Flower-Pot-on-Drop.patch: -------------------------------------------------------------------------------- 1 | From 89eb6b05e7135406df9ca8300dd018432b763e27 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Tue, 3 Dec 2013 11:07:48 +1100 4 | Subject: [PATCH] Clear Flower Pot on Drop 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/BlockFlowerPot.java b/src/main/java/net/minecraft/server/BlockFlowerPot.java 8 | index fd77047..ce46138 100644 9 | --- a/src/main/java/net/minecraft/server/BlockFlowerPot.java 10 | +++ b/src/main/java/net/minecraft/server/BlockFlowerPot.java 11 | @@ -95,6 +95,7 @@ public class BlockFlowerPot extends BlockContainer { 12 | 13 | if (tileentityflowerpot != null && tileentityflowerpot.b() != null) { 14 | a(world, blockposition, new ItemStack(tileentityflowerpot.b(), 1, tileentityflowerpot.c())); 15 | + tileentityflowerpot.a( null, 0 ); // Spigot 16 | } 17 | 18 | super.remove(world, blockposition, iblockdata); 19 | -- 20 | 2.1.4 21 | 22 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0050-Fix-some-chunks-not-being-sent-to-the-client.patch: -------------------------------------------------------------------------------- 1 | From 4780ccafe1a89c999b2be1124c3a08edfa190041 Mon Sep 17 00:00:00 2001 2 | From: Thinkofdeath 3 | Date: Mon, 2 Dec 2013 23:42:09 +0000 4 | Subject: [PATCH] Fix some chunks not being sent to the client 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java 8 | index 6460ab1..f461f50 100644 9 | --- a/src/main/java/net/minecraft/server/Chunk.java 10 | +++ b/src/main/java/net/minecraft/server/Chunk.java 11 | @@ -1061,7 +1061,15 @@ public class Chunk { 12 | } 13 | 14 | public boolean isReady() { 15 | - return this.p && this.done && this.lit; 16 | + // Spigot Start 17 | + /* 18 | + * As of 1.7, Mojang added a check to make sure that only chunks which have been lit are sent to the client. 19 | + * Unfortunately this interferes with our modified chunk ticking algorithm, which will only tick chunks distant from the player on a very infrequent basis. 20 | + * We cannot unfortunately do this lighting stage during chunk gen as it appears to put a lot more noticeable load on the server, than when it is done at play time. 21 | + * For now at least we will simply send all chunks, in accordance with pre 1.7 behaviour. 22 | + */ 23 | + return true; 24 | + // Spigot End 25 | } 26 | 27 | public ChunkCoordIntPair j() { 28 | -- 29 | 2.1.4 30 | 31 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0058-Prevent-Mineshaft-Saving.patch: -------------------------------------------------------------------------------- 1 | From 352eba0eb3c150efd3233443ec6eb2d5deaa9d83 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Fri, 13 Dec 2013 15:21:02 +1100 4 | Subject: [PATCH] Prevent Mineshaft Saving 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java 8 | index bb1a11e..0f8211a 100644 9 | --- a/src/main/java/net/minecraft/server/StructureGenerator.java 10 | +++ b/src/main/java/net/minecraft/server/StructureGenerator.java 11 | @@ -196,7 +196,7 @@ public abstract class StructureGenerator extends WorldGenBase { 12 | private void a(World world) { 13 | if (this.d == null) { 14 | // Spigot Start 15 | - if ( world.spigotConfig.saveStructureInfo ) 16 | + if ( world.spigotConfig.saveStructureInfo && !this.a().equals( "Mineshaft" ) ) 17 | { 18 | this.d = (PersistentStructure) world.a(PersistentStructure.class, this.a()); 19 | } else 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0059-Log-Cause-of-Unexpected-Exceptions.patch: -------------------------------------------------------------------------------- 1 | From 6a7da9b465c656b8c77602d8180a707c5e3349c6 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Wed, 18 Dec 2013 13:39:14 +1100 4 | Subject: [PATCH] Log Cause of Unexpected Exceptions 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 8 | index cdf7e0a..0637df9 100644 9 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 10 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 11 | @@ -547,6 +547,12 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs 12 | } 13 | } catch (Throwable throwable) { 14 | MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable); 15 | + // Spigot Start 16 | + if ( throwable.getCause() != null ) 17 | + { 18 | + MinecraftServer.LOGGER.error( "\tCause of unexpected exception was", throwable.getCause() ); 19 | + } 20 | + // Spigot End 21 | CrashReport crashreport = null; 22 | 23 | if (throwable instanceof ReportedException) { 24 | -- 25 | 2.1.4 26 | 27 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0065-Disable-Connected-Check-on-setScoreboard.patch: -------------------------------------------------------------------------------- 1 | From 9bacce598c5544cba0339a9ff3da446c4a8d4a3c Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 23 Dec 2013 15:57:57 +1100 4 | Subject: [PATCH] Disable Connected Check on setScoreboard 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 499c6d2..9998ed8 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -1237,7 +1237,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | throw new IllegalStateException("Cannot set scoreboard yet"); 13 | } 14 | if (playerConnection.isDisconnected()) { 15 | - throw new IllegalStateException("Cannot set scoreboard for invalid CraftPlayer"); 16 | + // throw new IllegalStateException("Cannot set scoreboard for invalid CraftPlayer"); // Spigot - remove this as Mojang's semi asynchronous Netty implementation can lead to races 17 | } 18 | 19 | this.server.getScoreboardManager().setPlayerBoard(this, scoreboard); 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0068-Fix-ItemStack-Unbreakable-Code.patch: -------------------------------------------------------------------------------- 1 | From 3133f7ad7c02420bd68fbc080d70da3144d506cb Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Fri, 10 Jan 2014 15:15:50 +1100 4 | Subject: [PATCH] Fix ItemStack Unbreakable Code 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java 8 | index b722be5..6808a46 100644 9 | --- a/src/main/java/net/minecraft/server/ItemStack.java 10 | +++ b/src/main/java/net/minecraft/server/ItemStack.java 11 | @@ -287,7 +287,13 @@ public final class ItemStack { 12 | } 13 | 14 | public boolean e() { 15 | - return this.item == null ? false : (this.item.getMaxDurability() <= 0 ? false : !this.hasTag() || !this.getTag().getBoolean("Unbreakable")); 16 | + // Spigot Start 17 | + if ( this.item.getMaxDurability() <= 0 ) 18 | + { 19 | + return false; 20 | + } 21 | + return ( !hasTag() ) || ( !getTag().getBoolean( "Unbreakable" ) ); 22 | + // Spigot End 23 | } 24 | 25 | public boolean usesData() { 26 | -- 27 | 2.1.4 28 | 29 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0079-Fix-dispensing-bone-meal-not-having-the-correct-data.patch: -------------------------------------------------------------------------------- 1 | From 20accb600aff6f6c6c5e4cc1fdb54622750db89d Mon Sep 17 00:00:00 2001 2 | From: Thinkofdeath 3 | Date: Thu, 6 Feb 2014 21:59:20 +0000 4 | Subject: [PATCH] Fix dispensing bone meal not having the correct data value 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/DispenserRegistry.java b/src/main/java/net/minecraft/server/DispenserRegistry.java 8 | index 4c68593..82cde14 100644 9 | --- a/src/main/java/net/minecraft/server/DispenserRegistry.java 10 | +++ b/src/main/java/net/minecraft/server/DispenserRegistry.java 11 | @@ -464,7 +464,7 @@ public class DispenserRegistry { 12 | 13 | // CraftBukkit start 14 | org.bukkit.block.Block block = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ()); 15 | - CraftItemStack craftItem = CraftItemStack.asNewCraftStack(itemstack.getItem()); 16 | + CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack); // Spigot 17 | 18 | BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0)); 19 | if (!BlockDispenser.eventFired) { 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0082-Add-support-for-fetching-hidden-players.patch: -------------------------------------------------------------------------------- 1 | From 673a0dcfb5c95fbe1513a8e0e71d034ab6f153aa Mon Sep 17 00:00:00 2001 2 | From: Tux 3 | Date: Sun, 9 Feb 2014 14:03:03 -0500 4 | Subject: [PATCH] Add support for fetching hidden players 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 29c73f0..b560f77 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -1434,6 +1434,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | { 13 | return getHandle().locale; 14 | } 15 | + 16 | + @Override 17 | + public Set getHiddenPlayers() 18 | + { 19 | + Set ret = new HashSet(); 20 | + for ( UUID u : hiddenPlayers ) 21 | + { 22 | + ret.add( getServer().getPlayer( u ) ); 23 | + } 24 | + 25 | + return java.util.Collections.unmodifiableSet( ret ); 26 | + } 27 | }; 28 | 29 | public Player.Spigot spigot() 30 | -- 31 | 2.1.4 32 | 33 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0084-Cap-Channel-Registrations.patch: -------------------------------------------------------------------------------- 1 | From 2d9c0f7fa94f843db9dd9947ef045f8ba666cd72 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Wed, 12 Feb 2014 20:02:58 +1100 4 | Subject: [PATCH] Cap Channel Registrations 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index b560f77..5604506 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -1057,6 +1057,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | } 13 | 14 | public void addChannel(String channel) { 15 | + com.google.common.base.Preconditions.checkState( channels.size() < 128, "Too many channels registered" ); // Spigot 16 | if (channels.add(channel)) { 17 | server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel)); 18 | } 19 | -- 20 | 2.1.4 21 | 22 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0086-Unfinalize-the-isDisconnected-method-by-bukkit.patch: -------------------------------------------------------------------------------- 1 | From 93af51933eb01ccbcd423a34ee958eb1dca54cfb Mon Sep 17 00:00:00 2001 2 | From: hcherndon 3 | Date: Sat, 15 Feb 2014 01:51:20 -0600 4 | Subject: [PATCH] Unfinalize the isDisconnected() method by bukkit. 5 | 6 | This would literally mean the world to me. You have no idea how much this method being final is fucking me over right now. (Working with NPC's and what not.) 7 | 8 | diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java 9 | index b1b8a2f..0f2908e 100644 10 | --- a/src/main/java/net/minecraft/server/PlayerConnection.java 11 | +++ b/src/main/java/net/minecraft/server/PlayerConnection.java 12 | @@ -2095,7 +2095,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList 13 | } 14 | 15 | // CraftBukkit start - Add "isDisconnected" method 16 | - public final boolean isDisconnected() { 17 | + public boolean isDisconnected() { // Spigot 18 | return !this.player.joining && !this.networkManager.channel.config().isAutoRead(); 19 | } 20 | 21 | -- 22 | 2.5.0 23 | 24 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0088-Use-one-PermissibleBase-for-all-Command-Blocks.patch: -------------------------------------------------------------------------------- 1 | From f6446a8b33609ca85fe75d12dda6dcb104f15353 Mon Sep 17 00:00:00 2001 2 | From: FrozenBrain 3 | Date: Sun, 2 Mar 2014 21:13:46 +0100 4 | Subject: [PATCH] Use one PermissibleBase for all Command Blocks 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java 8 | index 1314c74..b339cf3 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/command/ServerCommandSender.java 11 | @@ -12,9 +12,18 @@ import org.bukkit.plugin.Plugin; 12 | import java.util.Set; 13 | 14 | public abstract class ServerCommandSender implements CommandSender { 15 | - private final PermissibleBase perm = new PermissibleBase(this); 16 | + private static PermissibleBase blockPermInst; 17 | + private final PermissibleBase perm; 18 | 19 | public ServerCommandSender() { 20 | + if (this instanceof CraftBlockCommandSender) { 21 | + if (blockPermInst == null) { 22 | + blockPermInst = new PermissibleBase(this); 23 | + } 24 | + this.perm = blockPermInst; 25 | + } else { 26 | + this.perm = new PermissibleBase(this); 27 | + } 28 | } 29 | 30 | public boolean isPermissionSet(String name) { 31 | -- 32 | 2.1.4 33 | 34 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0089-Prevent-hoppers-from-loading-chunks.patch: -------------------------------------------------------------------------------- 1 | From dc19069d56b0c7c345ea865d24c256710b5e4b25 Mon Sep 17 00:00:00 2001 2 | From: Thinkofdeath 3 | Date: Wed, 5 Mar 2014 20:27:27 +0000 4 | Subject: [PATCH] Prevent hoppers from loading chunks 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java 8 | index 6785b71..1553656 100644 9 | --- a/src/main/java/net/minecraft/server/TileEntityHopper.java 10 | +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java 11 | @@ -549,6 +549,7 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU 12 | int j = MathHelper.floor(d1); 13 | int k = MathHelper.floor(d2); 14 | BlockPosition blockposition = new BlockPosition(i, j, k); 15 | + if ( !world.isLoaded( blockposition ) ) return null; // Spigot 16 | Block block = world.getType(blockposition).getBlock(); 17 | 18 | if (block.isTileEntity()) { 19 | -- 20 | 2.1.4 21 | 22 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0091-Fix-ConcurrentModificationException-while-being-idle.patch: -------------------------------------------------------------------------------- 1 | From 2184149435455c1312bcdc2e8787facc7611edff Mon Sep 17 00:00:00 2001 2 | From: Thinkofdeath 3 | Date: Tue, 14 Jan 2014 20:11:25 +0000 4 | Subject: [PATCH] Fix ConcurrentModificationException while being idle kicked 5 | in a vehicle 6 | 7 | 8 | diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java 9 | index 2788061..8f4a08a 100644 10 | --- a/src/main/java/net/minecraft/server/World.java 11 | +++ b/src/main/java/net/minecraft/server/World.java 12 | @@ -1093,6 +1093,7 @@ public abstract class World implements IBlockAccess { 13 | this.everyoneSleeping(); 14 | } 15 | 16 | + if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking 17 | int i = entity.ae; 18 | int j = entity.ag; 19 | 20 | @@ -1109,6 +1110,7 @@ public abstract class World implements IBlockAccess { 21 | this.entityList.remove(index); 22 | } 23 | // CraftBukkit end 24 | + } // Spigot 25 | this.b(entity); 26 | } 27 | 28 | -- 29 | 2.1.4 30 | 31 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0095-Display-Spigot-in-client-crashes-server-lists-and-Mo.patch: -------------------------------------------------------------------------------- 1 | From 993f29b10ba5812bf849113ddbbe89798ae57700 Mon Sep 17 00:00:00 2001 2 | From: Thinkofdeath 3 | Date: Fri, 11 Apr 2014 11:16:34 +0100 4 | Subject: [PATCH] Display 'Spigot' in client crashes, server lists and Mojang 5 | stats 6 | 7 | 8 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 9 | index c55dcae..304c577 100644 10 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 11 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 12 | @@ -1014,7 +1014,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs 13 | } 14 | 15 | public String getServerModName() { 16 | - return server.getName(); // CraftBukkit - cb > vanilla! 17 | + return "Spigot"; // Spigot - Spigot > // CraftBukkit - cb > vanilla! 18 | } 19 | 20 | public CrashReport b(CrashReport crashreport) { 21 | -- 22 | 2.1.4 23 | 24 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0097-Add-Conversion-Message.patch: -------------------------------------------------------------------------------- 1 | From 868ed7873d461685203a175e5c07e1c268a52387 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sat, 12 Apr 2014 23:30:44 +1000 4 | Subject: [PATCH] Add Conversion Message 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java 8 | index 9febc99..2bcc81f 100644 9 | --- a/src/main/java/net/minecraft/server/DedicatedServer.java 10 | +++ b/src/main/java/net/minecraft/server/DedicatedServer.java 11 | @@ -524,6 +524,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer 12 | } 13 | 14 | protected boolean aR() { 15 | + server.getLogger().info( "**** Beginning UUID conversion, this may take A LONG time ****"); // Spigot, let the user know whats up! 16 | boolean flag = false; 17 | 18 | int i; 19 | -- 20 | 2.1.4 21 | 22 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0098-Properly-cancel-fishing-event.-Fixes-BUKKIT-5396.patch: -------------------------------------------------------------------------------- 1 | From 7e2c3ef9d20fb88cbb0ade17c08ace098aea14bf Mon Sep 17 00:00:00 2001 2 | From: "gjmcferrin@gmail.com" 3 | Date: Mon, 10 Feb 2014 10:05:11 -0500 4 | Subject: [PATCH] Properly cancel fishing event. Fixes BUKKIT-5396 5 | 6 | Previously, when cancelling a PlayerFishEvent with State.FISHING, the next 7 | fishing attempt would automatically result in a new PlayerFishEvent with 8 | State.FAILED_ATTEMPT because the player's hooked entity was not properly 9 | cleared. This ensures that the player's hooked entity value is set to null so 10 | that the next attempt will result in the proper state being called. 11 | 12 | diff --git a/src/main/java/net/minecraft/server/ItemFishingRod.java b/src/main/java/net/minecraft/server/ItemFishingRod.java 13 | index 3cf292f..050a504 100644 14 | --- a/src/main/java/net/minecraft/server/ItemFishingRod.java 15 | +++ b/src/main/java/net/minecraft/server/ItemFishingRod.java 16 | @@ -23,6 +23,7 @@ public class ItemFishingRod extends Item { 17 | world.getServer().getPluginManager().callEvent(playerFishEvent); 18 | 19 | if (playerFishEvent.isCancelled()) { 20 | + entityhuman.hookedFish = null; 21 | return itemstack; 22 | } 23 | // CraftBukkit end 24 | -- 25 | 2.1.4 26 | 27 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0099-Print-Stack-on-InternalException.patch: -------------------------------------------------------------------------------- 1 | From c321d000af00c5d2ca2bd86e863a811a7f5a0fa3 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 13 Apr 2014 09:00:59 +1000 4 | Subject: [PATCH] Print Stack on InternalException 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java 8 | index 7959242..f26d377 100644 9 | --- a/src/main/java/net/minecraft/server/NetworkManager.java 10 | +++ b/src/main/java/net/minecraft/server/NetworkManager.java 11 | @@ -111,6 +111,7 @@ public class NetworkManager extends SimpleChannelInboundHandler { 12 | } 13 | 14 | this.close(chatmessage); 15 | + if (MinecraftServer.getServer().isDebugging()) throwable.printStackTrace(); // Spigot 16 | } 17 | 18 | protected void a(ChannelHandlerContext channelhandlercontext, Packet packet) throws Exception { 19 | -- 20 | 2.1.4 21 | 22 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0101-Use-Provided-Case-for-Non-Existent-Offline-Players.patch: -------------------------------------------------------------------------------- 1 | From c869eda4bd5c84e51f74d538913fe04c48dadb4c Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 14 Apr 2014 09:46:20 +1000 4 | Subject: [PATCH] Use Provided Case for Non Existent Offline Players 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java 8 | index d263ccc..846d7ca 100644 9 | --- a/src/main/java/net/minecraft/server/UserCache.java 10 | +++ b/src/main/java/net/minecraft/server/UserCache.java 11 | @@ -142,7 +142,7 @@ public class UserCache { 12 | this.e.remove(gameprofile); 13 | this.e.addFirst(gameprofile); 14 | } else { 15 | - gameprofile = a(this.f, s1); 16 | + gameprofile = a(this.f, s); // Spigot - use correct case for offline players 17 | if (gameprofile != null) { 18 | this.a(gameprofile); 19 | usercache_usercacheentry = (UserCache.UserCacheEntry) this.c.get(s1); 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0102-Check-for-blank-OfflinePlayer-Names.patch: -------------------------------------------------------------------------------- 1 | From dfb84fae6c926e7ad278d492ec619e531281954c Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Mon, 14 Apr 2014 17:21:24 +1000 4 | Subject: [PATCH] Check for blank OfflinePlayer Names 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 8 | index 103ace8..573490a 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 11 | @@ -1286,6 +1286,7 @@ public final class CraftServer implements Server { 12 | @Deprecated 13 | public OfflinePlayer getOfflinePlayer(String name) { 14 | Validate.notNull(name, "Name cannot be null"); 15 | + com.google.common.base.Preconditions.checkArgument( !org.apache.commons.lang.StringUtils.isBlank( name ), "Name cannot be blank" ); // Spigot 16 | 17 | // If the name given cannot ever be a valid username give a dummy return, for scoreboard plugins 18 | if (!validUserPattern.matcher(name).matches()) { 19 | -- 20 | 2.1.4 21 | 22 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0104-Fix-ban-expire-dates.patch: -------------------------------------------------------------------------------- 1 | From 82d2a9902b6c5c3ca1d1149b6901a81d4ea6730f Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Wed, 16 Apr 2014 10:09:56 +1000 4 | Subject: [PATCH] Fix ban expire dates. 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/GameProfileBanEntry.java b/src/main/java/net/minecraft/server/GameProfileBanEntry.java 8 | index e68d2b3..16fe481 100644 9 | --- a/src/main/java/net/minecraft/server/GameProfileBanEntry.java 10 | +++ b/src/main/java/net/minecraft/server/GameProfileBanEntry.java 11 | @@ -12,7 +12,7 @@ public class GameProfileBanEntry extends ExpirableListEntry { 12 | } 13 | 14 | public GameProfileBanEntry(GameProfile gameprofile, Date date, String s, Date date1, String s1) { 15 | - super(gameprofile, date1, s, date1, s1); 16 | + super(gameprofile, date, s, date1, s1); // Spigot 17 | } 18 | 19 | public GameProfileBanEntry(JsonObject jsonobject) { 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0105-Correct-Ban-Expiration.patch: -------------------------------------------------------------------------------- 1 | From 0641dde5f043d110afd4a703ebf54f9119780735 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Wed, 16 Apr 2014 11:14:38 +1000 4 | Subject: [PATCH] Correct Ban Expiration 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java 8 | index 3e9a4ef..0a39b06 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerList.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerList.java 11 | @@ -415,7 +415,7 @@ public abstract class PlayerList { 12 | } 13 | 14 | // return s; 15 | - event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s); 16 | + if (!gameprofilebanentry.hasExpired()) event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s); // Spigot 17 | } else if (!this.isWhitelisted(gameprofile)) { 18 | // return "You are not white-listed on this server!"; 19 | event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0106-Convert-Horses-owner-to-UUID.patch: -------------------------------------------------------------------------------- 1 | From d37b3eb2a15a15d2b2fe5dc961afee91639f27f2 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Wed, 16 Apr 2014 01:40:30 -0400 4 | Subject: [PATCH] Convert Horses owner to UUID 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java 8 | index 993a4a8..f131419 100644 9 | --- a/src/main/java/net/minecraft/server/EntityHorse.java 10 | +++ b/src/main/java/net/minecraft/server/EntityHorse.java 11 | @@ -1016,6 +1016,17 @@ public class EntityHorse extends EntityAnimal implements IInventoryListener { 12 | s = nbttagcompound.getString("OwnerUUID"); 13 | } else { 14 | String s1 = nbttagcompound.getString("Owner"); 15 | + // Spigot start 16 | + if ( s1 == null || s1.isEmpty() ) 17 | + { 18 | + if (nbttagcompound.hasKey("OwnerName")) { 19 | + String owner = nbttagcompound.getString("OwnerName"); 20 | + if (owner != null && !owner.isEmpty()) { 21 | + s1 = owner; 22 | + } 23 | + } 24 | + } 25 | + // Spigot end 26 | 27 | s = NameReferencingFileConverter.a(s1); 28 | } 29 | -- 30 | 2.1.4 31 | 32 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0107-Add-Score.isScoreSet-Z-API.patch: -------------------------------------------------------------------------------- 1 | From 65e5c43140f143929765996b367096545c599b0e Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Thu, 17 Apr 2014 19:35:53 +1000 4 | Subject: [PATCH] Add Score.isScoreSet()Z API. 5 | 6 | Also fix generics on CraftScore.getScore()I. 7 | 8 | diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java 9 | index 0b71b53..ee9d2ae 100644 10 | --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java 11 | +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java 12 | @@ -63,7 +63,9 @@ final class CraftScore implements Score { 13 | // Spigot start 14 | @Override 15 | public boolean isScoreSet() throws IllegalStateException { 16 | - throw new UnsupportedOperationException("Not supported yet."); 17 | + Scoreboard board = objective.checkState().board; 18 | + 19 | + return board.getPlayers().contains(entry) && board.getPlayerObjectives(entry).containsKey(objective.getHandle()); 20 | } 21 | // Spigot end 22 | } 23 | -- 24 | 2.1.4 25 | 26 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0108-Log-null-TileEntity-Owner.patch: -------------------------------------------------------------------------------- 1 | From 1874f36ea0732d6a192939fb70eb42404982c130 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 20 Apr 2014 11:16:54 +1000 4 | Subject: [PATCH] Log null TileEntity Owner 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java 8 | index b8d0961..c268a40 100644 9 | --- a/src/main/java/net/minecraft/server/TileEntity.java 10 | +++ b/src/main/java/net/minecraft/server/TileEntity.java 11 | @@ -229,7 +229,14 @@ public abstract class TileEntity { 12 | // CraftBukkit start - add method 13 | public InventoryHolder getOwner() { 14 | if (world == null) return null; 15 | - org.bukkit.block.BlockState state = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()).getState(); 16 | + // Spigot start 17 | + org.bukkit.block.Block block = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()); 18 | + if (block == null) { 19 | + org.bukkit.Bukkit.getLogger().log(java.util.logging.Level.WARNING, "No block for owner at %s %d %d %d", new Object[]{world.getWorld(), position.getX(), position.getY(), position.getZ()}); 20 | + return null; 21 | + } 22 | + // Spigot end 23 | + org.bukkit.block.BlockState state = block.getState(); 24 | if (state instanceof InventoryHolder) return (InventoryHolder) state; 25 | return null; 26 | } 27 | -- 28 | 2.1.4 29 | 30 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0109-Don-t-special-case-invalid-usernames-for-UUIDs.patch: -------------------------------------------------------------------------------- 1 | From 1a57d6484aee8da77a5640699982da4bf55cf923 Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Sun, 20 Apr 2014 18:58:00 +1000 4 | Subject: [PATCH] Don't special case 'invalid' usernames for UUIDs. 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 8 | index 573490a..0548e76 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 11 | @@ -1288,11 +1288,6 @@ public final class CraftServer implements Server { 12 | Validate.notNull(name, "Name cannot be null"); 13 | com.google.common.base.Preconditions.checkArgument( !org.apache.commons.lang.StringUtils.isBlank( name ), "Name cannot be blank" ); // Spigot 14 | 15 | - // If the name given cannot ever be a valid username give a dummy return, for scoreboard plugins 16 | - if (!validUserPattern.matcher(name).matches()) { 17 | - return new CraftOfflinePlayer(this, new GameProfile(invalidUserUUID, name)); 18 | - } 19 | - 20 | OfflinePlayer result = getPlayerExact(name); 21 | if (result == null) { 22 | // This is potentially blocking :( 23 | -- 24 | 2.1.4 25 | 26 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0112-Check-Skull-canPlace.patch: -------------------------------------------------------------------------------- 1 | From 374f5ab0db2baef88ccc9a2902217541af02eb1f Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Tue, 15 Apr 2014 10:48:35 +1000 4 | Subject: [PATCH] Check Skull canPlace 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/ItemSkull.java b/src/main/java/net/minecraft/server/ItemSkull.java 8 | index e710073..519574b 100644 9 | --- a/src/main/java/net/minecraft/server/ItemSkull.java 10 | +++ b/src/main/java/net/minecraft/server/ItemSkull.java 11 | @@ -35,6 +35,12 @@ public class ItemSkull extends Item { 12 | return false; 13 | } else { 14 | if (!world.isClientSide) { 15 | + // Spigot Start 16 | + if ( !Blocks.SKULL.canPlace( world, blockposition ) ) 17 | + { 18 | + return false; 19 | + } 20 | + // Spigot End 21 | world.setTypeAndData(blockposition, Blocks.SKULL.getBlockData().set(BlockSkull.FACING, enumdirection), 3); 22 | int i = 0; 23 | 24 | -- 25 | 2.1.4 26 | 27 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0116-Cap-Objective-Score-Length.patch: -------------------------------------------------------------------------------- 1 | From 5f66321b10cf8fc0a8fe7927316dd29b64b9c05e Mon Sep 17 00:00:00 2001 2 | From: hauno 3 | Date: Tue, 6 May 2014 18:01:37 -0700 4 | Subject: [PATCH] Cap Objective Score Length 5 | 6 | Adds a check for Score arguments that would crash the client 7 | 8 | diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java 9 | index 239ceca..5bd8cf9 100644 10 | --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java 11 | +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java 12 | @@ -93,6 +93,7 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective 13 | 14 | public Score getScore(String entry) throws IllegalArgumentException, IllegalStateException { 15 | Validate.notNull(entry, "Entry cannot be null"); 16 | + if (entry.length() > 40) throw new IllegalArgumentException("Entry cannot be longer than 40 characters!"); // Spigot 17 | CraftScoreboard scoreboard = checkState(); 18 | 19 | return new CraftScore(this, entry); 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0121-Cross-World-Entity-Teleportation.patch: -------------------------------------------------------------------------------- 1 | From aaa2c88a63db57c293bbd1440827602c72d2b4cd Mon Sep 17 00:00:00 2001 2 | From: Andrew Krieger 3 | Date: Tue, 24 Dec 2013 07:55:23 -0800 4 | Subject: [PATCH] Cross World Entity Teleportation 5 | 6 | Use Entity.teleportTo for cross-world teleportation in CraftEntity. 7 | 8 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 9 | index 0234fe3..efbf1a8 100644 10 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 11 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 12 | @@ -234,7 +234,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { 13 | // If this entity is riding another entity, we must dismount before teleporting. 14 | entity.mount(null); 15 | 16 | - entity.world = ((CraftWorld) location.getWorld()).getHandle(); 17 | + // Spigot start 18 | + if (!location.getWorld().equals(getWorld())) { 19 | + entity.teleportTo(location, cause.equals(TeleportCause.NETHER_PORTAL)); 20 | + return true; 21 | + } 22 | + 23 | + // entity.world = ((CraftWorld) location.getWorld()).getHandle(); 24 | + // Spigot end 25 | entity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); 26 | // entity.setLocation() throws no event, and so cannot be cancelled 27 | return true; 28 | -- 29 | 2.1.4 30 | 31 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0125-Disable-ResourceLeakDetector.patch: -------------------------------------------------------------------------------- 1 | From e58acb7c281b40d8de5690e907a1a0191ec31efd Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Tue, 8 Jul 2014 09:01:50 +1000 4 | Subject: [PATCH] Disable ResourceLeakDetector 5 | 6 | Hopefully no plugins are somehow leaking buffers, but disabling the ResourceLeakDetector is a good thing for performance of the Netty IO subsytem (it's been disabled in BungeeCord for a while now). 7 | 8 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 9 | index 1e6e401..dd3c740 100644 10 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 11 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 12 | @@ -124,6 +124,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs 13 | // Spigot end 14 | 15 | public MinecraftServer(OptionSet options, Proxy proxy, File file1) { 16 | + io.netty.util.ResourceLeakDetector.setEnabled( false ); // Spigot - disable 17 | this.e = proxy; 18 | MinecraftServer.l = this; 19 | // this.universe = file; // CraftBukkit 20 | -- 21 | 2.1.4 22 | 23 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0128-Fix-Slow-Loading-Libraries.patch: -------------------------------------------------------------------------------- 1 | From bf137a5718fbafd2b1c46dcb7b79f90996a1cf2a Mon Sep 17 00:00:00 2001 2 | From: md_5 3 | Date: Tue, 8 Jul 2014 20:27:52 +1000 4 | Subject: [PATCH] Fix Slow "Loading Libraries" 5 | 6 | 7 | diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml 8 | index 36eff85..08d68aa 100644 9 | --- a/src/main/resources/log4j2.xml 10 | +++ b/src/main/resources/log4j2.xml 11 | @@ -1,5 +1,5 @@ 12 | 13 | - 14 | + 15 | 16 | 17 | 18 | -- 19 | 2.1.4 20 | 21 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0130-Fix-for-enchanting-table-wiping-meta-when-placing-st.patch: -------------------------------------------------------------------------------- 1 | From 639afecbc1c663a8389f2fd401d78689562657e4 Mon Sep 17 00:00:00 2001 2 | From: drXor 3 | Date: Thu, 17 Jul 2014 21:13:15 -0400 4 | Subject: [PATCH] Fix for enchanting table wiping meta when placing stacked 5 | items 6 | 7 | 8 | diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java 9 | index 208d426..09eeb43 100644 10 | --- a/src/main/java/net/minecraft/server/ContainerEnchantTable.java 11 | +++ b/src/main/java/net/minecraft/server/ContainerEnchantTable.java 12 | @@ -336,7 +336,11 @@ public class ContainerEnchantTable extends Container { 13 | ((Slot) this.c.get(0)).set(itemstack1.cloneItemStack()); 14 | itemstack1.count = 0; 15 | } else if (itemstack1.count >= 1) { 16 | - ((Slot) this.c.get(0)).set(new ItemStack(itemstack1.getItem(), 1, itemstack1.getData())); 17 | + // Spigot start 18 | + ItemStack clone = itemstack1.cloneItemStack(); 19 | + clone.count = 1; 20 | + ((Slot) this.c.get(0)).set(clone); 21 | + // Spigot end 22 | --itemstack1.count; 23 | } 24 | } 25 | -- 26 | 2.1.4 27 | 28 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0134-Fix-Null-Tile-Entity-Worlds.patch: -------------------------------------------------------------------------------- 1 | From fb664aa6b7640d6e4a57e19531ff09db02abefc5 Mon Sep 17 00:00:00 2001 2 | From: "Evan A. Haskell" 3 | Date: Thu, 26 Jun 2014 18:37:29 -0400 4 | Subject: [PATCH] Fix Null Tile Entity Worlds 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java 8 | index 31e5e16..5a4e9e7 100644 9 | --- a/src/main/java/net/minecraft/server/World.java 10 | +++ b/src/main/java/net/minecraft/server/World.java 11 | @@ -1946,6 +1946,7 @@ public abstract class World implements IBlockAccess { 12 | } 13 | } 14 | 15 | + tileentity.a(this); // Spigot - No null worlds 16 | this.b.add(tileentity); 17 | } else { 18 | this.a(tileentity); 19 | -- 20 | 2.1.4 21 | 22 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0141-Fix-Corrupted-Trapped-Chest.patch: -------------------------------------------------------------------------------- 1 | From 77c78866dba86d58c6ae8ea82fdce606b7164a38 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Fri, 15 Aug 2014 00:56:41 -0400 4 | Subject: [PATCH] Fix Corrupted Trapped Chest 5 | 6 | The CraftBukkit code that auto repairs corrupted tile entities never was updated for Trapped Chest. 7 | If a Trapped Chest gets its Tile Entity corrupted, it will crash the server every time the chunk is loaded. 8 | 9 | This will now fix Trapped Chests too. 10 | 11 | diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java 12 | index 8a1165c..33d017b 100644 13 | --- a/src/main/java/net/minecraft/server/WorldServer.java 14 | +++ b/src/main/java/net/minecraft/server/WorldServer.java 15 | @@ -126,7 +126,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { 16 | TileEntity result = super.getTileEntity(pos); 17 | Block type = getType(pos).getBlock(); 18 | 19 | - if (type == Blocks.CHEST) { 20 | + if (type == Blocks.CHEST || type == Blocks.TRAPPED_CHEST) { // Spigot 21 | if (!(result instanceof TileEntityChest)) { 22 | result = fixTileEntity(pos, type, result); 23 | } 24 | -- 25 | 2.1.4 26 | 27 | -------------------------------------------------------------------------------- /CraftBukkit-Patches/0145-Skip-invalid-enchants-in-CraftMetaItem.patch: -------------------------------------------------------------------------------- 1 | From fd3dd337c8a095fdc855e9053dfeb1b99820445f Mon Sep 17 00:00:00 2001 2 | From: Thinkofdeath 3 | Date: Tue, 19 Aug 2014 11:04:21 +0100 4 | Subject: [PATCH] Skip invalid enchants in CraftMetaItem 5 | 6 | Its a rare case but when loading a world from a modded server which added enchantments 7 | CraftMetaItem would add a null enchantment into the enchantment map which causes 8 | NullPointers later 9 | 10 | diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java 11 | index e3d3424..dcb9252 100644 12 | --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java 13 | +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java 14 | @@ -460,7 +460,11 @@ class CraftMetaItem implements ItemMeta, Repairable { 15 | int id = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_ID.NBT); 16 | int level = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_LVL.NBT); 17 | 18 | - enchantments.put(Enchantment.getById(id), level); 19 | + // Spigot start - skip invalid enchantments 20 | + Enchantment e = Enchantment.getById(id); 21 | + if (e == null) continue; 22 | + // Spigot end 23 | + enchantments.put(e, level); 24 | } 25 | 26 | return enchantments; 27 | -- 28 | 2.1.4 29 | 30 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG git_ref 2 | FROM --platform=linux/amd64 ghcr.io/projectkig/kigpaper/kig-paper-builder:${git_ref} AS builder 3 | 4 | FROM eclipse-temurin:21-jre 5 | RUN apt-get update && apt-get install -y curl ca-certificates openssl git tar bash sqlite3 fontconfig \ 6 | && adduser --disabled-password --home /home/container container && mkdir -p /home/server/plugins \ 7 | && chown -R container:container /home/server && echo eula=true > eula.txt \ 8 | && rm -rf /var/lib/apt/lists/* 9 | USER container 10 | ARG git_ref=master 11 | ENV USER=container HOME=/home/container KIG_PLATFORM=hotspot 12 | WORKDIR /home/container 13 | COPY --from=builder ./build/PaperSpigot-Server/target/paperspigot*.jar /home/server/server.jar 14 | COPY ./docker/entrypoint.sh /entrypoint.sh 15 | CMD ["/bin/bash", "/entrypoint.sh"] 16 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0005-Add-getTPS-method.patch: -------------------------------------------------------------------------------- 1 | From 8bce4a508162d640c99efa7ddde38c1fe773d49e Mon Sep 17 00:00:00 2001 2 | From: Zach Brown 3 | Date: Sun, 19 Oct 2014 18:22:18 -0500 4 | Subject: [PATCH] Add getTPS method 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java 8 | index 169008a..26acdda 100644 9 | --- a/src/main/java/org/bukkit/Server.java 10 | +++ b/src/main/java/org/bukkit/Server.java 11 | @@ -956,6 +956,13 @@ public interface Server extends PluginMessageRecipient { 12 | public void restart() { 13 | throw new UnsupportedOperationException("Not supported yet."); 14 | } 15 | + 16 | + // PaperSpigot start - Add getTPS method 17 | + public double[] getTPS() 18 | + { 19 | + throw new UnsupportedOperationException( "Not supported yet." ); 20 | + } 21 | + // PaperSpigot end 22 | } 23 | 24 | Spigot spigot(); 25 | -- 26 | 2.5.0 27 | 28 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0006-Add-async-chunk-load-API.patch: -------------------------------------------------------------------------------- 1 | From 498f77bac894f37bb813f93a2d3da2c127a2384f Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Thu, 6 Nov 2014 18:29:20 -0600 4 | Subject: [PATCH] Add async chunk load API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java 8 | index ab73174..c962e7d 100644 9 | --- a/src/main/java/org/bukkit/World.java 10 | +++ b/src/main/java/org/bukkit/World.java 11 | @@ -129,6 +129,15 @@ public interface World extends PluginMessageRecipient, Metadatable { 12 | */ 13 | public Chunk getChunkAt(Block block); 14 | 15 | + // PaperSpigot start - Async chunk load API 16 | + public static interface ChunkLoadCallback { 17 | + public void onLoad(Chunk chunk); 18 | + } 19 | + public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb); 20 | + public void getChunkAtAsync(Location location, ChunkLoadCallback cb); 21 | + public void getChunkAtAsync(Block block, ChunkLoadCallback cb); 22 | + // PaperSpigot end 23 | + 24 | /** 25 | * Checks if the specified {@link Chunk} is loaded 26 | * 27 | -- 28 | 1.9.1 29 | 30 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0007-Add-TNT-source-location-API.patch: -------------------------------------------------------------------------------- 1 | From 28b66c77af202f83255000ebfa9050978a83af4a Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Sun, 30 Nov 2014 22:57:17 -0600 4 | Subject: [PATCH] Add TNT source location API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java 8 | index 3ce322d..7b1b6b6 100644 9 | --- a/src/main/java/org/bukkit/entity/TNTPrimed.java 10 | +++ b/src/main/java/org/bukkit/entity/TNTPrimed.java 11 | @@ -35,4 +35,11 @@ public interface TNTPrimed extends Explosive { 12 | * @return the source of this primed TNT 13 | */ 14 | public Entity getSource(); 15 | + 16 | + /** 17 | + * Gets the source block location of the primed TNT. 18 | + * 19 | + * @return the source block location the TNT was spawned from 20 | + */ 21 | + public org.bukkit.Location getSourceLoc(); 22 | } 23 | -- 24 | 1.9.1 25 | 26 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0009-Add-FallingBlock-source-location-API.patch: -------------------------------------------------------------------------------- 1 | From f255e1de552da583447620334ba2df03daabf61d Mon Sep 17 00:00:00 2001 2 | From: Byteflux 3 | Date: Fri, 17 Apr 2015 02:43:00 -0700 4 | Subject: [PATCH] Add FallingBlock source location API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java 8 | index bc56fa2..240a278 100644 9 | --- a/src/main/java/org/bukkit/entity/FallingBlock.java 10 | +++ b/src/main/java/org/bukkit/entity/FallingBlock.java 11 | @@ -59,4 +59,11 @@ public interface FallingBlock extends Entity { 12 | * @param hurtEntities whether entities will be damaged by this block. 13 | */ 14 | void setHurtEntities(boolean hurtEntities); 15 | + 16 | + /** 17 | + * Gets the source block location of the falling block 18 | + * 19 | + * @return the source block location the falling block was spawned from 20 | + */ 21 | + org.bukkit.Location getSourceLoc(); // PaperSpigot - Add FallingBlock source location API 22 | } 23 | -- 24 | 2.5.2 25 | 26 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0011-Add-player-view-distance-API.patch: -------------------------------------------------------------------------------- 1 | From 4159fb44e468dfea3813b86d3c69956393ec8dde Mon Sep 17 00:00:00 2001 2 | From: Byteflux 3 | Date: Wed, 1 Jul 2015 00:59:50 -0700 4 | Subject: [PATCH] Add player view distance API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index f93dcec..7522d45 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1183,6 +1183,26 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | { 13 | throw new UnsupportedOperationException( "Not supported yet" ); 14 | } 15 | + 16 | + /** 17 | + * Get the view distance for this player 18 | + * 19 | + * @return View distance 20 | + */ 21 | + public int getViewDistance() 22 | + { 23 | + throw new UnsupportedOperationException( "Not supported yet" ); 24 | + } 25 | + 26 | + /** 27 | + * Set the view distance for this player 28 | + * 29 | + * @param viewDistance View distance 30 | + */ 31 | + public void setViewDistance(int viewDistance) 32 | + { 33 | + throw new UnsupportedOperationException( "Not supported yet" ); 34 | + } 35 | } 36 | 37 | Spigot spigot(); 38 | -- 39 | 1.9.5.msysgit.1 40 | 41 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0017-Automatically-disable-plugins-that-fail-to-load.patch: -------------------------------------------------------------------------------- 1 | From 94997a931505151e58013ba362249d63daa09654 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Thu, 11 Feb 2016 23:21:31 -0500 4 | Subject: [PATCH] Automatically disable plugins that fail to load 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java 8 | index 4983ea8..b057b05 100644 9 | --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java 10 | +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java 11 | @@ -332,6 +332,10 @@ public final class JavaPluginLoader implements PluginLoader { 12 | jPlugin.setEnabled(true); 13 | } catch (Throwable ex) { 14 | server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); 15 | + // PaperSpigot start - Disable plugins that fail to load 16 | + disablePlugin(jPlugin); 17 | + return; 18 | + // PaperSpigot end 19 | } 20 | 21 | // Perhaps abort here, rather than continue going, but as it stands, 22 | -- 23 | 2.7.1 24 | 25 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0027-Update-POM-with-my-repos.patch: -------------------------------------------------------------------------------- 1 | From dabaf0f176740bd17a962b729022f162a60d8536 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 21 Sep 2020 13:51:05 +0200 4 | Subject: [PATCH] Update POM with my repos 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index fe9d6d26..6c22adc2 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -29,12 +29,12 @@ 12 | 13 | 14 | 15 | - destroystokyo-releases 16 | - https://repo.destroystokyo.com/content/repositories/releases/ 17 | + roccodev-releases 18 | + https://repo.rocco.dev/repository/releases/ 19 | 20 | 21 | - destroystokyo-snapshots 22 | - https://repo.destroystokyo.com/content/repositories/snapshots/ 23 | + roccodev-snapshots 24 | + https://repo.rocco.dev/repository/snapshots/ 25 | 26 | 27 | 28 | -- 29 | 2.26.2 30 | 31 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0029-Nickname-player-info-injection.patch: -------------------------------------------------------------------------------- 1 | From 3c51c28a868a7be8f4cbcdfa6638d9335ec86738 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 21 Sep 2020 20:41:46 +0200 4 | Subject: [PATCH] Nickname player info injection 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index d02fe560..3e340f79 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1193,6 +1193,27 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | @Deprecated 13 | public void sendTitle(String title, String subtitle); 14 | 15 | + /** 16 | + * Sets the player's nickname. 17 | + * @param nickname the nickname or {@code null} to reset it. 18 | + */ 19 | + void setNickname(String nickname); 20 | + 21 | + /** 22 | + * @return whether the player is nicknamed 23 | + */ 24 | + boolean isNicknamed(); 25 | + 26 | + /** 27 | + * @return the player's nickname, or {@code null} if the player isn't nicknamed. 28 | + */ 29 | + String getNickname(); 30 | + 31 | + /** 32 | + * @return the player's nickname if the player is nicknamed, or the player's real name 33 | + */ 34 | + String getEffectiveName(); 35 | + 36 | /** 37 | * Resets the title displayed to the player. 38 | */ 39 | -- 40 | 2.26.2 41 | 42 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0031-Nickname-tabcomplete-integration.patch: -------------------------------------------------------------------------------- 1 | From 5e53d618c64d036ca728c338e9ab071dc1ddffa9 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 22 Sep 2020 00:00:55 +0200 4 | Subject: [PATCH] Nickname tabcomplete integration 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java 8 | index 8558c2ec..5d441d25 100644 9 | --- a/src/main/java/org/bukkit/command/Command.java 10 | +++ b/src/main/java/org/bukkit/command/Command.java 11 | @@ -100,7 +100,7 @@ public abstract class Command { 12 | 13 | ArrayList matchedPlayers = new ArrayList(); 14 | for (Player player : sender.getServer().getOnlinePlayers()) { 15 | - String name = player.getName(); 16 | + String name = player.getEffectiveName(); 17 | if ((senderPlayer == null || senderPlayer.canSee(player)) && StringUtil.startsWithIgnoreCase(name, lastWord)) { 18 | matchedPlayers.add(name); 19 | } 20 | -- 21 | 2.26.2 22 | 23 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0032-Player-list-entry-self-update.patch: -------------------------------------------------------------------------------- 1 | From 54d4aee5511c6f25c96a983e7f8ddba93c14344e Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 22 Sep 2020 12:12:33 +0200 4 | Subject: [PATCH] Player list entry self update 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index 3e340f79..4ccd1e99 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1214,6 +1214,13 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | */ 13 | String getEffectiveName(); 14 | 15 | + /** 16 | + * Updates the user's player list entry. 17 | + * This change only applies to the current player. 18 | + * To change the display for other players, use {@link Player#hidePlayer(Player)} and {@link Player#showPlayer(Player)} instead. 19 | + */ 20 | + void updateSelfPlayerInfo(); 21 | + 22 | /** 23 | * Resets the title displayed to the player. 24 | */ 25 | -- 26 | 2.26.2 27 | 28 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0034-Knockback-friction-API.patch: -------------------------------------------------------------------------------- 1 | From fecd5035365ea4f35b78fca562fd9636cfe83c8f Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 27 Sep 2020 19:51:16 +0200 4 | Subject: [PATCH] Knockback friction API 5 | 6 | 7 | diff --git a/src/main/java/dev/rocco/kig/paper/api/velocity/KnockbackValues.java b/src/main/java/dev/rocco/kig/paper/api/velocity/KnockbackValues.java 8 | index 7293debf..a19ee197 100644 9 | --- a/src/main/java/dev/rocco/kig/paper/api/velocity/KnockbackValues.java 10 | +++ b/src/main/java/dev/rocco/kig/paper/api/velocity/KnockbackValues.java 11 | @@ -10,6 +10,7 @@ public interface KnockbackValues { 12 | void setVerticalMultiplier(float multiplier); 13 | void setSprintingVerticalMultiplier(float multiplier); 14 | void setSprintingHorizontalMultiplier(float multiplier); 15 | + void setFriction(float friction); 16 | void resetHorizontalMultiplier(); 17 | void resetVerticalMultiplier(); 18 | void resetFriction(); 19 | -- 20 | 2.26.2 21 | 22 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0035-Allow-entities-to-be-immune-to-stuck-arrows.patch: -------------------------------------------------------------------------------- 1 | From 056b77c9dec1d4a2df3c1b774ddb35632ddea40f Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 3 Jan 2021 14:06:47 +0100 4 | Subject: [PATCH] Allow entities to be immune to stuck arrows 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java 8 | index 48e25089..d93c9c93 100644 9 | --- a/src/main/java/org/bukkit/entity/LivingEntity.java 10 | +++ b/src/main/java/org/bukkit/entity/LivingEntity.java 11 | @@ -392,4 +392,15 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { 12 | * @return whether the operation was successful 13 | */ 14 | public boolean setLeashHolder(Entity holder); 15 | + 16 | + /** 17 | + * Sets whether the entity supports having arrows stuck to itself. 18 | + * @param capability whether arrows can stick to the entity 19 | + */ 20 | + void setCanArrowsBeStuck(boolean capability); 21 | + 22 | + /** 23 | + * Returns whether arrows can stick to the entity 24 | + */ 25 | + boolean getCanArrowsBeStuck(); 26 | } 27 | -- 28 | 2.28.0 29 | 30 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0036-Dynamic-server-player-limit.patch: -------------------------------------------------------------------------------- 1 | From 8880e1d6db41f07f5e97055549414db7f47fde4c Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 4 Jan 2021 15:43:23 +0100 4 | Subject: [PATCH] Dynamic server player limit 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java 8 | index c00fce8d..9c4650a9 100644 9 | --- a/src/main/java/org/bukkit/Bukkit.java 10 | +++ b/src/main/java/org/bukkit/Bukkit.java 11 | @@ -1182,5 +1182,8 @@ public final class Bukkit { 12 | public static KnockbackValues getKnockbackSettings() { 13 | return server.getKnockbackSettings(); 14 | } 15 | + public static void setMaxPlayers(int count) { 16 | + server.setMaxPlayers(count); 17 | + } 18 | // KigPaper end 19 | } 20 | diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java 21 | index 5d24b212..375d41ce 100644 22 | --- a/src/main/java/org/bukkit/Server.java 23 | +++ b/src/main/java/org/bukkit/Server.java 24 | @@ -1028,5 +1028,10 @@ public interface Server extends PluginMessageRecipient { 25 | * @return the server's custom knockback values 26 | */ 27 | KnockbackValues getKnockbackSettings(); 28 | + /** 29 | + * Sets a new max player count that the server can handle 30 | + * @param count the new count 31 | + */ 32 | + void setMaxPlayers(int count); 33 | // KigPaper end 34 | } 35 | -- 36 | 2.28.0 37 | 38 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0038-Add-World-getTileEntities.patch: -------------------------------------------------------------------------------- 1 | From 4e55285322da0bffee4d2a7feb3d7c814aa47ca8 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 20 Jan 2021 17:28:08 +0100 4 | Subject: [PATCH] Add World getTileEntities 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java 8 | index a8137e88..3d7b2686 100644 9 | --- a/src/main/java/org/bukkit/World.java 10 | +++ b/src/main/java/org/bukkit/World.java 11 | @@ -1,6 +1,8 @@ 12 | package org.bukkit; 13 | 14 | import java.io.File; 15 | + 16 | +import org.bukkit.block.BlockState; 17 | import org.bukkit.generator.ChunkGenerator; 18 | import java.util.Collection; 19 | import java.util.HashMap; 20 | @@ -1192,6 +1194,7 @@ public interface World extends PluginMessageRecipient, Metadatable { 21 | */ 22 | public boolean isGameRule(String rule); 23 | 24 | + // KigPaper start 25 | /** 26 | * Drops an item at the specified {@link Location}, setting its velocity to 0. 27 | * 28 | @@ -1201,6 +1204,12 @@ public interface World extends PluginMessageRecipient, Metadatable { 29 | */ 30 | Item dropImmovableItem(Location location, ItemStack item); 31 | 32 | + /** 33 | + * Returns the list of tile entities currently residing in the world. 34 | + */ 35 | + List getTileEntities(); 36 | + // KigPaper end 37 | + 38 | // Spigot start 39 | public class Spigot 40 | { 41 | -- 42 | 2.28.0 43 | 44 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0040-Add-EntityExtinguishEvent.patch: -------------------------------------------------------------------------------- 1 | From 73e6622f2d7dd70017bfbc6ab874cb48d6e209d9 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 3 Feb 2021 14:07:48 +0100 4 | Subject: [PATCH] Add EntityExtinguishEvent 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/event/entity/EntityExtinguishEvent.java b/src/main/java/org/bukkit/event/entity/EntityExtinguishEvent.java 8 | new file mode 100644 9 | index 00000000..299644c5 10 | --- /dev/null 11 | +++ b/src/main/java/org/bukkit/event/entity/EntityExtinguishEvent.java 12 | @@ -0,0 +1,24 @@ 13 | +package org.bukkit.event.entity; 14 | + 15 | +import org.bukkit.entity.Entity; 16 | +import org.bukkit.event.HandlerList; 17 | + 18 | +/** 19 | + * Called when an entity is about to be extinguished. 20 | + */ 21 | +public class EntityExtinguishEvent extends EntityEvent { 22 | + private static final HandlerList handlers = new HandlerList(); 23 | + 24 | + public EntityExtinguishEvent(Entity toExtinguish) { 25 | + super(toExtinguish); 26 | + } 27 | + 28 | + @Override 29 | + public HandlerList getHandlers() { 30 | + return handlers; 31 | + } 32 | + 33 | + public static HandlerList getHandlerList() { 34 | + return handlers; 35 | + } 36 | +} 37 | -- 38 | 2.28.0 39 | 40 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0042-Allow-disabling-cursors-in-CraftMapRenderer.patch: -------------------------------------------------------------------------------- 1 | From e4d669a36a786a69634f59d097a0915cc5ba9aa5 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 8 Feb 2021 16:49:18 +0100 4 | Subject: [PATCH] Allow disabling cursors in CraftMapRenderer 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/map/MapRenderer.java b/src/main/java/org/bukkit/map/MapRenderer.java 8 | index 322d0ce3..442fe062 100644 9 | --- a/src/main/java/org/bukkit/map/MapRenderer.java 10 | +++ b/src/main/java/org/bukkit/map/MapRenderer.java 11 | @@ -6,7 +6,7 @@ import org.bukkit.entity.Player; 12 | * Represents a renderer for a map. 13 | */ 14 | public abstract class MapRenderer { 15 | - 16 | + private boolean drawCursors = true; // KigPaper 17 | private boolean contextual; 18 | 19 | /** 20 | @@ -53,4 +53,20 @@ public abstract class MapRenderer { 21 | */ 22 | abstract public void render(MapView map, MapCanvas canvas, Player player); 23 | 24 | + // KigPaper start 25 | + /** 26 | + * Returns whether this renderer should draw cursors. Implementors should respect this choice. 27 | + */ 28 | + public boolean getDrawCursors() { 29 | + return drawCursors; 30 | + } 31 | + 32 | + /** 33 | + * Sets whether to draw cursors 34 | + * @param drawCursors whether this renderer should draw cursors 35 | + */ 36 | + public void setDrawCursors(boolean drawCursors) { 37 | + this.drawCursors = drawCursors; 38 | + } 39 | + // KigPaper end 40 | } 41 | -- 42 | 2.28.0 43 | 44 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0043-Add-MapView-Unload-API.patch: -------------------------------------------------------------------------------- 1 | From d294a83571676637f5a078d8f92f3f6d0e881488 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Thu, 11 Feb 2021 17:24:02 +0100 4 | Subject: [PATCH] Add MapView Unload API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/map/MapView.java b/src/main/java/org/bukkit/map/MapView.java 8 | index 65c41596..4826ea8d 100644 9 | --- a/src/main/java/org/bukkit/map/MapView.java 10 | +++ b/src/main/java/org/bukkit/map/MapView.java 11 | @@ -154,4 +154,10 @@ public interface MapView { 12 | */ 13 | public boolean removeRenderer(MapRenderer renderer); 14 | 15 | + // KigPaper start 16 | + /** 17 | + * Unloads the map from the main world's cached maps, and also removes the file from the world data folder. 18 | + */ 19 | + void unload(); 20 | + // KigPaper end 21 | } 22 | -- 23 | 2.28.0 24 | 25 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0045-ItemStack-max-stack-size-API.patch: -------------------------------------------------------------------------------- 1 | From c572a9adb1c286ef590e89a94df55f7e33477350 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Thu, 18 Feb 2021 20:37:19 +0100 4 | Subject: [PATCH] ItemStack max stack size API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java 8 | index 957a0b56..a3c65d2a 100644 9 | --- a/src/main/java/org/bukkit/inventory/ItemStack.java 10 | +++ b/src/main/java/org/bukkit/inventory/ItemStack.java 11 | @@ -280,7 +280,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { 12 | */ 13 | @Utility 14 | public int getMaxStackSize() { 15 | - if(this.customMaxStackSize != -1) return this.customMaxStackSize; // KigPaper 16 | + if(this.hasCustomMaxStackSize()) return this.customMaxStackSize; // KigPaper 17 | Material material = getType(); 18 | if (material != null) { 19 | return material.getMaxStackSize(); 20 | -- 21 | 2.28.0 22 | 23 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0047-Add-World-getEntityById-API.patch: -------------------------------------------------------------------------------- 1 | From 7257125a1d68271c909a9eac66d469b7f83a7756 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 10 Mar 2021 14:17:12 +0100 4 | Subject: [PATCH] Add World getEntityById API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java 8 | index 9edac15d..68f5d488 100644 9 | --- a/src/main/java/org/bukkit/World.java 10 | +++ b/src/main/java/org/bukkit/World.java 11 | @@ -1218,6 +1218,13 @@ public interface World extends PluginMessageRecipient, Metadatable { 12 | * Returns the list of tile entities currently residing in the world. 13 | */ 14 | List getTileEntities(); 15 | + 16 | + /** 17 | + * Returns an entity by its internal ID 18 | + * @param id the entity's internal ID, as returned by {@link Entity#getEntityId()}. 19 | + * @return the entity, or {@code null} if it could not be found 20 | + */ 21 | + Entity getEntityById(int id); 22 | // KigPaper end 23 | 24 | // Spigot start 25 | -- 26 | 2.28.0 27 | 28 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0048-Add-LivingEntity-clear-last-attacked-API.patch: -------------------------------------------------------------------------------- 1 | From ae4359a6bf278ecb7d404c35b0987acd92bd26ed Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 10 Mar 2021 20:21:55 +0100 4 | Subject: [PATCH] Add LivingEntity clear last attacked API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java 8 | index d93c9c93..cc8d81ca 100644 9 | --- a/src/main/java/org/bukkit/entity/LivingEntity.java 10 | +++ b/src/main/java/org/bukkit/entity/LivingEntity.java 11 | @@ -393,6 +393,7 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { 12 | */ 13 | public boolean setLeashHolder(Entity holder); 14 | 15 | + // KigPaper start 16 | /** 17 | * Sets whether the entity supports having arrows stuck to itself. 18 | * @param capability whether arrows can stick to the entity 19 | @@ -403,4 +404,10 @@ public interface LivingEntity extends Entity, Damageable, ProjectileSource { 20 | * Returns whether arrows can stick to the entity 21 | */ 22 | boolean getCanArrowsBeStuck(); 23 | + 24 | + /** 25 | + * Clears the last attacked player for this entity. Used to reset pathfinder goals for tameables owned by this entity. 26 | + */ 27 | + void clearLastAttacked(); 28 | + // KigPaper end 29 | } 30 | -- 31 | 2.28.0 32 | 33 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0051-Add-exit-code-to-shutdown-API.patch: -------------------------------------------------------------------------------- 1 | From 57ddb45602aef18d276f2bb4c316a3ec7c2d7d50 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 14 Apr 2021 14:00:10 +0200 4 | Subject: [PATCH] Add exit code to shutdown API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java 8 | index 9c4650a9..1f4c1da1 100644 9 | --- a/src/main/java/org/bukkit/Bukkit.java 10 | +++ b/src/main/java/org/bukkit/Bukkit.java 11 | @@ -1185,5 +1185,8 @@ public final class Bukkit { 12 | public static void setMaxPlayers(int count) { 13 | server.setMaxPlayers(count); 14 | } 15 | + public static void shutdown(int exitCode) { 16 | + server.shutdown(exitCode); 17 | + } 18 | // KigPaper end 19 | } 20 | diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java 21 | index 375d41ce..554e07f8 100644 22 | --- a/src/main/java/org/bukkit/Server.java 23 | +++ b/src/main/java/org/bukkit/Server.java 24 | @@ -597,6 +597,15 @@ public interface Server extends PluginMessageRecipient { 25 | */ 26 | public void shutdown(); 27 | 28 | + // KigPaper start 29 | + 30 | + /** 31 | + * Shuts the server down, stopping everything. 32 | + * @param exitCode the exit code to use 33 | + */ 34 | + void shutdown(int exitCode); 35 | + // KigPaper end 36 | + 37 | /** 38 | * Broadcasts the specified message to every user with the given 39 | * permission name. 40 | -- 41 | 2.28.0 42 | 43 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0053-Spoof-UUID-for-nicks.patch: -------------------------------------------------------------------------------- 1 | From a51302775d370b7f59350ca20df14d2ccdf2abad Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 10 May 2021 21:19:44 +0200 4 | Subject: [PATCH] Spoof UUID for nicks 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index bb579294..c1768637 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1,6 +1,7 @@ 12 | package org.bukkit.entity; 13 | 14 | import java.net.InetSocketAddress; 15 | +import java.util.UUID; 16 | 17 | import net.md_5.bungee.api.chat.BaseComponent; 18 | import org.bukkit.Achievement; 19 | @@ -1229,6 +1230,13 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 20 | * @param message the message to send 21 | */ 22 | void sendActionbarMessage(BaseComponent... message); 23 | + 24 | + /** 25 | + * Gets the UUID that should be sent to clients for this player. 26 | + * Use this if you spawn custom entities that should use the user's UUID. 27 | + * Essentially this returns a spoofed UUID if the player is nicked, or the user's normal UUID otherwise. 28 | + */ 29 | + UUID getUniqueIdForDisplay(); 30 | // KigPaper end 31 | 32 | /** 33 | -- 34 | 2.28.0 35 | 36 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0054-Add-Player-last-activity-API.patch: -------------------------------------------------------------------------------- 1 | From 6e8baa0bbcd7be761464687973284c83aae1dd6c Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 23 May 2021 00:25:07 +0200 4 | Subject: [PATCH] Add Player last activity API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index c1768637..f2a07235 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1237,6 +1237,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | * Essentially this returns a spoofed UUID if the player is nicked, or the user's normal UUID otherwise. 13 | */ 14 | UUID getUniqueIdForDisplay(); 15 | + 16 | + /** 17 | + * Returns the player's last activity timestamp, according to the "idle timeout" checks. 18 | + */ 19 | + long getLastActivity(); 20 | // KigPaper end 21 | 22 | /** 23 | -- 24 | 2.31.1 25 | 26 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0057-Player-DisconnectReason-kick-API.patch: -------------------------------------------------------------------------------- 1 | From d4306b8f2563018a75f9cff2ca107d85737e3927 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 1 Jun 2021 13:55:14 +0200 4 | Subject: [PATCH] Player DisconnectReason kick API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index f2a07235..d3db3cc4 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -3,6 +3,7 @@ package org.bukkit.entity; 12 | import java.net.InetSocketAddress; 13 | import java.util.UUID; 14 | 15 | +import dev.rocco.kig.paper.api.event.DisconnectReason; 16 | import net.md_5.bungee.api.chat.BaseComponent; 17 | import org.bukkit.Achievement; 18 | import org.bukkit.ChatColor; 19 | @@ -1242,6 +1243,14 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 20 | * Returns the player's last activity timestamp, according to the "idle timeout" checks. 21 | */ 22 | long getLastActivity(); 23 | + 24 | + /** 25 | + * Kicks player with custom kick message and reason. 26 | + * 27 | + * @param reason machine-friendly kick reason 28 | + * @param message kick message 29 | + */ 30 | + void kickPlayer(DisconnectReason reason, String message); 31 | // KigPaper end 32 | 33 | /** 34 | -- 35 | 2.31.1 36 | 37 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0061-Add-Player-invulnerability-API.patch: -------------------------------------------------------------------------------- 1 | From 9cc2f6791169fa9120d6f5dedc3d661d43424456 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Thu, 5 Aug 2021 06:39:45 +0200 4 | Subject: [PATCH] Add Player invulnerability API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java 8 | index 15783045..26638042 100644 9 | --- a/src/main/java/org/bukkit/entity/Player.java 10 | +++ b/src/main/java/org/bukkit/entity/Player.java 11 | @@ -1259,6 +1259,19 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline 12 | * @param channel the channel to register 13 | */ 14 | void registerPluginChannel(String channel); 15 | + 16 | + /** 17 | + * Sets the invulnerability flag in the player's capabilities. 18 | + * Being invulnerable also makes insentient entities ignore you. 19 | + * @param invulnerable whether the player should be immune to attacks 20 | + */ 21 | + void setInvulnerable(boolean invulnerable); 22 | + 23 | + /** 24 | + * Returns the invulnerability flag from the player's capabilities. 25 | + * Being invulnerable also makes insentient entities ignore you. 26 | + */ 27 | + boolean isInvulnerable(); 28 | // KigPaper end 29 | 30 | /** 31 | -- 32 | 2.31.1 33 | 34 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0062-Don-t-check-for-version-in-version.patch: -------------------------------------------------------------------------------- 1 | From 7be0fa1181ab408307883075bdf22074051c0ded Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 6 Aug 2021 15:12:16 +0200 4 | Subject: [PATCH] Don't check for version in /version 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java 8 | index e91e1d8c..9fa05939 100644 9 | --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java 10 | +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java 11 | @@ -159,6 +159,7 @@ public class VersionCommand extends BukkitCommand { 12 | return; 13 | } 14 | } 15 | + /* 16 | versionLock.lock(); 17 | try { 18 | if (hasVersion) { 19 | @@ -179,7 +180,7 @@ public class VersionCommand extends BukkitCommand { 20 | } 21 | } finally { 22 | versionLock.unlock(); 23 | - } 24 | + }*/ // KigPaper 25 | } 26 | 27 | private void obtainVersion() { 28 | -- 29 | 2.31.1 30 | 31 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0065-Make-tracking-range-configurable-per-entity.patch: -------------------------------------------------------------------------------- 1 | From d955cfdf811843a1d460fba029342079d4fe24cd Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 9 Nov 2021 18:57:27 +0100 4 | Subject: [PATCH] Make tracking range configurable per-entity 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java 8 | index 0a8a885d..30b049f0 100644 9 | --- a/src/main/java/org/bukkit/entity/Entity.java 10 | +++ b/src/main/java/org/bukkit/entity/Entity.java 11 | @@ -341,6 +341,22 @@ public interface Entity extends Metadatable, CommandSender { 12 | */ 13 | public boolean isCustomNameVisible(); 14 | 15 | + // KigPaper start 16 | + /** 17 | + * Returns the tracking range configured for this entity. 18 | + * The tracking range is the max distance the player can be from the entity until it can no longer be seen. 19 | + */ 20 | + int getTrackingRange(); 21 | + 22 | + /** 23 | + * Sets a new tracking range for this entity. 24 | + * The tracking range is the max distance the player can be from the entity until it can no longer be seen. 25 | + * 26 | + * @param trackingRange the new tracking range, or 0 to reset to the server-configured value. 27 | + */ 28 | + void setTrackingRange(int trackingRange); 29 | + // KigPaper end 30 | + 31 | // Spigot Start 32 | public class Spigot 33 | { 34 | -- 35 | 2.33.1 36 | 37 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0066-Add-Guardian-sounds-in-Sound.patch: -------------------------------------------------------------------------------- 1 | From a28fdfe92ee5c7f7dca7de1b9ae80bdef3f91170 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 14 Dec 2021 18:07:16 +0100 4 | Subject: [PATCH] Add Guardian sounds in Sound 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java 8 | index 09135300..77dbecf3 100644 9 | --- a/src/main/java/org/bukkit/Sound.java 10 | +++ b/src/main/java/org/bukkit/Sound.java 11 | @@ -208,4 +208,17 @@ public enum Sound { 12 | VILLAGER_IDLE, 13 | VILLAGER_NO, 14 | VILLAGER_YES, 15 | + // KigPaper start - Guardian sounds 16 | + GUARDIAN_IDLE, 17 | + GUARDIAN_IDLE_LAND, 18 | + GUARDIAN_IDLE_ELDER, 19 | + GUARDIAN_HIT, 20 | + GUARDIAN_HIT_LAND, 21 | + GUARDIAN_HIT_ELDER, 22 | + GUARDIAN_DEATH, 23 | + GUARDIAN_DEATH_LAND, 24 | + GUARDIAN_DEATH_ELDER, 25 | + GUARDIAN_FLOP, 26 | + GUARDIAN_CURSE 27 | + // KigPaper end 28 | } 29 | -- 30 | 2.33.1 31 | 32 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0073-Update-source-target-JRE-to-17.patch: -------------------------------------------------------------------------------- 1 | From 32baede4e7a1012d111acf1feaa391b680834615 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 22 Sep 2023 16:43:12 +0200 4 | Subject: [PATCH] Update source/target JRE to 17 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 7341ded0..4a796a95 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -20,9 +20,9 @@ 12 | 13 | 14 | 15 | + 16 | -Xdoclint:none 17 | - 1.8 18 | - 1.8 19 | + 17 20 | UTF-8 21 | 22 | 23 | @@ -121,7 +121,7 @@ 24 | org.apache.maven.plugins 25 | maven-compiler-plugin 26 | 27 | - 3.1 28 | + 3.11.0 29 | 30 | 31 | eclipse 32 | -- 33 | 2.41.0 34 | 35 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0074-Don-t-use-the-Eclipse-compiler-for-J17.patch: -------------------------------------------------------------------------------- 1 | From 00ae8915d71c25e211e78f512cb95a96383e1748 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 22 Sep 2023 17:32:02 +0200 4 | Subject: [PATCH] Don't use the Eclipse compiler for J17 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 4a796a95..80076c6f 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -120,12 +120,8 @@ 12 | 13 | org.apache.maven.plugins 14 | maven-compiler-plugin 15 | - 16 | 3.11.0 17 | 18 | - 19 | - eclipse 20 | - 21 | true 22 | 23 | 24 | @@ -140,7 +136,7 @@ 25 | 26 | org.apache.maven.plugins 27 | maven-shade-plugin 28 | - 2.3 29 | + 3.5.0 30 | 31 | 32 | package 33 | -- 34 | 2.41.0 35 | 36 | -------------------------------------------------------------------------------- /Spigot-API-Patches/0075-Upgrade-to-Java-21-upgrade-Netty-to-4.2.0.Final.patch: -------------------------------------------------------------------------------- 1 | From c591d99a9fcd16a17cb7c103542aee6c81de889e Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 15 Apr 2025 21:00:48 +0200 4 | Subject: [PATCH] Upgrade to Java 21, upgrade Netty to 4.2.0.Final 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 80076c6f..872732df 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -20,9 +20,9 @@ 12 | 13 | 14 | 15 | - 16 | + 17 | -Xdoclint:none 18 | - 17 19 | + 21 20 | UTF-8 21 | 22 | 23 | -- 24 | 2.48.1 25 | 26 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0020-Metrics.patch: -------------------------------------------------------------------------------- 1 | From a7cb1698f46a168af727798e55ef5116bf8ddde2 Mon Sep 17 00:00:00 2001 2 | From: Zach Brown 3 | Date: Wed, 18 Mar 2015 22:55:25 -0600 4 | Subject: [PATCH] Metrics 5 | 6 | 7 | diff --git a/src/main/java/org/spigotmc/Metrics.java b/src/main/java/org/spigotmc/Metrics.java 8 | index a5fd59d..558989c 100644 9 | --- a/src/main/java/org/spigotmc/Metrics.java 10 | +++ b/src/main/java/org/spigotmc/Metrics.java 11 | @@ -344,7 +344,7 @@ public class Metrics { 12 | */ 13 | private void postPlugin(final boolean isPing) throws IOException { 14 | // Server software specific section 15 | - String pluginName = "Spigot"; 16 | + String pluginName = "PaperSpigot"; // PaperSpigot - We need some usage data 17 | boolean onlineMode = Bukkit.getServer().getOnlineMode(); // TRUE if online mode is enabled 18 | String pluginVersion = (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown"; 19 | String serverVersion = Bukkit.getVersion(); 20 | -- 21 | 2.6.0 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0026-Only-refresh-abilities-if-needed.patch: -------------------------------------------------------------------------------- 1 | From dbcd027da8be15f1eb656da2f13bf0cbba8fa583 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Fri, 28 Nov 2014 13:20:22 -0600 4 | Subject: [PATCH] Only refresh abilities if needed 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index a9b4160..506a03c 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -1143,12 +1143,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | 13 | @Override 14 | public void setFlying(boolean value) { 15 | + boolean needsUpdate = getHandle().abilities.canFly != value; // PaperSpigot - Only refresh abilities if needed 16 | if (!getAllowFlight() && value) { 17 | throw new IllegalArgumentException("Cannot make player fly if getAllowFlight() is false"); 18 | } 19 | 20 | getHandle().abilities.isFlying = value; 21 | - getHandle().updateAbilities(); 22 | + if (needsUpdate) getHandle().updateAbilities(); // PaperSpigot - Only refresh abilities if needed 23 | } 24 | 25 | @Override 26 | -- 27 | 2.5.2 28 | 29 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0033-Enderman-drop-the-block-they-re-holding-when-they-di.patch: -------------------------------------------------------------------------------- 1 | From addd766578b634af56ba6ceef98ea1d74426f9f1 Mon Sep 17 00:00:00 2001 2 | From: Zach 3 | Date: Fri, 13 Feb 2015 14:49:30 -0600 4 | Subject: [PATCH] Enderman drop the block they're holding when they die 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java 8 | index a250062..f3afbbd 100644 9 | --- a/src/main/java/net/minecraft/server/EntityEnderman.java 10 | +++ b/src/main/java/net/minecraft/server/EntityEnderman.java 11 | @@ -251,6 +251,13 @@ public class EntityEnderman extends EntityMonster { 12 | } 13 | } 14 | 15 | + // PaperSpigot start - Drop the block the entity is holding when it dies 16 | + Item carriedItem = Item.getItemOf(getCarried().getBlock()); 17 | + if (carriedItem != null) { 18 | + this.a(carriedItem, 1); 19 | + } 20 | + // PaperSpigot end 21 | + 22 | } 23 | 24 | public void setCarried(IBlockData iblockdata) { 25 | -- 26 | 2.5.2 27 | 28 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0034-Check-online-mode-before-converting-and-renaming-pla.patch: -------------------------------------------------------------------------------- 1 | From b667634876a8af5cfc59125dffafebc1c8d5b685 Mon Sep 17 00:00:00 2001 2 | From: Zach Brown 3 | Date: Thu, 5 Mar 2015 15:30:06 -0600 4 | Subject: [PATCH] Check online mode before converting and renaming player data 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java 8 | index 7c51750..e5124af 100644 9 | --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java 10 | +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java 11 | @@ -202,7 +202,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { 12 | File file = new File(this.playerDir, entityhuman.getUniqueID().toString() + ".dat"); 13 | // Spigot Start 14 | boolean usingWrongFile = false; 15 | - if ( !file.exists() ) 16 | + if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // PaperSpigot - Check online mode first 17 | { 18 | file = new File( this.playerDir, UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + entityhuman.getName() ).getBytes( "UTF-8" ) ).toString() + ".dat"); 19 | if ( file.exists() ) 20 | -- 21 | 2.5.2 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0036-Always-tick-falling-blocks.patch: -------------------------------------------------------------------------------- 1 | From d983745c2061cbee37aa5a1ed042ae595b75dfbe Mon Sep 17 00:00:00 2001 2 | From: Zach Brown 3 | Date: Fri, 10 Apr 2015 18:07:36 -0500 4 | Subject: [PATCH] Always tick falling blocks 5 | 6 | 7 | diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java 8 | index d8d54bd..d6311bd 100644 9 | --- a/src/main/java/org/spigotmc/ActivationRange.java 10 | +++ b/src/main/java/org/spigotmc/ActivationRange.java 11 | @@ -14,6 +14,7 @@ import net.minecraft.server.EntityCreature; 12 | import net.minecraft.server.EntityCreeper; 13 | import net.minecraft.server.EntityEnderCrystal; 14 | import net.minecraft.server.EntityEnderDragon; 15 | +import net.minecraft.server.EntityFallingBlock; 16 | import net.minecraft.server.EntityFireball; 17 | import net.minecraft.server.EntityFireworks; 18 | import net.minecraft.server.EntityHuman; 19 | @@ -82,6 +83,7 @@ public class ActivationRange 20 | || entity instanceof EntityFireball 21 | || entity instanceof EntityWeather 22 | || entity instanceof EntityTNTPrimed 23 | + || entity instanceof EntityFallingBlock // PaperSpigot - Always tick falling blocks 24 | || entity instanceof EntityEnderCrystal 25 | || entity instanceof EntityFireworks ) 26 | { 27 | -- 28 | 2.6.0 29 | 30 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0039-Optimize-draining.patch: -------------------------------------------------------------------------------- 1 | From e930fc7dbc68671274199b2268d34bb3d8179990 Mon Sep 17 00:00:00 2001 2 | From: Byteflux 3 | Date: Fri, 10 Apr 2015 02:24:20 -0700 4 | Subject: [PATCH] Optimize draining 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java 8 | index de1dddb..ff18f63 100644 9 | --- a/src/main/java/net/minecraft/server/BlockFlowing.java 10 | +++ b/src/main/java/net/minecraft/server/BlockFlowing.java 11 | @@ -88,7 +88,14 @@ public class BlockFlowing extends BlockFluids { 12 | iblockdata = iblockdata.set(BlockFlowing.LEVEL, Integer.valueOf(i1)); 13 | world.setTypeAndData(blockposition, iblockdata, 2); 14 | world.a(blockposition, (Block) this, j); 15 | - world.applyPhysics(blockposition, this); 16 | + // PaperSpigot start - Optimize draining 17 | + world.d(blockposition.west(), this); 18 | + world.d(blockposition.east(), this); 19 | + world.d(blockposition.up(), this); 20 | + world.d(blockposition.north(), this); 21 | + world.d(blockposition.south(), this); 22 | + world.spigotConfig.antiXrayInstance.updateNearbyBlocks(world, blockposition); // Spigot 23 | + // PaperSpigot end 24 | } 25 | } 26 | } else { 27 | -- 28 | 2.5.2 29 | 30 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0042-Fix-jar-being-shaded-multiple-times.patch: -------------------------------------------------------------------------------- 1 | From d50dae836a3d3f52e9c5be6089246adadbb71628 Mon Sep 17 00:00:00 2001 2 | From: Jedediah Smith 3 | Date: Thu, 30 Apr 2015 22:42:34 -0400 4 | Subject: [PATCH] Fix jar being shaded multiple times 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 19e47f4..68073c0 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -130,6 +130,7 @@ 12 | maven-jar-plugin 13 | 2.5 14 | 15 | + true 16 | 17 | 18 | org.bukkit.craftbukkit.Main 19 | -- 20 | 2.7.1 21 | 22 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0051-Stop-updating-flowing-block-if-material-has-changed.patch: -------------------------------------------------------------------------------- 1 | From adb1d170502e3b0e44d08399ec31c0633f411c1c Mon Sep 17 00:00:00 2001 2 | From: Iceee 3 | Date: Tue, 30 Jun 2015 19:31:02 -0700 4 | Subject: [PATCH] Stop updating flowing block if material has changed 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java 8 | index ff18f63..ab2e43f 100644 9 | --- a/src/main/java/net/minecraft/server/BlockFlowing.java 10 | +++ b/src/main/java/net/minecraft/server/BlockFlowing.java 11 | @@ -102,6 +102,7 @@ public class BlockFlowing extends BlockFluids { 12 | this.f(world, blockposition, iblockdata); 13 | } 14 | 15 | + if (world.getType(blockposition).getBlock().getMaterial() != material) return; // PaperSpigot - Stop updating flowing block if material has changed 16 | IBlockData iblockdata2 = world.getType(blockposition.down()); 17 | 18 | if (this.h(world, blockposition.down(), iblockdata2)) { 19 | -- 20 | 2.5.2 21 | 22 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0067-Fix-lava-water-some-times-creating-air-instead-of-co.patch: -------------------------------------------------------------------------------- 1 | From 7a75bfc6005068781daff4e13863ad30ed28a60f Mon Sep 17 00:00:00 2001 2 | From: Iceee 3 | Date: Tue, 4 Aug 2015 18:15:05 -0700 4 | Subject: [PATCH] Fix lava/water some times creating air instead of cobblestone 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java 8 | index b610450..db73f5d 100644 9 | --- a/src/main/java/net/minecraft/server/BlockFluids.java 10 | +++ b/src/main/java/net/minecraft/server/BlockFluids.java 11 | @@ -154,7 +154,7 @@ public abstract class BlockFluids extends Block { 12 | return true; 13 | } 14 | 15 | - if (integer.intValue() <= 4) { 16 | + if (integer.intValue() > 0) { // PaperSpigot 17 | world.setTypeUpdate(blockposition, Blocks.COBBLESTONE.getBlockData()); 18 | this.fizz(world, blockposition); 19 | return true; 20 | -- 21 | 2.5.2 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0071-Don-t-damage-already-dead-ArmorStands.patch: -------------------------------------------------------------------------------- 1 | From e9deaf4147f5d5cff346d3af8e68a91e67682322 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Sun, 15 Nov 2015 19:35:31 -0600 4 | Subject: [PATCH] Don't damage already dead ArmorStands 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java 8 | index cd57d69..2ea4a5f 100644 9 | --- a/src/main/java/net/minecraft/server/EntityArmorStand.java 10 | +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java 11 | @@ -382,9 +382,9 @@ public class EntityArmorStand extends EntityLiving { 12 | return false; 13 | } 14 | // CraftBukkit end 15 | - if (this.world.isClientSide) { 16 | + if (this.world.isClientSide || this.dead) { 17 | return false; 18 | - } else if (DamageSource.OUT_OF_WORLD.equals(damagesource)) { 19 | + } else if (DamageSource.OUT_OF_WORLD.equals(damagesource)) { // PaperSpigot 20 | this.die(); 21 | return false; 22 | } else if (!this.isInvulnerable(damagesource) && !this.h && !this.s()) { 23 | -- 24 | 2.6.3 25 | 26 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0072-Bump-thread-count-for-chunk-loading.patch: -------------------------------------------------------------------------------- 1 | From c128310e73948cd22b1912eff4f5fc234427a681 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Sun, 15 Nov 2015 19:36:37 -0600 4 | Subject: [PATCH] Bump thread count for chunk loading 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java 8 | index e4fd9bc..69e5da4 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java 11 | @@ -7,7 +7,7 @@ import net.minecraft.server.World; 12 | import org.bukkit.craftbukkit.util.AsynchronousExecutor; 13 | 14 | public class ChunkIOExecutor { 15 | - static final int BASE_THREADS = 1; 16 | + static final int BASE_THREADS = 2; // PaperSpigot - Bumped value 17 | static final int PLAYERS_PER_THREAD = 50; 18 | 19 | private static final AsynchronousExecutor instance = new AsynchronousExecutor(new ChunkIOProvider(), BASE_THREADS); 20 | -- 21 | 2.6.3 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0074-Don-t-create-a-chunk-just-to-unload-it.patch: -------------------------------------------------------------------------------- 1 | From 97ec86b24834b3e21c8a76022f31964f3befdb7f Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Sun, 15 Nov 2015 19:46:07 -0600 4 | Subject: [PATCH] Don't create a chunk just to unload it 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 8 | index c15a0ba..72c0b17 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 11 | @@ -201,7 +201,12 @@ public class CraftWorld implements World { 12 | return false; 13 | } 14 | 15 | - net.minecraft.server.Chunk chunk = world.chunkProviderServer.getOrCreateChunk(x, z); 16 | + net.minecraft.server.Chunk chunk = world.chunkProviderServer.getChunkIfLoaded(x, z); 17 | + // PaperSpigot start - Don't create a chunk just to unload it 18 | + if (chunk == null) { 19 | + return false; 20 | + } 21 | + // PaperSpigot end 22 | if (chunk.mustSave) { // If chunk had previously been queued to save, must do save to avoid loss of that data 23 | save = true; 24 | } 25 | -- 26 | 2.6.3 27 | 28 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0077-Process-Entity-Chunk-Registration-on-Teleport.patch: -------------------------------------------------------------------------------- 1 | From d847896561ec7e88530d2561b353c5d181349115 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Mon, 4 Jan 2016 00:16:08 -0600 4 | Subject: [PATCH] Process Entity Chunk Registration on Teleport 5 | 6 | Fixes many issues with entities not being properly "switched" to their new chunk on teleport 7 | 8 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 9 | index efbf1a8..5df3476 100644 10 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 11 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 12 | @@ -243,6 +243,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { 13 | // entity.world = ((CraftWorld) location.getWorld()).getHandle(); 14 | // Spigot end 15 | entity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); 16 | + entity.world.entityJoinedWorld(entity, false); // PaperSpigot - Fix issues with entities not being switched to their new chunk 17 | // entity.setLocation() throws no event, and so cannot be cancelled 18 | return true; 19 | } 20 | -- 21 | 2.7.0.windows.2 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0084-Remove-completely-invalid-Redstone-event-for-Netherr.patch: -------------------------------------------------------------------------------- 1 | From c01d3012a7608566bf361ca4392cb8c0085ea248 Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Fri, 29 Jan 2016 03:39:09 -0600 4 | Subject: [PATCH] Remove completely invalid Redstone event for Netherrack 5 | 6 | Was added years ago to special case 1 specific plugins needs 7 | at that time, and is now causing heavy redstone lag in the 8 | nether. 9 | 10 | diff --git a/src/main/java/net/minecraft/server/BlockBloodStone.java b/src/main/java/net/minecraft/server/BlockBloodStone.java 11 | index 7daf006..0158497 100644 12 | --- a/src/main/java/net/minecraft/server/BlockBloodStone.java 13 | +++ b/src/main/java/net/minecraft/server/BlockBloodStone.java 14 | @@ -14,8 +14,8 @@ public class BlockBloodStone extends Block { 15 | } 16 | 17 | // CraftBukkit start 18 | - @Override 19 | - public void doPhysics(World world, BlockPosition position, IBlockData iblockdata, Block block) { 20 | + //@Override // PaperSpigot - Remove completely invalid Redstone event for Netherrack 21 | + public void doPhysics_nvmplsdont(World world, BlockPosition position, IBlockData iblockdata, Block block) { 22 | if (block != null && block.isPowerSource()) { 23 | org.bukkit.block.Block bl = world.getWorld().getBlockAt(position.getX(), position.getY(), position.getZ()); 24 | int power = bl.getBlockPower(); 25 | -- 26 | 2.7.0.windows.2 27 | 28 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0088-Optimize-getBlockData.patch: -------------------------------------------------------------------------------- 1 | From 114866a0d3665b3f45a5e3e5b95d9ba34ec895fa Mon Sep 17 00:00:00 2001 2 | From: Aikar 3 | Date: Sat, 13 Feb 2016 19:28:50 -0600 4 | Subject: [PATCH] Optimize getBlockData 5 | 6 | Hot method, so reduce # of instructions for the method. 7 | 8 | diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java 9 | index 7efacfa..c636da3 100644 10 | --- a/src/main/java/net/minecraft/server/Chunk.java 11 | +++ b/src/main/java/net/minecraft/server/Chunk.java 12 | @@ -489,7 +489,18 @@ public class Chunk { 13 | } 14 | } 15 | 16 | + // PaperSpigot start - Optimize getBlockData 17 | public IBlockData getBlockData(final BlockPosition blockposition) { 18 | + if (blockposition.getY() >= 0 && blockposition.getY() >> 4 < this.sections.length) { 19 | + ChunkSection chunksection = this.sections[blockposition.getY() >> 4]; 20 | + if (chunksection != null) { 21 | + return chunksection.getType(blockposition.getX() & 15, blockposition.getY() & 15, blockposition.getZ() & 15); 22 | + } 23 | + } 24 | + return Blocks.AIR.getBlockData(); 25 | + } 26 | + public IBlockData getBlockDataSlow(final BlockPosition blockposition) { 27 | + // PaperSpigot end 28 | if (this.world.G() == WorldType.DEBUG_ALL_BLOCK_STATES) { 29 | IBlockData iblockdata = null; 30 | 31 | -- 32 | 2.7.1 33 | 34 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0090-Expose-server-CommandMap.patch: -------------------------------------------------------------------------------- 1 | From db26b15a3200ab4d0306f0879bb88887938493df Mon Sep 17 00:00:00 2001 2 | From: kashike 3 | Date: Mon, 15 Feb 2016 07:11:28 -0800 4 | Subject: [PATCH] Expose server CommandMap 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 8 | index 642880e..7b8fdc3 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 11 | @@ -1558,6 +1558,7 @@ public final class CraftServer implements Server { 12 | return helpMap; 13 | } 14 | 15 | + @Override // Paper - add override 16 | public SimpleCommandMap getCommandMap() { 17 | return commandMap; 18 | } 19 | -- 20 | 2.7.0.rc0.20.g4b9ab0e 21 | 22 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0092-Be-a-bit-more-informative-in-maxHealth-exception.patch: -------------------------------------------------------------------------------- 1 | From b2ef1030ddd6d746537b351980967f188a8dd582 Mon Sep 17 00:00:00 2001 2 | From: kashike 3 | Date: Tue, 16 Feb 2016 13:36:04 -0800 4 | Subject: [PATCH] Be a bit more informative in maxHealth exception 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java 8 | index 5317cff..3e3a048 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java 11 | @@ -80,7 +80,9 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { 12 | 13 | public void setHealth(double health) { 14 | if ((health < 0) || (health > getMaxHealth())) { 15 | - throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth()); 16 | + throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth() + ", but was " + health 17 | + + ". (attribute base value: " + this.getHandle().getAttributeInstance(GenericAttributes.maxHealth).b() 18 | + + (this instanceof CraftPlayer ? ", player: " + this.getName() + ')' : ')')); 19 | } 20 | 21 | if (entity instanceof EntityPlayer && health == 0) { 22 | -- 23 | 2.7.0.rc0.20.g4b9ab0e 24 | 25 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0095-Ensure-inv-drag-is-in-bounds.patch: -------------------------------------------------------------------------------- 1 | From df382ed55169c36f68183a98494e24277c2b3553 Mon Sep 17 00:00:00 2001 2 | From: Joseph Hirschfeld 3 | Date: Sat, 20 Feb 2016 02:19:31 -0500 4 | Subject: [PATCH] Ensure inv drag is in bounds 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java 8 | index 3cfaa75..7fc4957 100644 9 | --- a/src/main/java/net/minecraft/server/Container.java 10 | +++ b/src/main/java/net/minecraft/server/Container.java 11 | @@ -138,7 +138,7 @@ public abstract class Container { 12 | this.d(); 13 | } 14 | } else if (this.g == 1) { 15 | - Slot slot = (Slot) this.c.get(i); 16 | + Slot slot = i < this.c.size() ? this.c.get(i) : null; // Paper - Ensure drag in bounds 17 | 18 | if (slot != null && a(slot, playerinventory.getCarried(), true) && slot.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count > this.h.size() && this.b(slot)) { 19 | this.h.add(slot); 20 | -- 21 | 2.7.1 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0103-This-is-KigPaper.patch: -------------------------------------------------------------------------------- 1 | From 888ed141a9c52c13e557a20a1a02875ef7517d78 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 7 Aug 2020 15:12:23 +0200 4 | Subject: [PATCH] This is KigPaper 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 8 | index b400ce04..2ac286bc 100644 9 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 10 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 11 | @@ -1084,7 +1084,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs 12 | } 13 | 14 | public String getServerModName() { 15 | - return "PaperSpigot"; // PaperSpigot - PaperSpigot > // Spigot - Spigot > // CraftBukkit - cb > vanilla! 16 | + return "KigPaper"; // PaperSpigot - PaperSpigot > // Spigot - Spigot > // CraftBukkit - cb > vanilla! 17 | } 18 | 19 | public CrashReport b(CrashReport crashreport) { 20 | -- 21 | 2.26.2 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0105-Make-the-permission-message-configurable.patch: -------------------------------------------------------------------------------- 1 | From ae8eef04215d823d976f721b29c46f9f56d83967 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 7 Aug 2020 23:45:58 +0200 4 | Subject: [PATCH] Make the permission message configurable 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 8 | index 69485fa69..da68aa20a 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 11 | @@ -1830,4 +1830,11 @@ public final class CraftServer implements Server { 12 | { 13 | return spigot; 14 | } 15 | + 16 | + // KigPaper start 17 | + @Override 18 | + public String getPermissionMessage() { 19 | + return configuration.getString("settings.permission-message", ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error."); 20 | + } 21 | + // KigPaper end 22 | } 23 | -- 24 | 2.26.2 25 | 26 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0107-Disable-world-saving-on-shutdown-if-auto-save-is-dis.patch: -------------------------------------------------------------------------------- 1 | From 4e6e70ad4a4e4dba771757f4d4be42fc5b0e01b0 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 10 Aug 2020 11:43:26 +0200 4 | Subject: [PATCH] Disable world saving on shutdown if auto save is disabled 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 8 | index 2ac286bce..1a52430f8 100644 9 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 10 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 11 | @@ -419,6 +419,9 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs 12 | // CraftBukkit end 13 | 14 | if (worldserver != null) { 15 | + // KigPaper start - disable saving if !autoSave 16 | + if(worldserver.savingDisabled) continue; 17 | + // KigPaper end 18 | if (!flag) { 19 | MinecraftServer.LOGGER.info("Saving chunks for level \'" + worldserver.getWorldData().getName() + "\'/" + worldserver.worldProvider.getName()); 20 | } 21 | -- 22 | 2.26.2 23 | 24 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0108-Fix-CraftPlayer-setFlying-not-working.patch: -------------------------------------------------------------------------------- 1 | From 02eb1a6ccd9cb8430a940d8ba6eb0ef6e23eb38c Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 10 Aug 2020 17:50:02 +0200 4 | Subject: [PATCH] Fix CraftPlayer#setFlying not working 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index d44fc62b9..32eca3bbd 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -1239,7 +1239,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | 13 | @Override 14 | public void setFlying(boolean value) { 15 | - boolean needsUpdate = getHandle().abilities.canFly != value; // PaperSpigot - Only refresh abilities if needed 16 | + boolean needsUpdate = getHandle().abilities.isFlying != value; // PaperSpigot - Only refresh abilities if needed 17 | if (!getAllowFlight() && value) { 18 | throw new IllegalArgumentException("Cannot make player fly if getAllowFlight() is false"); 19 | } 20 | -- 21 | 2.26.2 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0113-Allow-disabling-of-namespaced-commands.patch: -------------------------------------------------------------------------------- 1 | From e4d348e409698aee9c51025668b6f6de857529fb Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 15 Sep 2020 13:54:12 +0200 4 | Subject: [PATCH] Allow disabling of namespaced commands 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 8 | index da68aa20a..5abbec2d5 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 11 | @@ -1836,5 +1836,9 @@ public final class CraftServer implements Server { 12 | public String getPermissionMessage() { 13 | return configuration.getString("settings.permission-message", ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error."); 14 | } 15 | + @Override 16 | + public boolean getAllowNamespaced() { 17 | + return configuration.getBoolean("settings.namespaced-commands", true); 18 | + } 19 | // KigPaper end 20 | } 21 | -- 22 | 2.26.2 23 | 24 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0119-Nickname-tabcomplete-integration.patch: -------------------------------------------------------------------------------- 1 | From d4d38a27b552ee0e9d0a34141381ee7ff93f0887 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 21 Sep 2020 23:54:27 +0200 4 | Subject: [PATCH] Nickname tabcomplete integration 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 8 | index 50f76ecc..21fb4cd0 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 11 | @@ -1632,8 +1632,8 @@ public final class CraftServer implements Server { 12 | PlayerChatTabCompleteEvent event = new PlayerChatTabCompleteEvent(player, message, completions); 13 | String token = event.getLastToken(); 14 | for (Player p : getOnlinePlayers()) { 15 | - if (player.canSee(p) && StringUtil.startsWithIgnoreCase(p.getName(), token)) { 16 | - completions.add(p.getName()); 17 | + if (player.canSee(p) && StringUtil.startsWithIgnoreCase(p.getEffectiveName(), token)) { 18 | + completions.add(p.getEffectiveName()); 19 | } 20 | } 21 | pluginManager.callEvent(event); 22 | -- 23 | 2.26.2 24 | 25 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0120-Player-list-entry-self-update.patch: -------------------------------------------------------------------------------- 1 | From 031b8c7b3c7ab266826f871eaea52ded1204cabb Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 22 Sep 2020 12:27:37 +0200 4 | Subject: [PATCH] Player list entry self update 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 45c3193b..7a33726e 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -302,6 +302,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | } 13 | } 14 | 15 | + @Override 16 | + public void updateSelfPlayerInfo() { 17 | + if(getHandle().playerConnection == null) return; 18 | + getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, getHandle())); 19 | + getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, getHandle())); 20 | + } 21 | + 22 | @Override 23 | public boolean equals(Object obj) { 24 | if (!(obj instanceof OfflinePlayer)) { 25 | -- 26 | 2.26.2 27 | 28 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0121-Nicknames-in-server-ping.patch: -------------------------------------------------------------------------------- 1 | From 11d151c8ba89c100087b8760bdf9da570094e56e Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 22 Sep 2020 13:06:14 +0200 4 | Subject: [PATCH] Nicknames in server ping 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java 8 | index e4bff04a..19eae948 100644 9 | --- a/src/main/java/net/minecraft/server/PacketStatusListener.java 10 | +++ b/src/main/java/net/minecraft/server/PacketStatusListener.java 11 | @@ -103,7 +103,11 @@ public class PacketStatusListener implements PacketStatusInListener { 12 | java.util.List profiles = new java.util.ArrayList(players.length); 13 | for (Object player : players) { 14 | if (player != null) { 15 | - profiles.add(((EntityPlayer) player).getProfile()); 16 | + EntityPlayer ep = (EntityPlayer) player; 17 | + GameProfile profile; 18 | + if(ep.isNicknamed()) profile = new GameProfile(ep.getProfile().getId(), ep.getNickname()); 19 | + else profile = ep.getProfile(); 20 | + profiles.add(profile); 21 | } 22 | } 23 | 24 | -- 25 | 2.26.2 26 | 27 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0123-Knockback-friction-API.patch: -------------------------------------------------------------------------------- 1 | From b8e64059d9f74ecfb58476da0e66810eb28aafa0 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 27 Sep 2020 19:51:13 +0200 4 | Subject: [PATCH] Knockback friction API 5 | 6 | 7 | diff --git a/src/main/java/dev/rocco/kig/paper/impl/velocity/CraftKnockbackValues.java b/src/main/java/dev/rocco/kig/paper/impl/velocity/CraftKnockbackValues.java 8 | index cf0fd297d..735d1a8f9 100644 9 | --- a/src/main/java/dev/rocco/kig/paper/impl/velocity/CraftKnockbackValues.java 10 | +++ b/src/main/java/dev/rocco/kig/paper/impl/velocity/CraftKnockbackValues.java 11 | @@ -83,4 +83,9 @@ public class CraftKnockbackValues implements KnockbackValues { 12 | public void resetSprintingVerticalMultiplier() { 13 | this.sprintingVertical = PaperSpigotConfig.knockbackVerticalSprinting; 14 | } 15 | + 16 | + @Override 17 | + public void setFriction(float friction) { 18 | + this.friction = friction; 19 | + } 20 | } 21 | -- 22 | 2.26.2 23 | 24 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0127-Add-World-getTileEntities.patch: -------------------------------------------------------------------------------- 1 | From 40ce6ece85bf5ce2ba4b2ac2149e72faada1b8af Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 20 Jan 2021 17:28:03 +0100 4 | Subject: [PATCH] Add World getTileEntities 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 8 | index 9d1f779e7..0cbe995ed 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 11 | @@ -349,6 +349,16 @@ public class CraftWorld implements World { 12 | // However, this entity is not at the moment backed by a server entity class so it may be left. 13 | return new CraftItem(world.getServer(), entity); 14 | } 15 | + 16 | + @Override 17 | + public List getTileEntities() { 18 | + List list = new ArrayList(); 19 | + for (TileEntity entity : world.tileEntityList) { 20 | + org.bukkit.block.Block block = world.getWorld().getBlockAt(entity.getPosition().getX(), entity.getPosition().getY(), entity.getPosition().getZ()); 21 | + if(block != null) list.add(block.getState()); 22 | + } 23 | + return list; 24 | + } 25 | // KigPaper end 26 | 27 | private static void randomLocationWithinBlock(Location loc, double xs, double ys, double zs) { 28 | -- 29 | 2.28.0 30 | 31 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0130-Fix-CraftLivingEntity-damage-not-calling-EntityDamag.patch: -------------------------------------------------------------------------------- 1 | From 9226619dcb0c6feb5ed2101dfd8480073838358a Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sat, 30 Jan 2021 18:05:31 +0100 4 | Subject: [PATCH] Fix CraftLivingEntity#damage not calling EntityDamageEvent 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java 8 | index db915033b..da902708b 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java 11 | @@ -532,7 +532,8 @@ public class CraftEventFactory { 12 | } else if (source == DamageSource.FALL) { 13 | cause = DamageCause.FALL; 14 | } else if (source == DamageSource.GENERIC) { 15 | - return new EntityDamageEvent(entity.getBukkitEntity(), null, modifiers, modifierFunctions); 16 | + //return new EntityDamageEvent(entity.getBukkitEntity(), null, modifiers, modifierFunctions); 17 | + cause = DamageCause.CUSTOM; // KigPaper 18 | } 19 | 20 | if (cause != null) { 21 | -- 22 | 2.28.0 23 | 24 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0131-Set-last-attacked-entity-on-projectile-hit.patch: -------------------------------------------------------------------------------- 1 | From bc39862171923b4c0e77a3478feac2e24f245fdb Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 3 Feb 2021 13:46:34 +0100 4 | Subject: [PATCH] Set last attacked entity on projectile hit 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java 8 | index 1f039c57f..61b83390d 100644 9 | --- a/src/main/java/net/minecraft/server/EntityArrow.java 10 | +++ b/src/main/java/net/minecraft/server/EntityArrow.java 11 | @@ -311,7 +311,9 @@ public class EntityArrow extends Entity implements IProjectile { 12 | } 13 | 14 | if (this.shooter != null && movingobjectposition.entity != this.shooter && movingobjectposition.entity instanceof EntityHuman && this.shooter instanceof EntityPlayer) { 15 | - ((EntityPlayer) this.shooter).playerConnection.sendPacket(new PacketPlayOutGameStateChange(6, 0.0F)); 16 | + EntityPlayer shooter = (EntityPlayer) this.shooter; 17 | + shooter.p(movingobjectposition.entity); // KigPaper - set attacked entity (used for wolf pathfinding) 18 | + shooter.playerConnection.sendPacket(new PacketPlayOutGameStateChange(6, 0.0F)); 19 | } 20 | } 21 | 22 | -- 23 | 2.28.0 24 | 25 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0134-Fix-extinguish-event-implementation.patch: -------------------------------------------------------------------------------- 1 | From 3bb81871d338258019a82f7cd3b160a7f6f9de80 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 3 Feb 2021 15:50:35 +0100 4 | Subject: [PATCH] Fix extinguish event implementation 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java 8 | index 0880142f3..85a6a6300 100644 9 | --- a/src/main/java/net/minecraft/server/Entity.java 10 | +++ b/src/main/java/net/minecraft/server/Entity.java 11 | @@ -812,13 +812,18 @@ public abstract class Entity implements ICommandListener { 12 | } 13 | 14 | if (flag2 && this.fireTicks > 0) { 15 | - this.wasOnFire = true; // KigPaper 16 | this.makeSound("random.fizz", 0.7F, 1.6F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); 17 | this.fireTicks = -this.maxFireTicks; 18 | - } else if(this.wasOnFire && this.fireTicks <= 0) { // KigPaper 19 | + } 20 | + 21 | + // KigPaper start 22 | + if(this.fireTicks > 0) { 23 | + this.wasOnFire = true; 24 | + } else if(this.wasOnFire) { // KigPaper 25 | this.wasOnFire = false; 26 | this.world.getServer().getPluginManager().callEvent(new EntityExtinguishEvent(this.getBukkitEntity())); 27 | } 28 | + // KigPaper end 29 | 30 | this.world.methodProfiler.b(); 31 | } 32 | -- 33 | 2.28.0 34 | 35 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0151-Paper-0344-Start-entity-IDs-at-1.patch: -------------------------------------------------------------------------------- 1 | From 0f668090053da4a31542dd1954f0371b93a1fbfb Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 5 Mar 2021 15:20:36 +0100 4 | Subject: [PATCH] Paper-0344 Start entity IDs at 1 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java 8 | index 85a6a6300..e708b3bf0 100644 9 | --- a/src/main/java/net/minecraft/server/Entity.java 10 | +++ b/src/main/java/net/minecraft/server/Entity.java 11 | @@ -45,7 +45,7 @@ public abstract class Entity implements ICommandListener { 12 | // CraftBukikt end 13 | 14 | private static final AxisAlignedBB a = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); 15 | - private static int entityCount; 16 | + private static int entityCount = 1; 17 | private int id; 18 | public double j; 19 | public boolean k; 20 | -- 21 | 2.28.0 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0154-Fix-canFlush-from-0147.patch: -------------------------------------------------------------------------------- 1 | From 8b01575f5a0019f69c6e23bf67348a266cee18c2 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 5 Mar 2021 16:02:56 +0100 4 | Subject: [PATCH] Fix canFlush from 0147 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java 8 | index 8d0a7459d..62d6c504a 100644 9 | --- a/src/main/java/net/minecraft/server/NetworkManager.java 10 | +++ b/src/main/java/net/minecraft/server/NetworkManager.java 11 | @@ -86,7 +86,7 @@ public class NetworkManager extends SimpleChannelInboundHandler { 12 | public void disableAutomaticFlush() { 13 | synchronized (this.flushLock) { 14 | this.flushPacketsStart = this.packetWrites.get(); 15 | - this.canFlush = true; 16 | + this.canFlush = false; 17 | } 18 | } 19 | 20 | -- 21 | 2.28.0 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0158-Add-World-getEntityById-API.patch: -------------------------------------------------------------------------------- 1 | From 3abea05795dd6dfc875de84aa2b603685ee2cffc Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 10 Mar 2021 14:17:01 +0100 4 | Subject: [PATCH] Add World getEntityById API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 8 | index 86e842e9..b850e02a 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 11 | @@ -380,6 +380,12 @@ public class CraftWorld implements World { 12 | } 13 | return list; 14 | } 15 | + 16 | + @Override 17 | + public Entity getEntityById(int id) { 18 | + net.minecraft.server.Entity entity = getHandle().a(id); 19 | + return entity == null ? null : entity.getBukkitEntity(); 20 | + } 21 | // KigPaper end 22 | 23 | private static void randomLocationWithinBlock(Location loc, double xs, double ys, double zs) { 24 | -- 25 | 2.28.0 26 | 27 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0159-Add-LivingEntity-clear-last-attacked-API.patch: -------------------------------------------------------------------------------- 1 | From fe95c6b1310aba87b396e8f2565e63fc772293c8 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 10 Mar 2021 20:21:50 +0100 4 | Subject: [PATCH] Add LivingEntity clear last attacked API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java 8 | index 164f19ed..40585f78 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java 11 | @@ -463,6 +463,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { 12 | return true; 13 | } 14 | 15 | + // KigPaper start 16 | @Override 17 | public void setCanArrowsBeStuck(boolean capability) { 18 | getHandle().setStickArrows(capability); 19 | @@ -474,6 +475,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { 20 | return getHandle().getStickArrows(); 21 | } 22 | 23 | + @Override 24 | + public void clearLastAttacked() { 25 | + getHandle().p(null); 26 | + } 27 | + // KigPaper end 28 | + 29 | @Deprecated 30 | public int _INVALID_getLastDamage() { 31 | return NumberConversions.ceil(getLastDamage()); 32 | -- 33 | 2.28.0 34 | 35 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0164-Allow-teleporting-vehicles-when-PlayerMoveEvent-is-c.patch: -------------------------------------------------------------------------------- 1 | From 265e90c14163fc5ddba30c95f82b516b04161468 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 12 Apr 2021 16:46:05 +0200 4 | Subject: [PATCH] Allow teleporting vehicles when PlayerMoveEvent is cancelled 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 6c3f8ed1f..d83207cb0 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -562,7 +562,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | } 13 | 14 | if (entity.passenger != null) { 15 | - return false; 16 | + // KigPaper - only cancel if not unknown 17 | + // if a PlayerMoveEvent is cancelled using setTo and the player has a passenger, the event won't set the user back. 18 | + if (cause != PlayerTeleportEvent.TeleportCause.UNKNOWN) { 19 | + return false; 20 | + } 21 | } 22 | 23 | // From = Players current Location 24 | -- 25 | 2.28.0 26 | 27 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0170-Kick-after-receiving-invalid-creative-action-packet.patch: -------------------------------------------------------------------------------- 1 | From 9f1b2e0d74673d92afe4a45b7a7e7249190831ca Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 26 Apr 2021 09:50:16 +0200 4 | Subject: [PATCH] Kick after receiving invalid creative action packet 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java 8 | index 87afa4b2a..8f6dfdb40 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerConnection.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerConnection.java 11 | @@ -1882,6 +1882,8 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList 12 | entityitem.j(); 13 | } 14 | } 15 | + } else { 16 | + disconnect("Not in creative mode"); // KigPaper 17 | } 18 | 19 | } 20 | -- 21 | 2.28.0 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0173-Block-place-item-update-fix.patch: -------------------------------------------------------------------------------- 1 | From c48324ea0b47a258e49e8170b5e59f9d2304ade6 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 9 May 2021 18:28:46 +0200 4 | Subject: [PATCH] Block place item update fix 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java 8 | index 72545b297..c38586ac7 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerConnection.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerConnection.java 11 | @@ -793,8 +793,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList 12 | this.player.activeContainer.b(); 13 | this.player.g = false; 14 | // CraftBukkit - TODO CHECK IF NEEDED -- new if structure might not need 'always'. Kept it in for now, but may be able to remove in future 15 | - //if (!ItemStack.matches(this.player.inventory.getItemInHand(), packetplayinblockplace.getItemStack()) || always) { // KigPaper 16 | - if (always) { 17 | + if (!ItemStack.matches(this.player.inventory.getItemInHand(), itemstack) || always) { // KigPaper - use saved itemstack instead of stack from packet 18 | this.sendPacket(new PacketPlayOutSetSlot(this.player.activeContainer.windowId, slot.rawSlotIndex, this.player.inventory.getItemInHand())); 19 | } 20 | } 21 | -- 22 | 2.28.0 23 | 24 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0176-Fix-update-packet-not-being-sent-on-right-click.patch: -------------------------------------------------------------------------------- 1 | From 241ddfe2ebe2bcf4fac3f0a00d248eabebfda051 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 10 May 2021 21:34:04 +0200 4 | Subject: [PATCH] Fix update packet not being sent on right click 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java 8 | index c38586ac7..a7b9e4e71 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerConnection.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerConnection.java 11 | @@ -783,6 +783,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList 12 | if (itemstack != null && itemstack.count == 0) { 13 | this.player.inventory.items[this.player.inventory.itemInHandIndex] = null; 14 | itemstack = null; 15 | + always = true; // KigPaper - send update packet 16 | } 17 | 18 | if (itemstack == null || itemstack.l() == 0) { 19 | -- 20 | 2.28.0 21 | 22 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0179-Don-t-make-PlayerInfoData-static.patch: -------------------------------------------------------------------------------- 1 | From d5ad2c5338950d152fff9455b7ccdef0125105c1 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sat, 15 May 2021 21:14:25 +0200 4 | Subject: [PATCH] Don't make PlayerInfoData static 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPlayerInfo.java b/src/main/java/net/minecraft/server/PacketPlayOutPlayerInfo.java 8 | index 890c4fc66..95308d8ad 100644 9 | --- a/src/main/java/net/minecraft/server/PacketPlayOutPlayerInfo.java 10 | +++ b/src/main/java/net/minecraft/server/PacketPlayOutPlayerInfo.java 11 | @@ -281,7 +281,7 @@ public class PacketPlayOutPlayerInfo implements Packet { 12 | } 13 | } 14 | 15 | - public static class PlayerInfoData { // KigPaper - make static 16 | + public class PlayerInfoData { // Don't make static - Breaks ProtocolLib 17 | 18 | private final int b; 19 | private final WorldSettings.EnumGamemode c; 20 | -- 21 | 2.28.0 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0180-Add-Player-last-activity-API.patch: -------------------------------------------------------------------------------- 1 | From 89ce6784173dc8e660e147433b5735d653acebef Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 23 May 2021 00:25:03 +0200 4 | Subject: [PATCH] Add Player last activity API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 5f9f92739..0f3aa24aa 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -324,6 +324,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | UUID spoofed = getHandle().getNickSpoofedUUID(); 13 | return spoofed == null ? getUniqueId() : spoofed; 14 | } 15 | + 16 | + @Override 17 | + public long getLastActivity() { 18 | + return getHandle().D(); 19 | + } 20 | + 21 | // KigPaper end 22 | 23 | @Override 24 | -- 25 | 2.31.1 26 | 27 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0184-Update-pom-to-new-Paper-repo.patch: -------------------------------------------------------------------------------- 1 | From f8a2fbfe6fae1b401c1886962536c234b9998856 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 7 Jun 2021 23:34:15 +0200 4 | Subject: [PATCH] Update pom to new Paper repo 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 6aaba5027..2be32c45c 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -100,7 +100,7 @@ 12 | 13 | 14 | destroystokyo 15 | - https://ci.destroystokyo.com/plugin/repository/everything/ 16 | + https://papermc.io/repo/repository/maven-public/ 17 | 18 | 19 | 20 | -- 21 | 2.31.1 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0186-Player-register-plugin-channel-API.patch: -------------------------------------------------------------------------------- 1 | From 80c6764704785c703c3034af8b031a031b22fd10 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 11 Jun 2021 23:02:29 +0200 4 | Subject: [PATCH] Player register plugin channel API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 2dc4a4ae2..9cc7c3a48 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -339,6 +339,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | getHandle().playerConnection.disconnect(message == null ? "" : message, reason); 13 | } 14 | 15 | + @Override 16 | + public void registerPluginChannel(String channel) { 17 | + addChannel(channel); 18 | + } 19 | // KigPaper end 20 | 21 | @Override 22 | -- 23 | 2.31.1 24 | 25 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0188-Add-compatibility-to-PlayerConnection.patch: -------------------------------------------------------------------------------- 1 | From 3c53143ad7df221ad06b84a8186d916c6313a9cd Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 20 Jun 2021 00:31:39 +0200 4 | Subject: [PATCH] Add compatibility to PlayerConnection 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java 8 | index cd3c2c6da..99315de8a 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerConnection.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerConnection.java 11 | @@ -161,6 +161,12 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList 12 | return this.networkManager; 13 | } 14 | 15 | + // KigPaper - compatibility 16 | + @Deprecated 17 | + public void disconnect(String reason) { 18 | + this.disconnect(reason, DisconnectReason.KICK_PLUGIN); 19 | + } 20 | + 21 | public void disconnect(String s, DisconnectReason reason) { // KigPaper - add DisconnectReason 22 | // KigPaper - if already disconnecting, do nothing 23 | if(disconnecting) return; 24 | -- 25 | 2.31.1 26 | 27 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0189-Respect-player-visibility-for-certain-sounds.patch: -------------------------------------------------------------------------------- 1 | From 7cfc36919606702df7c019f3d1df4966f78d9e3d Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 20 Jun 2021 10:28:33 +0200 4 | Subject: [PATCH] Respect player visibility for certain sounds 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java 8 | index 4ad6ae143..9c11ce4e7 100644 9 | --- a/src/main/java/net/minecraft/server/World.java 10 | +++ b/src/main/java/net/minecraft/server/World.java 11 | @@ -946,6 +946,13 @@ public abstract class World implements IBlockAccess { 12 | } 13 | 14 | public void makeSound(Entity entity, String s, float f, float f1) { 15 | + // KigPaper start - respect visibility for players 16 | + if (entity instanceof EntityHuman) { 17 | + this.a((EntityHuman) entity, s, f, f1); 18 | + return; 19 | + } 20 | + // KigPaper end 21 | + 22 | for (int i = 0; i < this.u.size(); ++i) { 23 | ((IWorldAccess) this.u.get(i)).a(s, entity.locX, entity.locY, entity.locZ, f, f1); 24 | } 25 | -- 26 | 2.31.1 27 | 28 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0191-Don-t-calculate-initial-light-if-not-requested.patch: -------------------------------------------------------------------------------- 1 | From ba9fab9ed19690486c5db1551dccbab282cb7a2d Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sun, 4 Jul 2021 17:48:09 +0200 4 | Subject: [PATCH] Don't calculate initial light if not requested 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java 8 | index ac9ddda50..fabf96a40 100644 9 | --- a/src/main/java/net/minecraft/server/Chunk.java 10 | +++ b/src/main/java/net/minecraft/server/Chunk.java 11 | @@ -611,7 +611,7 @@ public class Chunk { 12 | if (chunksection.b(i, j & 15, k) != block) { 13 | return null; 14 | } else { 15 | - if (flag) { 16 | + if (updateLight && flag) { 17 | this.initLighting(); 18 | } else if (updateLight) { // KigPaper - conditional light update 19 | int j1 = block.p(); 20 | -- 21 | 2.31.1 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0192-Fix-more-EnchantmentManager-leaks.patch: -------------------------------------------------------------------------------- 1 | From 0300166b65c6a16abbc81b3be8a47aba80c3b21f Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 7 Jul 2021 17:37:36 +0200 4 | Subject: [PATCH] Fix more EnchantmentManager leaks 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java 8 | index 9fc38c1d8..63cf45886 100644 9 | --- a/src/main/java/net/minecraft/server/EnchantmentManager.java 10 | +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java 11 | @@ -147,7 +147,9 @@ public class EnchantmentManager { 12 | } else if (EnchantmentManager.b.a < 0) { 13 | EnchantmentManager.b.a = 0; 14 | } 15 | - 16 | + // KigPaper start 17 | + EnchantmentManager.b.b = null; 18 | + // KigPaper end 19 | return (EnchantmentManager.b.a + 1 >> 1) + EnchantmentManager.a.nextInt((EnchantmentManager.b.a >> 1) + 1); 20 | } 21 | 22 | @@ -185,8 +187,8 @@ public class EnchantmentManager { 23 | a((EnchantmentManager.EnchantmentModifier) EnchantmentManager.e, entityliving.bA()); 24 | } 25 | // KigPaper start 26 | - EnchantmentManager.d.a = null; 27 | - EnchantmentManager.d.b = null; 28 | + EnchantmentManager.e.a = null; 29 | + EnchantmentManager.e.b = null; 30 | // KigPaper end 31 | } 32 | 33 | -- 34 | 2.31.1 35 | 36 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0195-Add-Player-invulnerability-API.patch: -------------------------------------------------------------------------------- 1 | From c37cef7c930e249f8a0bdc44ed789cb648ba880d Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Thu, 5 Aug 2021 06:39:40 +0200 4 | Subject: [PATCH] Add Player invulnerability API 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 9cc7c3a4..45b64e65 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -343,6 +343,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | public void registerPluginChannel(String channel) { 13 | addChannel(channel); 14 | } 15 | + 16 | + @Override 17 | + public void setInvulnerable(boolean invulnerable) { 18 | + boolean changed = invulnerable != getHandle().abilities.isInvulnerable; 19 | + getHandle().abilities.isInvulnerable = invulnerable; 20 | + if (changed) getHandle().updateAbilities(); 21 | + } 22 | + 23 | + @Override 24 | + public boolean isInvulnerable() { 25 | + return getHandle().abilities.isInvulnerable; 26 | + } 27 | // KigPaper end 28 | 29 | @Override 30 | -- 31 | 2.31.1 32 | 33 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0205-Remove-sink-players-on-death.patch: -------------------------------------------------------------------------------- 1 | From a4b9d4aa75e1490af559757b092b5440f08d9bcc Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 8 Sep 2021 18:35:56 +0200 4 | Subject: [PATCH] Remove sink players on death 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java 8 | index e6f55af10..4845fda20 100644 9 | --- a/src/main/java/net/minecraft/server/World.java 10 | +++ b/src/main/java/net/minecraft/server/World.java 11 | @@ -4,6 +4,7 @@ import com.google.common.base.Predicate; 12 | import com.google.common.collect.Lists; 13 | import com.google.common.collect.Maps; 14 | import com.google.common.collect.Sets; 15 | +import dev.rocco.kig.paper.impl.cheetah.SinkEntityPlayer; 16 | import org.bukkit.Bukkit; 17 | import org.bukkit.block.BlockState; 18 | import org.bukkit.craftbukkit.CraftServer; 19 | @@ -1439,6 +1440,12 @@ public abstract class World implements IBlockAccess { 20 | } 21 | // Paper end 22 | 23 | + // KigPaper start 24 | + if (this instanceof WorldServer) { 25 | + ((WorldServer) this).sinkPlayers.entrySet().removeIf(e -> e.getValue().dead); 26 | + } 27 | + // KigPaper end 28 | + 29 | this.g.clear(); 30 | timings.entityRemoval.stopTiming(); // Spigot 31 | this.methodProfiler.c("regular"); 32 | -- 33 | 2.31.1 34 | 35 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0209-accurate-collisions-Switch-to-Deque.patch: -------------------------------------------------------------------------------- 1 | From 2b2b98a9a5eb653094d7f1dc58070316cab71623 Mon Sep 17 00:00:00 2001 2 | From: Archer 3 | Date: Mon, 13 Sep 2021 21:27:25 +0200 4 | Subject: [PATCH] accurate-collisions: Switch to Deque 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java 8 | index 941d79d11..1e1536b07 100644 9 | --- a/src/main/java/net/minecraft/server/Entity.java 10 | +++ b/src/main/java/net/minecraft/server/Entity.java 11 | @@ -850,7 +850,7 @@ public abstract class Entity implements ICommandListener { 12 | // KigPaper - Start 13 | double motYAccount = PaperSpigotConfig.accurateBlockCollisions ? this.motY : 0.0D; // KigPaper - account for falling speed 14 | boolean shouldCollideWithWeb = true, didCollide = false; 15 | - Stack> websQueue = new Stack<>(); 16 | + Deque> websQueue = new ArrayDeque<>(); 17 | // KigPaper - End 18 | BlockPosition blockposition = new BlockPosition(this.getBoundingBox().a + 0.001D, this.getBoundingBox().b + 0.001D + motYAccount, this.getBoundingBox().c + 0.001D); 19 | BlockPosition blockposition1 = new BlockPosition(this.getBoundingBox().d - 0.001D, this.getBoundingBox().e - 0.001D, this.getBoundingBox().f - 0.001D); 20 | -- 21 | 2.33.0 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0218-Update-entity-head-yaw-on-teleport.patch: -------------------------------------------------------------------------------- 1 | From d385fe3d41c1acf8db3ded5fc7e53d9c32bc4567 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 23 Nov 2021 12:50:36 +0100 4 | Subject: [PATCH] Update entity head yaw on teleport 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 8 | index 5224d2f5d..3a0bb483b 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java 11 | @@ -253,6 +253,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { 12 | // entity.world = ((CraftWorld) location.getWorld()).getHandle(); 13 | // Spigot end 14 | entity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); 15 | + entity.f(location.getYaw()); // KigPaper - update head yaw to keep consistency with /tp 16 | entity.world.entityJoinedWorld(entity, false); // PaperSpigot - Fix issues with entities not being switched to their new chunk 17 | // entity.setLocation() throws no event, and so cannot be cancelled 18 | return true; 19 | -- 20 | 2.33.1 21 | 22 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0219-Fix-custom-item-despawn-rate-in-unloaded-chunks.patch: -------------------------------------------------------------------------------- 1 | From 37b914fc65a6207d019e047a94febd4c90754286 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 23 Nov 2021 18:21:43 +0100 4 | Subject: [PATCH] Fix custom item despawn rate in unloaded chunks 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java 8 | index f0ab9458d..aeba5b978 100644 9 | --- a/src/main/java/net/minecraft/server/EntityItem.java 10 | +++ b/src/main/java/net/minecraft/server/EntityItem.java 11 | @@ -163,7 +163,7 @@ public class EntityItem extends Entity { 12 | this.lastTick = MinecraftServer.currentTick; 13 | // CraftBukkit end 14 | 15 | - if (!this.world.isClientSide && this.age >= world.spigotConfig.itemDespawnRate) { // Spigot 16 | + if (!this.world.isClientSide && this.age >= getDespawnRate()) { // Spigot 17 | // CraftBukkit start - fire ItemDespawnEvent 18 | if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { 19 | this.age = 0; 20 | -- 21 | 2.33.1 22 | 23 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0223-Update-log4j-to-2.16.0.patch: -------------------------------------------------------------------------------- 1 | From 63eba9ddbf8895c70c8c1bbe0a51e71ef9936485 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 17 Dec 2021 14:02:33 +0100 4 | Subject: [PATCH] Update log4j to 2.16.0 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 6d099739b..cd117e3e3 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -113,12 +113,12 @@ 12 | 13 | org.apache.logging.log4j 14 | log4j-api 15 | - 2.15.0 16 | + 2.16.0 17 | 18 | 19 | org.apache.logging.log4j 20 | log4j-core 21 | - 2.15.0 22 | + 2.16.0 23 | 24 | 25 | 26 | -- 27 | 2.33.1 28 | 29 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0224-deps-update-log4j-to-2.17.0.patch: -------------------------------------------------------------------------------- 1 | From 7c07e00718c7a4be7c7533ecb34633537f76771b Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 28 Dec 2021 14:12:27 +0100 4 | Subject: [PATCH] deps: update log4j to 2.17.0 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index cd117e3e3..4ce515446 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -113,12 +113,12 @@ 12 | 13 | org.apache.logging.log4j 14 | log4j-api 15 | - 2.16.0 16 | + 2.17.0 17 | 18 | 19 | org.apache.logging.log4j 20 | log4j-core 21 | - 2.16.0 22 | + 2.17.0 23 | 24 | 25 | 26 | -- 27 | 2.33.1 28 | 29 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0226-Update-log4j-to-2.17.1.patch: -------------------------------------------------------------------------------- 1 | From 016223829e86e57329f57d513df9afe48c89c620 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Sat, 8 Jan 2022 18:14:32 +0100 4 | Subject: [PATCH] Update log4j to 2.17.1 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 4ce515446..53909e286 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -113,12 +113,12 @@ 12 | 13 | org.apache.logging.log4j 14 | log4j-api 15 | - 2.17.0 16 | + 2.17.1 17 | 18 | 19 | org.apache.logging.log4j 20 | log4j-core 21 | - 2.17.0 22 | + 2.17.1 23 | 24 | 25 | 26 | -- 27 | 2.33.1 28 | 29 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0229-Make-ChunkCoordComparator-package-private.patch: -------------------------------------------------------------------------------- 1 | From 09454c8ce88609b32e5ae4e0f5b4da6074c3e477 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Thu, 3 Feb 2022 17:33:24 +0100 4 | Subject: [PATCH] Make ChunkCoordComparator package-private 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java 8 | index 285de1b14..aeb47e061 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java 11 | @@ -558,7 +558,8 @@ public class PlayerChunkMap { 12 | } 13 | 14 | // CraftBukkit start - Sorter to load nearby chunks first 15 | - private static class ChunkCoordComparator implements java.util.Comparator { 16 | + // KigPaper - private -> package-private 17 | + static class ChunkCoordComparator implements java.util.Comparator { 18 | private int x; 19 | private int z; 20 | 21 | @@ -567,6 +568,13 @@ public class PlayerChunkMap { 22 | z = (int) entityplayer.locZ >> 4; 23 | } 24 | 25 | + // KigPaper start 26 | + public ChunkCoordComparator(int x, int z) { 27 | + this.x = x; 28 | + this.z = z; 29 | + } 30 | + // KigPaper end 31 | + 32 | public int compare(ChunkCoordIntPair a, ChunkCoordIntPair b) { 33 | if (a.equals(b)) { 34 | return 0; 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0236-Prevent-xp-orbs-from-following-intangible-players.patch: -------------------------------------------------------------------------------- 1 | From d5b9f1d8602a93c120033d1b1957230c73fe973a Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 4 Oct 2022 22:19:56 +0200 4 | Subject: [PATCH] Prevent xp orbs from following intangible players 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java 8 | index 4845fda2..4bf3c09e 100644 9 | --- a/src/main/java/net/minecraft/server/World.java 10 | +++ b/src/main/java/net/minecraft/server/World.java 11 | @@ -2896,7 +2896,8 @@ public abstract class World implements IBlockAccess { 12 | for (int i = 0; i < this.players.size(); ++i) { 13 | EntityHuman entityhuman1 = (EntityHuman) this.players.get(i); 14 | // CraftBukkit start - Fixed an NPE 15 | - if (entityhuman1 == null || entityhuman1.dead) { 16 | + if (!(entityhuman1 instanceof EntityPlayer) || entityhuman1.dead 17 | + || !((EntityPlayer) entityhuman1).collidesWithEntities) { // KigPaper - add entity collision check 18 | continue; 19 | } 20 | // CraftBukkit end 21 | -- 22 | 2.37.2 23 | 24 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0240-Update-source-target-JRE-to-17.patch: -------------------------------------------------------------------------------- 1 | From daec499e31e88540f117d3b946e920f2aca6e32e Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 22 Sep 2023 16:43:08 +0200 4 | Subject: [PATCH] Update source/target JRE to 17 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index a7474d133..18c855f16 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -18,8 +18,8 @@ 12 | git-Bukkit- 13 | 14 | 15 | - 1.8 16 | - 1.8 17 | + 18 | + 17 19 | 20 | 21 | 22 | @@ -280,7 +280,7 @@ 23 | org.apache.maven.plugins 24 | maven-compiler-plugin 25 | 26 | - 3.1 27 | + 3.11.0 28 | 29 | 30 | eclipse 31 | -- 32 | 2.41.0 33 | 34 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0241-Don-t-use-the-Eclipse-compiler-for-J17.patch: -------------------------------------------------------------------------------- 1 | From 385ddcfeff232beb01c7695eda2725bfed5774bb Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Fri, 22 Sep 2023 17:31:58 +0200 4 | Subject: [PATCH] Don't use the Eclipse compiler for J17 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index 18c855f16..cb6f3e3d1 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -217,7 +217,7 @@ 12 | 13 | org.apache.maven.plugins 14 | maven-shade-plugin 15 | - 3.2.4 16 | + 3.5.0 17 | 18 | 19 | package 20 | @@ -279,12 +279,8 @@ 21 | 22 | org.apache.maven.plugins 23 | maven-compiler-plugin 24 | - 25 | 3.11.0 26 | 27 | - 28 | - eclipse 29 | - 30 | true 31 | 32 | 33 | -- 34 | 2.41.0 35 | 36 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0242-Add-CraftMapView-getHandle.patch: -------------------------------------------------------------------------------- 1 | From e0840c64e8658a5119a27e42e072201fbca8d885 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 3 Oct 2023 17:30:40 +0200 4 | Subject: [PATCH] Add CraftMapView#getHandle 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java 8 | index 767e8b70c..3bd6d24fa 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapView.java 11 | @@ -172,4 +172,9 @@ public final class CraftMapView implements MapView { 12 | renderCache.clear(); 13 | } 14 | // KigPaper end 15 | + 16 | + // KigPaper 17 | + public WorldMap getHandle() { 18 | + return worldMap; 19 | + } 20 | } 21 | -- 22 | 2.41.0 23 | 24 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0247-Send-ping-and-game-mode-updates-to-sink-players.patch: -------------------------------------------------------------------------------- 1 | From eeb3078809c87cf793e1146bd815936a4e88f024 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Wed, 21 Aug 2024 05:38:07 +0200 4 | Subject: [PATCH] Send ping and game mode updates to sink players 5 | 6 | 7 | diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java 8 | index 762f9d24b..fb35d62db 100644 9 | --- a/src/main/java/net/minecraft/server/PlayerList.java 10 | +++ b/src/main/java/net/minecraft/server/PlayerList.java 11 | @@ -929,6 +929,12 @@ public abstract class PlayerList { 12 | } 13 | recipient.playerConnection.sendPacket(packet.cloneFor(recipient)); 14 | } 15 | + // Sink players 16 | + for (WorldServer world : this.server.worlds) { 17 | + for (EntityPlayer player : world.sinkPlayers.values()) { 18 | + player.playerConnection.sendPacket(packet.cloneFor(player)); 19 | + } 20 | + } 21 | } 22 | // KigPaper end 23 | 24 | -- 25 | 2.45.2 26 | 27 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0248-Send-player-list-name-to-sink-players.patch: -------------------------------------------------------------------------------- 1 | From 4c43597f381f31e07c3987930080088847bd4900 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Mon, 23 Sep 2024 00:46:10 +0200 4 | Subject: [PATCH] Send player list name to sink players 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 8 | index 582d7aa64..81b35e905 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java 11 | @@ -285,6 +285,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { 12 | player.playerConnection.sendPacket(packet.cloneFor(player)); // KigPaper - add cloneFor 13 | } 14 | } 15 | + // KigPaper - sink players 16 | + if (getHandle().world instanceof WorldServer) { 17 | + for (EntityPlayer player : ((WorldServer) getHandle().world).sinkPlayers.values()) { 18 | + player.playerConnection.sendPacket(packet.cloneFor(player)); 19 | + } 20 | + } 21 | } 22 | 23 | // KigPaper start 24 | -- 25 | 2.45.2 26 | 27 | -------------------------------------------------------------------------------- /Spigot-Server-Patches/0249-Send-CraftWorld-effects-to-sink-players.patch: -------------------------------------------------------------------------------- 1 | From c1e91f9d889df8933e22f0e488591dfb34e45e77 Mon Sep 17 00:00:00 2001 2 | From: RoccoDev 3 | Date: Tue, 8 Oct 2024 00:15:34 +0200 4 | Subject: [PATCH] Send CraftWorld effects to sink players 5 | 6 | 7 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 8 | index 0f218a04..76e8e593 100644 9 | --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 10 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java 11 | @@ -1543,6 +1543,11 @@ public class CraftWorld implements World { 12 | ( (CraftPlayer) player ).getHandle().playerConnection.sendPacket( packet ); 13 | } 14 | } 15 | + // KigPaper start - sink players 16 | + for (EntityPlayer player : getHandle().sinkPlayers.values()) { 17 | + player.playerConnection.sendPacket(packet); 18 | + } 19 | + // KigPaper end 20 | } 21 | 22 | @Override 23 | -- 24 | 2.46.1 25 | 26 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git submodule update --init && ./remap.sh && ./decompile.sh && ./init.sh && ./newApplyPatches.sh && mvn clean install 4 | -------------------------------------------------------------------------------- /ci_settings.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | gitlab-maven 6 | 7 | 8 | 9 | Job-Token 10 | ${env.CI_JOB_TOKEN} 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /decompile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PS1="$" 4 | basedir=`pwd` 5 | workdir=$basedir/work 6 | minecraftversion=$(cat BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) 7 | decompiledir=$workdir/$minecraftversion 8 | classdir=$decompiledir/classes 9 | 10 | echo "Extracting NMS classes..." 11 | if [ ! -d "$classdir" ]; then 12 | mkdir -p "$classdir" 13 | cd "$classdir" 14 | jar xf "$decompiledir/$minecraftversion-mapped.jar" net/minecraft/server 15 | if [ "$?" != "0" ]; then 16 | cd "$basedir" 17 | echo "Failed to extract NMS classes." 18 | exit 1 19 | fi 20 | fi 21 | 22 | echo "Decompiling classes..." 23 | if [ ! -d "$decompiledir/net/minecraft/server" ]; then 24 | cd "$basedir" 25 | java -jar BuildData/bin/fernflower.jar -dgs=1 -hdc=0 -rbr=0 -asc=1 -udv=0 "$classdir" "$decompiledir" 26 | if [ "$?" != "0" ]; then 27 | echo "Failed to decompile classes." 28 | exit 1 29 | fi 30 | fi 31 | -------------------------------------------------------------------------------- /docker/build.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM maven:3.9.9-eclipse-temurin-21-alpine 2 | WORKDIR build 3 | COPY . . 4 | RUN apk add --no-cache --update git bash patch zip && git config --global user.name "Kig Docker" && git config --global user.email "docker@playkig.com" && bash build.sh -------------------------------------------------------------------------------- /docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd /home/container 3 | 4 | MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')` 5 | echo ":/home/container$ ${MODIFIED_STARTUP}" 6 | 7 | ${MODIFIED_STARTUP} 8 | -------------------------------------------------------------------------------- /docker/j9.Dockerfile: -------------------------------------------------------------------------------- 1 | ARG git_ref 2 | FROM --platform=linux/amd64 ghcr.io/projectkig/kigpaper/kig-paper-builder:${git_ref} AS builder 3 | 4 | FROM ibm-semeru-runtimes:open-21-jre 5 | RUN apt-get update && apt-get install -y curl ca-certificates openssl git tar bash sqlite3 fontconfig \ 6 | && adduser --disabled-password --home /home/container container && mkdir -p /home/server/plugins \ 7 | && chown -R container:container /home/server && echo eula=true > eula.txt \ 8 | && rm -rf /var/lib/apt/lists/* 9 | USER container 10 | ARG git_ref 11 | ENV USER=container HOME=/home/container KIG_PLATFORM=j9 12 | WORKDIR /home/container 13 | COPY --from=builder ./build/PaperSpigot-Server/target/paperspigot*.jar /home/server/server.jar 14 | COPY ./docker/entrypoint.sh /entrypoint.sh 15 | CMD ["/bin/bash", "/entrypoint.sh"] -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PS1="$" 4 | basedir=`pwd` 5 | workdir=$basedir/work 6 | minecraftversion=$(cat BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4) 7 | decompiledir=$workdir/$minecraftversion 8 | nms=$decompiledir/net/minecraft/server 9 | cb=src/main/java/net/minecraft/server 10 | 11 | patch=$(which patch 2>/dev/null) 12 | if [ "x$patch" == "x" ]; then 13 | patch=$basedir/hctap.exe 14 | fi 15 | 16 | echo "Applying CraftBukkit patches to NMS..." 17 | cd "$basedir/CraftBukkit" 18 | git checkout -B patched HEAD >/dev/null 2>&1 19 | rm -rf $cb 20 | mkdir -p $cb 21 | for file in nms-patches/* "$basedir"/nms-patches/* 22 | do 23 | patchFile="$file" 24 | file="$(echo "$file" | rev | cut -d/ -f1 | rev | cut -d. -f1).java" 25 | 26 | echo "Patching $file < $patchFile" 27 | sed -i 's/\r//' "$nms/$file" > /dev/null 28 | 29 | cp "$nms/$file" "$cb/$file" 30 | "$patch" -s -d src/main/java/ "net/minecraft/server/$file" < "$patchFile" 31 | done 32 | 33 | git add src >/dev/null 2>&1 34 | git commit -m "CraftBukkit $ $(date)" >/dev/null 2>&1 35 | git checkout -f HEAD^ >/dev/null 2>&1 36 | -------------------------------------------------------------------------------- /newApplyPatches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PS1="$" 4 | basedir=`pwd` 5 | echo "Rebuilding Forked projects.... " 6 | 7 | function applyPatch { 8 | what=$1 9 | target=$2 10 | branch=$3 11 | cd "$basedir/$what" 12 | git fetch 13 | git branch -f upstream "$branch" >/dev/null 14 | 15 | cd "$basedir" 16 | if [ ! -d "$basedir/$target" ]; then 17 | git clone "$what" "$target" 18 | fi 19 | cd "$basedir/$target" 20 | echo "Resetting $target to $what..." 21 | git remote add -f upstream ../$what >/dev/null 2>&1 22 | git checkout master >/dev/null 2>&1 23 | git fetch upstream >/dev/null 2>&1 24 | git reset --hard upstream/upstream 25 | echo " Applying patches to $target..." 26 | git am --abort >/dev/null 2>&1 27 | git am --3way --ignore-whitespace "$basedir/${what}-Patches/"*.patch 28 | if [ "$?" != "0" ]; then 29 | echo " Something did not apply cleanly to $target." 30 | echo " Please review above details and finish the apply then" 31 | echo " save the changes with rebuildPatches.sh" 32 | exit 1 33 | else 34 | echo " Patches applied cleanly to $target" 35 | fi 36 | } 37 | 38 | applyPatch Bukkit Spigot-API HEAD && applyPatch CraftBukkit Spigot-Server patched 39 | applyPatch Spigot-API PaperSpigot-API HEAD && applyPatch Spigot-Server PaperSpigot-Server HEAD -------------------------------------------------------------------------------- /newRebuildPatches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PS1="$" 4 | basedir=`pwd` 5 | echo "Rebuilding patch files from current fork state..." 6 | git config core.safecrlf false 7 | 8 | function cleanupPatches { 9 | cd "$1" 10 | for patch in *.patch; do 11 | echo "$patch" 12 | gitver=$(tail -n 2 $patch | grep -ve "^$" | tail -n 1) 13 | diffs=$(git diff --staged $patch | grep -E "^(\+|\-)" | grep -Ev "(From [a-z0-9]{32,}|\-\-\- a|\+\+\+ b|.index)") 14 | 15 | testver=$(echo "$diffs" | tail -n 2 | grep -ve "^$" | tail -n 1 | grep "$gitver") 16 | if [ "x$testver" != "x" ]; then 17 | diffs=$(echo "$diffs" | sed 'N;$!P;$!D;$d') 18 | fi 19 | 20 | if [ "x$diffs" == "x" ] ; then 21 | git reset HEAD $patch >/dev/null 22 | git checkout -- $patch >/dev/null 23 | fi 24 | done 25 | } 26 | 27 | function savePatches { 28 | what=$1 29 | target=$2 30 | echo "Formatting patches for $what..." 31 | cd "$basedir/$target" 32 | git format-patch --no-stat -N -o "$basedir/${what}-Patches/" upstream/upstream >/dev/null 33 | cd "$basedir" 34 | git add -A "$basedir/${what}-Patches" 35 | cleanupPatches "$basedir/${what}-Patches" 36 | echo " Patches saved for $what to $what-Patches/" 37 | } 38 | if [ "$1" == "clean" ]; then 39 | rm -rf Spigot-*-Patches 40 | fi 41 | savePatches Spigot-API PaperSpigot-API 42 | savePatches Spigot-Server PaperSpigot-Server 43 | -------------------------------------------------------------------------------- /nms-patches/BlockState.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/main/java/net/minecraft/server/BlockState.java b/src/main/java/net/minecraft/server/BlockState.java 2 | index 3cada5afc..0934322e4 100644 3 | --- a/src/main/java/net/minecraft/server/BlockState.java 4 | +++ b/src/main/java/net/minecraft/server/BlockState.java 5 | @@ -1,6 +1,6 @@ 6 | package net.minecraft.server; 7 | 8 | -import com.google.common.base.Objects; 9 | +import com.google.common.base.MoreObjects; // KigPaper 10 | 11 | public abstract class BlockState> implements IBlockState { 12 | 13 | @@ -21,7 +21,7 @@ public abstract class BlockState> implements IBlockState 14 | } 15 | 16 | public String toString() { 17 | - return Objects.toStringHelper(this).add("name", this.b).add("clazz", this.a).add("values", this.c()).toString(); 18 | + return MoreObjects.toStringHelper(this).add("name", this.b).add("clazz", this.a).add("values", this.c()).toString(); // KigPaper 19 | } 20 | 21 | public boolean equals(Object object) { 22 | -------------------------------------------------------------------------------- /nms-patches/GameRules.patch: -------------------------------------------------------------------------------- 1 | --- a/net/minecraft/server/GameRules.java 2 | +++ b/net/minecraft/server/GameRules.java 3 | @@ -24,6 +24,7 @@ public class GameRules { 4 | this.a("randomTickSpeed", "3", GameRules.EnumGameRuleType.NUMERICAL_VALUE); 5 | this.a("sendCommandFeedback", "true", GameRules.EnumGameRuleType.BOOLEAN_VALUE); 6 | this.a("reducedDebugInfo", "false", GameRules.EnumGameRuleType.BOOLEAN_VALUE); 7 | + this.a("doWaterFreezing", "true", EnumGameRuleType.BOOLEAN_VALUE); // KigPaper 8 | } 9 | 10 | public void a(String s, String s1, GameRules.EnumGameRuleType gamerules_enumgameruletype) { 11 | -------------------------------------------------------------------------------- /nms-patches/ShapeDetector.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java 2 | index 325dcc6ae..8aa0bf9fe 100644 3 | --- a/src/main/java/net/minecraft/server/ShapeDetector.java 4 | +++ b/src/main/java/net/minecraft/server/ShapeDetector.java 5 | @@ -1,6 +1,6 @@ 6 | package net.minecraft.server; 7 | 8 | -import com.google.common.base.Objects; 9 | +import com.google.common.base.MoreObjects; // KigPaper 10 | import com.google.common.base.Predicate; 11 | import com.google.common.cache.CacheBuilder; 12 | import com.google.common.cache.CacheLoader; 13 | @@ -146,7 +146,7 @@ public class ShapeDetector { 14 | } 15 | 16 | public String toString() { 17 | - return Objects.toStringHelper(this).add("up", this.c).add("forwards", this.b).add("frontTopLeft", this.a).toString(); 18 | + return MoreObjects.toStringHelper(this).add("up", this.c).add("forwards", this.b).add("frontTopLeft", this.a).toString(); // KigPaper 19 | } 20 | } 21 | 22 | @@ -164,7 +164,9 @@ public class ShapeDetector { 23 | return new ShapeDetectorBlock(this.a, blockposition, this.b); 24 | } 25 | 26 | - public Object load(Object object) throws Exception { 27 | + // KigPaper 28 | + @Override 29 | + public ShapeDetectorBlock load(BlockPosition object) throws Exception { 30 | return this.a((BlockPosition) object); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /nms-patches/StructureBoundingBox.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/main/java/net/minecraft/server/StructureBoundingBox.java b/src/main/java/net/minecraft/server/StructureBoundingBox.java 2 | index d6c2aac9f..d9f557e62 100644 3 | --- a/src/main/java/net/minecraft/server/StructureBoundingBox.java 4 | +++ b/src/main/java/net/minecraft/server/StructureBoundingBox.java 5 | @@ -1,6 +1,6 @@ 6 | package net.minecraft.server; 7 | 8 | -import com.google.common.base.Objects; 9 | +import com.google.common.base.MoreObjects; // KigPaper 10 | 11 | public class StructureBoundingBox { 12 | 13 | @@ -139,7 +139,7 @@ public class StructureBoundingBox { 14 | } 15 | 16 | public String toString() { 17 | - return Objects.toStringHelper(this).add("x0", this.a).add("y0", this.b).add("z0", this.c).add("x1", this.d).add("y1", this.e).add("z1", this.f).toString(); 18 | + return MoreObjects.toStringHelper(this).add("x0", this.a).add("y0", this.b).add("z0", this.c).add("x1", this.d).add("y1", this.e).add("z1", this.f).toString(); // KigPaper 19 | } 20 | 21 | public NBTTagIntArray g() { 22 | -------------------------------------------------------------------------------- /nms-patches/WorldGenCaves.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/main/java/net/minecraft/server/WorldGenCaves.java b/src/main/java/net/minecraft/server/WorldGenCaves.java 2 | index 2cdd02378..f68019a29 100644 3 | --- a/src/main/java/net/minecraft/server/WorldGenCaves.java 4 | +++ b/src/main/java/net/minecraft/server/WorldGenCaves.java 5 | @@ -1,6 +1,6 @@ 6 | package net.minecraft.server; 7 | 8 | -import com.google.common.base.Objects; 9 | +import com.google.common.base.MoreObjects; // KigPaper 10 | import java.util.Random; 11 | 12 | public class WorldGenCaves extends WorldGenBase { 13 | @@ -140,7 +140,8 @@ public class WorldGenCaves extends WorldGenBase { 14 | 15 | if (d14 > -0.7D && d12 * d12 + d14 * d14 + d13 * d13 < 1.0D) { 16 | IBlockData iblockdata1 = chunksnapshot.a(j3, j4, i4); 17 | - IBlockData iblockdata2 = (IBlockData) Objects.firstNonNull(chunksnapshot.a(j3, j4 + 1, i4), Blocks.AIR.getBlockData()); 18 | + IBlockData iblockdata2 = 19 | + MoreObjects.firstNonNull(chunksnapshot.a(j3, j4 + 1, i4), Blocks.AIR.getBlockData()); // KigPaper 20 | 21 | if (iblockdata1.getBlock() == Blocks.GRASS || iblockdata1.getBlock() == Blocks.MYCELIUM) { 22 | flag3 = true; 23 | -------------------------------------------------------------------------------- /paperclip.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cp ./PaperSpigot-Server/target/paperspigot*-SNAPSHOT.jar ./Paperclip/paperspigot-1.8.8.jar 4 | cp ./work/1.8.8/1.8.8.jar ./Paperclip/minecraft_server.1.8.8.jar 5 | cd ./Paperclip 6 | mvn clean package -Dmaven.compiler.release=1.8 7 | cd .. 8 | cp ./Paperclip/target/paperclip*-SNAPSHOT.jar ./Paperclip.jar 9 | 10 | echo "" 11 | echo "" 12 | echo "" 13 | echo "Build success!" 14 | echo "Copied final jar to $(pwd)/Paperclip.jar" -------------------------------------------------------------------------------- /upstreamMerge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PS1="$" 4 | basedir=`pwd` 5 | 6 | function update { 7 | cd "$basedir/$1" 8 | git fetch && git reset --hard origin/master 9 | cd ../ 10 | git add $1 11 | } 12 | 13 | update Bukkit 14 | update CraftBukkit 15 | 16 | --------------------------------------------------------------------------------