mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-23 08:59:31 +00:00
Update Paper
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
||||
Date: Wed, 30 Nov 2022 07:32:05 +0800
|
||||
Subject: [PATCH] Random flatten triangular distribution
|
||||
|
||||
This patch is Powered by Carpet-TIS-Addition(https://github.com/plusls/Carpet-TIS-Addition)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/util/RandomSource.java b/src/main/java/net/minecraft/util/RandomSource.java
|
||||
index 9c6f5b55b1f1376fa75e216cd366ee47c79fafc4..50dc6530e6191f2a00025d4610e335041bc858a4 100644
|
||||
--- a/src/main/java/net/minecraft/util/RandomSource.java
|
||||
+++ b/src/main/java/net/minecraft/util/RandomSource.java
|
||||
@@ -53,7 +53,14 @@ public interface RandomSource {
|
||||
double nextGaussian();
|
||||
|
||||
default double triangle(double mode, double deviation) {
|
||||
- return mode + deviation * (this.nextDouble() - this.nextDouble());
|
||||
+ // Leaves start - flattenTriangularDistribution
|
||||
+ if (org.leavesmc.leaves.LeavesConfig.flattenTriangularDistribution) {
|
||||
+ this.nextDouble();
|
||||
+ return mode + deviation * (-1 + this.nextDouble() * 2);
|
||||
+ } else {
|
||||
+ return mode + deviation * (this.nextDouble() - this.nextDouble());
|
||||
+ }
|
||||
+ // Leaves end - flattenTriangularDistribution
|
||||
}
|
||||
|
||||
default void consumeCount(int count) {
|
||||
Reference in New Issue
Block a user