This commit is contained in:
AlphaKR93
2024-11-01 18:07:21 +09:00
parent 7a7a88a7bb
commit 2028e19bf8
9 changed files with 2555 additions and 2701 deletions

View File

@@ -52,7 +52,7 @@ jobs:
path: jdmain
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v3
- name: Set up GraalVM ${{ matrix.base_jdk }}
uses: graalvm/setup-graalvm@v1
@@ -72,9 +72,8 @@ jobs:
- name: Apply Patches
run: ./gradlew applyPatches --stacktrace
# TODO: fix tests
# - name: Build
# run: ./gradlew build --stacktrace
- name: Build
run: ./gradlew build --stacktrace
- name: Create Reobf Jar
run: ./gradlew createReobfPaperclipJar --stacktrace
@@ -115,7 +114,7 @@ jobs:
- name: Release Artifacts
if: startsWith(github.ref_name, 'ver/')
uses: softprops/action-gh-release@v0.1.15
uses: softprops/action-gh-release@v2
with:
name: "Build #${{ env.BUILD_NUMBER }} for ${{ env.VERSION }}"
tag_name: "build/${{ env.VERSION }}/${{ env.BUILD_NUMBER }}"
@@ -126,7 +125,7 @@ jobs:
- name: Release Artifacts (Latest/Stable)
if: startsWith(github.ref_name, 'ver/')
uses: softprops/action-gh-release@v0.1.15
uses: softprops/action-gh-release@v2
with:
name: "Build #${{ env.BUILD_NUMBER }} for ${{ env.VERSION }}"
tag_name: "build/${{ github.ref_name }}/latest"
@@ -137,7 +136,7 @@ jobs:
- name: Release Artifacts (Latest/Development)
if: startsWith(github.ref_name, 'dev/')
uses: softprops/action-gh-release@v0.1.15
uses: softprops/action-gh-release@v2
with:
name: "Development Build for ${{ env.VERSION }}"
tag_name: build/${{ env.VERSION }}/latest

3
.gitignore vendored
View File

@@ -18,6 +18,9 @@ out/
nbproject/
nbactions.xml
# vscode
.vscode/
# Gradle
!gradle-wrapper.jar
.gradle/

View File

@@ -8,7 +8,9 @@ export PROJECT_DIR=$(pwd)
alias api="cd $PROJECT_DIR/*-API"
alias srv="cd $PROJECT_DIR/*-Server"
alias g="./gradlew"
alias c="clear;"
alias ap="./gradlew --no-rebuild applyPatches"
alias aap="./gradlew --no-rebuild applyAPIPatches"
alias agp="./gradlew --no-rebuild applyGeneratedAPIPatches"
@@ -19,6 +21,11 @@ alias rap="./gradlew --no-rebuild rebuildAPIPatches"
alias rgp="./gradlew --no-rebuild rebuildGeneratedAPIPatches"
alias rsp="./gradlew --no-rebuild rebuildServerPatches"
alias run="./gradlew runDevServer"
alias build="./gradlew build"
alias reobf="./gradlew createReobfPaperclipJar"
alias mojmap="./gradlew createMojmapPaperclipJar"
alias lg="git log --oneline base..HEAD"
alias rc="git rebase --autosquash -i base"
alias rcc="git rebase --continue"

View File

