even moar workkkkk

This commit is contained in:
Aurora 2021-06-14 16:41:34 +02:00
parent 3721b1466f
commit 21effd6c48
No known key found for this signature in database
GPG Key ID: 89839F67B53656AD
22 changed files with 125 additions and 129 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add additional open container api to HumanEntity
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index b09d12390d5f77330ac84452e0fee63a169bd01f..77bff8fb6bfdf739e413084e13677a83e723c71e 100644
index c307a58b17324d6df8c21fa45f0f1e34810f1828..112c891e54e8f30ac10e6865efc2a8ee8d172188 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -148,6 +148,92 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity#isTicking
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index ecb5595332ab493224d06a75904e142ab541aad9..4ed8c74f874dbd1017764d7592acfdafbc5d5fe1 100644
index 09dc74b0e10d075190009631c84a3710cc1f9177..8cfe08cbc869e468edc0f0bdaa28d5bf1f6201a2 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -744,5 +744,10 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -747,5 +747,10 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* Check if entity is in lava
*/
public boolean isInLava();

View File

@ -2,7 +2,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Thu, 8 Oct 2020 00:00:25 -0400
Subject: [PATCH] Fix "Not a string" Map Conversion spam
1.17 Update: See if this is still needed, might be fixed upstream
The maps did convert successfully, but had noisy logs due to Spigot
implementing this logic incorrectly.

View File

@ -19,7 +19,7 @@ index 78948c42b13194005bdbbbc69c2b7ae0732a78c5..b41e7922dd96c3358eb849ab39982a75
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c8ebce55b4e3838bf70b115ffb0b634b3548a7dd..b82dd96147224057ea0e0dc92506b27ffbc9f034 100644
index 2bfafeec6f8a605a7826091314992e61a49e4c51..6d7f2db63d586b96939cfc3643ebae3a952a4836 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1264,6 +1264,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@ -31,7 +31,7 @@ index c8ebce55b4e3838bf70b115ffb0b634b3548a7dd..b82dd96147224057ea0e0dc92506b27f
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index e4f3dbff2605243039f9f59f025c931b3fb309c5..a5d90af5275c9c8069932f711069a6d422303d05 100644
index e4f3dbff2605243039f9f59f025c931b3fb309c5..3a444371e484defa3119d04b9fa7cf50ca5966ec 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -103,6 +103,7 @@ public abstract class Mob extends LivingEntity {
@ -52,7 +52,7 @@ index e4f3dbff2605243039f9f59f025c931b3fb309c5..a5d90af5275c9c8069932f711069a6d4
+ if (goalFloat.validConditions()) goalFloat.update();
+ this.getJumpControl().jumpIfSet();
+ }
+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterOrRainOrBubble()) {
+ if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) {
+ hurt(DamageSource.DROWN, 1.0F);
+ }
+ return;

View File

