Skip to content

Instantly share code, notes, and snippets.

:atom:
Powered by 5 Hour Energy

Daniel Ennis aikar

:atom:
Powered by 5 Hour Energy
View GitHub Profile
View 0001-Improve-behavior-of-main-thread-blocking-chunk-load-.patch
From 414cb1c38d347adcf66a4b4bdfb1a150f647a6a8 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 27 Mar 2020 20:57:32 -0400
Subject: [PATCH] Improve behavior of main thread blocking chunk load/gens
---
.../paper/io/PrioritizedTaskQueue.java | 13 ++--
.../paper/io/chunk/ChunkTaskManager.java | 59 +++++++++++---
.../minecraft/server/ChunkProviderServer.java | 14 ++++
.../net/minecraft/server/ChunkStatus.java | 3 +
View x.diff
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
index b6239e5fa6..d5339cea9a 100644
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
@@ -46,14 +46,31 @@ public class PlayerChunk {
// Paper start
int chunkPriority = -1;
int lastChunkPriority = -1;
+ boolean isUrgent = false;
+ java.util.List<PlayerChunk> urgentNeighbors = new java.util.ArrayList<>();
View emclag.js
#!/usr/bin/env _node
var Rcon = require('rcon');
var exec = require('child_process').exec;
var rconPass = require('fs').readFileSync(__dirname + '/rconpass').toString();
var servers = {};
[
"smp1", "smp2", "smp3",
"smp4", "smp5", "smp6",
"smp7", "smp8", "smp9",
View mainload.diff
commit 26d9deef41eb09dd70394e15124c26f2c546252f
Author: Aikar <aikar@aikar.co>
Date: Fri Mar 27 20:57:32 2020 -0400
Improve behavior of main thread blocking chunk load/gens
diff --git a/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
index 78bd238f4c..f28e563a43 100644
--- a/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
+++ b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
View asyncfix.patch
diff --git a/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
index 78bd238f4c..24d4902929 100644
--- a/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
+++ b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java
@@ -72,7 +72,10 @@ public class PrioritizedTaskQueue<T extends PrioritizedTaskQueue.PrioritizedTask
* This can also be thrown if the queue has shutdown.
*/
public void add(final T task) throws IllegalStateException {
- task.onQueue(this);
+ add(task, false);
View GCMonitorTask.java
/*
* Copyright (c) 2017. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.systems.tasks;
import com.empireminecraft.util.Log;
View GCMonitorTask.java
/*
* Copyright (c) 2017. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.systems.tasks;
import com.empireminecraft.util.Log;
View ExplosiveArrow.java
/*
* Copyright (c) 2018. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.items.uncommon;
import com.destroystokyo.paper.event.entity.ArrowHitBlockEvent;
View timings2.diff
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
index 98079dc0..64531fcc 100644
--- a/src/main/java/co/aikar/timings/FullServerTickHandler.java
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
@@ -2,6 +2,8 @@ package co.aikar.timings;
import static co.aikar.timings.TimingsManager.*;
+import org.jetbrains.annotations.NotNull;
+
View timings.diff
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
index f6d61673..64531fcc 100644
--- a/src/main/java/co/aikar/timings/FullServerTickHandler.java
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
@@ -53,8 +53,7 @@ public class FullServerTickHandler extends TimingHandler {
long start = System.nanoTime();
TimingsManager.tick();
long diff = System.nanoTime() - start;
- CURRENT = TIMINGS_TICK;
- TIMINGS_TICK.addDiff(diff);
You can’t perform that action at this time.