@@ -0,0 +1,62 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 15 May 2024 14:12:50 +0900
Subject: [PATCH] Completely remove timings implementation
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
index 23594fb7eb4b2f33146592866608c2858ef23937..8acdea0f086129854cb44bc5ce8bbbc4e810b9ad 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperEventManager.java
@@ -1,6 +1,6 @@
package io.papermc.paper.plugin.manager;
-import co.aikar.timings.TimedEventExecutor;
+//import co.aikar.timings.TimedEventExecutor; // Plazma - Completely remove timings implementation
import com.destroystokyo.paper.event.server.ServerExceptionEvent;
import com.destroystokyo.paper.exception.ServerEventException;
import com.google.common.collect.Sets;
@@ -96,7 +96,7 @@ class PaperEventManager {
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
}
- executor = new TimedEventExecutor(executor, plugin, null, event);
+ //executor = new TimedEventExecutor(executor, plugin, null, event); // Plazma - Completely remove timings implementation
this.getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
}
@@ -183,7 +183,7 @@ class PaperEventManager {
}
}
- EventExecutor executor = new TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass);
+ EventExecutor executor = EventExecutor.create(method, eventClass); // Plazma - Completely remove timings implementation
eventSet.add(new RegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
}
return ret;
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java
index 097500a59336db1bbfffcd1aa4cff7a8586e46ec..844e340c331c6dd12eaaac247f871b042ceb6c25 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginManagerImpl.java
@@ -232,7 +232,7 @@ public class PaperPluginManagerImpl implements PluginManager, DependencyContext
@Override
public boolean useTimings() {
- return co.aikar.timings.Timings.isTimingsEnabled();
+ return false; // Thunderbolt - Remove remaining timings implementations
}
@Override
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5cd9b92bccf8446df2a9341a006e2e6bbcba7257..2ccf6415ec36a998904df6d5c4cae435b3e948e7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,7 +3,7 @@ package net.minecraft.server;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
import com.google.common.collect.ImmutableList;
-import co.aikar.timings.Timings;
+//import co.aikar.timings.Timings; // Plazma - Completely remove timings implementation
import com.destroystokyo.paper.event.server.PaperServerListPingEvent;
import com.google.common.base.Stopwatch;
import com.google.common.collect.Lists;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: scriptlinestudios <scriptlinestudios@protonmail.com>
Date: Thu, 31 Oct 2024 12:00:37 +0200
Subject: [PATCH] improve random block selection RNG
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 507671476c3d2d92a2fdb05be24443af27d26dcf..aa97b6a1c4dd1e23cd3a1657efd8a9109b053354 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -123,16 +123,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public final Thread thread;
private final boolean isDebug;
private int skyDarken;
- protected int randValue = RandomSource.create().nextInt();
+ protected long randValue = RandomSource.create().nextLong();
protected final int addend = 1013904223;
protected float oRainLevel;
public float rainLevel;
protected float oThunderLevel;
public float thunderLevel;
public final RandomSource random = RandomSource.create();
- /** @deprecated */
- @Deprecated
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
private final Holder<DimensionType> dimensionTypeRegistration;
public final WritableLevelData levelData;
private final Supplier<ProfilerFiller> profiler;
@@ -1327,15 +1324,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
public void playSound(@Nullable Player source, double x, double y, double z, SoundEvent sound, SoundSource category, float volume, float pitch) {
- this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.threadSafeRandom.nextLong());
+ this.randValue++;
+ this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.randValue);
}
public void playSound(@Nullable Player source, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch) {
- this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.threadSafeRandom.nextLong());
+ this.randValue++;
+ this.playSeededSound(source, x, y, z, sound, category, volume, pitch, this.randValue);
}
public void playSound(@Nullable Player source, Entity entity, SoundEvent sound, SoundSource category, float volume, float pitch) {
- this.playSeededSound(source, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(sound), category, volume, pitch, this.threadSafeRandom.nextLong());
+ this.randValue++;
+ this.playSeededSound(source, entity, BuiltInRegistries.SOUND_EVENT.wrapAsHolder(sound), category, volume, pitch, this.randValue);
}
public void playLocalSound(BlockPos pos, SoundEvent sound, SoundSource category, float volume, float pitch, boolean useDistance) {
@@ -1950,10 +1950,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public abstract RecipeManager getRecipeManager();
public BlockPos getBlockRandomPos(int x, int y, int z, int l) {
- this.randValue = this.randValue * 3 + 1013904223;
- int i1 = this.randValue >> 2;
+ this.randValue = (((long)(x ^ 16691) << 32 | ((z ^ 19391) & 0xffffffffL)) << 8 | ((this.randValue + 2319389831L) * 11 & 0xFF));
+ long i1 = Long.reverse(randValue*randValue<<39);
+ long i2 = Long.reverse(randValue*randValue<<41);
+ long i3 = Long.reverse(randValue*randValue<<23);
- return new BlockPos(x + (i1 & 15), y + (i1 >> 16 & l), z + (i1 >> 8 & 15));
+ return new BlockPos(x + ((int)i1 & 15), y + ((int)i2 & l), z + ((int)i3 & 15));
}
public boolean noSave() {