@ -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 96da70f1077f70c4bd5ba1196292a856deb25286..8531f1deea95aa8e73e75b714426c915a52a74af 100644
index 96da70f1077f70c4bd5ba1196292a856deb25286..466de2bbdbf0c9e3ed28ec8fee5fcfeb75c54398 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1305,12 +1305,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -1305,13 +1305,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
return this.wasTouchingWater;
}
@ -19,28 +19,21 @@ index 96da70f1077f70c4bd5ba1196292a856deb25286..8531f1deea95aa8e73e75b714426c915
return this.level.isRainingAt(blockposition) || this.level.isRainingAt(new BlockPos((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ()));
}
+ public final boolean isInBubbleColumn() { return isInBubbleColumn(); } // Paper - OBFHELPER
private boolean isInBubbleColumn() {
- private boolean isInBubbleColumn() {
+ public boolean isInBubbleColumn() { // Paper - make public
return this.level.getBlockState(this.blockPosition()).is(Blocks.BUBBLE_COLUMN);
}
@@ -1324,6 +1325,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
@@ -1319,7 +1319,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
return this.isInWater() || this.isInRain();
}
- public final boolean isInWaterOrRainOrBubble() { return isInWaterRainOrBubble(); } // Paper - OBFHELPER
public boolean isInWaterRainOrBubble() {
return this.isInWater() || this.isInRain() || this.isInBubbleColumn();
}
+ public final boolean isInWaterOrBubbleColumn() { return isInWaterOrBubble(); } // Paper - OBFHELPER
public boolean isInWaterOrBubble() {
return this.isInWater() || this.isInBubbleColumn();
}
@@ -1463,6 +1465,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
return this.fluidOnEyes == fluidTag;
}
+ public final boolean isInLava() { return isInLava(); } // Paper - OBFHELPER
public boolean isInLava() {
return !this.firstTick && this.fluidHeight.getDouble(FluidTags.LAVA) > 0.0D;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 98d3818d38f487fc7e1302ee4af9e4898efec809..26bfbab1e8332f91c4d2814cd0056ca2ea7ddab7 100644
index 98d3818d38f487fc7e1302ee4af9e4898efec809..a13042367ac284ce23d799eba1330aa2777173e7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1169,5 +1169,29 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@ -61,11 +54,11 @@ index 98d3818d38f487fc7e1302ee4af9e4898efec809..26bfbab1e8332f91c4d2814cd0056ca2
+ }
+
+ public boolean isInWaterOrBubbleColumn() {
+ return getHandle().isInWaterOrBubbleColumn();
+ return getHandle().isInWaterOrBubble();
+ }
+
+ public boolean isInWaterOrRainOrBubbleColumn() {
+ return getHandle().isInWaterOrRainOrBubble();
+ return getHandle().isInWaterRainOrBubble();
+ }
+
+ public boolean isInLava() {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6bc5ba51c90723c7138b1b5d2381cb215f1e5271..df2c41d18377d8519d5537186d529ecc1901f58a 100644
index 6bc5ba51c90723c7138b1b5d2381cb215f1e5271..beb8b7d06ef47c80ede95c884598fedcc7126d67 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2033,6 +2033,32 @@ public final class CraftServer implements Server {
@ -19,17 +19,17 @@ index 6bc5ba51c90723c7138b1b5d2381cb215f1e5271..df2c41d18377d8519d5537186d529ecc
+ CraftChunkData data = (CraftChunkData) createChunkData(world);
+ // do bunch of vanilla shit
+ net.minecraft.server.level.ServerLevel nmsWorld = ((CraftWorld) world).getHandle();
+ net.minecraft.world.level.chunk.ProtoChunk protoChunk = new net.minecraft.world.level.chunk.ProtoChunk(new net.minecraft.world.level.ChunkPos(x, z), net.minecraft.world.level.chunk.UpgradeData.getEmptyConverter(), nmsWorld);
+ net.minecraft.world.level.chunk.ProtoChunk protoChunk = new net.minecraft.world.level.chunk.ProtoChunk(new net.minecraft.world.level.ChunkPos(x, z), null, nmsWorld);
+ List<net.minecraft.world.level.chunk.ChunkAccess> list = new ArrayList<>();
+ list.add(protoChunk);
+ net.minecraft.server.level.WorldGenRegion genRegion = new net.minecraft.server.level.WorldGenRegion(nmsWorld, list);
+ net.minecraft.server.level.WorldGenRegion genRegion = new net.minecraft.server.level.WorldGenRegion(nmsWorld, list, net.minecraft.world.level.chunk.ChunkStatus.EMPTY, -1);
+ // call vanilla generator, one feature after another. Order here is important!
+ net.minecraft.world.level.chunk.ChunkGenerator chunkGenerator = nmsWorld.getChunkSource().generator;
+ if (chunkGenerator instanceof org.bukkit.craftbukkit.generator.CustomChunkGenerator) {
+ chunkGenerator = ((org.bukkit.craftbukkit.generator.CustomChunkGenerator) chunkGenerator).delegate;
+ }
+ chunkGenerator.createBiomes(nmsWorld.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), protoChunk);
+ chunkGenerator.fillFromNoise(genRegion, nmsWorld.structureFeatureManager(), protoChunk);
+ chunkGenerator.fillFromNoise((runnable) -> {}, nmsWorld.structureFeatureManager(), protoChunk);
+ chunkGenerator.buildSurfaceAndBedrock(genRegion, protoChunk);
+ // copy over generated sections
+ data.setRawChunkData(protoChunk.getSections());

View File

@ -42,7 +42,7 @@ index 5356f6484751e4b4740720aecac90bdfe044283b..ed54479b14dcfc736ac90749106557f0
for(int i = 0; i < bs.length; ++i) {
diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
index 449f1b2f5dca350dc0912e14c8c2bf3eb4652b92..9e944aa41c184ebde1179399def662b2f08eef62 100644
index 449f1b2f5dca350dc0912e14c8c2bf3eb4652b92..bcf53ec07b8eeec7a88fb67e6fb908362e6f51b0 100644
--- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java
+++ b/src/main/java/net/minecraft/network/protocol/PacketUtils.java
@@ -1,6 +1,9 @@
@ -61,7 +61,7 @@ index 449f1b2f5dca350dc0912e14c8c2bf3eb4652b92..9e944aa41c184ebde1179399def662b2
} // Paper - timings
+ // Paper start
+ catch (Exception e) {
+ Connection networkmanager = listener.a();
+ Connection networkmanager = listener.getConnection();
+ if (networkmanager.getPlayer() != null) {
+ LOGGER.error("Error whilst processing packet {} for {}[{}]", packet, networkmanager.getPlayer().getScoreboardName(), networkmanager.getRemoteAddress(), e);
+ } else {

View File

@ -5,16 +5,10 @@ Subject: [PATCH] Fix MC-187716 Use configured height
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
index 5ad6e0ef718a1775a2310925b8273120687230b1..88fbd8a925d84184116051082514ef4d45c98acf 100644
index 5ad6e0ef718a1775a2310925b8273120687230b1..7c3386b37aae7d10629e0a256102967f69b68a7e 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherCappedSurfaceBuilder.java
@@ -1,4 +1,5 @@
package net.minecraft.world.level.levelgen.surfacebuilders;
+<<<<<<< found
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -42,7 +43,7 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
@@ -42,7 +42,7 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
BlockState blockState3 = chunk.getBlockState(mutableBlockPos.set(k, 128, m));
@ -23,6 +17,11 @@ index 5ad6e0ef718a1775a2310925b8273120687230b1..88fbd8a925d84184116051082514ef4d
mutableBlockPos.set(k, p, m);
BlockState blockState4 = chunk.getBlockState(mutableBlockPos);
if (blockState3.is(defaultBlock.getBlock()) && (blockState4.isAir() || blockState4 == defaultFluid)) {
@@ -103,3 +103,4 @@ public abstract class NetherCappedSurfaceBuilder extends SurfaceBuilder<SurfaceB
protected abstract BlockState getPatchBlockState();
}
+
diff --git a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java b/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java
index fbb756504609285d96e01c4079be06561f75331e..aa6be90ac272c7e1186d177768230b7f52371e68 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/surfacebuilders/NetherForestSurfaceBuilder.java

View File

@ -4,6 +4,25 @@ Date: Sun, 23 Aug 2020 15:28:35 +0200
Subject: [PATCH] Add more Evoker API
diff --git a/src/main/java/net/minecraft/world/entity/monster/Evoker.java b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
index 2b09a864425160fadd05323006ddab0bab1d47c8..0400ced70839947532b90f546360701729244a73 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Evoker.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Evoker.java
@@ -125,12 +125,12 @@ public class Evoker extends SpellcasterIllager {
return SoundEvents.EVOKER_HURT;
}
- void setWololoTarget(@Nullable Sheep sheep) {
+ public void setWololoTarget(@Nullable Sheep sheep) { // Paper - make public
this.wololoTarget = sheep;
}
@Nullable
- Sheep getWololoTarget() {
+ public Sheep getWololoTarget() { // Paper - make public
return this.wololoTarget;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java
index 91d07e6996e315734689ea25336992b0ed21cf25..7e861636710aa44ed36e7f20c6320dabb809c35d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEvoker.java

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add a way to get translation keys for blocks, entities and
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
index 872f92ac1a6bc86ce54700dbf555ceea4fab2057..4a663a70235609d2f801b8c6bcecbe59d0ea2e27 100644
index 872f92ac1a6bc86ce54700dbf555ceea4fab2057..b3c07e22d4e7107ca22242661fa9ecf2d81fc9e4 100644
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
@@ -291,6 +291,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
@ -17,14 +17,6 @@ index 872f92ac1a6bc86ce54700dbf555ceea4fab2057..4a663a70235609d2f801b8c6bcecbe59
public static Optional<EntityType<?>> byString(String id) {
return Registry.ENTITY_TYPE.getOptional(ResourceLocation.tryParse(id));
}
@@ -445,6 +446,7 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
return this.category;
}
+ public String getDescriptionId() { return getDescriptionId(); } // Paper - OBFHELPER
public String getDescriptionId() {
if (this.descriptionId == null) {
this.descriptionId = Util.makeDescriptionId("entity", Registry.ENTITY_TYPE.getKey(this));
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index 878cdfc49253e7916d038495f79fec7cce75aa50..85fa2b26863e2da8f4de93aa10ffd77f7076b682 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
index 746755f76ae177b2eeccf66f8cd95e6ffd5acad9..2e0be9771ca3511f5d9364c57235556b70f07ec6 100644
index 6ec39de514ceed7e5ffe9a8dc94c2ffd2902cd98..9cde8ae979287d342574da066f65731324725dea 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
@@ -365,5 +365,40 @@ public final class CraftItemFactory implements ItemFactory {
@@ -368,5 +368,40 @@ public final class CraftItemFactory implements ItemFactory {
return nms != null ? net.minecraft.locale.Language.getInstance().translateKey(nms.getItem().getDescriptionId()) : null;
return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId()) : null;
}
+
+ @Override

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 735c3c983e96e4e6f36de0975909fc48cb042081..5c5903867432894b47bc62d89989f78c36a84ca1 100644
index 1889de77a5e3d9371005b6bd451e2c0e57e96a93..dd51341115450a38ea5b0ea34dbadc2a8e191f60 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1953,6 +1953,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2038,6 +2038,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().reloadResources();
this.functionManager.replaceLibrary(this.resources.getFunctionLibrary());
this.structureManager.onResourceManagerReload(this.resources.getResourceManager());
@ -17,7 +17,7 @@ index 735c3c983e96e4e6f36de0975909fc48cb042081..5c5903867432894b47bc62d89989f78c
if (this.isSameThread()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index 0b6c6dfc380cea87bd88c3eb8a199e072dcbf56c..03e065bf92cafd376ad0f878584cdac6fd196245 100644
index 3594f432a25b580173e8577bf324be954f5eddd1..6dc8f9f269db6971b8b46819e017357899ccd118 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -13,6 +13,7 @@ import net.minecraft.commands.arguments.blocks.BlockStateParser;
@ -28,8 +28,8 @@ index 0b6c6dfc380cea87bd88c3eb8a199e072dcbf56c..03e065bf92cafd376ad0f878584cdac6
import net.minecraft.util.StringRepresentable;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
@@ -476,9 +477,39 @@ public class CraftBlockData implements BlockData {
Preconditions.checkState(MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
@@ -494,9 +495,39 @@ public class CraftBlockData implements BlockData {
Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit);
}
+ // Paper start - cache block data strings

View File

@ -9,32 +9,32 @@ as this is how Vanilla teleports entities.
Cancel any pending motion when teleported.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ab6494f5a872bba5398bef0367b4d9257786f61e..ab45497e8f7720c9d60626b32e9c95779af676b0 100644
index 0176b85a031b33cb2a12bb75079f5e3111f4f2b7..e3725db7e19fe3235ec25beffca26a7eede24394 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -691,7 +691,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
@@ -682,7 +682,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (packet.getId() == this.awaitingTeleport && this.awaitingPositionFromClient != null) { // CraftBukkit
- this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.yRot, this.player.xRot);
+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.yRot, this.player.xRot); // Paper - use proper setPositionRotation for teleportation
- this.player.absMoveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot());
+ this.player.moveTo(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); // Paper - use proper setPositionRotation for teleportation
this.lastGoodX = this.awaitingPositionFromClient.x;
this.lastGoodY = this.awaitingPositionFromClient.y;
this.lastGoodZ = this.awaitingPositionFromClient.z;
@@ -1536,7 +1536,7 @@ public class ServerGamePacketListenerImpl implements ServerGamePacketListener {
@@ -1569,7 +1569,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser
// CraftBukkit end
this.awaitingTeleportTime = this.tickCount;
- this.player.absMoveTo(d0, d1, d2, f, f1);
+ this.player.moveTo(d0, d1, d2, f, f1); // Paper - use proper setPositionRotation for teleportation
this.player.forceCheckHighPriority(); // Paper
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport));
this.player.connection.send(new ClientboundPlayerPositionPacket(d0 - d3, d1 - d4, d2 - d5, f - f2, f1 - f3, set, this.awaitingTeleport, flag));
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index aea2457510c75214bbb925307155611e981f115f..d69981a1b5a40418c7d17de5f3bece30592ae586 100644
index 466de2bbdbf0c9e3ed28ec8fee5fcfeb75c54398..a9c90e41af1cc67a88a639dc795dd8023a7acb89 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -143,6 +143,7 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
@@ -152,6 +152,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
// CraftBukkit start
private static final int CURRENT_LEVEL = 2;
@ -42,7 +42,7 @@ index aea2457510c75214bbb925307155611e981f115f..d69981a1b5a40418c7d17de5f3bece30
static boolean isLevelAtLeast(CompoundTag tag, int level) {
return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level;
}
@@ -1406,6 +1407,13 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
@@ -1522,6 +1523,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
}
public void moveTo(double x, double y, double z, float yaw, float pitch) {
@ -53,31 +53,31 @@ index aea2457510c75214bbb925307155611e981f115f..d69981a1b5a40418c7d17de5f3bece30
+ this.preserveMotion = false;
+ }
+ // Paper end
this.setPosAndOldPos(x, y, z);
this.yRot = yaw;
this.xRot = pitch;
this.setPosRaw(x, y, z);
this.setYRot(yaw);
this.setXRot(pitch);
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 6ca378ec7868b855d46c749910c656f82ddb009f..091e72474ac199c38fff979a5faf524e011d8d0a 100644
index 68ce2732dfdc25ddadc15c43c30a609f9b1eba86..c741f8e4a4b67d1bfed2d1bac36856c5688bb161 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -165,6 +165,7 @@ public abstract class BaseSpawner {
return;
}
@@ -170,6 +170,7 @@ public abstract class BaseSpawner {
return;
}
+ entity.preserveMotion = true; // Paper - preserve entity motion from tag
entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), world.random.nextFloat() * 360.0F, 0.0F);
if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity;
+ entity.preserveMotion = true; // Paper - preserve entity motion from tag
entity.moveTo(entity.getX(), entity.getY(), entity.getZ(), world.random.nextFloat() * 360.0F, 0.0F);
if (entity instanceof Mob) {
Mob entityinsentient = (Mob) entity;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index deeae62e9926f9435907c68e7d35e7420f5e79dd..1275768762884416fa3c68dab3a6671b24949976 100644
index a13042367ac284ce23d799eba1330aa2777173e7..5d11d573a68bea7b341bb987b6cfb998bd1b74fb 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -556,7 +556,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -563,7 +563,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
}
// entity.setLocation() throws no event, and so cannot be cancelled
- entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
- this.entity.absMoveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
+ entity.moveTo(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // Paper - use proper setPosition, as per vanilla teleporting
// SPIGOT-619: Force sync head rotation also
entity.setYHeadRot(location.getYaw());
((net.minecraft.server.level.ServerLevel) entity.level).updateChunkPos(entity); // Spigot - register to new chunk
this.entity.setYHeadRot(location.getYaw());

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add additional open container api to HumanEntity
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
index 878a62e04962aafeaf192075fbe08e319298a800..aceb57c93c91730345f49f78838780c41ce2dcef 100644
index 36ea76bfe0bd96ead82ed1ad34f25de10b7fa30e..021394a0e668d2cfccd8617d4aee79147181fa22 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
@@ -459,6 +459,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@@ -458,6 +458,70 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
return this.getHandle().containerMenu.getBukkitView();
}
@ -78,4 +78,4 @@ index 878a62e04962aafeaf192075fbe08e319298a800..aceb57c93c91730345f49f78838780c4
+
@Override
public void closeInventory() {
// Paper start
this.getHandle().closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.PLUGIN);

View File

@ -6,24 +6,16 @@ Subject: [PATCH] Extend block drop capture to capture all items added to the
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 22266fda4de9b5fbace3b8e55ce390b8d7e75a65..fe7b71fbb3963beafe93a5d86bebdd629c7ec8f2 100644
index 4ae56444d258cdf44a02256315d6aae84e2f53be..f1c02ae301da2a3b582d2ec1215c1a981e26ac47 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -95,6 +95,7 @@ import net.minecraft.world.entity.ai.village.poi.PoiType;
import net.minecraft.world.entity.animal.horse.SkeletonHorse;
import net.minecraft.world.entity.boss.EnderDragonPart;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
+import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.monster.Drowned;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.raid.Raid;
@@ -1284,6 +1285,13 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
} else if (this.isUUIDUsed(entity)) {
@@ -1220,6 +1220,13 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
// WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit
return false;
} else {
+ // Paper start - capture all item additions to the world
+ if (captureDrops != null && entity instanceof ItemEntity) {
+ captureDrops.add((ItemEntity) entity);
+ if (captureDrops != null && entity instanceof net.minecraft.world.entity.item.ItemEntity) {
+ captureDrops.add((net.minecraft.world.entity.item.ItemEntity) entity);
+ return true;
+ }
+ // Paper end
@ -32,10 +24,10 @@ index 22266fda4de9b5fbace3b8e55ce390b8d7e75a65..fe7b71fbb3963beafe93a5d86bebdd62
return false;
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 79f3e4176145c42debb9adc1e68175cf063c1f22..6269e37f2859417a80e6de16045f1c2325f9746f 100644
index 6c55bd8b876d1d694e05ad6de6a9fd29a4d4d053..de4fdd46f23b2b17da752a8afc0faecc1ad8344f 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -6,6 +6,7 @@ import net.minecraft.world.InteractionResult;
@@ -7,6 +7,7 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.EquipmentSlot;
@ -43,7 +35,7 @@ index 79f3e4176145c42debb9adc1e68175cf063c1f22..6269e37f2859417a80e6de16045f1c23
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.DoubleHighBlockItem;
import net.minecraft.world.item.ItemStack;
@@ -418,10 +419,12 @@ public class ServerPlayerGameMode {
@@ -421,10 +422,12 @@ public class ServerPlayerGameMode {
// return true; // CraftBukkit
}
// CraftBukkit start

View File

@ -5,13 +5,13 @@ Subject: [PATCH] Don't mark dirty in invalid locations (SPIGOT-6086)
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 82205ad13ef0e987bd83979d06331545efe0a60a..50dc47e8c03ce274d558bc0dfa73ba3ab5fbae5c 100644
index 1f67c9c5f7161ea687983e7ae0ec7d259da9acd3..0d8ddbc3f8aa22f16907613838ffb9a42f1e6de6 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -388,6 +388,7 @@ public class ChunkHolder {
@@ -246,6 +246,7 @@ public class ChunkHolder {
}
public void blockChanged(BlockPos blockposition) {
public void blockChanged(BlockPos pos) {
+ if (!blockposition.isValidLocation()) return; // Paper - SPIGOT-6086 for all invalid locations; avoid acquiring locks
LevelChunk chunk = this.getSendingChunk(); // Paper - no-tick view distance

View File

@ -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 d69981a1b5a40418c7d17de5f3bece30592ae586..fa22c0d7f676c96d34bf56d80181d6b047f2ff0b 100644
index a9c90e41af1cc67a88a639dc795dd8023a7acb89..dac4585ba1bfc782b3e381dfba0a1b9abbb6a2d7 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3476,4 +3476,10 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
@@ -3904,4 +3904,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
void accept(Entity entity, double x, double y, double z);
}
@ -21,7 +21,7 @@ index d69981a1b5a40418c7d17de5f3bece30592ae586..fa22c0d7f676c96d34bf56d80181d6b0
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index de5d02a1345f9886200f0540ac08be0df5878708..9a16882deee21faf78ea46e08b2f2ad3fbb6021b 100644
index 1e387ba8552484b10ae276e1eea47d77d121e19d..2984f5fa036019bb35a603690c568fc5c7b855d6 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -443,6 +443,10 @@ public final class CraftMagicNumbers implements UnsafeValues {

View File

@ -28,7 +28,7 @@ index 545948f20efd6c8dd42140b565af94cd6b52b661..7d50aded88f5b7dfebaea1aebc86231f
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
index 4c93be31fd95d731327479519ecb34a08785c1ca..57537b8871dd5c54d97f3effe1802a3396644e46 100644
index 68aa66c340b7a686a353e2a15084d811a3955a0a..b1fbbfeadb63d495b57f6c29b00de5327ca713cd 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java
@@ -18,6 +18,7 @@ import org.bukkit.scoreboard.Team;
@ -49,11 +49,11 @@ index 4c93be31fd95d731327479519ecb34a08785c1ca..57537b8871dd5c54d97f3effe1802a33
+ registeredGlobally = true;
+ }
+ // Paper end
net.minecraft.world.scores.Objective objective = board.registerObjective(name, craftCriteria.criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
net.minecraft.world.scores.Objective objective = board.addObjective(name, craftCriteria.criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
return new CraftObjective(this, objective);
}
@@ -65,6 +72,12 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists");
@@ -68,6 +75,12 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard {
net.minecraft.world.scores.Objective objective = this.board.addObjective(name, craftCriteria.criteria, CraftChatMessage.fromStringOrNull(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType));
CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria);
+ // Paper start
@ -66,25 +66,26 @@ index 4c93be31fd95d731327479519ecb34a08785c1ca..57537b8871dd5c54d97f3effe1802a33
return new CraftObjective(this, objective);*/ // Paper
return registerNewObjective(name, criteria, io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(displayName), renderType); // Paper
diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
index 30b0d4986a7edcf324d94d9304d66d0567098855..8217e35f5a3093e63a165ee8c8b30bf3f28f3bd3 100644
index ff090edcc85713083449cebb22bd1490123bc1ee..8ccfe9488db44d7d2cf4040a5b4cead33da1d5f4 100644
--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardManager.java
@@ -30,6 +30,7 @@ public final class CraftScoreboardManager implements ScoreboardManager {
public CraftScoreboardManager(MinecraftServer minecraftserver, net.minecraft.world.scores.Scoreboard scoreboardServer) {
mainScoreboard = new CraftScoreboard(scoreboardServer);
this.mainScoreboard = new CraftScoreboard(scoreboardServer);
+ mainScoreboard.registeredGlobally = true; // Paper
server = minecraftserver;
scoreboards.add(mainScoreboard);
this.server = minecraftserver;
this.scoreboards.add(mainScoreboard);
}
@@ -43,10 +44,22 @@ public final class CraftScoreboardManager implements ScoreboardManager {
public CraftScoreboard getNewScoreboard() {
org.spigotmc.AsyncCatcher.catchOp("scoreboard creation"); // Spigot
CraftScoreboard scoreboard = new CraftScoreboard(new ServerScoreboard(server));
CraftScoreboard scoreboard = new CraftScoreboard(new ServerScoreboard(this.server));
- this.scoreboards.add(scoreboard);
+ // Paper start
+ if (com.destroystokyo.paper.PaperConfig.trackPluginScoreboards) {
+ scoreboard.registeredGlobally = true;
scoreboards.add(scoreboard);
+ scoreboards.add(scoreboard);
+ }
+ // Paper end
return scoreboard;
@ -99,4 +100,4 @@ index 30b0d4986a7edcf324d94d9304d66d0567098855..8217e35f5a3093e63a165ee8c8b30bf3
+
// CraftBukkit method
public CraftScoreboard getPlayerBoard(CraftPlayer player) {
CraftScoreboard board = playerBoards.get(player);
CraftScoreboard board = this.playerBoards.get(player);

View File

@ -5,18 +5,18 @@ 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 fa22c0d7f676c96d34bf56d80181d6b047f2ff0b..a623c22cd03ad92657e661851fddc76a30986755 100644
index dac4585ba1bfc782b3e381dfba0a1b9abbb6a2d7..7ecf78759ff7e3d64bb09306e55d54402a2d99a5 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -49,6 +49,7 @@ import net.minecraft.resources.ResourceLocation;
@@ -52,6 +52,7 @@ import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MCUtil;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ChunkMap;
+import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.level.TicketType;
@@ -3481,5 +3482,9 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
@@ -3909,5 +3910,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
public static int nextEntityId() {
return ENTITY_COUNTER.incrementAndGet();
}
@ -27,10 +27,10 @@ index fa22c0d7f676c96d34bf56d80181d6b047f2ff0b..a623c22cd03ad92657e661851fddc76a
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 1275768762884416fa3c68dab3a6671b24949976..502773ae60290125057fb342a3358ff55927d196 100644
index 5d11d573a68bea7b341bb987b6cfb998bd1b74fb..b75a14a3af6c23128010f37f10cf78e477b72c4f 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -1159,5 +1159,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
@@ -1193,5 +1193,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
public boolean isInLava() {
return getHandle().isInLava();
}

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5c5903867432894b47bc62d89989f78c36a84ca1..954dce690852da87a37e7797c6f9f549242e511a 100644
index dd51341115450a38ea5b0ea34dbadc2a8e191f60..9bd2255d31bcfd4574f8d1caf598f9141aa9e3c1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2018,6 +2018,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2104,6 +2104,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.isEnforceWhitelist()) {
PlayerList playerlist = source.getServer().getPlayerList();
UserWhiteList whitelist = playerlist.getWhiteList();