mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-22 11:18:15 +02:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@1a332f7e move age locked related methods to Ageable and normalize setBaby/Adult setters PaperMC/Paper@8b644429 fix chorus plant not growing properly PaperMC/Paper@d45004bd deprecate group methods for some recipes PaperMC/Paper@006f9d1b use the right var in ItemStack#useOn PaperMC/Paper@f66c5901 remove redundant setBlock for cauldrons PaperMC/Paper@c2631139 simplify cauldron events PaperMC/Paper@33a9258c merge PlayerInteractAtEntityEvent and PlayerInteractEntityEvent PaperMC/Paper@2d6e82ec Change world storage layout to be closer to vanilla & implement migration (#13736) PaperMC/Paper@16e0088d Update Moonrise and DC PaperMC/Paper@c7532535 Delete rej patches for applied files PaperMC/Paper@e0497a6e Fix Moonrise compile
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
@@ -168,6 +_,7 @@
|
||||
SlotProvider,
|
||||
DebugValueSource,
|
||||
TypedInstance<EntityType<?>> {
|
||||
TypedInstance<EntityType<?>>, 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;
|
||||
static boolean isLevelAtLeast(ValueInput input, int level) {
|
||||
@@ -341,8 +_,9 @@
|
||||
@@ -297,8 +_,9 @@
|
||||
public double xOld;
|
||||
public double yOld;
|
||||
public double zOld;
|
||||
@@ -19,7 +19,7 @@
|
||||
public int tickCount;
|
||||
private int remainingFireTicks;
|
||||
private final EntityFluidInteraction fluidInteraction = new EntityFluidInteraction(Set.of(FluidTags.WATER, FluidTags.LAVA));
|
||||
@@ -374,8 +_,8 @@
|
||||
@@ -330,8 +_,8 @@
|
||||
public @Nullable 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};
|
||||
@@ -426,6 +_,7 @@
|
||||
@@ -382,6 +_,7 @@
|
||||
private final int despawnTime; // Paper - entity despawn time limit
|
||||
public int totalEntityAge; // Paper - age-like counter for all entities
|
||||
public final io.papermc.paper.entity.activation.ActivationType activationType = io.papermc.paper.entity.activation.ActivationType.activationTypeFor(this); // Paper - EAR 2/tracking ranges
|
||||
@@ -38,11 +38,11 @@
|
||||
// Paper start - EAR 2
|
||||
public final boolean defaultActivationState;
|
||||
public long activatedTick = Integer.MIN_VALUE;
|
||||
@@ -443,10 +_,22 @@
|
||||
@@ -549,10 +_,22 @@
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - optimise entity tracker
|
||||
|
||||
+ // Purpur start - Add canSaveToDisk to Entity
|
||||
+ // Purpur start - Add canSaveToDisk to Entity
|
||||
+ public boolean canSaveToDisk() {
|
||||
+ return true;
|
||||
+ }
|
||||
@@ -61,7 +61,7 @@
|
||||
this.position = Vec3.ZERO;
|
||||
this.blockPosition = BlockPos.ZERO;
|
||||
this.chunkPosition = ChunkPos.ZERO;
|
||||
@@ -844,6 +_,7 @@
|
||||
@@ -950,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
|
||||
@@ -69,7 +69,7 @@
|
||||
this.onBelowWorld();
|
||||
}
|
||||
}
|
||||
@@ -1857,7 +_,7 @@
|
||||
@@ -2005,7 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean fireImmune() {
|
||||
@@ -78,7 +78,7 @@
|
||||
}
|
||||
|
||||
public boolean causeFallDamage(final double fallDistance, final float damageModifier, final DamageSource damageSource) {
|
||||
@@ -2443,7 +_,7 @@
|
||||
@@ -2591,7 +_,7 @@
|
||||
output.putBoolean("Bukkit.invisible", this.persistentInvisibility);
|
||||
}
|
||||
// SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
||||
@@ -87,7 +87,7 @@
|
||||
output.putInt("Bukkit.MaxAirSupply", this.getMaxAirSupply());
|
||||
}
|
||||
output.putInt("Spigot.ticksLived", this.totalEntityAge); // Paper
|
||||
@@ -2530,6 +_,11 @@
|
||||
@@ -2678,6 +_,11 @@
|
||||
output.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -99,7 +99,7 @@
|
||||
} catch (Throwable var7) {
|
||||
CrashReport report = CrashReport.forThrowable(var7, "Saving entity NBT");
|
||||
CrashReportCategory category = report.addCategory("Entity being saved");
|
||||
@@ -2652,6 +_,9 @@
|
||||
@@ -2800,6 +_,9 @@
|
||||
}
|
||||
freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
|
||||
// Paper end
|
||||
@@ -109,7 +109,7 @@
|
||||
} catch (Throwable var7) {
|
||||
CrashReport report = CrashReport.forThrowable(var7, "Loading entity NBT");
|
||||
CrashReportCategory category = report.addCategory("Entity being loaded");
|
||||
@@ -2831,6 +_,7 @@
|
||||
@@ -3068,6 +_,7 @@
|
||||
if (this.isAlive() && this instanceof Leashable leashablex) {
|
||||
if (leashablex.getLeashHolder() == player) {
|
||||
if (!this.level().isClientSide()) {
|
||||
@@ -117,7 +117,7 @@
|
||||
// Paper start - EntityUnleashEvent
|
||||
if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
|
||||
leashablex, player, hand, !player.hasInfiniteMaterials(), true
|
||||
@@ -3261,15 +_,18 @@
|
||||
@@ -3498,15 +_,18 @@
|
||||
return Vec3.directionFromRotation(this.getRotationVector());
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4000,7 +_,7 @@
|
||||
@@ -4237,7 +_,7 @@
|
||||
}
|
||||
|
||||
public boolean canUsePortal(final boolean ignorePassenger) {
|
||||
@@ -146,7 +146,7 @@
|
||||
}
|
||||
|
||||
public boolean canTeleport(final Level from, final Level to) {
|
||||
@@ -4548,6 +_,12 @@
|
||||
@@ -4787,6 +_,12 @@
|
||||
return Mth.lerp(partial, this.yRotO, this.yRot);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
public boolean touchingUnloadedChunk() {
|
||||
AABB box = this.getBoundingBox().inflate(1.0);
|
||||
int x0 = Mth.floor(box.minX);
|
||||
@@ -4842,7 +_,7 @@
|
||||
@@ -5090,7 +_,7 @@
|
||||
}
|
||||
|
||||
public float maxUpStep() {
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
}
|
||||
|
||||
private boolean hungry() {
|
||||
@@ -892,6 +_,7 @@
|
||||
@@ -891,6 +_,7 @@
|
||||
}
|
||||
|
||||
public void spawnGolemIfNeeded(final ServerLevel level, final long timestamp, final int villagersNeededToAgree) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -453,6 +_,7 @@
|
||||
@@ -452,6 +_,7 @@
|
||||
// revert back all captured blocks
|
||||
for (org.bukkit.block.BlockState blockstate : blocks) {
|
||||
((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace();
|
||||
@@ -8,15 +8,15 @@
|
||||
}
|
||||
|
||||
SignItem.openSign = null; // SPIGOT-6758 - Reset on early return
|
||||
@@ -476,6 +_,7 @@
|
||||
@@ -475,6 +_,7 @@
|
||||
if (!(block.getBlock() instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // Containers get placed automatically
|
||||
block.onPlace(serverLevel, newPos, oldBlock, true, context);
|
||||
block.onPlace(level, newPos, oldBlock, true, context);
|
||||
}
|
||||
+ block.getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed
|
||||
|
||||
serverLevel.notifyAndUpdatePhysics(newPos, null, oldBlock, block, serverLevel.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point
|
||||
level.notifyAndUpdatePhysics(newPos, null, oldBlock, block, level.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point
|
||||
}
|
||||
@@ -592,6 +_,26 @@
|
||||
@@ -591,6 +_,26 @@
|
||||
return this.isDamageableItem() && this.getDamageValue() > 0;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
public int getDamageValue() {
|
||||
return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage());
|
||||
}
|
||||
@@ -1241,6 +_,12 @@
|
||||
@@ -1240,6 +_,12 @@
|
||||
public boolean isEnchanted() {
|
||||
return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/EntityGetter.java
|
||||
+++ b/net/minecraft/world/level/EntityGetter.java
|
||||
@@ -142,7 +_,7 @@
|
||||
@@ -183,7 +_,7 @@
|
||||
|
||||
default boolean hasNearbyAlivePlayer(final double x, final double y, final double z, final double range) {
|
||||
for (Player player : this.players()) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -168,10 +_,54 @@
|
||||
@@ -169,10 +_,54 @@
|
||||
}
|
||||
// Paper end - add paper world config
|
||||
|
||||
@@ -55,20 +55,20 @@
|
||||
public CraftWorld getWorld() {
|
||||
return this.world;
|
||||
}
|
||||
@@ -214,6 +_,8 @@
|
||||
) {
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
|
||||
@@ -848,6 +_,8 @@
|
||||
// Paper end - getblock optimisations - cache world height/sections
|
||||
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(bukkitName); // Spigot
|
||||
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
|
||||
+ this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName(), environment); // Purpur - Purpur config files
|
||||
+ this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur - Add adjustable breeding cooldown to config
|
||||
this.generator = generator;
|
||||
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
|
||||
|
||||
@@ -1489,4 +_,14 @@
|
||||
return ret;
|
||||
@@ -2188,4 +_,14 @@
|
||||
return this.moonrise$getEntityLookup().getEntityCount(); // Paper - rewrite chunk system
|
||||
}
|
||||
// Paper end - allow patching this logic
|
||||
+
|
||||
+
|
||||
+ // Purpur start - Add allow water in end world option
|
||||
+ public boolean isNether() {
|
||||
+ return getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/ServerExplosion.java
|
||||
+++ b/net/minecraft/world/level/ServerExplosion.java
|
||||
@@ -340,6 +_,23 @@
|
||||
@@ -623,6 +_,23 @@
|
||||
}
|
||||
|
||||
public int explode() {
|
||||
@@ -21,6 +21,6 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // Purpur end - Add PreExplodeEvents
|
||||
this.level.gameEvent(this.source, GameEvent.EXPLODE, this.center);
|
||||
List<BlockPos> toBlow = this.calculateExplodedPositions();
|
||||
this.hurtEntities();
|
||||
// Paper start - collision optimisations
|
||||
this.blockCache = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>();
|
||||
this.chunkPosCache = new long[CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -50,7 +_,7 @@
|
||||
@@ -243,7 +_,7 @@
|
||||
|
||||
// Paper start
|
||||
private static void printOversizedLog(String msg, Path file, int x, int z) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -193,7 +_,7 @@
|
||||
@@ -235,7 +_,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
BlockState belowState = level.getBlockState(mutablePos.setWithOffset(pos, Direction.DOWN));
|
||||
FluidState belowFluid = belowState.getFluidState();
|
||||
if (belowState.isSolid() || this.isSourceBlockOfThisType(belowFluid)) {
|
||||
@@ -279,6 +_,12 @@
|
||||
@@ -321,6 +_,12 @@
|
||||
}
|
||||
|
||||
protected abstract boolean canConvertToSource(ServerLevel level);
|
||||
|
||||
Reference in New Issue
Block a user