13
0
geforkt von Mirrors/Paper

More more patches

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-03-14 19:36:39 +01:00
Ursprung f29f49ac23
Commit 92dd8645a8
125 geänderte Dateien mit 333 neuen und 78 gelöschten Zeilen

Datei anzeigen

@ -27,12 +27,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.server = server;
@@ -0,0 +0,0 @@ public class ServerConnectionListener {
int j = ServerConnectionListener.this.server.getRateLimitPacketsPerSecond();
Object object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND);
Connection object = j > 0 ? new RateKickingConnection(j) : new Connection(PacketFlow.SERVERBOUND); // CraftBukkit - decompile error
- ServerConnectionListener.this.connections.add((Connection) object); // CraftBukkit - decompile error
+ // ServerConnectionListener.this.connections.add((Connection) object); // CraftBukkit - decompile error
+ pending.add((Connection) object); // Paper
channel.pipeline().addLast("packet_handler", (ChannelHandler) object);
- ServerConnectionListener.this.connections.add(object);
+ //ServerConnectionListener.this.connections.add(object);
+ pending.add(object); // Paper
channelpipeline.addLast("packet_handler", (ChannelHandler) object);
((Connection) object).setListener(new ServerHandshakePacketListenerImpl(ServerConnectionListener.this.server, (Connection) object));
}
@@ -0,0 +0,0 @@ public class ServerConnectionListener {

Datei anzeigen

@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
implementation("org.ow2.asm:asm:9.4")
+ implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0")
runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
@@ -0,0 +0,0 @@ dependencies {

Datei anzeigen

@ -27,7 +27,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
}

Datei anzeigen

@ -30,7 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Vec3 vec3 = context.getParamOrNull(LootContextParams.ORIGIN);
if (vec3 != null) {
ServerLevel serverLevel = context.getLevel();
- BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, new BlockPos(vec3), this.searchRadius, this.skipKnownStructures);
- BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, BlockPos.containing(vec3), this.searchRadius, this.skipKnownStructures);
+ // Paper start
+ if (!serverLevel.paperConfig().environment.treasureMaps.enabled) {
+ /*
@ -40,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return stack;
+ }
+ // Paper end
+ BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, new BlockPos(vec3), this.searchRadius, !serverLevel.paperConfig().environment.treasureMaps.findAlreadyDiscoveredLootTable.or(!this.skipKnownStructures)); // Paper
+ BlockPos blockPos = serverLevel.findNearestMapStructure(this.destination, BlockPos.containing(vec3), this.searchRadius, !serverLevel.paperConfig().environment.treasureMaps.findAlreadyDiscoveredLootTable.or(!this.skipKnownStructures)); // Paper
if (blockPos != null) {
ItemStack itemStack = MapItem.create(serverLevel, blockPos.getX(), blockPos.getZ(), this.zoom, true, true);
MapItem.renderBiomePreviewMap(serverLevel, itemStack);

Datei anzeigen

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger()) {
if (this.clientIsFloating && !this.player.isSleeping() && !this.player.isPassenger() && !this.player.isDeadOrDying()) {
if (++this.aboveGroundTickCount > 80) {
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString());
- this.disconnect(Component.translatable("multiplayer.disconnect.flying"));

Datei anzeigen

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.triggerItemUseEffects(this.useItem, 16);
// CraftBukkit start - fire PlayerItemConsumeEvent
ItemStack itemstack;
@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
level.getCraftServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
} else {
itemstack = this.useItem.finishUsingItem(this.level, this);
}
@ -35,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit end
if (itemstack != this.useItem) {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.stopUsingItem();

Datei anzeigen

@ -26,7 +26,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
if (nbt.contains("Team", 8)) {
String s = nbt.getString("Team");
PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s);

Datei anzeigen

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
}
@ -16,15 +16,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (flag1) {
if (flag) {
this.level.broadcastEntityEvent(this, (byte) 29);
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
b0 = 2;
}
} else {
+ if (!knockbackCancelled) // Paper - Disable explosion knockback
this.level.broadcastEntityEvent(this, b0);
this.level.broadcastDamageEvent(this, source);
}
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
}
@ -37,19 +34,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion {
double d14 = d13;
if (entity instanceof LivingEntity) {
- d14 = ProtectionEnchantment.getExplosionKnockbackAfterDampener((LivingEntity) entity, d13);
+ d14 = entity instanceof Player && level.paperConfig().environment.disableExplosionKnockback ? 0 : ProtectionEnchantment.getExplosionKnockbackAfterDampener((LivingEntity) entity, d13); // Paper - Disable explosion knockback
}
LivingEntity entityliving = (LivingEntity) entity;
entity.setDeltaMovement(entity.getDeltaMovement().add(d8 * d14, d9 * d14, d10 * d14));
- d14 = ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d13);
+ d14 = entity instanceof Player && level.paperConfig().environment.disableExplosionKnockback ? 0 : ProtectionEnchantment.getExplosionKnockbackAfterDampener(entityliving, d13); // Paper - disable explosion knockback
} else {
d14 = d13;
}
@@ -0,0 +0,0 @@ public class Explosion {
if (entity instanceof Player) {
Player entityhuman = (Player) entity;
- if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying)) {
+ if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.getAbilities().flying) && !level.paperConfig().environment.disableExplosionKnockback) { // Paper - Disable explosion knockback
this.hitPlayers.put(entityhuman, new Vec3(d8 * d13, d9 * d13, d10 * d13));
this.hitPlayers.put(entityhuman, vec3d1);
}
}

Datei anzeigen

@ -19,8 +19,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return BlockPathTypes.BLOCKED;
+ } else {
+ // Paper end
if (blockState.is(Blocks.CACTUS)) {
return BlockPathTypes.DANGER_CACTUS;
if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) {
return BlockPathTypes.DANGER_OTHER;
}
@@ -0,0 +0,0 @@ public class WalkNodeEvaluator extends NodeEvaluator {
if (world.getFluidState(pos).is(FluidTags.WATER)) {

Datei anzeigen

@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -0,0 +0,0 @@ public class Util {
private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads";
private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1);
private static final ExecutorService BOOTSTRAP_EXECUTOR = makeExecutor("Bootstrap");
private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main");
+ // Paper start - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread
+ public static final ExecutorService PROFILE_EXECUTOR = Executors.newFixedThreadPool(2, new java.util.concurrent.ThreadFactory() {
@ -55,13 +55,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java
@@ -0,0 +0,0 @@ public class SkullBlockEntity extends BlockEntity {
public static void updateGameprofile(@Nullable GameProfile owner, Consumer<GameProfile> callback) {
if (owner != null && !StringUtil.isNullOrEmpty(owner.getName()) && (!owner.isComplete() || !owner.getProperties().containsKey("textures")) && SkullBlockEntity.profileCache != null && SkullBlockEntity.sessionService != null) {
SkullBlockEntity.profileCache.getAsync(owner.getName(), (optional) -> {
if (owner != null && !StringUtil.isNullOrEmpty(owner.getName()) && (!owner.isComplete() || !owner.getProperties().containsKey("textures")) && profileCache != null && sessionService != null) {
profileCache.getAsync(owner.getName(), (profile) -> {
- Util.backgroundExecutor().execute(() -> {
+ Util.PROFILE_EXECUTOR.execute(() -> { // Paper - not a good idea to use BLOCKING OPERATIONS on the worldgen executor
Util.ifElse(optional, (gameprofile1) -> {
Property property = (Property) Iterables.getFirst(gameprofile1.getProperties().get("textures"), (Object) null);
Util.ifElse(profile, (profilex) -> {
Property property = Iterables.getFirst(profilex.getProperties().get("textures"), (Property)null);
if (property == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java b/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java

Datei anzeigen

@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) {

Datei anzeigen

@ -134,7 +134,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity {
@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable {
protected void dropExperience() {
// CraftBukkit start - Update getExpReward() above if the removed if() changes!
if (true && !(this instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time
@ -210,7 +210,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (this.dragonDeathTime == 1 && !this.isSilent()) {
@@ -0,0 +0,0 @@ public class EnderDragon extends Mob implements Enemy {
this.yBodyRot = this.getYRot();
this.move(MoverType.SELF, new Vec3(0.0D, 0.10000000149011612D, 0.0D));
if (this.dragonDeathTime == 200 && this.level instanceof ServerLevel) {
if (true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp
- ExperienceOrb.award((ServerLevel) this.level, this.position(), Mth.floor((float) short0 * 0.2F));

Datei anzeigen

@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -0,0 +0,0 @@ public class Main {
Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -28);
deadline.add(Calendar.DAY_OF_YEAR, -3);
if (buildDate.before(deadline.getTime())) {
- System.err.println("*** Error, this build is outdated ***");
+ // Paper start - This is some stupid bullshit

Datei anzeigen

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -0,0 +0,0 @@ public class ServerPlayer extends Player {
return s;
}
}
- public String locale = "en_us"; // CraftBukkit - add, lowercase

Datei anzeigen

@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/n
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity {
@@ -0,0 +0,0 @@ public abstract class Mob extends LivingEntity implements Targeting {
ItemEntity entityitem = (ItemEntity) iterator.next();
if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) {
@ -24,8 +24,8 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity {
private UUID owner;
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
public UUID target;
public final float bobOffs;
private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit
+ public boolean canMobPickup = true; // Paper
@ -54,4 +54,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
@Override
public void setOwner(UUID uuid) {
this.item.setOwner(uuid);
this.item.setTarget(uuid);

Datei anzeigen

@ -561,7 +561,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@@ -0,0 +0,0 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
this.itemStacks = NonNullList.withSize(this.getContainerSize(), ItemStack.EMPTY);
this.level.gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of((Entity) player));
}
+ // Paper start

Datei anzeigen

@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/core/Vec3i.java
+++ b/src/main/java/net/minecraft/core/Vec3i.java
@@ -0,0 +0,0 @@ public class Vec3i implements Comparable<Vec3i> {
return CODEC.flatXmap(checkOffsetAxes(maxAbsValue), checkOffsetAxes(maxAbsValue));
});
}
+ // Paper start

Datei anzeigen

@ -21,7 +21,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java b/src/
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/src/main/java/net/minecraft/world/entity/item/PrimedTnt.java
@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity {
@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity implements TraceableEntity {
}
}
@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
private void explode() {
@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity {
@@ -0,0 +0,0 @@ public class PrimedTnt extends Entity implements TraceableEntity {
public int getFuse() {
return (Integer) this.entityData.get(PrimedTnt.DATA_FUSE_ID);
}

Datei anzeigen

@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
+ implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
runtimeOnly("org.xerial:sqlite-jdbc:3.41.0.0")
runtimeOnly("com.mysql:mysql-connector-j:8.0.32")
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
new file mode 100644

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen