mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-04 15:41:40 +00:00
Move Purpur patches to first
To reduce the difficulty on maintenance and reduce chances to fix conflicts on updating
This commit is contained in:
@@ -5,19 +5,18 @@ Subject: [PATCH] cache eye block position
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index 1f812fed92f842123708e39a76fe73dd825b3f92..b47a15ca84a66283ceaf46d1d768bfa0530950c2 100644
|
||||
index f1081fbae2ab7b7b69f98a4dd01c8df6ffb753c0..ea5e38b2efe3b11eb80abb2326d06d9282b2fb5b 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -553,20 +553,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -553,18 +553,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
// Leaf start - Fix Pufferfish and Purpur patches
|
||||
// Purpur start - copied from Mob - API for any mob to burn daylight
|
||||
// Gale start - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
- private BlockPos cached_eye_blockpos;
|
||||
- private net.minecraft.world.phys.Vec3 cached_position;
|
||||
+ private BlockPos leaf$cached_eye_blockpos = BlockPos.ZERO;
|
||||
+ @Nullable private Vec3 leaf$cached_position = null;
|
||||
// Gale end - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
// Purpur start - copied from Mob - API for any mob to burn daylight
|
||||
public boolean isSunBurnTick() {
|
||||
if (this.level().isBrightOutside() && !this.level().isClientSide) {
|
||||
// Gale start - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
@@ -27,12 +26,11 @@ index 1f812fed92f842123708e39a76fe73dd825b3f92..b47a15ca84a66283ceaf46d1d768bfa0
|
||||
- }
|
||||
-
|
||||
- float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue(cached_eye_blockpos); // Pass BlockPos to getBrightness
|
||||
-
|
||||
+ float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
|
||||
|
||||
// Check brightness first
|
||||
if (lightLevelDependentMagicValue <= 0.5F) return false;
|
||||
if (this.random.nextFloat() * 30.0F >= (lightLevelDependentMagicValue - 0.4F) * 2.0F) return false;
|
||||
@@ -574,11 +568,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -573,11 +568,29 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
boolean flag = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
|
||||
@@ -61,9 +59,9 @@ index 1f812fed92f842123708e39a76fe73dd825b3f92..b47a15ca84a66283ceaf46d1d768bfa0
|
||||
+ // Leaf end - cache eye block pos
|
||||
+
|
||||
// Purpur end - copied from Mob - API for any mob to burn daylight
|
||||
// Leaf end - Fix Pufferfish and Purpur patches
|
||||
|
||||
@@ -2152,8 +2164,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
public Entity(EntityType<?> entityType, Level level) {
|
||||
@@ -2150,8 +2163,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
&& abstractBoat.getBoundingBox().maxY >= eyeY
|
||||
&& abstractBoat.getBoundingBox().minY <= eyeY
|
||||
)) {
|
||||
@@ -75,7 +73,7 @@ index 1f812fed92f842123708e39a76fe73dd825b3f92..b47a15ca84a66283ceaf46d1d768bfa0
|
||||
double d = blockPos.getY() + fluidState.getHeight(this.level(), blockPos);
|
||||
if (d > eyeY) {
|
||||
// Leaf start - Optimize isEyeInFluid
|
||||
@@ -2281,20 +2294,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2279,20 +2293,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
@Deprecated
|
||||
public float getLightLevelDependentMagicValue() {
|
||||
@@ -98,7 +96,7 @@ index 1f812fed92f842123708e39a76fe73dd825b3f92..b47a15ca84a66283ceaf46d1d768bfa0
|
||||
|
||||
public void absSnapTo(double x, double y, double z, float yRot, float xRot) {
|
||||
this.absSnapTo(x, y, z);
|
||||
@@ -4532,6 +4535,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4530,6 +4534,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
EntityDimensions dimensions = this.getDimensions(pose);
|
||||
this.dimensions = dimensions;
|
||||
this.eyeHeight = dimensions.eyeHeight();
|
||||
@@ -106,7 +104,7 @@ index 1f812fed92f842123708e39a76fe73dd825b3f92..b47a15ca84a66283ceaf46d1d768bfa0
|
||||
}
|
||||
|
||||
public void refreshDimensions() {
|
||||
@@ -4540,6 +4544,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -4538,6 +4543,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
EntityDimensions dimensions = this.getDimensions(pose);
|
||||
this.dimensions = dimensions;
|
||||
this.eyeHeight = dimensions.eyeHeight();
|
||||
@@ -115,7 +113,7 @@ index 1f812fed92f842123708e39a76fe73dd825b3f92..b47a15ca84a66283ceaf46d1d768bfa0
|
||||
boolean flag = dimensions.width() <= 4.0F && dimensions.height() <= 4.0F;
|
||||
if (!this.level.isClientSide
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 453c3eb95bebd426d0457f27bda261033dd7b14d..8baa17d2eadfa83b1fcb36fcd1408e917b883989 100644
|
||||
index 2bdfd3f60e217e8959ce45a259eb9434392fdc68..179722eb09e3c48220ec7d7a25332a000faf710c 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -464,7 +464,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
|
||||
|
||||
Reference in New Issue
Block a user