mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@20e9fe8e Fix javadocs in DriedGhast PaperMC/Paper@1366eaa5 Readd dropped hunk PaperMC/Paper@4b6fae10 1.21.6-pre2 PaperMC/Paper@5cfd6383 Fix compile issues PaperMC/Paper@18924de7 run generator PaperMC/Paper@fbc139e0 some fixes PaperMC/Paper@0c3879ac track block for lava/conduit damage PaperMC/Paper@767e99c9 Moonrise attempt PaperMC/Paper@b15c51ce Rest of feature patches PaperMC/Paper@c136222e Moonrise compile fixes and changes PaperMC/Paper@52880cec Fix LayeredCauldronBlock event call PaperMC/Paper@4fa21c21 Update Moonrise to 1.21.6-pre2 PaperMC/Paper@cb705c41 Add DataConverter patch PaperMC/Paper@87b3d8ba Replace deprecated Thread#getId usage with Thread#threadId PaperMC/Paper@5b362692 Add MCUtil#toLocation from Folia PaperMC/Paper@b2f3c2c9 Move over to non discarding reporter PaperMC/Paper@4c4ddfcc Update ItemType
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -147,6 +_,7 @@
|
||||
@@ -148,6 +_,7 @@
|
||||
import org.slf4j.Logger;
|
||||
|
||||
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, DataComponentGetter {
|
||||
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||
+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes
|
||||
// CraftBukkit start
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
public boolean preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; keep initial motion on first snapTo
|
||||
@@ -323,8 +_,9 @@
|
||||
@@ -280,8 +_,9 @@
|
||||
public double xOld;
|
||||
public double yOld;
|
||||
public double zOld;
|
||||
@@ -19,7 +19,7 @@
|
||||
public int tickCount;
|
||||
private int remainingFireTicks;
|
||||
public boolean wasTouchingWater;
|
||||
@@ -358,8 +_,8 @@
|
||||
@@ -315,8 +_,8 @@
|
||||
public PortalProcessor portalProcess;
|
||||
public int portalCooldown;
|
||||
private boolean invulnerable;
|
||||
@@ -30,7 +30,7 @@
|
||||
private boolean hasGlowingTag;
|
||||
private final Set<String> tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
|
||||
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
|
||||
@@ -414,6 +_,7 @@
|
||||
@@ -371,6 +_,7 @@
|
||||
public long activatedTick = Integer.MIN_VALUE;
|
||||
public boolean isTemporarilyActive;
|
||||
public long activatedImmunityTick = Integer.MIN_VALUE;
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
public void inactiveTick() {
|
||||
}
|
||||
@@ -426,10 +_,21 @@
|
||||
@@ -533,10 +_,21 @@
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - optimise entity tracker
|
||||
|
||||
+ // Purpur start - Add canSaveToDisk to Entity
|
||||
+ public boolean canSaveToDisk() {
|
||||
@@ -60,7 +60,7 @@
|
||||
this.position = Vec3.ZERO;
|
||||
this.blockPosition = BlockPos.ZERO;
|
||||
this.chunkPosition = ChunkPos.ZERO;
|
||||
@@ -804,6 +_,7 @@
|
||||
@@ -911,6 +_,7 @@
|
||||
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
|
||||
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
|
||||
// Paper end - Configurable nether ceiling damage
|
||||
@@ -68,7 +68,7 @@
|
||||
this.onBelowWorld();
|
||||
}
|
||||
}
|
||||
@@ -1741,7 +_,7 @@
|
||||
@@ -1889,7 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) {
|
||||
@@ -2437,6 +_,11 @@
|
||||
@@ -2585,6 +_,11 @@
|
||||
output.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -89,7 +89,7 @@
|
||||
} catch (Throwable var7) {
|
||||
CrashReport crashReport = CrashReport.forThrowable(var7, "Saving entity NBT");
|
||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being saved");
|
||||
@@ -2557,6 +_,9 @@
|
||||
@@ -2705,6 +_,9 @@
|
||||
}
|
||||
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
|
||||
// Paper end
|
||||
@@ -99,7 +99,7 @@
|
||||
} catch (Throwable var7) {
|
||||
CrashReport crashReport = CrashReport.forThrowable(var7, "Loading entity NBT");
|
||||
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
|
||||
@@ -2746,6 +_,7 @@
|
||||
@@ -2983,6 +_,7 @@
|
||||
if (this.isAlive() && this instanceof Leashable leashable2) {
|
||||
if (leashable2.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -107,7 +107,7 @@
|
||||
// Paper start - EntityUnleashEvent
|
||||
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
|
||||
leashable2, player, hand, !player.hasInfiniteMaterials()
|
||||
@@ -3151,15 +_,18 @@
|
||||
@@ -3388,15 +_,18 @@
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3364,7 +_,7 @@
|
||||
@@ -3601,7 +_,7 @@
|
||||
}
|
||||
|
||||
public int getMaxAirSupply() {
|
||||
@@ -136,7 +136,7 @@
|
||||
}
|
||||
|
||||
public int getAirSupply() {
|
||||
@@ -3909,7 +_,7 @@
|
||||
@@ -4146,7 +_,7 @@
|
||||
// CraftBukkit end
|
||||
|
||||
public boolean canUsePortal(boolean allowPassengers) {
|
||||
@@ -145,7 +145,7 @@
|
||||
}
|
||||
|
||||
public boolean canTeleport(Level fromLevel, Level toLevel) {
|
||||
@@ -4432,6 +_,12 @@
|
||||
@@ -4671,6 +_,12 @@
|
||||
return Mth.lerp(partialTick, this.yRotO, this.yRot);
|
||||
}
|
||||
|
||||
@@ -155,10 +155,10 @@
|
||||
+ }
|
||||
+ // Purpur end - Stop squids floating on top of water
|
||||
+
|
||||
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> fluidTag, double motionScale) {
|
||||
// Paper start - optimise collisions
|
||||
public boolean updateFluidHeightAndDoFluidPushing(final TagKey<Fluid> fluid, final double flowScale) {
|
||||
if (this.touchingUnloadedChunk()) {
|
||||
return false;
|
||||
@@ -4795,7 +_,7 @@
|
||||
@@ -5102,7 +_,7 @@
|
||||
}
|
||||
|
||||
public float maxUpStep() {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
|
||||
@@ -85,7 +_,7 @@
|
||||
}
|
||||
@@ -86,7 +_,7 @@
|
||||
};
|
||||
Set<Pair<Holder<PoiType>, BlockPos>> set = poiManager.findAllClosestFirstWithType(
|
||||
- acquirablePois, predicate1, mob.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE
|
||||
+ acquirablePois, predicate1, mob.blockPosition(), level.purpurConfig.villagerAcquirePoiSearchRadius, PoiManager.Occupancy.HAS_SPACE // Purpur - Configurable villager search radius
|
||||
)
|
||||
.limit(5L)
|
||||
.filter(pair1 -> predicate.test(level, pair1.getSecond()))
|
||||
// Paper start - optimise POI access
|
||||
final java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
- io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, acquirablePois, predicate1, mob.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes);
|
||||
+ io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, acquirablePois, predicate1, mob.blockPosition(), level.purpurConfig.villagerAcquirePoiSearchRadius, level.purpurConfig.villagerAcquirePoiSearchRadius*level.purpurConfig.villagerAcquirePoiSearchRadius, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes); // Purpur - Configurable villager search radius
|
||||
final Set<Pair<Holder<PoiType>, BlockPos>> set = new java.util.HashSet<>(poiposes.size());
|
||||
for (final Pair<Holder<PoiType>, BlockPos> poiPose : poiposes) {
|
||||
if (predicate.test(level, poiPose.getSecond())) {
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
--- a/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
+++ b/net/minecraft/world/entity/ai/sensing/NearestBedSensor.java
|
||||
@@ -54,9 +_,9 @@
|
||||
}
|
||||
};
|
||||
Set<Pair<Holder<PoiType>, BlockPos>> set = poiManager.findAllWithType(
|
||||
- holder -> holder.is(PoiTypes.HOME), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY
|
||||
+ holder -> holder.is(PoiTypes.HOME), predicate, entity.blockPosition(), level.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY
|
||||
)
|
||||
- .collect(Collectors.toSet());
|
||||
+ .collect(Collectors.toSet()); // Purpur - Configurable villager search radius
|
||||
Path path = AcquirePoi.findPathToPois(entity, set);
|
||||
@@ -56,7 +_,7 @@
|
||||
// Paper start - optimise POI access
|
||||
java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
|
||||
// don't ask me why it's unbounded. ask mojang.
|
||||
- io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), 48, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes);
|
||||
+ io.papermc.paper.util.PoiAccess.findAnyPoiPositions(poiManager, type -> type.is(PoiTypes.HOME), predicate, entity.blockPosition(), level.purpurConfig.villagerNearestBedSensorSearchRadius, PoiManager.Occupancy.ANY, false, Integer.MAX_VALUE, poiposes); // Purpur - Configurable villager search radius
|
||||
Path path = AcquirePoi.findPathToPois(entity, new java.util.HashSet<>(poiposes));
|
||||
// Paper end - optimise POI access
|
||||
if (path != null && path.canReach()) {
|
||||
BlockPos target = path.getTarget();
|
||||
|
||||
Reference in New Issue
Block a user