mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-19 14:59:29 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@efdcaa2 Fix removing the "LootTable" nbt tag from Block entities (#11929) PaperMC/Paper@55f3f28 Reimplement ItemStack Obfuscation (#11817) PaperMC/Paper@08fc33c Update CustomTimingsHandler Nag Message (#11923) PaperMC/Paper@5e14504 [ci skip] Add missing deprecated docs for isEnabledByFeature (#11938) PaperMC/Paper@4007171 Correct obfuscation of oversized items (#11944) PaperMC/Paper@1b38f28 Fix reading recipes used on furnace (#11947) PaperMC/Paper@b03d39b [ci skip] Update paperweight to 2.0.0-beta.13 PaperMC/Paper@6316a50 Make CraftServer#isPrimaryThread use TickThread check PaperMC/Paper@ea7b961 Fix MapItem incorectly fetching water biomes on treasure maps (#11936) PaperMC/Paper@b242f1e Prevent day cycle on the client when using fixed time (#11924) PaperMC/Paper@3e42518 Fix snow accumulating in custom biomes without precipitation (#11854) PaperMC/Paper@3d9ecc4 Log thread check parameters when the thread check fails PaperMC/Paper@3ad3fbc Update to Concurrentutil 0.0.3 PaperMC/Paper@79ffcd1 Fix vanilla parity on enchantable items with no targets (#11896) PaperMC/Paper@19ddbef Fix InventoryAction wrong for Bundles (#11902) PaperMC/Paper@ac3aaa2 Don't use delayed registries in impl anywhere (#11918) PaperMC/Paper@775002a [ci skip] Remove nullable from SyncedEntityData#packAll (#11949) PaperMC/Paper@c949225 MenuType API addition InventoryView Builders (#11816) PaperMC/Paper@c2f24e1 Feat: Add 'with' methods to CommandSourceStack (#11868) PaperMC/Paper@ed75b0e Disallow calling JavaPlugin#getCommand during onEnable for Paper plugins (#11914) PaperMC/Paper@08ac057 Rename getPotentialBedLocation to getPotentialRespawnLocation (#11950) PaperMC/Paper@9746d73 Add back known movement check PaperMC/Paper@e5542cf Hide unnecessary decorated pot data (#11957) PaperMC/Paper@eb4db79 Make CommandSourceStack respect hidden players (#11898) PaperMC/Paper@76617dd Add EntityEffectTickEvent (#11838) PaperMC/Paper@86c6308 Fix locate command dist overflow/underflow (#11956) PaperMC/Paper@2ea6aee Deprecate Turtle#isDigging (#11959) PaperMC/Paper@ad74b67 Fix client visual desync if cooldown events are cancelled (#11892) PaperMC/Paper@50c2c59 Fix unstable Suggestion comparison by sorting int suggestions before text ones (#11941) PaperMC/Paper@3709150 Expose all possible block data states (#11958) PaperMC/Paper@5e23d28 Remove entity tag selector tag completion fix (#11964) PaperMC/Paper@ab1b312 Call PlayerItemDamageEvent for tridents (#11899) PaperMC/Paper@1bb3677 Remove deprecation from EntityRemoveEvent (#11961) PaperMC/Paper@d69981b [ci skip] Remove redundant build configuration PaperMC/Paper@6fde26d remove .paperassetsroot PaperMC/Paper@fe75eaf split direct holder support up from ctor accepting Holder PaperMC/Paper@c44f891 Fix PlayerUseUnknownEntityEvent jd (#11969) PaperMC/Paper@85d0040 [ci skip] Fix getTemperature javadocs (#11967) PaperMC/Paper@e82f7e6 [ci skip] Fix Inventory#setMaxStackSize jd (#11968) PaperMC/Paper@9f74858 [ci skip] Cleanup test plugin
68 lines
4.3 KiB
Diff
68 lines
4.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
|
Date: Tue, 8 Aug 2023 21:12:58 +0200
|
|
Subject: [PATCH] Add xor-shift random
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
|
Gale - https://galemc.org
|
|
|
|
This patch is based on the following patch:
|
|
"Apply faster random"
|
|
By: AlphaKR93 <dev@alpha93.kr>
|
|
As part of: Plazma (https://github.com/PlazmaMC/Plazma)
|
|
Class `org.plazmamc.plazma.Random` licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
|
Other changes licensed under: MIT (https://opensource.org/licenses/MIT)
|
|
|
|
* Plazma copyright *
|
|
|
|
The MIT License (MIT)
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
|
index 861bff267cb397e13e8e1c79bd0776b130c6e5da..30972bf7889973cf63b5f32ad166afdc9800bee1 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
|
@@ -21,7 +21,7 @@ import org.checkerframework.framework.qual.DefaultQualifier;
|
|
@DefaultQualifier(NonNull.class)
|
|
public class PaperLootableInventoryData {
|
|
|
|
- private static final Random RANDOM = new Random();
|
|
+ public static Random RANDOM; // Gale - xor-shift random - set in GaleGlobalConfiguration
|
|
|
|
private long lastFill = -1;
|
|
private long nextRefill = -1;
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index ba32db69c95b325a781cb2dff4200e4464a11baf..91156797d0ffed5227851b398d8b896aef71d614 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -286,7 +286,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
|
}
|
|
// Paper end
|
|
|
|
- private static final Random rand = new Random();
|
|
+ public static Random rand; // Gale - xor-shift random - set in GaleGlobalConfiguration
|
|
|
|
public CraftWorld(ServerLevel world, ChunkGenerator gen, BiomeProvider biomeProvider, Environment env) {
|
|
this.world = world;
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
|
index 759b6e54db93792c9862b1f1625118ac6fa49d7a..4b5e9bc33c25ac98c32aff1bd13788edf0eeee8c 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
|
|
@@ -14,7 +14,7 @@ import org.bukkit.inventory.meta.FireworkMeta;
|
|
|
|
public class CraftFirework extends CraftProjectile implements Firework {
|
|
|
|
- private final Random random = new Random();
|
|
+ private final Random random = org.galemc.gale.configuration.GaleGlobalConfiguration.get().smallOptimizations.useXorShiftRandom.elytraFireworkSpeed ? new org.galemc.gale.random.XorShiftRandom() : new Random(); // Gale - xor-shift random - not thread-safe but it is not really a concern here
|
|
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
|
|
|
|
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
|