Skip to content

Commit 907f193

Browse files
committed
bump built-in datapack version and api-version
1 parent 564344f commit 907f193

29 files changed

+101
-109
lines changed

build-data/paper.at

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket yRot
4040
public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket z
4141
public net.minecraft.resources.RegistryOps lookupProvider
4242
public net.minecraft.resources.RegistryOps$HolderLookupAdapter
43-
public net/minecraft/server/Main forceUpgrade(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lnet/minecraft/world/level/storage/WorldData;Lcom/mojang/datafixers/DataFixer;ZLjava/util/function/BooleanSupplier;Lnet/minecraft/core/RegistryAccess;Z)V
43+
public net.minecraft.server.Main forceUpgrade(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lnet/minecraft/world/level/storage/WorldData;Lcom/mojang/datafixers/DataFixer;ZLjava/util/function/BooleanSupplier;Lnet/minecraft/core/RegistryAccess;Z)V
4444
public net.minecraft.server.MinecraftServer LOGGER
4545
public net.minecraft.server.MinecraftServer doRunTask(Lnet/minecraft/server/TickTask;)V
4646
public net.minecraft.server.MinecraftServer executor

paper-api/src/main/java/org/bukkit/block/TileState.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
import org.jetbrains.annotations.NotNull;
66

