Yatopia/patches/server/0005-Add-last-tick-time-API...

75 lines
4.6 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ivan Pekov <ivan@mrivanplays.com>
Date: Sun, 27 Sep 2020 18:30:10 +0300
Subject: [PATCH] Add last tick time API
Original patch by:
Co-authored-by: tr7zw <tr7zw@live.de>
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
Upstream (#469) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: fbae9dbe0 [Auto] Updated Upstream (Bukkit/CraftBukkit) ac4a33aab [Auto] Updated Upstream (Bukkit) c1e07158b [Auto] Updated Upstream (Bukkit/CraftBukkit) 5e4b88e95 Fix dangling sout 23afda179 basic hostname validation 0fb8bdf0e Updated Upstream (Bukkit/CraftBukkit) (#5508) 88ab784da [Auto] Updated Upstream (CraftBukkit) ca7111d5f Fix PlayerItemConsumeEvent cancelling (fixes #4682) (#5383) 06fb560dc Add support for tab completing and highlighting console input from the Brigadier command tree (#5437) 0a9b89c7a Fix occasional light gen issues for neighbor blocks (#5500) a08be1ec7 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: 7d36676 Fix light source locking f1ec0c2 Add concurrency check to ProtoChunk light sources 159d146 Improvements to chunk loader system Airplane Changes: 3b3cde7 Correctly use DEAR values, fix config reloading dd60919 Updated Upstream (Tuinity) Purpur Changes: 5674cdc Updated Upstream (Paper) Empirecraft Changes: efda8c5b Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 39bf5b525 Update teams known as code owners Tuinity Changes: b12d0cc Replace ticket level propagator 42df8e1 Correctly handle recursion for chunkholder updates 73eb2a8 Do not copy visible chunks 8a4f3be Do not schedule poi task for each block write on chunk gen * Multithreaded Entity Tracker fixup
2021-04-21 23:26:49 +02:00
index 7fa91a3cb0d48396d106a4a729533f95e91562c0..0ca3e2d7366ee295d369e87b7ce2edd84df68ab5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
Upstream (#469) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: fbae9dbe0 [Auto] Updated Upstream (Bukkit/CraftBukkit) ac4a33aab [Auto] Updated Upstream (Bukkit) c1e07158b [Auto] Updated Upstream (Bukkit/CraftBukkit) 5e4b88e95 Fix dangling sout 23afda179 basic hostname validation 0fb8bdf0e Updated Upstream (Bukkit/CraftBukkit) (#5508) 88ab784da [Auto] Updated Upstream (CraftBukkit) ca7111d5f Fix PlayerItemConsumeEvent cancelling (fixes #4682) (#5383) 06fb560dc Add support for tab completing and highlighting console input from the Brigadier command tree (#5437) 0a9b89c7a Fix occasional light gen issues for neighbor blocks (#5500) a08be1ec7 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: 7d36676 Fix light source locking f1ec0c2 Add concurrency check to ProtoChunk light sources 159d146 Improvements to chunk loader system Airplane Changes: 3b3cde7 Correctly use DEAR values, fix config reloading dd60919 Updated Upstream (Tuinity) Purpur Changes: 5674cdc Updated Upstream (Paper) Empirecraft Changes: efda8c5b Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 39bf5b525 Update teams known as code owners Tuinity Changes: b12d0cc Replace ticket level propagator 42df8e1 Correctly handle recursion for chunkholder updates 73eb2a8 Do not copy visible chunks 8a4f3be Do not schedule poi task for each block write on chunk gen * Multithreaded Entity Tracker fixup
2021-04-21 23:26:49 +02:00
@@ -1064,6 +1064,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
// Paper End
// Spigot End
+ public static java.time.Duration lastTickTime = java.time.Duration.ZERO; // Yatopia
+
protected void w() {
try {
long serverStartTime = SystemUtils.getMonotonicNanos(); // Paper
Upstream (#469) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: fbae9dbe0 [Auto] Updated Upstream (Bukkit/CraftBukkit) ac4a33aab [Auto] Updated Upstream (Bukkit) c1e07158b [Auto] Updated Upstream (Bukkit/CraftBukkit) 5e4b88e95 Fix dangling sout 23afda179 basic hostname validation 0fb8bdf0e Updated Upstream (Bukkit/CraftBukkit) (#5508) 88ab784da [Auto] Updated Upstream (CraftBukkit) ca7111d5f Fix PlayerItemConsumeEvent cancelling (fixes #4682) (#5383) 06fb560dc Add support for tab completing and highlighting console input from the Brigadier command tree (#5437) 0a9b89c7a Fix occasional light gen issues for neighbor blocks (#5500) a08be1ec7 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: 7d36676 Fix light source locking f1ec0c2 Add concurrency check to ProtoChunk light sources 159d146 Improvements to chunk loader system Airplane Changes: 3b3cde7 Correctly use DEAR values, fix config reloading dd60919 Updated Upstream (Tuinity) Purpur Changes: 5674cdc Updated Upstream (Paper) Empirecraft Changes: efda8c5b Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 39bf5b525 Update teams known as code owners Tuinity Changes: b12d0cc Replace ticket level propagator 42df8e1 Correctly handle recursion for chunkholder updates 73eb2a8 Do not copy visible chunks 8a4f3be Do not schedule poi task for each block write on chunk gen * Multithreaded Entity Tracker fixup
2021-04-21 23:26:49 +02:00
@@ -1135,7 +1137,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
this.a(gameprofilertick);
Updated Upstream and Sidestream(s) (Tuinity/Akarin/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: ff785fc Updated Upstream (Paper) Akarin Changes: 2dab0a4 Removed gradle 72e3c4a Update README.md bbad638 Update README.md bbdea8e Update Jenkinsfile bb9db8b Updated tuinity to spottedleaf repo 6961481 Updated Tuinity branch de97830 Updated Tuinity 62d4b43 Update SUPPORT.md 21fffd0 Update README.md 4bd120b Merge pull request #186 from adsa562/patch-1 1f8eccf add demo server 630ea72 Updated Tuinity 59fae5a Made 1.15.2 build again bd703ba Allowed building for dirs that have spaces a339866 Update SUPPORT.md db61690 stated that it is not a bedrock server software df7efd2 Added Jenkinsfile 75b7f13 removed broken patch 19387b2 Updated Artifacts URL c5a7778 fixed build 3abf7a7 Fixed Initialize step 2d3ea37 Updated Tuinity and Paper 220d1b8 Removed patch 0019 - breaks upstream 1ccf615 Added tuinity branch to gitmodules c5e73c7 Updated Upstream (Tuinity) 3cd947f Updated Upstream (Tuinity) 14df550 cleanup scripts/importSources.sh 49d9af7 revert a broken patch 630492a revert a broken patch cb5ea51 Fixed build failure 826c0f0 Updated 1.15.2 jenkinsfile to 1.16.1 574b206 Update SUPPORT.md 90e3f89 Update SUPPORT.md c2a5f66 fix b30241b fix 4e06aea fix 284809b 1.16.1 Purpur Changes: 096971d Rename kelp/vines options to make more sense 8ea89f9 Fix broken methods in purpur config c505cf7 Updated Upstream (Paper) 695f3ac Add configurable snowball damage 2d04fb5 Updated Upstream (Paper) badfd60 Rebuild patches f3aff1b Merge branch 'ver/1.16.4' of github.com:pl3xgaming/Purpur into ver/1.16.4 cfcf7d7 Add critical hit check to EntityDamagedByEntityEvent 0b48c6c Add config for allowing Endermen to despawn even while holding a block 1349e72 Updated Upstream (Tuinity) 651105e Kelp weeping and twisting vines configurable max length 058399c Updated Upstream (Tuinity) 3e0a758 Add twisting and weeping vines growth rates
2020-11-26 10:52:33 +01:00
this.methodProfiler.a();
this.methodProfiler.enter("tick");
+ long tickStart = System.nanoTime(); // Yatopia
this.a(this::canSleepForTick);
+ lastTickTime = java.time.Duration.ofNanos(System.nanoTime() - tickStart); // Yatopia
Updated Upstream and Sidestream(s) (Tuinity/Akarin/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: ff785fc Updated Upstream (Paper) Akarin Changes: 2dab0a4 Removed gradle 72e3c4a Update README.md bbad638 Update README.md bbdea8e Update Jenkinsfile bb9db8b Updated tuinity to spottedleaf repo 6961481 Updated Tuinity branch de97830 Updated Tuinity 62d4b43 Update SUPPORT.md 21fffd0 Update README.md 4bd120b Merge pull request #186 from adsa562/patch-1 1f8eccf add demo server 630ea72 Updated Tuinity 59fae5a Made 1.15.2 build again bd703ba Allowed building for dirs that have spaces a339866 Update SUPPORT.md db61690 stated that it is not a bedrock server software df7efd2 Added Jenkinsfile 75b7f13 removed broken patch 19387b2 Updated Artifacts URL c5a7778 fixed build 3abf7a7 Fixed Initialize step 2d3ea37 Updated Tuinity and Paper 220d1b8 Removed patch 0019 - breaks upstream 1ccf615 Added tuinity branch to gitmodules c5e73c7 Updated Upstream (Tuinity) 3cd947f Updated Upstream (Tuinity) 14df550 cleanup scripts/importSources.sh 49d9af7 revert a broken patch 630492a revert a broken patch cb5ea51 Fixed build failure 826c0f0 Updated 1.15.2 jenkinsfile to 1.16.1 574b206 Update SUPPORT.md 90e3f89 Update SUPPORT.md c2a5f66 fix b30241b fix 4e06aea fix 284809b 1.16.1 Purpur Changes: 096971d Rename kelp/vines options to make more sense 8ea89f9 Fix broken methods in purpur config c505cf7 Updated Upstream (Paper) 695f3ac Add configurable snowball damage 2d04fb5 Updated Upstream (Paper) badfd60 Rebuild patches f3aff1b Merge branch 'ver/1.16.4' of github.com:pl3xgaming/Purpur into ver/1.16.4 cfcf7d7 Add critical hit check to EntityDamagedByEntityEvent 0b48c6c Add config for allowing Endermen to despawn even while holding a block 1349e72 Updated Upstream (Tuinity) 651105e Kelp weeping and twisting vines configurable max length 058399c Updated Upstream (Tuinity) 3e0a758 Add twisting and weeping vines growth rates
2020-11-26 10:52:33 +01:00
this.methodProfiler.exitEnter("nextTickWait");
this.X = true;
// Purpur start - tps catchup
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) (#443) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 0641de2d4 [CI-SKIP] Change some fields to textara (#5405) 98a34ea47 [CI-SKIP] 🚀 Upgrade to new form-based templates (#5278) bca97a8f7 replace spaces in world key (touches #5397) de94f6485 Refactor chat message composition (#5396) e27f334bb [CI-SKIP] Fix makemcdevsrc.sh for nms relocations (#5389) ae15e85da Updated Upstream (CraftBukkit) 26fe0ac5a Only set despawnTimer for Wandering Traders spawned by MobSpawnerTrader (#5391) b748eb7b8 Fix VanillaMobGoalTest#testBukkitMap (#5390) 18dbbb578 [Auto] Updated Upstream (CraftBukkit) fac9cc5d5 [CI-SKIP] Ignore .gitignore 087aa70e7 Deprecate ItemStack#setLore(List<String>) and ItemStack#getLore, add Component based alternatives 9889c651c apply fixup c310f0a61 Updated Upstream (Bukkit/CraftBukkit) f17560ab0 wtf is this t file -jmp 347f3a9b8 fix compile 700e9e6a5 rebase cf4dc464a Revert de5f4e469...c270abe96 6870db613 script & POM fix 743c6533c Replace ** with * (BSD/macOS) 376d7b097 Don't remove the .java fcb3fd42a Fix macOS/BSD support 8cfc05249 Link correctly ba1031ca7 Rename work dir c8d844ab7 Actually fix preloading this time e62aa5e3e Fix class preloading 1c03cf898 It's mojang math, not minecraft math 1034873df Apply fixups 39b125771 Use revision file 956150da7 Welcome to 1.16.5-R0.2 ccb217c01 Change cache keys 0d217001c more work f6d820f07 It compiles 0f78e9525 More work 1718f61bf Updated Upstream (CraftBukkit/Spigot) b28d46114 Update scripts for NMS repackaging d4532f7e7 bug #5373 - fix AsyncChatEvent not being posted when processing a legacy APCE continuation 522ae1c51 Replace all block states of a specified block (#5055) 1cda67118 [Auto] Updated Upstream (CraftBukkit) 8c74d3126 Updated Upstream (Bukkit) (#5359) fd3c66a91 bug #5362 - correctly pass "render type" when registering a new scoreboard objective Tuinity Changes: 9bdcb9b Delete work dir when running jar 6351d7c Updated Upstream (Paper) 932c199 Generate mc-dev correctly bf3e737 Make packet limiter work from IDE 1686f38 Fix packet limiter config f40f7b4 Update README.md styling (#264) da1c3ac GH Actions Changes (#213) 5f325ec Updated Upstream (Paper) 0f83fe4 Updated Upstream (Paper) 44e8e5d Do not load extra radius of chunks when loading a single chunk 31f9cae Revert custom table implementation for blockstate states 9ac33d1 Be aware of entity teleports when chunk checking entities 18c7f3f Always set impulse for projectiles to true, even if hit event failed Airplane Changes: f94d399 Merge pull request #18 from notOM3GA/upstream/nms-repackage 0fc6226 Force build for Flare update 08439d6 Updated Upstream (Tuinity) 0f80443 Updated Upstream (Tuinity) 2f6cbdc More debug for plugins not shutting down tasks 12e1b61 Updated Upstream (Tuinity) fc778d3 Update README.md db6b0eb Merge pull request #16 from DeadSteve51/patch-2 b23bee3 Remove debug 8157e98 Config style, flare style, disable tracker by def 98d0b58 Updates to README Purpur Changes: 75b07a0 Fix stack overflow on armorstand movement f754a7b Sneak to bulk process composter 1362f49 Updated Upstream (Paper, Tuinity, & Airplane) 5bf8615 [ci-skip] Conflict on change for adventure deprecations 114b37b Add purpur.yml to Flare (#204) c6dce38 forgot the crops c004236 Configurable ravager griefable blocks list 766246a [ci-skip] remove duplicate patch ac93477 Config to make Creepers explode on death (#201) 297181e Updated Upstream (Paper, Tuinity, & Airplane) 45b9a18 Config to disable Llama caravans (#203) a99a83b Allow fully disabling farmland trampling 3aa4f68 Tick fluids config 0e34d59 Add missing imports :/ 3dd9f46 Updated Upstream (Paper, Tuinity, & Airplane) Empirecraft Changes: 1b579407 Improve importmcdev script and fix first server patch f597a82e Update generatesources script 218f5298 Fix patches - imported files 847cf558 Updated Paper d51410c3 Updated Paper fb3301fd Fix bow entity ai speed/distance dbde1dc4 Add isJoined boolean to fake players a23317f7 Update Fake Player API - misc changes a970b77f Updated Paper * Updated Upstream and Sidestream(s) (Paper/Airplane/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7259c32ba [CI-SKIP] [Auto] Rebuild Patches 0e06e912e Fix annotations so Inventory#getContents returns non-null array with nullable type (#5350) b90b4f8ad Properly apply Sign#isEditable to TEs when calling BlockState#update Airplane Changes: 87d4a17 Track queue debug command Purpur Changes: d44f93e Fix tpsbar with naughty plugins * Updated Upstream and Sidestream(s) (Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Purpur Changes: 99f1ce6 Add enchantment target for bows and crossbows af9181e Add configurable drowning settings (closes #221) (#222) f72437b Remove mcdevimports.* (#228) 08de42d Add config for infinity on crossbows (#215) 5f76cb3 Add a config for villager trading (#210) 67ffa05 Add config for disabling skipping the night (#209) * revert paper commit that made the build fail (CI still doesn't work) * Update build.yml * test2 * Update build.yml * take7 * how often does md_5 change mappings? this will come back to bite me in exactly 17 days * Revert "how often does md_5 change mappings?" This reverts commit 8b05c16d6cce156c7d8b57f5071a700b979206ef. * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 6caa330c6 Add checkerframework nullness annotations to accepted list for AnnotationTest (#5409) Purpur Changes: 96f5360 Config to allow for unsafe enchants (#235) b6235af Rebase on latest Purpur (#230) 754948e Updated Upstream (Paper) f55c0e9 Option to make doors require redstone (closes #171) 34d5818 Fix paper using wrong annotations f31bcc6 Updated Upstream (Paper & Airplane) 55244dd Config to show Armor Stand arms on spawn (#231) c726479 Config to disable hostile mob spawn on ice `:)` (closes #214) (#229) 26a0094 Break individual slabs when sneaking (closes #218) c3de3ac Fix wart farmers plating vegetables on soul sand * Updated Upstream and Sidestream(s) (Tuinity/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1b0d783 Updated Upstream (Paper) 2c16629 Fix NPE in NetworkManager#execute Purpur Changes: 0d25d39 Add cache for slime max health (resolves #234) 39dd78a Fix #240 - Separate slab breaking triggers every single time 1ecb9ef Projectile offsets config (#237) 33ee1e7 Configurable sponge absorption (closes #232) (#236) a0355eb Add Note Block to disabled block updates (#241) * Updated Upstream and Sidestream(s) (Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 8b47131da Optimize short circuit evaluation of sign check (#5348) 1a2fd12a5 Drop carried item when player has disconnected (#5036) (#5166) 68af93524 Use PaperAdventure.PLAIN instead of PlainComponentSerializer.plain() for AdventureComponent#getString (#5414) * Updated Upstream and Sidestream(s) (Tuinity/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 94f025a Updated Upstream (Paper) ab00f31 Do not load chunks around fake players a9599d8 Fix incorrect parsing of positive target-send-rate 2a6cd81 Make sure to remove correct TE during TE tick Purpur Changes: 9dfc780 Config for powered rail activation distance (#248) Co-authored-by: duplexsystem <duplexsys@protonmail.com>
2021-03-28 16:50:47 +02:00
index 7771fa5c98809b6c3aeff78ab9d0b8ec2178accc..449fce2d76c701b789dd09326c9a8fc818b39c45 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) (#443) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 0641de2d4 [CI-SKIP] Change some fields to textara (#5405) 98a34ea47 [CI-SKIP] 🚀 Upgrade to new form-based templates (#5278) bca97a8f7 replace spaces in world key (touches #5397) de94f6485 Refactor chat message composition (#5396) e27f334bb [CI-SKIP] Fix makemcdevsrc.sh for nms relocations (#5389) ae15e85da Updated Upstream (CraftBukkit) 26fe0ac5a Only set despawnTimer for Wandering Traders spawned by MobSpawnerTrader (#5391) b748eb7b8 Fix VanillaMobGoalTest#testBukkitMap (#5390) 18dbbb578 [Auto] Updated Upstream (CraftBukkit) fac9cc5d5 [CI-SKIP] Ignore .gitignore 087aa70e7 Deprecate ItemStack#setLore(List<String>) and ItemStack#getLore, add Component based alternatives 9889c651c apply fixup c310f0a61 Updated Upstream (Bukkit/CraftBukkit) f17560ab0 wtf is this t file -jmp 347f3a9b8 fix compile 700e9e6a5 rebase cf4dc464a Revert de5f4e469...c270abe96 6870db613 script & POM fix 743c6533c Replace ** with * (BSD/macOS) 376d7b097 Don't remove the .java fcb3fd42a Fix macOS/BSD support 8cfc05249 Link correctly ba1031ca7 Rename work dir c8d844ab7 Actually fix preloading this time e62aa5e3e Fix class preloading 1c03cf898 It's mojang math, not minecraft math 1034873df Apply fixups 39b125771 Use revision file 956150da7 Welcome to 1.16.5-R0.2 ccb217c01 Change cache keys 0d217001c more work f6d820f07 It compiles 0f78e9525 More work 1718f61bf Updated Upstream (CraftBukkit/Spigot) b28d46114 Update scripts for NMS repackaging d4532f7e7 bug #5373 - fix AsyncChatEvent not being posted when processing a legacy APCE continuation 522ae1c51 Replace all block states of a specified block (#5055) 1cda67118 [Auto] Updated Upstream (CraftBukkit) 8c74d3126 Updated Upstream (Bukkit) (#5359) fd3c66a91 bug #5362 - correctly pass "render type" when registering a new scoreboard objective Tuinity Changes: 9bdcb9b Delete work dir when running jar 6351d7c Updated Upstream (Paper) 932c199 Generate mc-dev correctly bf3e737 Make packet limiter work from IDE 1686f38 Fix packet limiter config f40f7b4 Update README.md styling (#264) da1c3ac GH Actions Changes (#213) 5f325ec Updated Upstream (Paper) 0f83fe4 Updated Upstream (Paper) 44e8e5d Do not load extra radius of chunks when loading a single chunk 31f9cae Revert custom table implementation for blockstate states 9ac33d1 Be aware of entity teleports when chunk checking entities 18c7f3f Always set impulse for projectiles to true, even if hit event failed Airplane Changes: f94d399 Merge pull request #18 from notOM3GA/upstream/nms-repackage 0fc6226 Force build for Flare update 08439d6 Updated Upstream (Tuinity) 0f80443 Updated Upstream (Tuinity) 2f6cbdc More debug for plugins not shutting down tasks 12e1b61 Updated Upstream (Tuinity) fc778d3 Update README.md db6b0eb Merge pull request #16 from DeadSteve51/patch-2 b23bee3 Remove debug 8157e98 Config style, flare style, disable tracker by def 98d0b58 Updates to README Purpur Changes: 75b07a0 Fix stack overflow on armorstand movement f754a7b Sneak to bulk process composter 1362f49 Updated Upstream (Paper, Tuinity, & Airplane) 5bf8615 [ci-skip] Conflict on change for adventure deprecations 114b37b Add purpur.yml to Flare (#204) c6dce38 forgot the crops c004236 Configurable ravager griefable blocks list 766246a [ci-skip] remove duplicate patch ac93477 Config to make Creepers explode on death (#201) 297181e Updated Upstream (Paper, Tuinity, & Airplane) 45b9a18 Config to disable Llama caravans (#203) a99a83b Allow fully disabling farmland trampling 3aa4f68 Tick fluids config 0e34d59 Add missing imports :/ 3dd9f46 Updated Upstream (Paper, Tuinity, & Airplane) Empirecraft Changes: 1b579407 Improve importmcdev script and fix first server patch f597a82e Update generatesources script 218f5298 Fix patches - imported files 847cf558 Updated Paper d51410c3 Updated Paper fb3301fd Fix bow entity ai speed/distance dbde1dc4 Add isJoined boolean to fake players a23317f7 Update Fake Player API - misc changes a970b77f Updated Paper * Updated Upstream and Sidestream(s) (Paper/Airplane/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 7259c32ba [CI-SKIP] [Auto] Rebuild Patches 0e06e912e Fix annotations so Inventory#getContents returns non-null array with nullable type (#5350) b90b4f8ad Properly apply Sign#isEditable to TEs when calling BlockState#update Airplane Changes: 87d4a17 Track queue debug command Purpur Changes: d44f93e Fix tpsbar with naughty plugins * Updated Upstream and Sidestream(s) (Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Purpur Changes: 99f1ce6 Add enchantment target for bows and crossbows af9181e Add configurable drowning settings (closes #221) (#222) f72437b Remove mcdevimports.* (#228) 08de42d Add config for infinity on crossbows (#215) 5f76cb3 Add a config for villager trading (#210) 67ffa05 Add config for disabling skipping the night (#209) * revert paper commit that made the build fail (CI still doesn't work) * Update build.yml * test2 * Update build.yml * take7 * how often does md_5 change mappings? this will come back to bite me in exactly 17 days * Revert "how often does md_5 change mappings?" This reverts commit 8b05c16d6cce156c7d8b57f5071a700b979206ef. * Updated Upstream and Sidestream(s) (Paper/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 6caa330c6 Add checkerframework nullness annotations to accepted list for AnnotationTest (#5409) Purpur Changes: 96f5360 Config to allow for unsafe enchants (#235) b6235af Rebase on latest Purpur (#230) 754948e Updated Upstream (Paper) f55c0e9 Option to make doors require redstone (closes #171) 34d5818 Fix paper using wrong annotations f31bcc6 Updated Upstream (Paper & Airplane) 55244dd Config to show Armor Stand arms on spawn (#231) c726479 Config to disable hostile mob spawn on ice `:)` (closes #214) (#229) 26a0094 Break individual slabs when sneaking (closes #218) c3de3ac Fix wart farmers plating vegetables on soul sand * Updated Upstream and Sidestream(s) (Tuinity/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 1b0d783 Updated Upstream (Paper) 2c16629 Fix NPE in NetworkManager#execute Purpur Changes: 0d25d39 Add cache for slime max health (resolves #234) 39dd78a Fix #240 - Separate slab breaking triggers every single time 1ecb9ef Projectile offsets config (#237) 33ee1e7 Configurable sponge absorption (closes #232) (#236) a0355eb Add Note Block to disabled block updates (#241) * Updated Upstream and Sidestream(s) (Paper) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 8b47131da Optimize short circuit evaluation of sign check (#5348) 1a2fd12a5 Drop carried item when player has disconnected (#5036) (#5166) 68af93524 Use PaperAdventure.PLAIN instead of PlainComponentSerializer.plain() for AdventureComponent#getString (#5414) * Updated Upstream and Sidestream(s) (Tuinity/Purpur) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Tuinity Changes: 94f025a Updated Upstream (Paper) ab00f31 Do not load chunks around fake players a9599d8 Fix incorrect parsing of positive target-send-rate 2a6cd81 Make sure to remove correct TE during TE tick Purpur Changes: 9dfc780 Config for powered rail activation distance (#248) Co-authored-by: duplexsystem <duplexsys@protonmail.com>
2021-03-28 16:50:47 +02:00
@@ -2540,4 +2540,6 @@ public final class CraftServer implements Server {
return getServer().lagging;
}
// Purpur end
+
+ @Override public java.time.Duration getLastTickTime() { return net.minecraft.server.MinecraftServer.lastTickTime; } // Yatopia
}
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Airplane/Empirecraft) (#392) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Airplane/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 13a476e15 Deprecate PlayerLeaveBedEvent#setBedSpawn 3a1d95c71 [Auto] Updated Upstream (CraftBukkit) d4dcc1a2e Updated Upstream (CraftBukkit) e886d8118 Updated Upstream () 8bc0c6c31 Updated Upstream (CraftBukkit/Spigot) (#5169) 002f65b8b living entity allow attribute registration (#4723) 69a5c67b1 fix calling setSize on dead slimes causing invincibility (fixes #5137) (#5168) Tuinity Changes: 502d57b Updated Upstream (Paper) 87e0cd9 Print exceptions for light scheduling Purpur Changes: 7fc2d31 Updated Upstream (Paper & Tuinity) Airplane Changes: d7d1626 Remove multithreaded entity tracker 677ec73 Ensure armor change event is on main thread c07d254 Fix crash ec7605c Updated Upstream (Tuinity) 2768f39 Update DEAR commit message e975972 Multithreaded entity tracking 98244f9 Updated Upstream (Tuinity) 44b2499 Larger headings 2c4a7fb Merge pull request #6 from Encode42/master cc19631 More changes beba27a Badges and variables 0aeaf12 Improve readability, grammar, etc. Empirecraft Changes: bbc8d297 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 3dadd97bb [CI-SKIP] [Meta] Exempt more labels from being marked as stale (#5142) 36a72cad3 [Auto] Updated Upstream (Bukkit/CraftBukkit/Spigot) Origami Changes: 168394a Access config after loading it... fixes velocity auto offline-mode c47b182 Add velocity to automatic offline mode
2021-02-08 16:31:51 +01:00
index 312248b5c6febc6a3c10940714fac7fbc3c53b7f..abc9b7aa53e554ef2196dceafe8db8ba65f34e84 100644
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
+++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Airplane/Empirecraft) (#392) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Airplane/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 13a476e15 Deprecate PlayerLeaveBedEvent#setBedSpawn 3a1d95c71 [Auto] Updated Upstream (CraftBukkit) d4dcc1a2e Updated Upstream (CraftBukkit) e886d8118 Updated Upstream () 8bc0c6c31 Updated Upstream (CraftBukkit/Spigot) (#5169) 002f65b8b living entity allow attribute registration (#4723) 69a5c67b1 fix calling setSize on dead slimes causing invincibility (fixes #5137) (#5168) Tuinity Changes: 502d57b Updated Upstream (Paper) 87e0cd9 Print exceptions for light scheduling Purpur Changes: 7fc2d31 Updated Upstream (Paper & Tuinity) Airplane Changes: d7d1626 Remove multithreaded entity tracker 677ec73 Ensure armor change event is on main thread c07d254 Fix crash ec7605c Updated Upstream (Tuinity) 2768f39 Update DEAR commit message e975972 Multithreaded entity tracking 98244f9 Updated Upstream (Tuinity) 44b2499 Larger headings 2c4a7fb Merge pull request #6 from Encode42/master cc19631 More changes beba27a Badges and variables 0aeaf12 Improve readability, grammar, etc. Empirecraft Changes: bbc8d297 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 3dadd97bb [CI-SKIP] [Meta] Exempt more labels from being marked as stale (#5142) 36a72cad3 [Auto] Updated Upstream (Bukkit/CraftBukkit/Spigot) Origami Changes: 168394a Access config after loading it... fixes velocity auto offline-mode c47b182 Add velocity to automatic offline mode
2021-02-08 16:31:51 +01:00
@@ -32,6 +32,10 @@ public class TicksPerSecondCommand extends Command
tpsAvg[i] = format( tps[i] );
}
sender.sendMessage(ChatColor.GOLD + "TPS from last 5s, 1m, 5m, 15m: " + org.apache.commons.lang.StringUtils.join(tpsAvg, ", ")); // Purpur
+ // Yatopia start
+ java.time.Duration lastTickTime = org.bukkit.Bukkit.getLastTickTime();
+ sender.sendMessage(ChatColor.GOLD + "Last tick: " + formatTo( lastTickTime, java.util.concurrent.TimeUnit.MILLISECONDS ) + " (" + formatTo( lastTickTime, java.util.concurrent.TimeUnit.NANOSECONDS ) + ")");
+ // Yatopia end
if (args.length > 0 && args[0].equals("mem") && sender.hasPermission("bukkit.command.tpsmemory")) {
sender.sendMessage(ChatColor.GOLD + "Current Memory Usage: " + ChatColor.GREEN + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / (1024 * 1024)) + "/" + (Runtime.getRuntime().totalMemory() / (1024 * 1024)) + " mb (Max: " + (Runtime.getRuntime().maxMemory() / (1024 * 1024)) + " mb)");
if (!hasShownMemoryWarning) {
Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Airplane/Empirecraft) (#392) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Purpur/Airplane/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 13a476e15 Deprecate PlayerLeaveBedEvent#setBedSpawn 3a1d95c71 [Auto] Updated Upstream (CraftBukkit) d4dcc1a2e Updated Upstream (CraftBukkit) e886d8118 Updated Upstream () 8bc0c6c31 Updated Upstream (CraftBukkit/Spigot) (#5169) 002f65b8b living entity allow attribute registration (#4723) 69a5c67b1 fix calling setSize on dead slimes causing invincibility (fixes #5137) (#5168) Tuinity Changes: 502d57b Updated Upstream (Paper) 87e0cd9 Print exceptions for light scheduling Purpur Changes: 7fc2d31 Updated Upstream (Paper & Tuinity) Airplane Changes: d7d1626 Remove multithreaded entity tracker 677ec73 Ensure armor change event is on main thread c07d254 Fix crash ec7605c Updated Upstream (Tuinity) 2768f39 Update DEAR commit message e975972 Multithreaded entity tracking 98244f9 Updated Upstream (Tuinity) 44b2499 Larger headings 2c4a7fb Merge pull request #6 from Encode42/master cc19631 More changes beba27a Badges and variables 0aeaf12 Improve readability, grammar, etc. Empirecraft Changes: bbc8d297 Updated Paper * Updated Upstream and Sidestream(s) (Paper/Origami) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 3dadd97bb [CI-SKIP] [Meta] Exempt more labels from being marked as stale (#5142) 36a72cad3 [Auto] Updated Upstream (Bukkit/CraftBukkit/Spigot) Origami Changes: 168394a Access config after loading it... fixes velocity auto offline-mode c47b182 Add velocity to automatic offline mode
2021-02-08 16:31:51 +01:00
@@ -50,4 +54,16 @@ public class TicksPerSecondCommand extends Command
return ( ( tps > 18.0 ) ? ChatColor.GREEN : ( tps > 16.0 ) ? ChatColor.YELLOW : ChatColor.RED ).toString()
+ ( ( tps > 21.0 ) ? "*" : "" ) + Math.min( Math.round( tps * 100.0 ) / 100.0, 20.0 ); // Paper - only print * at 21, we commonly peak to 20.02 as the tick sleep is not accurate enough, stop the noise
}
+
+ // Yatopia start
+ public static String formatTo(java.time.Duration duration, java.util.concurrent.TimeUnit unit)
+ {
+ java.util.concurrent.TimeUnit nanosUnit = java.util.concurrent.TimeUnit.NANOSECONDS;
+ long nanos = duration.toNanos();
+ long toAskedUnit = unit.convert( nanos, nanosUnit );
+ long ms = nanosUnit.toMillis( nanos );
+ ChatColor startingColor = ms < 40 ? ChatColor.GREEN : ( ms < 50 ) ? ChatColor.YELLOW : ChatColor.RED;
+ return startingColor.toString() + toAskedUnit + ChatColor.GOLD + org.yatopiamc.yatopia.server.util.TimeUtils.getFriendlyName( unit );
+ }
+ // Yatopia end
}