mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-21 15:59:33 +00:00
78 lines
5.4 KiB
Diff
78 lines
5.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: violetc <58360096+s-yh-china@users.noreply.github.com>
|
|
Date: Thu, 16 Feb 2023 17:25:01 +0800
|
|
Subject: [PATCH] Use vanilla random config
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 76508bdb3331f8b33d1b7575e8500cef3fa7e8f4..e4ad454fed1d4f615621c7973598f8106f57b5ab 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -547,7 +547,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
|
this.bb = Entity.INITIAL_AABB;
|
|
this.stuckSpeedMultiplier = Vec3.ZERO;
|
|
this.nextStep = 1.0F;
|
|
- this.random = SHARED_RANDOM; // Paper
|
|
+ this.random = top.leavesmc.leaves.LeavesConfig.useVanillaRandom ? RandomSource.create() : SHARED_RANDOM; // Paper // Leaves - vanilla plz
|
|
this.remainingFireTicks = -this.getFireImmuneTicks();
|
|
this.fluidHeight = new Object2DoubleArrayMap(2);
|
|
this.fluidOnEyes = new HashSet();
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
|
index a87a34b0c4c8e5d0cf079025c230b1434c919b54..c56dd96ab35dae5331e9cec4bc27cdb78c1741fc 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
|
@@ -1036,7 +1036,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
|
|
|
BeeGoToHiveGoal() {
|
|
super();
|
|
- this.travellingTicks = Bee.this.random.nextInt(10); // CraftBukkit - SPIGOT-7495: Give Bees another chance and let them use their own random, avoid concurrency issues
|
|
+ this.travellingTicks = top.leavesmc.leaves.LeavesConfig.useVanillaRandom ? Bee.this.level().random.nextInt(10) : Bee.this.random.nextInt(10); // CraftBukkit - SPIGOT-7495: Give Bees another chance and let them use their own random, avoid concurrency issues // Leaves - why no vanilla
|
|
this.blacklistedTargets = Lists.newArrayList();
|
|
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
index f60c4cd0543fd5d50fa7e2c1a9e8381227adb540..8c9c694744951dc11b9f8828f27e4d4a2210a3bc 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java
|
|
@@ -44,7 +44,7 @@ public class Squid extends WaterAnimal {
|
|
|
|
public Squid(EntityType<? extends Squid> type, Level world) {
|
|
super(type, world);
|
|
- //this.random.setSeed((long)this.getId()); // Paper - we set the random to shared, do not clobber the seed
|
|
+ if (top.leavesmc.leaves.LeavesConfig.useVanillaRandom) this.random.setSeed(this.getId()); // Paper - we set the random to shared, do not clobber the seed // Leaves - vanilla plz
|
|
this.tentacleSpeed = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
index 1b6cd8276c6bda2832f6447a2cceb75f11e6811a..c8abafdfc2bd09429fe0a509b1afa1579d5d75b6 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
@@ -73,7 +73,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
|
// Paper start - don't use world random in entity constructor
|
|
this(EntityType.ITEM, world);
|
|
this.setPos(x, y, z);
|
|
- this.setDeltaMovement(this.random.nextDouble() * 0.2D - 0.1D, 0.2D, this.random.nextDouble() * 0.2D - 0.1D);
|
|
+ // Leaves start - vanilla yes, paper no
|
|
+ if (top.leavesmc.leaves.LeavesConfig.useVanillaRandom) {
|
|
+ this.setDeltaMovement(world.random.nextDouble() * 0.2D - 0.1D, 0.2D, world.random.nextDouble() * 0.2D - 0.1D);
|
|
+ } else {
|
|
+ this.setDeltaMovement(this.random.nextDouble() * 0.2D - 0.1D, 0.2D, this.random.nextDouble() * 0.2D - 0.1D);
|
|
+ }
|
|
+ // Leaves end - vanilla yes, paper no
|
|
this.setItem(stack);
|
|
// Paper end
|
|
// Leaves start - stackable shulker boxes
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
index 1d3764c2278a5daf1cfddf28c6ae78dd8809d4ff..8c96f1ad6b6de5f42b275f08ad47ce8d8f7aea49 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
|
|
@@ -43,7 +43,7 @@ public class PrimedTnt extends Entity implements TraceableEntity {
|
|
public PrimedTnt(Level world, double x, double y, double z, @Nullable LivingEntity igniter) {
|
|
this(EntityType.TNT, world);
|
|
this.setPos(x, y, z);
|
|
- double d3 = this.random.nextDouble() * 6.2831854820251465D; // Paper - don't use world random in entity constructor
|
|
+ double d3 = (top.leavesmc.leaves.LeavesConfig.useVanillaRandom ? world.random.nextDouble() : this.random.nextDouble()) * 6.2831854820251465D; // Paper - don't use world random in entity constructor // Leaves - why?
|
|
|
|
this.setDeltaMovement(-Math.sin(d3) * 0.02D, 0.20000000298023224D, -Math.cos(d3) * 0.02D);
|
|
this.setFuse(80);
|