77
/**
8-
* Represents a block state that also hosts a tile entity at the given location.
9-
*
8+
* Represents a block state that also hosts a block entity at the given location.
9+
* <br>
1010
* This interface alone is merely a marker that does not provide any data.
11-
*
12-
* Data about the tile entities is provided by the respective interface for each
13-
* tile entity type.
14-
*
11+
* <p>
12+
* Data about the block entities is provided by the respective interface for each
13+
* block entity type.
14+
* <p>
1515
* After modifying the data provided by a TileState, {@link #update()} needs to
1616
* be called to store the data.
1717
*/
1818
public interface TileState extends BlockState, PersistentDataHolder {
1919

2020
/**
2121
* Returns a custom tag container capable of storing tags on the object.
22-
*
22+
* <p>
2323
* Note that the tags stored on this container are all stored under their
2424
* own custom namespace therefore modifying default tags using this
2525
* {@link PersistentDataHolder} is impossible.
2626
* <p>
2727
* This {@link PersistentDataHolder} is only linked to the snapshot instance
2828
* stored by the {@link BlockState}.
29-
*
29+
* <p>
3030
* When storing changes on the {@link PersistentDataHolder}, the updated
3131
* content will only be applied to the actual block entity after one of the
3232
* {@link #update()} methods is called.

paper-api/src/main/java/org/bukkit/block/data/type/TestBlock.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public interface TestBlock extends BlockData {
1717
/**
1818
* Sets the value of the 'mode' property.
1919
*
20-
* @param state the new 'mode' value
20+
* @param mode the new 'mode' value
2121
*/
22-
void setMode(Mode state);
22+
void setMode(Mode mode);
2323

2424
enum Mode {
2525
START,

paper-api/src/main/java/org/bukkit/persistence/PersistentDataHolder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface PersistentDataHolder extends io.papermc.paper.persistence.Persi
1212

1313
/**
1414
* Returns a custom tag container capable of storing tags on the object.
15-
*
15+
* <p>
1616
* Note that the tags stored on this container are all stored under their
1717
* own custom namespace therefore modifying default tags using this
1818
* {@link PersistentDataHolder} is impossible.

paper-server/patches/sources/net/minecraft/server/Main.java.patch

+10-7
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
Dynamic<?> dataTag;
117117
if (levelStorageAccess.hasWorldData()) {
118118
LevelSummary summary;
119-
@@ -169,12 +_,30 @@
119+
@@ -169,12 +_,33 @@
120120
}
121121

122122
Dynamic<?> dynamic = dataTag;
@@ -134,12 +134,15 @@
134134
+ }
135135
+ File mcMeta = new File(bukkitDataPackFolder, "pack.mcmeta");
136136
+ try {
137-
+ com.google.common.io.Files.asCharSink(mcMeta, java.nio.charset.StandardCharsets.UTF_8).write("{\n"
138-
+ + " \"pack\": {\n"
139-
+ + " \"description\": \"Data pack for resources provided by Bukkit plugins\",\n"
140-
+ + " \"pack_format\": " + SharedConstants.getCurrentVersion().getPackVersion(net.minecraft.server.packs.PackType.SERVER_DATA) + "\n"
141-
+ + " }\n"
142-
+ + "}\n");
137+
+ com.google.common.io.Files.asCharSink(mcMeta, java.nio.charset.StandardCharsets.UTF_8).write("""
138+
+ {
139+
+ "pack": {
140+
+ "description": "Data pack for resources provided by Bukkit plugins",
141+
+ "pack_format": %d
142+
+ }
143+
+ }
144+
+ """.formatted(SharedConstants.getCurrentVersion().getPackVersion(net.minecraft.server.packs.PackType.SERVER_DATA))
145+
+ );
143146
+ } catch (java.io.IOException ex) {
144147
+ throw new RuntimeException("Could not initialize Bukkit datapack", ex);
145148
+ }

paper-server/patches/sources/net/minecraft/server/commands/SetSpawnCommand.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- serverPlayer.setRespawnPosition(new ServerPlayer.RespawnConfig(resourceKey, pos, angle, true), false);
1010
- }
1111
+ // Paper start - Add PlayerSetSpawnEvent
12-
+ if (serverPlayer.setRespawnPosition(new net.minecraft.server.level.ServerPlayer.RespawnConfig(resourceKey, pos, angle, true), false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.COMMAND)) {
12+
+ if (serverPlayer.setRespawnPosition(new ServerPlayer.RespawnConfig(resourceKey, pos, angle, true), false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.COMMAND)) {
1313
+ actualTargets.add(serverPlayer);
1414
+ }
1515
+ // Paper end - Add PlayerSetSpawnEvent

paper-server/patches/sources/net/minecraft/server/level/ServerPlayer.java.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@
545545
+
546546
+ return new TeleportTransition(
547547
+ ((org.bukkit.craftbukkit.CraftWorld) location.getWorld()).getHandle(),
548-
+ org.bukkit.craftbukkit.util.CraftLocation.toVec3D(location),
548+
+ org.bukkit.craftbukkit.util.CraftLocation.toVec3(location),
549549
+ teleportTransition.deltaMovement(),
550550
+ location.getYaw(),
551551
+ location.getPitch(),
@@ -615,7 +615,7 @@
615615
+ level = ((org.bukkit.craftbukkit.CraftWorld) newExit.getWorld()).getHandle();
616616
+ teleportTransition = new TeleportTransition(
617617
+ level,
618-
+ org.bukkit.craftbukkit.util.CraftLocation.toVec3D(newExit),
618+
+ org.bukkit.craftbukkit.util.CraftLocation.toVec3(newExit),
619619
+ Vec3.ZERO,
620620
+ newExit.getYaw(),
621621
+ newExit.getPitch(),

paper-server/patches/sources/net/minecraft/server/network/ServerGamePacketListenerImpl.java.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@
837837
+ this.player.jumpFromGround();
838838
+ } else {
839839
+ from = event.getFrom();
840-
+ this.internalTeleport(new PositionMoveRotation(org.bukkit.craftbukkit.util.CraftLocation.toVec3D(from), Vec3.ZERO, from.getYaw(), from.getPitch()), Collections.emptySet());
840+
+ this.internalTeleport(new PositionMoveRotation(org.bukkit.craftbukkit.util.CraftLocation.toVec3(from), Vec3.ZERO, from.getYaw(), from.getPitch()), Collections.emptySet());
841841
+ return;
842842
+ }
843843
+ // Paper end - Add PlayerJumpEvent
@@ -1030,7 +1030,7 @@
10301030
+ if (event.isCancelled() || !to.equals(event.getTo())) {
10311031
+ // set = Collections.emptySet(); // Can't relative teleport // Paper - Teleport API; Now you can!
10321032
+ to = event.isCancelled() ? event.getFrom() : event.getTo();
1033-
+ posMoveRotation = new PositionMoveRotation(CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch());
1033+
+ posMoveRotation = new PositionMoveRotation(CraftLocation.toVec3(to), Vec3.ZERO, to.getYaw(), to.getPitch());
10341034
+ }
10351035
+
10361036
+ this.internalTeleport(posMoveRotation, relatives);

paper-server/patches/sources/net/minecraft/server/players/PlayerList.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@
668668
+ location = org.bukkit.craftbukkit.util.CraftLocation.toBukkit(teleportTransition.position(), teleportTransition.newLevel().getWorld(), teleportTransition.yRot(), teleportTransition.xRot());
669669
+ // Paper end - Add PlayerPostRespawnEvent
670670
+ } else {
671-
+ teleportTransition = new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) location.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3D(location), Vec3.ZERO, location.getYaw(), location.getPitch(), TeleportTransition.DO_NOTHING);
671+
+ teleportTransition = new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) location.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3(location), Vec3.ZERO, location.getYaw(), location.getPitch(), TeleportTransition.DO_NOTHING);
672672
+ }
673673
+ // Spigot start
674674
+ if (teleportTransition == null) { // Paper - Add PlayerPostRespawnEvent - diff on change - spigot early returns if respawn pos is null, that is how they handle disconnected player in respawn event

paper-server/patches/sources/net/minecraft/world/entity/Entity.java.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@
13811381
+ }
13821382
+ if (!to.equals(teleEvent.getTo())) {
13831383
+ to = teleEvent.getTo();
1384-
+ teleportTransition = new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) to.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch(), teleportTransition.missingRespawnBlock(), teleportTransition.asPassenger(), Set.of(), teleportTransition.postTeleportTransition(), teleportTransition.cause());
1384+
+ teleportTransition = new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) to.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3(to), Vec3.ZERO, to.getYaw(), to.getPitch(), teleportTransition.missingRespawnBlock(), teleportTransition.asPassenger(), Set.of(), teleportTransition.postTeleportTransition(), teleportTransition.cause());
13851385
+ // Paper start - Call EntityPortalExitEvent
13861386
+ velocity = Vec3.ZERO;
13871387
+ }
@@ -1398,7 +1398,7 @@
13981398
+ if (!event.isCancelled() && event.getTo() != null && (!event.getTo().equals(event.getFrom()) || !event.getAfter().equals(event.getBefore()))) {
13991399
+ to = event.getTo().clone();
14001400
+ velocity = org.bukkit.craftbukkit.util.CraftVector.toNMS(event.getAfter());
1401-
+ teleportTransition = new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) to.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3D(to), velocity, to.getYaw(), to.getPitch(), teleportTransition.missingRespawnBlock(), teleportTransition.asPassenger(), Set.of(), teleportTransition.postTeleportTransition(), teleportTransition.cause());
1401+
+ teleportTransition = new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) to.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3(to), velocity, to.getYaw(), to.getPitch(), teleportTransition.missingRespawnBlock(), teleportTransition.asPassenger(), Set.of(), teleportTransition.postTeleportTransition(), teleportTransition.cause());
14021402
+ }
14031403
+ }
14041404
+ if (this.isRemoved()) {

paper-server/patches/sources/net/minecraft/world/inventory/ContainerLevelAccess.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
+ }
5252
+
5353
+ default org.bukkit.Location getLocation() {
54-
+ return new org.bukkit.Location(this.getWorld().getWorld(), this.getPosition().getX(), this.getPosition().getY(), this.getPosition().getZ());
54+
+ return org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.getPosition(), this.getWorld());
5555
+ }
5656
+ // CraftBukkit end
5757
+ // Paper start - Add missing InventoryHolders

paper-server/patches/sources/net/minecraft/world/level/block/EndGatewayBlock.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
&& level.getBlockEntity(pos) instanceof TheEndGatewayBlockEntity theEndGatewayBlockEntity
1111
&& !theEndGatewayBlockEntity.isCoolingDown()) {
1212
+ // Paper start - call EntityPortalEnterEvent
13-
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(level.getWorld(), pos.getX(), pos.getY(), pos.getZ()), org.bukkit.PortalType.END_GATEWAY); // Paper - add portal type
13+
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, level), org.bukkit.PortalType.END_GATEWAY); // Paper - add portal type
1414
+ if (!event.callEvent()) return;
1515
+ // Paper end - call EntityPortalEnterEvent
1616
entity.setAsInsidePortal(this, pos);

paper-server/patches/sources/net/minecraft/world/level/block/EndPortalBlock.java.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
88
if (entity.canUsePortal(false)) {
99
+ // CraftBukkit start - Entity in portal
10-
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(level.getWorld(), pos.getX(), pos.getY(), pos.getZ()), org.bukkit.PortalType.ENDER); // Paper - add portal type
10+
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, level), org.bukkit.PortalType.ENDER); // Paper - add portal type
1111
+ level.getCraftServer().getPluginManager().callEvent(event);
1212
+ if (event.isCancelled()) return; // Paper - make cancellable
1313
+ // CraftBukkit end
@@ -57,7 +57,7 @@
5757
+ }
5858
+ org.bukkit.Location to = event.getTo();
5959
+
60-
+ return new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) to.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3D(to), Vec3.ZERO, to.getYaw(), to.getPitch(), set, TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL);
60+
+ return new TeleportTransition(((org.bukkit.craftbukkit.CraftWorld) to.getWorld()).getHandle(), org.bukkit.craftbukkit.util.CraftLocation.toVec3(to), Vec3.ZERO, to.getYaw(), to.getPitch(), set, TeleportTransition.PLAY_PORTAL_SOUND.then(TeleportTransition.PLACE_PORTAL_TICKET), org.bukkit.event.player.PlayerTeleportEvent.TeleportCause.END_PORTAL);
6161
+ // CraftBukkit end
6262
}
6363
}

paper-server/patches/sources/net/minecraft/world/level/block/NetherPortalBlock.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
+ if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
3232
if (entity.canUsePortal(false)) {
3333
+ // CraftBukkit start - Entity in portal
34-
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), new org.bukkit.Location(level.getWorld(), pos.getX(), pos.getY(), pos.getZ()), org.bukkit.PortalType.NETHER); // Paper - add portal type
34+
+ org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, level), org.bukkit.PortalType.NETHER); // Paper - add portal type
3535
+ level.getCraftServer().getPluginManager().callEvent(event);
3636
+ if (event.isCancelled()) return; // Paper - make cancellable
3737
+ // CraftBukkit end

paper-server/patches/sources/net/minecraft/world/level/block/entity/BaseContainerBlockEntity.java.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
+ @Override
5757
+ public org.bukkit.Location getLocation() {
5858
+ if (this.level == null) return null;
59-
+ return new org.bukkit.Location(this.level.getWorld(), this.worldPosition.getX(), this.worldPosition.getY(), this.worldPosition.getZ());
59+
+ return org.bukkit.craftbukkit.util.CraftLocation.toBukkit(this.worldPosition, this.level);
6060
+ }
6161
+ // CraftBukkit end
6262
}

0 commit comments

Comments
 (0)