Don't call ticking_list on Spigot (#1655)

* ticking_list is paper only

* Update adapters
Dieser Commit ist enthalten in:
Jordan 2022-03-14 10:08:10 +00:00 committet von GitHub
Ursprung d400a470a1
Commit 1708584e8d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
4 geänderte Dateien mit 22 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -481,8 +481,10 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
// Don't attempt to tick section whilst we're editing // Don't attempt to tick section whilst we're editing
if (existingSection != null) { if (existingSection != null) {
PaperweightPlatformAdapter.clearCounts(existingSection); PaperweightPlatformAdapter.clearCounts(existingSection);
if (PaperLib.isPaper()) {
existingSection.tickingList.clear(); existingSection.tickingList.clear();
} }
}
if (existingSection == null) { if (existingSection == null) {
newSection = PaperweightPlatformAdapter.newChunkSection(layerNo, setArr, fastmode, adapter); newSection = PaperweightPlatformAdapter.newChunkSection(layerNo, setArr, fastmode, adapter);
@ -503,7 +505,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
//ensure that the server doesn't try to tick the chunksection while we're editing it (again). //ensure that the server doesn't try to tick the chunksection while we're editing it (again).
DelegateSemaphore lock = PaperweightPlatformAdapter.applyLock(existingSection); DelegateSemaphore lock = PaperweightPlatformAdapter.applyLock(existingSection);
PaperweightPlatformAdapter.clearCounts(existingSection); PaperweightPlatformAdapter.clearCounts(existingSection);
if (PaperLib.isPaper()) {
existingSection.tickingList.clear(); existingSection.tickingList.clear();
}
synchronized (lock) { synchronized (lock) {
// lock.acquire(); // lock.acquire();

Datei anzeigen

@ -510,8 +510,10 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
// Don't attempt to tick section whilst we're editing // Don't attempt to tick section whilst we're editing
if (existingSection != null) { if (existingSection != null) {
PaperweightPlatformAdapter.clearCounts(existingSection); PaperweightPlatformAdapter.clearCounts(existingSection);
if (PaperLib.isPaper()) {
existingSection.tickingList.clear(); existingSection.tickingList.clear();
} }
}
if (createCopy) { if (createCopy) {
char[] tmpLoad = loadPrivately(layerNo); char[] tmpLoad = loadPrivately(layerNo);
@ -553,7 +555,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
//ensure that the server doesn't try to tick the chunksection while we're editing it. (Again) //ensure that the server doesn't try to tick the chunksection while we're editing it. (Again)
PaperweightPlatformAdapter.clearCounts(existingSection); PaperweightPlatformAdapter.clearCounts(existingSection);
if (PaperLib.isPaper()) {
existingSection.tickingList.clear(); existingSection.tickingList.clear();
}
DelegateSemaphore lock = PaperweightPlatformAdapter.applyLock(existingSection); DelegateSemaphore lock = PaperweightPlatformAdapter.applyLock(existingSection);
synchronized (lock) { synchronized (lock) {

Datei anzeigen

@ -514,6 +514,13 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
LevelChunkSection newSection; LevelChunkSection newSection;
LevelChunkSection existingSection = levelChunkSections[getSectionIndex]; LevelChunkSection existingSection = levelChunkSections[getSectionIndex];
// Don't attempt to tick section whilst we're editing
if (existingSection != null) {
PaperweightPlatformAdapter.clearCounts(existingSection);
if (PaperLib.isPaper()) {
existingSection.tickingList.clear();
}
}
if (createCopy) { if (createCopy) {
char[] tmpLoad = loadPrivately(layerNo); char[] tmpLoad = loadPrivately(layerNo);
@ -564,7 +571,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
//ensure that the server doesn't try to tick the chunksection while we're editing it. (Again) //ensure that the server doesn't try to tick the chunksection while we're editing it. (Again)
PaperweightPlatformAdapter.clearCounts(existingSection); PaperweightPlatformAdapter.clearCounts(existingSection);
if (PaperLib.isPaper()) {
existingSection.tickingList.clear(); existingSection.tickingList.clear();
}
DelegateSemaphore lock = PaperweightPlatformAdapter.applyLock(existingSection); DelegateSemaphore lock = PaperweightPlatformAdapter.applyLock(existingSection);
synchronized (lock) { synchronized (lock) {