Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.9-R0.1-SNAPSHOT</version>
<version>1.21.10-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
Expand All @@ -53,7 +53,7 @@ repositories {
}

dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.9-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
}

java {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
group=io.papermc.paper
version=1.21.9-R0.1-SNAPSHOT
mcVersion=1.21.9
version=1.21.10-R0.1-SNAPSHOT
mcVersion=1.21.10

# Set to true while updating Minecraft version
updatingMinecraft=false
Expand Down
5 changes: 1 addition & 4 deletions paper-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ java {
}

val annotationsVersion = "26.0.2"
// Keep in sync with paper-server adventure-text-serializer-ansi dep
val adventureVersion = "4.25.0-SNAPSHOT"
val adventureVersion = "4.25.0"
val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
val slf4jVersion = "2.0.16"
val log4jVersion = "2.24.1"
Expand Down Expand Up @@ -176,15 +175,13 @@ tasks.withType<Javadoc>().configureEach {
//"https://javadoc.io/doc/org.joml/joml/1.10.8/",
//"https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0",
"https://jspecify.dev/docs/api/",
/* TODO 1.21.9 dev - adventure release
"https://jd.advntr.dev/api/$adventureVersion/",
"https://jd.advntr.dev/key/$adventureVersion/",
"https://jd.advntr.dev/text-minimessage/$adventureVersion/",
"https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
*/
//"https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
"https://logging.apache.org/log4j/2.x/javadoc/log4j-api/",
//"https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3",
Expand Down
62 changes: 41 additions & 21 deletions paper-api/src/main/java/org/bukkit/entity/LivingEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.bukkit.scoreboard.Team;
import org.bukkit.util.RayTraceResult;
import org.bukkit.util.Vector;
import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -402,106 +403,120 @@ default RayTraceResult rayTraceBlocks(double maxDistance) {
*
* @return ticks until arrow leaves
*/
public int getArrowCooldown();
public @NonNegative int getArrowCooldown();

/**
* Sets the time in ticks until the next arrow leaves the entity's body.
* <p>
* A value of 0 will cause the server to re-calculate the time on the next tick.
*
* @param ticks time until arrow leaves
*/
public void setArrowCooldown(int ticks);
public void setArrowCooldown(@NonNegative int ticks);

/**
* Gets the amount of arrows in an entity's body.
*
* @return amount of arrows in body
*/
public int getArrowsInBody();
public @NonNegative int getArrowsInBody();

// Paper start
/**
* Set the amount of arrows in the entity's body.
* <p>
* Does not fire the {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent}.
*
* @param count amount of arrows in entity's body
*/
default void setArrowsInBody(final int count) {
default void setArrowsInBody(final @NonNegative int count) {
this.setArrowsInBody(count, false);
}
// Paper end

/**
* Set the amount of arrows in the entity's body.
*
* @param count amount of arrows in entity's body
* @param fireEvent whether to fire the {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent} event
*/
void setArrowsInBody(int count, boolean fireEvent); // Paper
void setArrowsInBody(@NonNegative int count, boolean fireEvent); // Paper

// Paper start - Add methods for working with arrows stuck in living entities
/**
* Sets the amount of ticks before the next arrow gets removed from the entities body.
* <p>
* A value of 0 will cause the server to re-calculate the amount of ticks on the next tick.
*
* @param ticks Amount of ticks
* @deprecated use {@link #setArrowCooldown(int)}
*/
void setNextArrowRemoval(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int ticks);
@Deprecated(since = "1.21.10")
default void setNextArrowRemoval(@NonNegative int ticks) {
this.setArrowCooldown(ticks);
}

/**
* Gets the amount of ticks before the next arrow gets removed from the entities body.
*
* @return ticks Amount of ticks
* @deprecated use {@link #getArrowCooldown()}
*/
int getNextArrowRemoval();
// Paper end - Add methods for working with arrows stuck in living entities
@Deprecated(since = "1.21.10")
default @NonNegative int getNextArrowRemoval() {
return this.getArrowCooldown();
}

// Paper start - Bee Stinger API
/**
* Gets the time in ticks until the next bee stinger leaves the entity's body.
*
* @return ticks until bee stinger leaves
*/
public int getBeeStingerCooldown();
public @NonNegative int getBeeStingerCooldown();

/**
* Sets the time in ticks until the next stinger leaves the entity's body.
* <p>
* A value of 0 will cause the server to re-calculate the time on the next tick.
*
* @param ticks time until bee stinger leaves
*/
public void setBeeStingerCooldown(int ticks);
public void setBeeStingerCooldown(@NonNegative int ticks);

/**
* Gets the amount of bee stingers in an entity's body.
*
* @return amount of bee stingers in body
*/
public int getBeeStingersInBody();
public @NonNegative int getBeeStingersInBody();

/**
* Set the amount of bee stingers in the entity's body.
*
* @param count amount of bee stingers in entity's body
*/
public void setBeeStingersInBody(int count);
public void setBeeStingersInBody(@NonNegative int count);

/**
* Sets the amount of ticks before the next bee stinger gets removed from the entities body.
* <p>
* A value of 0 will cause the server to re-calculate the amount of ticks on the next tick.
*
* @param ticks Amount of ticks
* @deprecated use {@link #setBeeStingerCooldown(int)}
*/
void setNextBeeStingerRemoval(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int ticks);
@Deprecated(since = "1.21.10")
default void setNextBeeStingerRemoval(@NonNegative int ticks) {
this.setBeeStingerCooldown(ticks);
}

/**
* Gets the amount of ticks before the next bee stinger gets removed from the entities body.
*
* @return ticks Amount of ticks
* @deprecated use {@link #getBeeStingerCooldown()}
*/
int getNextBeeStingerRemoval();
// Paper end - Stinger API
@Deprecated(since = "1.21.10")
default @NonNegative int getNextBeeStingerRemoval() {
return this.getBeeStingerCooldown();
}

/**
* Returns the living entity's current maximum no damage ticks.
Expand Down Expand Up @@ -1065,11 +1080,14 @@ default boolean addPotionEffect(@NotNull PotionEffect effect) {

/**
* Get the number of arrows stuck in this entity
*
* @return Number of arrows stuck
* @deprecated use {@link #getArrowsInBody()}
*/
@Deprecated
int getArrowsStuck();
default @NonNegative int getArrowsStuck() {
return this.getArrowsInBody();
}

/**
* Set the number of arrows stuck in this entity
Expand All @@ -1079,7 +1097,9 @@ default boolean addPotionEffect(@NotNull PotionEffect effect) {
* you want to retain exact functionality, pass {@code true} for {@code fireEvent}.</b>
*/
@Deprecated
void setArrowsStuck(int arrows);
default void setArrowsStuck(@NonNegative int arrows) {
this.setArrowsInBody(arrows, true);
}

/**
* Get the delay (in ticks) before blocking is effective for this entity
Expand Down
2 changes: 1 addition & 1 deletion paper-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugins {
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"

dependencies {
mache("io.papermc:mache:1.21.9+build.1")
mache("io.papermc:mache:1.21.10+build.1")
paperclip("io.papermc:paperclip:3.0.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23021,7 +23021,7 @@ index e7510be12644b2edd966c538c84379a3d5fe89b5..8d299a75c80fddc61a2aa4dc5b0dc594
thread1 -> {
DedicatedServer dedicatedServer1 = new DedicatedServer(
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index cf953706a9de504c93625a2d656509bf95ee98fc..d3cad90499a86e6e93192bc5fe27984f9714cdd6 100644
index f1ec0b9c3f8fe7811e36a66f8091a0a9f5a72d13..174ee247eaaf2e2352f4ccc099e31a8240e86b71 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -177,7 +177,7 @@ import net.minecraft.world.phys.Vec2;
Expand Down Expand Up @@ -23226,8 +23226,8 @@ index cf953706a9de504c93625a2d656509bf95ee98fc..d3cad90499a86e6e93192bc5fe27984f
profiler.pop(); // moonrise:run_all_chunk
profiler.pop(); // moonrise:run_all_tasks

@@ -1197,6 +1292,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickFrame.start();
@@ -1200,6 +1295,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
profilerFiller.pop();
this.runAllTasksAtTickStart(); // Paper - improve tick loop
this.tickServer(flag ? () -> false : this::haveTime);
+ // Paper start - rewrite chunk system
Expand All @@ -23240,15 +23240,15 @@ index cf953706a9de504c93625a2d656509bf95ee98fc..d3cad90499a86e6e93192bc5fe27984f
this.tickFrame.end();
this.recordEndOfTick(); // Paper - improve tick loop
profilerFiller.popPush("nextTickWait");
@@ -1369,6 +1471,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1372,6 +1474,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa

private boolean pollTaskInternal() {
if (super.pollTask()) {
+ this.moonrise$executeMidTickTasks(); // Paper - rewrite chunk system
return true;
} else {
boolean ret = false; // Paper - force execution of all worlds, do not just bias the first
@@ -2544,6 +2647,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2547,6 +2650,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}

Expand Down Expand Up @@ -26963,7 +26963,7 @@ index 9f88fafefa490be098b6d45cb55ae290fb435246..9d105729b5828bb6c601641b968f0c7c
}

diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
index b40fd308a93295f52392cf8d05673a8455667f85..a69158ea3e8c8ba35b5ff840102fd763f42e7b4f 100644
index a124ee91940c5e323546eb7ba22f73643330e88f..54f526fb32fa4cac89c8a89aff73fab6abd36ab7 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
@@ -201,7 +201,7 @@ import net.minecraft.world.scores.Team;
Expand Down Expand Up @@ -28061,7 +28061,7 @@ index 8cc5c0716392ba06501542ff5cbe71ee43979e5d..09fd99c9cbd23b5f3c899bfb00c9b896
+ // Paper end - block counting
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d7e100b59 100644
index 6aab64ed605376324898db1bc0d991e951810dad..2cae59fbc6a279e70c388ea7cc6f6f5f749f46a1 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -149,7 +149,7 @@ import net.minecraft.world.waypoints.WaypointTransmitter;
Expand Down Expand Up @@ -28312,7 +28312,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d

public Entity(EntityType<?> entityType, Level level) {
this.type = entityType;
@@ -1368,35 +1474,77 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -1371,35 +1477,77 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
return list.isEmpty() ? distance : -Shapes.collide(Direction.Axis.Y, boundingBox, list, -distance);
}

Expand Down Expand Up @@ -28414,7 +28414,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d
}

private static float[] collectCandidateStepUpHeights(AABB box, List<VoxelShape> colliders, float deltaY, float maxUpStep) {
@@ -2700,21 +2848,110 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -2705,21 +2853,110 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
}

public boolean isInWall() {
Expand Down Expand Up @@ -28536,7 +28536,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d
}

public InteractionResult interact(Player player, InteractionHand hand) {
@@ -4327,15 +4564,17 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -4332,15 +4569,17 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
}

public Iterable<Entity> getIndirectPassengers() {
Expand All @@ -28562,7 +28562,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d
}

public int countPlayerPassengers() {
@@ -4478,77 +4717,126 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -4483,77 +4722,126 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
return Mth.lerp(partialTick, this.yRotO, this.yRot);
}

Expand Down Expand Up @@ -28747,7 +28747,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d

public boolean touchingUnloadedChunk() {
AABB aabb = this.getBoundingBox().inflate(1.0);
@@ -4704,6 +4992,15 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -4709,6 +4997,15 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
}

public final void setPosRaw(double x, double y, double z, boolean forceBoundingBoxUpdate) {
Expand All @@ -28763,7 +28763,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d
if (!checkPosition(this, x, y, z)) {
return;
}
@@ -4855,6 +5152,12 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -4860,6 +5157,12 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name

@Override
public final void setRemoved(Entity.RemovalReason removalReason, @Nullable org.bukkit.event.entity.EntityRemoveEvent.Cause cause) { // CraftBukkit - add Bukkit remove cause
Expand All @@ -28776,7 +28776,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityRemoveEvent(this, cause); // CraftBukkit
final boolean alreadyRemoved = this.removalReason != null; // Paper - Folia schedulers
if (this.removalReason == null) {
@@ -4865,7 +5168,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -4870,7 +5173,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
this.stopRiding();
}

Expand All @@ -28785,7 +28785,7 @@ index 5ee3dc10cb4755fca83d8f7cad55d26b07afd6ff..454f588b166e412a6da9d7991607418d
this.levelCallback.onRemove(removalReason);
this.onRemoval(removalReason);
// Paper start - Folia schedulers
@@ -4899,7 +5202,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
@@ -4904,7 +5207,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name
public boolean shouldBeSaved() {
return (this.removalReason == null || this.removalReason.shouldSave())
&& !this.isPassenger()
Expand Down Expand Up @@ -30994,7 +30994,7 @@ index 9d5f6433a1628cb2285f81f8c99dbee4d6c54d81..4fd746ccfd0018f5e551490e24aa6826

public void animateTick(BlockState state, Level level, BlockPos pos, RandomSource random) {
diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java
index 5ad3b49fcf3d25e2309c29cf9fbc9a049402fde9..dff1c4fa389d5168bd9ec1aff4c7e4bc63c4110e 100644
index af3dfdd85579d01b12d7b6bceec635015bb081f6..07777e331251b7e2c4fdcb63fee41f733e775004 100644
--- a/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -416,7 +416,7 @@ public abstract class BlockBehaviour implements FeatureElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32907,7 +32907,7 @@ index 71b8bbeda2fecf930870a9b6e856e20639d31645..91650a92a21fcaac65a5dfcac0cc856b
return structureTemplate.save(new CompoundTag());
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
index 638990d0d89aa85285675d05e2a74aed6ceaf2f0..cc0834ac0ecac9735c7bd399fc7f5b908437676e 100644
index 174ee247eaaf2e2352f4ccc099e31a8240e86b71..2bb59acb87f0a230b7cf4870477fc65bea18f3e3 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -348,6 +348,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Expand Down
Loading
Loading