fix reobf issues around randomsource impls
prolly should be fixed in a mapping patch instead but I don't wanna
This commit is contained in:
parent
02804a49a2
commit
8399e10c43
|
@ -6,10 +6,10 @@ Subject: [PATCH] Use a Shared Random for Entities
|
|||
Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index e6917848029b1686e4e3a1a0eadac85eda92518d..91a5b46e5a7459494a49a85ba93dc0ced146b717 100644
|
||||
index e6917848029b1686e4e3a1a0eadac85eda92518d..3e0f58a928931fd1b3ee32f9dadf65288d8798d6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -158,6 +158,38 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -158,6 +158,74 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
}
|
||||
|
||||
|
@ -42,13 +42,49 @@ index e6917848029b1686e4e3a1a0eadac85eda92518d..91a5b46e5a7459494a49a85ba93dc0ce
|
|||
+ public int nextInt(int origin, int bound) {
|
||||
+ return RandomSource.super.nextInt(origin, bound);
|
||||
+ }
|
||||
+
|
||||
+ // these below are added to fix reobf issues that I don't wanna deal with right now
|
||||
+ @Override
|
||||
+ public long nextLong() {
|
||||
+ return super.nextInt();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextInt() {
|
||||
+ return super.nextInt();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextInt(int bound) {
|
||||
+ return super.nextInt(bound);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean nextBoolean() {
|
||||
+ return super.nextBoolean();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float nextFloat() {
|
||||
+ return super.nextFloat();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double nextDouble() {
|
||||
+ return super.nextDouble();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double nextGaussian() {
|
||||
+ return super.nextGaussian();
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
private CraftEntity bukkitEntity;
|
||||
|
||||
public CraftEntity getBukkitEntity() {
|
||||
@@ -345,7 +377,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -345,7 +413,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.bb = Entity.INITIAL_AABB;
|
||||
this.stuckSpeedMultiplier = Vec3.ZERO;
|
||||
this.nextStep = 1.0F;
|
||||
|
|
|
@ -516,10 +516,10 @@ index 0000000000000000000000000000000000000000..3377b86c337d0234bbb9b0349e4034a7
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 91a5b46e5a7459494a49a85ba93dc0ced146b717..86bdbd2d08f8ad5561597b95295cbfc68522a0bc 100644
|
||||
index 3e0f58a928931fd1b3ee32f9dadf65288d8798d6..cd4b9b659904e587933b83616dfdcffb2de8bea5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -190,6 +190,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -226,6 +226,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 86bdbd2d08f8ad5561597b95295cbfc68522a0bc..d729d0ab7168246af901513e41334176a1f95861 100644
|
||||
index cd4b9b659904e587933b83616dfdcffb2de8bea5..a93426773dff94aebea8283ebd9f21fa841e01d7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2281,6 +2281,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2317,6 +2317,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
protected boolean addPassenger(Entity entity) { // CraftBukkit
|
||||
|
|
|
@ -27,10 +27,10 @@ index 8451982ba4fc9522f2d77f68fc63a0e12558955f..ee8ce0e5bdb0acb7d6ef3439a388e108
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d729d0ab7168246af901513e41334176a1f95861..abfa26bf132dd2d0ef2979bac92eff87c11dd5cd 100644
|
||||
index a93426773dff94aebea8283ebd9f21fa841e01d7..1e9589e08149bbbbe581ecb68d9f590d16ed897a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -337,6 +337,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -373,6 +373,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public void inactiveTick() { }
|
||||
// Spigot end
|
||||
// Paper start
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner()
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index abfa26bf132dd2d0ef2979bac92eff87c11dd5cd..106ff6a91c557d08305250f24f82dc84e8e4b79a 100644
|
||||
index 1e9589e08149bbbbe581ecb68d9f590d16ed897a..66a5a84098913b9bf6456e52df103332dcb147bb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -338,6 +338,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -374,6 +374,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// Spigot end
|
||||
// Paper start
|
||||
protected int numCollisions = 0; // Paper
|
||||
|
@ -16,7 +16,7 @@ index abfa26bf132dd2d0ef2979bac92eff87c11dd5cd..106ff6a91c557d08305250f24f82dc84
|
|||
@javax.annotation.Nullable
|
||||
private org.bukkit.util.Vector origin;
|
||||
@javax.annotation.Nullable
|
||||
@@ -1918,6 +1919,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1954,6 +1955,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ index abfa26bf132dd2d0ef2979bac92eff87c11dd5cd..106ff6a91c557d08305250f24f82dc84
|
|||
// Paper end
|
||||
return nbt;
|
||||
} catch (Throwable throwable) {
|
||||
@@ -2055,6 +2060,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2091,6 +2096,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.originWorld = originWorld;
|
||||
origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2));
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString()
|
|||
UUID, ticks lived, valid, dead
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 106ff6a91c557d08305250f24f82dc84e8e4b79a..d09251502261764fdbb05facb6ce9a8d465ca3a9 100644
|
||||
index 66a5a84098913b9bf6456e52df103332dcb147bb..31decb2c608042d026cb8a996389cf0c11859c13 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2864,7 +2864,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2900,7 +2900,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public String toString() {
|
||||
String s = this.level == null ? "~NULL~" : this.level.toString();
|
||||
|
||||
|
|
|
@ -72,10 +72,10 @@ index efd06327b3cbe15d6a4c8b2f1082bc43798de311..8c00f5d064106cca5722bdd41287ba4e
|
|||
return false;
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d09251502261764fdbb05facb6ce9a8d465ca3a9..737f941bee26abfc73304d362913c552c0d3552b 100644
|
||||
index 31decb2c608042d026cb8a996389cf0c11859c13..bae9afa3f56fed4bd00e1ce5e760935829c1c751 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -193,6 +193,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -229,6 +229,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||
private CraftEntity bukkitEntity;
|
||||
|
||||
|
|
|
@ -41,10 +41,10 @@ index 222452a5549e29ef43d183390cc41783aeb8f3e9..3e50915041041486dc6dd939609bcd26
|
|||
|
||||
if (entity1 != entity && this.connection != null) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 737f941bee26abfc73304d362913c552c0d3552b..848a9b1650c222f92b4ba7fba972f21fde9b3498 100644
|
||||
index bae9afa3f56fed4bd00e1ce5e760935829c1c751..df59b8252e8182519c587ed27feca4963a4d57e9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2277,11 +2277,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2313,11 +2313,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public void removeVehicle() {
|
||||
|
@ -62,7 +62,7 @@ index 737f941bee26abfc73304d362913c552c0d3552b..848a9b1650c222f92b4ba7fba972f21f
|
|||
}
|
||||
|
||||
}
|
||||
@@ -2344,7 +2349,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2380,7 +2385,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return true; // CraftBukkit
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ index 737f941bee26abfc73304d362913c552c0d3552b..848a9b1650c222f92b4ba7fba972f21f
|
|||
if (entity.getVehicle() == this) {
|
||||
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
|
||||
} else {
|
||||
@@ -2354,7 +2362,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2390,7 +2398,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
|
||||
VehicleExitEvent event = new VehicleExitEvent(
|
||||
(Vehicle) this.getBukkitEntity(),
|
||||
|
@ -83,7 +83,7 @@ index 737f941bee26abfc73304d362913c552c0d3552b..848a9b1650c222f92b4ba7fba972f21f
|
|||
);
|
||||
// Suppress during worldgen
|
||||
if (this.valid) {
|
||||
@@ -2368,7 +2376,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2404,7 +2412,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
// CraftBukkit end
|
||||
// Spigot start
|
||||
|
|
|
@ -35,7 +35,7 @@ index 056d89f0a8f94e2be94a773068cf2cf52556ce5a..604ce3bcec48f63292020220e4636595
|
|||
});
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 848a9b1650c222f92b4ba7fba972f21fde9b3498..2bbfd0364af2ad49ffdfa0eeb124eed6278efade 100644
|
||||
index df59b8252e8182519c587ed27feca4963a4d57e9..f075e2663260759c457bce48d2ce0773709fc9e7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -73,6 +73,8 @@ import net.minecraft.world.InteractionHand;
|
||||
|
@ -47,7 +47,7 @@ index 848a9b1650c222f92b4ba7fba972f21fde9b3498..2bbfd0364af2ad49ffdfa0eeb124eed6
|
|||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.vehicle.Boat;
|
||||
@@ -189,6 +191,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -225,6 +227,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
|
@ -55,7 +55,7 @@ index 848a9b1650c222f92b4ba7fba972f21fde9b3498..2bbfd0364af2ad49ffdfa0eeb124eed6
|
|||
|
||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||
private CraftEntity bukkitEntity;
|
||||
@@ -1921,6 +1924,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1957,6 +1960,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ index 848a9b1650c222f92b4ba7fba972f21fde9b3498..2bbfd0364af2ad49ffdfa0eeb124eed6
|
|||
// Save entity's from mob spawner status
|
||||
if (spawnedViaMobSpawner) {
|
||||
nbt.putBoolean("Paper.FromMobSpawner", true);
|
||||
@@ -2064,6 +2070,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2100,6 +2106,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
||||
|
|
|
@ -108,10 +108,10 @@ index 06d4c948241f121f4ccafe869b3e37c8a6279622..1d036031889a41134b5c475c18a85c5b
|
|||
} else {
|
||||
passenger.stopRiding();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 2bbfd0364af2ad49ffdfa0eeb124eed6278efade..a5366974f4252dabb26e89273103008115a94a72 100644
|
||||
index f075e2663260759c457bce48d2ce0773709fc9e7..f5f40e97fa07cd84de0c759a6dffd638f752d466 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -342,6 +342,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -378,6 +378,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public void inactiveTick() { }
|
||||
// Spigot end
|
||||
// Paper start
|
||||
|
@ -120,7 +120,7 @@ index 2bbfd0364af2ad49ffdfa0eeb124eed6278efade..a5366974f4252dabb26e892731030081
|
|||
protected int numCollisions = 0; // Paper
|
||||
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
|
||||
@javax.annotation.Nullable
|
||||
@@ -815,6 +817,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -851,6 +853,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
} else {
|
||||
this.wasOnFire = this.isOnFire();
|
||||
if (movementType == MoverType.PISTON) {
|
||||
|
@ -129,7 +129,7 @@ index 2bbfd0364af2ad49ffdfa0eeb124eed6278efade..a5366974f4252dabb26e892731030081
|
|||
movement = this.limitPistonMovement(movement);
|
||||
if (movement.equals(Vec3.ZERO)) {
|
||||
return;
|
||||
@@ -827,6 +831,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -863,6 +867,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.stuckSpeedMultiplier = Vec3.ZERO;
|
||||
this.setDeltaMovement(Vec3.ZERO);
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the
|
|||
heightmap resolves the issue without having to load all spawn chunks.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a5366974f4252dabb26e89273103008115a94a72..3747415098127bb5700fa6e019635a345732557b 100644
|
||||
index f5f40e97fa07cd84de0c759a6dffd638f752d466..22e4ca3ae5136f7df92981272c30f7f53d47e5cc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3071,6 +3071,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3107,6 +3107,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (flag1) {
|
||||
blockposition1 = ServerLevel.END_SPAWN_POINT;
|
||||
} else {
|
||||
|
|
|
@ -21,10 +21,10 @@ index a9b3442a49dc359959496d1f6adadefa76bfc863..62dfb6afe204c078f579a3dae944d935
|
|||
private void lightQueueSize() {
|
||||
lightQueueSize = getInt("light-queue-size", lightQueueSize);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 3747415098127bb5700fa6e019635a345732557b..0d930c195cb898b5649b49e74425b53693ea87c1 100644
|
||||
index 22e4ca3ae5136f7df92981272c30f7f53d47e5cc..6be19303b491c42d86c617166427f44f75bdaff4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -344,6 +344,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -380,6 +380,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// Paper start
|
||||
public long activatedImmunityTick = Integer.MIN_VALUE; // Paper
|
||||
public boolean isTemporarilyActive = false; // Paper
|
||||
|
@ -32,7 +32,7 @@ index 3747415098127bb5700fa6e019635a345732557b..0d930c195cb898b5649b49e74425b536
|
|||
protected int numCollisions = 0; // Paper
|
||||
public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one
|
||||
@javax.annotation.Nullable
|
||||
@@ -1942,6 +1943,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1978,6 +1979,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (spawnedViaMobSpawner) {
|
||||
nbt.putBoolean("Paper.FromMobSpawner", true);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ index 3747415098127bb5700fa6e019635a345732557b..0d930c195cb898b5649b49e74425b536
|
|||
// Paper end
|
||||
return nbt;
|
||||
} catch (Throwable throwable) {
|
||||
@@ -2081,6 +2085,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2117,6 +2121,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
||||
|
|
|
@ -26,10 +26,10 @@ index a2071ea91515c5ddd2318cc4918328d20dec224e..dcdf25a8111410d54adc2e758775efcc
|
|||
entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 0d930c195cb898b5649b49e74425b53693ea87c1..8833e6161f1dc5eb524d0eee7a3ce120a5584782 100644
|
||||
index 6be19303b491c42d86c617166427f44f75bdaff4..94ff77c8ea011d74367589ee3121484066314018 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -194,6 +194,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -230,6 +230,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason; // Paper
|
||||
|
||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||
|
|
|
@ -7,10 +7,10 @@ The code following this has better support for null worlds to move
|
|||
them back to the world spawn.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 8833e6161f1dc5eb524d0eee7a3ce120a5584782..7dd4c0bc2fb874a94970ddbf86f998948ee72796 100644
|
||||
index 94ff77c8ea011d74367589ee3121484066314018..3905bbb797f0f4f1d6e5822fc7b52f66f9979421 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2058,9 +2058,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2094,9 +2094,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
bworld = server.getWorld(worldName);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the
|
|||
same item twice because the source was destroyed.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 7dd4c0bc2fb874a94970ddbf86f998948ee72796..89471c12b3d251848ad57e975c27673f756a5133 100644
|
||||
index 3905bbb797f0f4f1d6e5822fc7b52f66f9979421..9cb122ff9347eb8da347de98f362cca2709f60ce 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2188,11 +2188,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2224,11 +2224,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
} else {
|
||||
// CraftBukkit start - Capture drops for death event
|
||||
if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) {
|
||||
|
@ -34,7 +34,7 @@ index 7dd4c0bc2fb874a94970ddbf86f998948ee72796..89471c12b3d251848ad57e975c27673f
|
|||
|
||||
entityitem.setDefaultPickUpDelay();
|
||||
// CraftBukkit start
|
||||
@@ -2956,6 +2957,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2992,6 +2993,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@Nullable
|
||||
public Entity teleportTo(ServerLevel worldserver, BlockPos location) {
|
||||
// CraftBukkit end
|
||||
|
@ -47,7 +47,7 @@ index 7dd4c0bc2fb874a94970ddbf86f998948ee72796..89471c12b3d251848ad57e975c27673f
|
|||
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
||||
this.level.getProfiler().push("changeDimension");
|
||||
// CraftBukkit start
|
||||
@@ -2982,6 +2989,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3018,6 +3025,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// CraftBukkit end
|
||||
|
||||
this.level.getProfiler().popPush("reloading");
|
||||
|
@ -59,7 +59,7 @@ index 7dd4c0bc2fb874a94970ddbf86f998948ee72796..89471c12b3d251848ad57e975c27673f
|
|||
Entity entity = this.getType().create(worldserver);
|
||||
|
||||
if (entity != null) {
|
||||
@@ -2995,10 +3007,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3031,10 +3043,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// CraftBukkit start - Forward the CraftEntity to the new entity
|
||||
this.getBukkitEntity().setHandle(entity);
|
||||
entity.bukkitEntity = this.getBukkitEntity();
|
||||
|
@ -70,7 +70,7 @@ index 7dd4c0bc2fb874a94970ddbf86f998948ee72796..89471c12b3d251848ad57e975c27673f
|
|||
// CraftBukkit end
|
||||
}
|
||||
|
||||
@@ -3120,7 +3128,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3156,7 +3164,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public boolean canChangeDimensions() {
|
||||
|
|
|
@ -280,7 +280,7 @@ index 464a00542756437d8c3dccc1a85ae51cfdb588d2..95dbf60604d86666a359c0d861ef3eb8
|
|||
return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 89471c12b3d251848ad57e975c27673f756a5133..a92e716a295bf575c3ec47387c008fda8d6c6b77 100644
|
||||
index 9cb122ff9347eb8da347de98f362cca2709f60ce..5a1dff0c0806ac7ca3d7db531f2a84be8ddc7ca4 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -56,6 +56,7 @@ import net.minecraft.network.syncher.EntityDataSerializers;
|
||||
|
@ -291,7 +291,7 @@ index 89471c12b3d251848ad57e975c27673f756a5133..a92e716a295bf575c3ec47387c008fda
|
|||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -382,6 +383,39 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -418,6 +419,39 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a92e716a295bf575c3ec47387c008fda8d6c6b77..99ca6777dbdbef9c3955614ec05ce354ff4b14d0 100644
|
||||
index 5a1dff0c0806ac7ca3d7db531f2a84be8ddc7ca4..a34797b5afd6460a5f98e9485c53d6963c6ee462 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -620,8 +620,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -656,8 +656,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public void setPos(double x, double y, double z) {
|
||||
|
@ -19,7 +19,7 @@ index a92e716a295bf575c3ec47387c008fda8d6c6b77..99ca6777dbdbef9c3955614ec05ce354
|
|||
}
|
||||
|
||||
protected AABB makeBoundingBox() {
|
||||
@@ -3833,6 +3833,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3869,6 +3869,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public final void setPosRaw(double x, double y, double z) {
|
||||
|
@ -31,7 +31,7 @@ index a92e716a295bf575c3ec47387c008fda8d6c6b77..99ca6777dbdbef9c3955614ec05ce354
|
|||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||
this.position = new Vec3(x, y, z);
|
||||
int i = Mth.floor(x);
|
||||
@@ -3850,6 +3855,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3886,6 +3891,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.levelCallback.onMove();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add entity liquid API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 99ca6777dbdbef9c3955614ec05ce354ff4b14d0..c91a81a26bb85041ac6f93de93ca4d7ba2513f39 100644
|
||||
index a34797b5afd6460a5f98e9485c53d6963c6ee462..9bff42f4bd84b6ec294ff8515d52d40d8373b197 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1407,7 +1407,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1443,7 +1443,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return this.isInWater() || this.isInRain();
|
||||
}
|
||||
|
||||
|
|
|
@ -1135,10 +1135,10 @@ index f9fbbd0130c1d3e2ed51f0c79d275c6861aec4fd..28ef198d96e78fb51125519f3707545f
|
|||
if (updatingChunk != null) {
|
||||
return updatingChunk.getEntityTickingChunkFuture();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index c91a81a26bb85041ac6f93de93ca4d7ba2513f39..3590c6de96e741d656654b228a59efc43a79cde2 100644
|
||||
index 9bff42f4bd84b6ec294ff8515d52d40d8373b197..be6c44b0f5139a9de7605264b460093604988f9f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -251,7 +251,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -287,7 +287,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
private BlockPos blockPosition;
|
||||
private ChunkPos chunkPosition;
|
||||
private Vec3 deltaMovement;
|
||||
|
@ -1194,7 +1194,7 @@ index 62aef8853b168d6330fb3fe357dfb8de310cc37f..d84db6b9cbabd7979c391fa7d1ae1f55
|
|||
net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) either.left().orElse(null);
|
||||
if (chunk != null) addTicket(x, z); // Paper
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index f5ccd52b40bccc478c83d9393adf8622fc101aa2..463e8e1604860dd23ab154936a954bc5f4595050 100644
|
||||
index ccdbeadcb232832b12c3249a24966136b7ac54fd..55f7bf62671d55cf967b55ae7233b6caa735f3af 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1028,6 +1028,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
|
|
@ -31,7 +31,7 @@ index 5c00238e29cfd6ed107e3bf988a9ac2e55e55361..85841a93e17e685bb7d676995891d27c
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 3590c6de96e741d656654b228a59efc43a79cde2..ee5f3e0adc86660b7f8eacf761a9b2cf0e019394 100644
|
||||
index be6c44b0f5139a9de7605264b460093604988f9f..11f6b176c03c9a2b02d2355e7f650c043aa44ba6 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -157,6 +157,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
@ -42,7 +42,7 @@ index 3590c6de96e741d656654b228a59efc43a79cde2..ee5f3e0adc86660b7f8eacf761a9b2cf
|
|||
static boolean isLevelAtLeast(CompoundTag tag, int level) {
|
||||
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
|
||||
}
|
||||
@@ -1614,6 +1615,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1650,6 +1651,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public void moveTo(double x, double y, double z, float yaw, float pitch) {
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index ee5f3e0adc86660b7f8eacf761a9b2cf0e019394..b649331eb5e1a94d4d9c4bc16f17c7abdf25e417 100644
|
||||
index 11f6b176c03c9a2b02d2355e7f650c043aa44ba6..e51d32717e29a4c1cba723edc24c851dea5ec2e7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4036,4 +4036,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4072,4 +4072,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
void accept(Entity entity, double x, double y, double z);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Entity#isTicking
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b649331eb5e1a94d4d9c4bc16f17c7abdf25e417..abff005638997cc991bc7e7c5fd98c91d8f076cf 100644
|
||||
index e51d32717e29a4c1cba723edc24c851dea5ec2e7..d6c75e74bf680ee8968803708408954f6dfa3d79 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -58,6 +58,7 @@ import net.minecraft.resources.ResourceKey;
|
||||
|
@ -16,7 +16,7 @@ index b649331eb5e1a94d4d9c4bc16f17c7abdf25e417..abff005638997cc991bc7e7c5fd98c91
|
|||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.level.TicketType;
|
||||
@@ -4041,5 +4042,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4077,5 +4078,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public static int nextEntityId() {
|
||||
return ENTITY_COUNTER.incrementAndGet();
|
||||
}
|
||||
|
|
|
@ -21,10 +21,10 @@ index 9147b408b35b7d15ced3749e34706087d2cdffd8..340e610b6af2dab7d916c530d3cce9aa
|
|||
private void keepLoadedRange() {
|
||||
keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index abff005638997cc991bc7e7c5fd98c91d8f076cf..a260eeed180b43bb0b13e3192682822a4fde624c 100644
|
||||
index d6c75e74bf680ee8968803708408954f6dfa3d79..0ad4e512ea9400957a2f19a5b8854b628965104d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1795,6 +1795,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1831,6 +1831,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public boolean isPushable() {
|
||||
|
|
|
@ -28,10 +28,10 @@ index 96fd9803810db0f8a4b25e070a56da05862e1e4e..2b3e034d6cddbe5c94f2be856833680d
|
|||
public int wanderingTraderSpawnDayTicks = 24000;
|
||||
public int wanderingTraderSpawnChanceFailureIncrement = 25;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index a260eeed180b43bb0b13e3192682822a4fde624c..5f5c6b2bf1c3056965ea343a1444e1be753d819f 100644
|
||||
index 0ad4e512ea9400957a2f19a5b8854b628965104d..16a1f39c118778efa6b494cad1f9ad639e6dbb41 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1678,6 +1678,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1714,6 +1714,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public void push(Entity entity) {
|
||||
if (!this.isPassengerOfSameVehicle(entity)) {
|
||||
if (!entity.noPhysics && !this.noPhysics) {
|
||||
|
|
|
@ -11,10 +11,10 @@ Move the tick logic into the post tick, where portaling was
|
|||
designed to happen in the first place.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 5f5c6b2bf1c3056965ea343a1444e1be753d819f..b5340dc3c41ac10637794422b974d69a8a70c23b 100644
|
||||
index 16a1f39c118778efa6b494cad1f9ad639e6dbb41..4af9eda54cf1430abc6abca07628635a2af35f53 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -417,6 +417,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -453,6 +453,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
|
||||
}
|
||||
// Paper end - optimise entity tracking
|
||||
|
@ -51,7 +51,7 @@ index 5f5c6b2bf1c3056965ea343a1444e1be753d819f..b5340dc3c41ac10637794422b974d69a
|
|||
|
||||
public Entity(EntityType<?> type, Level world) {
|
||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||
@@ -2582,6 +2612,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2618,6 +2648,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
this.processPortalCooldown();
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Optimize indirect passenger iteration
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index b5340dc3c41ac10637794422b974d69a8a70c23b..4dae2acdcc26a5513efe8df6b1904c7c85b08675 100644
|
||||
index 4af9eda54cf1430abc6abca07628635a2af35f53..861bd56910aa3ae1c683d01eacf4750c8a12971d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3558,26 +3558,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3594,26 +3594,41 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
private Stream<Entity> getIndirectPassengersStream() {
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add back EntityPortalExitEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4dae2acdcc26a5513efe8df6b1904c7c85b08675..80be82855b06fa98602775027906f4b77076be35 100644
|
||||
index 861bd56910aa3ae1c683d01eacf4750c8a12971d..b83070b44fe90a53a2807716598aee5c34116eca 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3059,6 +3059,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3095,6 +3095,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
} else {
|
||||
// CraftBukkit start
|
||||
worldserver = shapedetectorshape.world;
|
||||
|
@ -32,7 +32,7 @@ index 4dae2acdcc26a5513efe8df6b1904c7c85b08675..80be82855b06fa98602775027906f4b7
|
|||
if (worldserver == this.level) {
|
||||
// SPIGOT-6782: Just move the entity if a plugin changed the world to the one the entity is already in
|
||||
this.moveTo(shapedetectorshape.pos.x, shapedetectorshape.pos.y, shapedetectorshape.pos.z, shapedetectorshape.yRot, shapedetectorshape.xRot);
|
||||
@@ -3078,8 +3095,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3114,8 +3131,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
if (entity != null) {
|
||||
entity.restoreFrom(this);
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 80be82855b06fa98602775027906f4b77076be35..4cab4400345a9ce3e1c6ae0fa4288d86c53e1704 100644
|
||||
index b83070b44fe90a53a2807716598aee5c34116eca..0fdcb84b9ae3df528e91877518154da9919eea55 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1884,6 +1884,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1920,6 +1920,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -953,10 +953,10 @@ index ba3023c7dd5b3bcf66f829fe5dc9757f96d16b45..05ff7bcc79e617904903cf082f6687d2
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4cab4400345a9ce3e1c6ae0fa4288d86c53e1704..038a7d0a1f5e38e630b3b39268454f095f0512e7 100644
|
||||
index 0fdcb84b9ae3df528e91877518154da9919eea55..576dd79386c1514778aaaf558452e8eb9c354764 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -448,6 +448,56 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -484,6 +484,56 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
// Paper end - make end portalling safe
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ index 4cab4400345a9ce3e1c6ae0fa4288d86c53e1704..038a7d0a1f5e38e630b3b39268454f09
|
|||
public Entity(EntityType<?> type, Level world) {
|
||||
this.id = Entity.ENTITY_COUNTER.incrementAndGet();
|
||||
this.passengers = ImmutableList.of();
|
||||
@@ -2319,11 +2369,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2355,11 +2405,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,10 +123,10 @@ index 07f5c61fc3da270215133d2d0240e96f701a6216..4566c7b0cd5551f2e348e532911e77c6
|
|||
|
||||
private void tickPassenger(Entity vehicle, Entity passenger) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 038a7d0a1f5e38e630b3b39268454f095f0512e7..47523429d105403afa1546c9bf9cba85fc3087ea 100644
|
||||
index 576dd79386c1514778aaaf558452e8eb9c354764..e7af0e4fc239a247019271c2901f804b558addf7 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -929,7 +929,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -965,7 +965,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return this.onGround;
|
||||
}
|
||||
|
||||
|
@ -169,7 +169,7 @@ index 038a7d0a1f5e38e630b3b39268454f095f0512e7..47523429d105403afa1546c9bf9cba85
|
|||
if (this.noPhysics) {
|
||||
this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z);
|
||||
} else {
|
||||
@@ -1102,6 +1137,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1138,6 +1173,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.level.getProfiler().pop();
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ index 038a7d0a1f5e38e630b3b39268454f095f0512e7..47523429d105403afa1546c9bf9cba85
|
|||
}
|
||||
|
||||
protected boolean isHorizontalCollisionMinor(Vec3 adjustedMovement) {
|
||||
@@ -3910,7 +3952,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3946,7 +3988,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public void setDeltaMovement(Vec3 velocity) {
|
||||
|
@ -193,7 +193,7 @@ index 038a7d0a1f5e38e630b3b39268454f095f0512e7..47523429d105403afa1546c9bf9cba85
|
|||
}
|
||||
|
||||
public void setDeltaMovement(double x, double y, double z) {
|
||||
@@ -3976,7 +4020,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4012,7 +4056,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
|
||||
// Paper end
|
||||
if (this.position.x != x || this.position.y != y || this.position.z != z) {
|
||||
|
|
|
@ -20,10 +20,10 @@ remains the same.
|
|||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java b/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..35551289c27735e2a77102f31ef8cae843aeb225
|
||||
index 0000000000000000000000000000000000000000..16ca915c33e31b50d33336408b041e401cb9cbfc
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/util/math/ThreadUnsafeRandom.java
|
||||
@@ -0,0 +1,64 @@
|
||||
@@ -0,0 +1,95 @@
|
||||
+package io.papermc.paper.util.math;
|
||||
+
|
||||
+import net.minecraft.util.RandomSource;
|
||||
|
@ -87,6 +87,37 @@ index 0000000000000000000000000000000000000000..35551289c27735e2a77102f31ef8cae8
|
|||
+ // however there's nothing that uses this class that relies on it
|
||||
+ return fastRandomBounded(this.next(32) & 0xFFFFFFFFL, bound);
|
||||
+ }
|
||||
+
|
||||
+ // these below are added to fix reobf issues that I don't wanna deal with right now
|
||||
+ @Override
|
||||
+ public long nextLong() {
|
||||
+ return super.nextInt();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int nextInt() {
|
||||
+ return super.nextInt();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean nextBoolean() {
|
||||
+ return super.nextBoolean();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float nextFloat() {
|
||||
+ return super.nextFloat();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double nextDouble() {
|
||||
+ return super.nextDouble();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public double nextGaussian() {
|
||||
+ return super.nextGaussian();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 4566c7b0cd5551f2e348e532911e77c62d3de2f2..6f0b2a6a79dfeb1c61cd0b316841f902d3377bdd 100644
|
||||
|
|
|
@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw.
|
|||
This issue only applies to players.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 47523429d105403afa1546c9bf9cba85fc3087ea..1427002e8433359d4fda2a11ae13d88c3f0b050f 100644
|
||||
index e7af0e4fc239a247019271c2901f804b558addf7..67eec506b4decd90d9d1558465ea14982328c93c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1712,6 +1712,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1748,6 +1748,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F);
|
||||
this.yRotO = this.getYRot();
|
||||
this.xRotO = this.getXRot();
|
||||
|
@ -19,7 +19,7 @@ index 47523429d105403afa1546c9bf9cba85fc3087ea..1427002e8433359d4fda2a11ae13d88c
|
|||
}
|
||||
|
||||
public void absMoveTo(double x, double y, double z) {
|
||||
@@ -1750,6 +1751,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1786,6 +1787,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.setXRot(pitch);
|
||||
this.setOldPosAndRot();
|
||||
this.reapplyPosition();
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 1427002e8433359d4fda2a11ae13d88c3f0b050f..e30f87b4a8bd75b1be517dda362e7c35cf04b88b 100644
|
||||
index 67eec506b4decd90d9d1558465ea14982328c93c..8013e54f44922f04404c38693fc4d8f4c011c2ff 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -737,7 +737,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -773,7 +773,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// CraftBukkit start
|
||||
public void postTick() {
|
||||
// No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle
|
||||
|
|
|
@ -1215,10 +1215,10 @@ index 082a16f49c07faadce68fc118b2fff859da422d0..ac9ee7f574f9b6c5e9c9368e54928e47
|
|||
}
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index e30f87b4a8bd75b1be517dda362e7c35cf04b88b..af919459ebc8ef08a1016e140a8ef3432a0efb0c 100644
|
||||
index 8013e54f44922f04404c38693fc4d8f4c011c2ff..bb9b35649ddc8d28e920b3dbfe760d275eabbb04 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -1118,9 +1118,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1154,9 +1154,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
float f2 = this.getBlockSpeedFactor();
|
||||
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply((double) f2, 1.0D, (double) f2));
|
||||
|
@ -1266,7 +1266,7 @@ index e30f87b4a8bd75b1be517dda362e7c35cf04b88b..af919459ebc8ef08a1016e140a8ef343
|
|||
if (this.remainingFireTicks <= 0) {
|
||||
this.setRemainingFireTicks(-this.getFireImmuneTicks());
|
||||
}
|
||||
@@ -1264,32 +1299,78 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1300,32 +1335,78 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
private Vec3 collide(Vec3 movement) {
|
||||
|
@ -1366,7 +1366,7 @@ index e30f87b4a8bd75b1be517dda362e7c35cf04b88b..af919459ebc8ef08a1016e140a8ef343
|
|||
}
|
||||
|
||||
public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) {
|
||||
@@ -2401,11 +2482,30 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2437,11 +2518,30 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
float f = this.dimensions.width * 0.8F;
|
||||
AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f);
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Forward CraftEntity in teleport command
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index af919459ebc8ef08a1016e140a8ef3432a0efb0c..273114f3a89e7ef861e988eb1db8ecc0c9a97436 100644
|
||||
index bb9b35649ddc8d28e920b3dbfe760d275eabbb04..0d8ff9f36073afd92eee815af0c0e04332b60c91 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -3223,6 +3223,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3259,6 +3259,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
public void restoreFrom(Entity original) {
|
||||
|
@ -22,7 +22,7 @@ index af919459ebc8ef08a1016e140a8ef3432a0efb0c..273114f3a89e7ef861e988eb1db8ecc0
|
|||
CompoundTag nbttagcompound = original.saveWithoutId(new CompoundTag());
|
||||
|
||||
nbttagcompound.remove("Dimension");
|
||||
@@ -3304,10 +3311,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3340,10 +3347,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (worldserver.getTypeKey() == LevelStem.END) { // CraftBukkit
|
||||
ServerLevel.makeObsidianPlatform(worldserver, this); // CraftBukkit
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Freeze Tick Lock API
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 273114f3a89e7ef861e988eb1db8ecc0c9a97436..0d327667f6cb1ad2adf993b14883b7967049aa02 100644
|
||||
index 0d8ff9f36073afd92eee815af0c0e04332b60c91..5f5c62e53fc656e3b239bcea06081b22e5bf923e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -355,6 +355,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -391,6 +391,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
private org.bukkit.util.Vector origin;
|
||||
@javax.annotation.Nullable
|
||||
private UUID originWorld;
|
||||
|
@ -16,7 +16,7 @@ index 273114f3a89e7ef861e988eb1db8ecc0c9a97436..0d327667f6cb1ad2adf993b14883b796
|
|||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -783,7 +784,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -819,7 +820,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.setRemainingFireTicks(this.remainingFireTicks - 1);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ index 273114f3a89e7ef861e988eb1db8ecc0c9a97436..0d327667f6cb1ad2adf993b14883b796
|
|||
this.setTicksFrozen(0);
|
||||
this.level.levelEvent((Player) null, 1009, this.blockPosition, 1);
|
||||
}
|
||||
@@ -2210,6 +2211,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2246,6 +2247,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (fromNetherPortal) {
|
||||
nbt.putBoolean("Paper.FromNetherPortal", true);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ index 273114f3a89e7ef861e988eb1db8ecc0c9a97436..0d327667f6cb1ad2adf993b14883b796
|
|||
// Paper end
|
||||
return nbt;
|
||||
} catch (Throwable throwable) {
|
||||
@@ -2372,6 +2376,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2408,6 +2412,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
if (spawnReason == null) {
|
||||
spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT;
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity
|
|||
Bad plugins doing this would cause some obvious problems...
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 0d327667f6cb1ad2adf993b14883b7967049aa02..9d8d4f4aef4f7a055f697761d31df9a285c7a2c7 100644
|
||||
index 5f5c62e53fc656e3b239bcea06081b22e5bf923e..961f627c5eea8144d3f5235a78b0b25e712c5016 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2631,6 +2631,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2667,6 +2667,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
protected boolean addPassenger(Entity entity) { // CraftBukkit
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Guard against invalid entity positions
|
|||
Anything not finite should be blocked and logged
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 9d8d4f4aef4f7a055f697761d31df9a285c7a2c7..9e5e7fd12468cd409152a2c41ceb811209594a6c 100644
|
||||
index 961f627c5eea8144d3f5235a78b0b25e712c5016..e28c48d4e000eec335cd25555d1723147f28a043 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -4135,11 +4135,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -4171,11 +4171,33 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return this.getZ((2.0D * this.random.nextDouble() - 1.0D) * widthScale);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Prevent entity loading causing async lookups
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 9e5e7fd12468cd409152a2c41ceb811209594a6c..87a2228c5c5038153935184f0e4a2f11053b202d 100644
|
||||
index e28c48d4e000eec335cd25555d1723147f28a043..0473a4d80f58538ea3cabcd38684339b27c1d29c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -746,6 +746,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -782,6 +782,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
public void baseTick() {
|
||||
this.level.getProfiler().push("entityBaseTick");
|
||||
|
|
Loading…
Reference in New Issue