mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-06 15:51:31 +00:00
fix vmp patch skip entity zero movement (#511)
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] optimize getOnPos
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac71b359f6 100644
|
||||
index b4361d2164c497b0388fac1701a9944d41f58125..1f812fed92f842123708e39a76fe73dd825b3f92 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -895,6 +895,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -47,7 +47,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
}
|
||||
|
||||
this.onGroundNoBlocks = optional.isEmpty();
|
||||
@@ -1207,8 +1218,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1208,8 +1219,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
this.minorHorizontalCollision = false;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
if (this.isLocalInstanceAuthoritative()) {
|
||||
this.checkFallDamage(vec3.y, this.onGround(), blockState, onPosLegacy);
|
||||
}
|
||||
@@ -1275,9 +1286,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1276,9 +1287,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
float f = 0.6F;
|
||||
float f1 = (float)(movement.length() * 0.6F);
|
||||
float f2 = (float)(movement.horizontalDistance() * 0.6F);
|
||||
@@ -70,7 +70,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
boolean isStateClimbable = this.isStateClimbable(blockState);
|
||||
this.moveDist += isStateClimbable ? f1 : f2;
|
||||
this.flyDist += f1;
|
||||
@@ -1346,8 +1356,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1347,8 +1357,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
private void applyEffectsFromBlocks(List<Entity.Movement> movements) {
|
||||
if (this.isAffectedByBlocks()) {
|
||||
if (this.onGround()) {
|
||||
@@ -81,7 +81,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
blockState.getBlock().stepOn(this.level(), onPosLegacy, blockState, this);
|
||||
}
|
||||
|
||||
@@ -1442,34 +1452,124 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1443,34 +1453,124 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.getOnPos(0.2F);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
|
||||
protected float getBlockJumpFactor() {
|
||||
float jumpFactor = this.level().getBlockState(this.blockPosition()).getBlock().getJumpFactor();
|
||||
@@ -1481,7 +1581,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1482,7 +1582,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
BlockState blockState = this.level().getBlockState(this.blockPosition());
|
||||
float speedFactor = blockState.getBlock().getSpeedFactor();
|
||||
if (!blockState.is(Blocks.WATER) && !blockState.is(Blocks.BUBBLE_COLUMN)) {
|
||||
@@ -223,7 +223,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
} else {
|
||||
return speedFactor;
|
||||
}
|
||||
@@ -2103,7 +2203,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2104,7 +2204,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
@Deprecated
|
||||
protected BlockState getBlockStateOnLegacy() {
|
||||
@@ -232,7 +232,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
}
|
||||
|
||||
public BlockState getBlockStateOn() {
|
||||
@@ -2115,8 +2215,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -2116,8 +2216,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
protected void spawnSprintParticle() {
|
||||
@@ -244,7 +244,7 @@ index bc02ce9093adb0ec09252ce00f60dd84335cca70..bb16f3ebffcafcb11d3112e03f5767ac
|
||||
Vec3 deltaMovement = this.getDeltaMovement();
|
||||
BlockPos blockPos = this.blockPosition();
|
||||
diff --git a/net/minecraft/world/entity/ExperienceOrb.java b/net/minecraft/world/entity/ExperienceOrb.java
|
||||
index 3ee788b172240ccf38cb31385dff13364ccc4142..d88fc291f3c6ea7dd8293d39a435607937d877bc 100644
|
||||
index b7cd9b286e7392c3fd619c7ba9e049076e245fd6..d923c98460cbb5b99926914261417c7fc1af6810 100644
|
||||
--- a/net/minecraft/world/entity/ExperienceOrb.java
|
||||
+++ b/net/minecraft/world/entity/ExperienceOrb.java
|
||||
@@ -243,6 +243,13 @@ public class ExperienceOrb extends Entity {
|
||||
|
||||
Reference in New Issue
Block a user