mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-11 12:31:34 +01:00
NOT FINISHED! 1.13 pre-7 - Holy moley, more patches!
Really, don't touch! may harm your cat!
This commit is contained in:
parent
dd390c99fd
commit
f3b00978d9
39 changed files with 406 additions and 394 deletions
|
@ -1,4 +1,4 @@
|
|||
From 6d4327193f6dc1773ded2f0ecdb48e141f864542 Mon Sep 17 00:00:00 2001
|
||||
From 3632af99628eb8d4102b22dce1b6c2a073da52ba Mon Sep 17 00:00:00 2001
|
||||
From: Jedediah Smith <jedediah@silencegreys.com>
|
||||
Date: Sat, 2 Apr 2016 05:09:16 -0400
|
||||
Subject: [PATCH] Add PlayerUseUnknownEntityEvent
|
||||
|
@ -9,16 +9,16 @@ index 77440ac81..8711462e1 100644
|
|||
--- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java
|
||||
@@ -5,7 +5,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
|
||||
public class PacketPlayInUseEntity implements Packet<PacketListenerPlayIn> {
|
||||
|
||||
|
||||
- private int a;
|
||||
+ private int a; public int getEntityId() { return this.a; } // Paper - add accessor
|
||||
private PacketPlayInUseEntity.EnumEntityUseAction action;
|
||||
private Vec3D c;
|
||||
private EnumHand d;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 2cc277e4f..b1f483990 100644
|
||||
index 9c27966ea..5c70a4a9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -1888,6 +1888,16 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
|
@ -35,8 +35,9 @@ index 2cc277e4f..b1f483990 100644
|
|||
+ ));
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
|
||||
}
|
||||
|
||||
--
|
||||
2.18.0
|
||||
|
||||
--
|
||||
2.18.0
|
|
@ -1,4 +1,4 @@
|
|||
From d671e6f9baa04e24af9751c81d428b61757ae3c0 Mon Sep 17 00:00:00 2001
|
||||
From eeac8ed81a52cd19d1af1f4d7d26c9fb333d1dec Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Fri, 9 Jun 2017 19:03:43 +0200
|
||||
Subject: [PATCH] Use TerminalConsoleAppender for console improvements
|
||||
|
@ -20,28 +20,22 @@ Other changes:
|
|||
configuration
|
||||
|
||||
diff --git a/pom.xml b/pom.xml
|
||||
index 17bc80776..4dd5fed25 100644
|
||||
index 17bc80776..f9e225b73 100644
|
||||
--- a/pom.xml
|
||||
+++ b/pom.xml
|
||||
@@ -41,15 +41,9 @@
|
||||
@@ -40,12 +40,6 @@
|
||||
<version>${minecraft.version}-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
- <dependency>
|
||||
- <groupId>jline</groupId>
|
||||
- <artifactId>jline</artifactId>
|
||||
- <version>2.12.1</version>
|
||||
- <scope>compile</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.ow2.asm</groupId>
|
||||
- <artifactId>asm</artifactId>
|
||||
- <version>6.2</version>
|
||||
+ <groupId>net.sf.jopt-simple</groupId>
|
||||
+ <artifactId>jopt-simple</artifactId>
|
||||
+ <version>5.0.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
@@ -70,6 +64,32 @@
|
||||
<version>3.0.3</version>
|
||||
<scope>compile</scope>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
From 0d322700c9153d75a278138ef862ea9cd8fad05b Mon Sep 17 00:00:00 2001
|
||||
From 23aceaa82824bf66c20245da5ec07a076fb92ee4 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Thu, 11 Jan 2018 16:47:28 -0600
|
||||
Subject: [PATCH] Make max squid spawn height configurable
|
||||
|
@ -7,13 +7,25 @@ I don't know why upstream made only the minimum height configurable but
|
|||
whatever
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 0ddf826f9..9fd76dcc9 100644
|
||||
index 49f282332..d80cd60ab 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -484,4 +484,9 @@ public class PaperWorldConfig {
|
||||
@@ -402,4 +402,21 @@ public class PaperWorldConfig {
|
||||
}
|
||||
log("Max Chunk Sends Per Tick: " + maxChunkSendsPerTick);
|
||||
}
|
||||
|
||||
+
|
||||
+ public int maxChunkGensPerTick = 10;
|
||||
+ private void maxChunkGensPerTick() {
|
||||
+ maxChunkGensPerTick = getInt("max-chunk-gens-per-tick", maxChunkGensPerTick);
|
||||
+ if (maxChunkGensPerTick <= 0) {
|
||||
+ maxChunkGensPerTick = Integer.MAX_VALUE;
|
||||
+ log("Max Chunk Gens Per Tick: Unlimited (NOT RECOMMENDED)");
|
||||
+ } else {
|
||||
+ log("Max Chunk Gens Per Tick: " + maxChunkGensPerTick);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public double squidMaxSpawnHeight;
|
||||
+ private void squidMaxSpawnHeight() {
|
||||
+ squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D);
|
||||
|
@ -21,20 +33,21 @@ index 0ddf826f9..9fd76dcc9 100644
|
|||
+
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java
|
||||
index 0ce16be65..58a902831 100644
|
||||
index ffc6d0b68..70b251210 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntitySquid.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntitySquid.java
|
||||
@@ -141,7 +141,9 @@ public class EntitySquid extends EntityWaterAnimal {
|
||||
@@ -167,7 +167,10 @@ public class EntitySquid extends EntityWaterAnimal {
|
||||
}
|
||||
|
||||
public boolean P() {
|
||||
- return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < (double) this.world.getSeaLevel() && super.P(); // Spigot
|
||||
public boolean a(GeneratorAccess generatoraccess) {
|
||||
- return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < (double) generatoraccess.getSeaLevel(); // Spigot
|
||||
+ // Paper - Make max spawn height configurable
|
||||
+ final double maxHeight = world.paperConfig.squidMaxSpawnHeight > 0 ? world.paperConfig.squidMaxSpawnHeight : world.getSeaLevel();
|
||||
+ return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < maxHeight && super.P(); // Spigot
|
||||
+ return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < maxHeight; // Spigot
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
public void b(float f, float f1, float f2) {
|
||||
public void c(float f, float f1, float f2) {
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 0d9573cce034afcfd6b1f86fd955aeae30d06f30 Mon Sep 17 00:00:00 2001
|
||||
From 171f872bb3e15d27684344335d6b651520cd303d Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 14 Jan 2018 17:01:31 -0500
|
||||
Subject: [PATCH] PreCreatureSpawnEvent
|
||||
|
@ -15,7 +15,7 @@ instead and save a lot of server resources.
|
|||
See: https://github.com/PaperMC/Paper/issues/917
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
index 87fe4775f..9466bcdc7 100644
|
||||
index c76dbe74a..b88160a2e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -26,10 +26,10 @@ index 87fe4775f..9466bcdc7 100644
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -87,6 +88,27 @@ public abstract class MobSpawnerAbstract {
|
||||
double d3 = j >= 1 ? nbttaglist.f(0) : (double) blockposition.getX() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D;
|
||||
double d4 = j >= 2 ? nbttaglist.f(1) : (double) (blockposition.getY() + world.random.nextInt(3) - 1);
|
||||
double d5 = j >= 3 ? nbttaglist.f(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D;
|
||||
@@ -94,6 +95,27 @@ public abstract class MobSpawnerAbstract {
|
||||
double d3 = j >= 1 ? nbttaglist.k(0) : (double) blockposition.getX() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D;
|
||||
double d4 = j >= 2 ? nbttaglist.k(1) : (double) (blockposition.getY() + world.random.nextInt(3) - 1);
|
||||
double d5 = j >= 3 ? nbttaglist.k(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D;
|
||||
+ // Paper start
|
||||
+ if (this.getMobName() == null) {
|
||||
+ return;
|
||||
|
@ -55,35 +55,41 @@ index 87fe4775f..9466bcdc7 100644
|
|||
|
||||
if (entity == null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index 2cd063829..e217d3340 100644
|
||||
index 6d842df62..8c6c68c9e 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -184,6 +184,25 @@ public final class SpawnerCreature {
|
||||
}
|
||||
@@ -160,10 +160,30 @@ public final class SpawnerCreature {
|
||||
|
||||
if (worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition) && a(EntityPositionTypes.a(biomebase_biomemeta.b), worldserver, blockposition_mutableblockposition)) {
|
||||
+ // Paper start
|
||||
+ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event;
|
||||
+ Class<? extends EntityInsentient> cls = biomebase_biomemeta.b;
|
||||
+ org.bukkit.entity.EntityType type = EntityTypes.clsToTypeMap.get(cls);
|
||||
+ if (type != null) {
|
||||
+ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
||||
+ MCUtil.toLocation(worldserver, blockposition_mutableblockposition),
|
||||
+ type, SpawnReason.NATURAL
|
||||
+ );
|
||||
+ if (!event.callEvent()) {
|
||||
+ if (event.shouldAbortSpawn()) {
|
||||
+ continue label120;
|
||||
if (worldserver.a(enumcreaturetype, biomebase_biomemeta, (BlockPosition) blockposition_mutableblockposition)) {
|
||||
EntityPositionTypes.Surface entitypositiontypes_surface = EntityPositionTypes.a(biomebase_biomemeta.b);
|
||||
-
|
||||
if (entitypositiontypes_surface != null && a(entitypositiontypes_surface, worldserver, blockposition_mutableblockposition, biomebase_biomemeta.b)) {
|
||||
EntityInsentient entityinsentient;
|
||||
|
||||
+ // Paper start
|
||||
+ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event;
|
||||
+ EntityTypes<? extends EntityInsentient> cls = biomebase_biomemeta.b;
|
||||
+ org.bukkit.entity.EntityType type = EntityTypes.clsToTypeMap.get(cls);
|
||||
+ if (type != null) {
|
||||
+ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent(
|
||||
+ MCUtil.toLocation(worldserver, blockposition_mutableblockposition),
|
||||
+ type, SpawnReason.NATURAL
|
||||
+ );
|
||||
+ if (!event.callEvent()) {
|
||||
+ if (event.shouldAbortSpawn()) {
|
||||
+ continue label128; // right above the iterator for c (Chunk Pos Set)
|
||||
+ }
|
||||
+ j1 += l2;
|
||||
+ ++j4;
|
||||
+ continue;
|
||||
+ }
|
||||
+ j1 += l2;
|
||||
+ ++j4;
|
||||
+ continue;
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
EntityInsentient entityinsentient;
|
||||
|
||||
try {
|
||||
+ // Paper end
|
||||
+
|
||||
+
|
||||
try {
|
||||
entityinsentient = (EntityInsentient) biomebase_biomemeta.b.a((World) worldserver);
|
||||
} catch (Exception exception) {
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 0e4807dea8c78e44fb2aae08d851040732fc2ec6 Mon Sep 17 00:00:00 2001
|
||||
From ac250076349e8ce8ab3869b3cb1d653036d1b90c Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 14 Jan 2018 17:36:02 -0500
|
||||
Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent
|
||||
|
@ -9,10 +9,10 @@ from triggering monster spawns on a server.
|
|||
Also a highly more effecient way to blanket block spawns in a world
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
index e217d3340..46faa062d 100644
|
||||
index 8c6c68c9e..e7bf1e5fc 100644
|
||||
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||
@@ -72,6 +72,15 @@ public final class SpawnerCreature {
|
||||
@@ -47,6 +47,15 @@ public final class SpawnerCreature {
|
||||
byte b0 = worldserver.spigotConfig.mobSpawnRange;
|
||||
b0 = ( b0 > worldserver.spigotConfig.viewDistance ) ? (byte) worldserver.spigotConfig.viewDistance : b0;
|
||||
b0 = ( b0 > 8 ) ? 8 : b0;
|
|
@ -1,4 +1,4 @@
|
|||
From 1a2d4a99770a6eacb577d1f7d7daba01af23eb70 Mon Sep 17 00:00:00 2001
|
||||
From 8091a3d4dafb4742d6c378f6f222321cf2e89eb3 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 19 Jan 2018 00:36:25 -0500
|
||||
Subject: [PATCH] Add SkullMeta.setPlayerProfile API
|
||||
|
@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo
|
|||
which commonly cause rate limit issues with Mojang API
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
index 862b30286..1ac549e5e 100644
|
||||
index 52de1439e..960ae59ae 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java
|
||||
@@ -2,6 +2,8 @@ package org.bukkit.craftbukkit.inventory;
|
||||
|
@ -28,7 +28,7 @@ index 862b30286..1ac549e5e 100644
|
|||
@DelegateDeserialization(SerializableMeta.class)
|
||||
class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
|
||||
@@ -119,6 +123,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
@@ -131,6 +135,19 @@ class CraftMetaSkull extends CraftMetaItem implements SkullMeta {
|
||||
return hasOwner() ? profile.getName() : null;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 7de0f8add5f32e662c9354154f52a63942cb1274 Mon Sep 17 00:00:00 2001
|
||||
From 0da84cefeb2c91c603e41defbf16bd6d35b1dc9e Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Tue, 2 Jan 2018 00:31:26 -0500
|
||||
Subject: [PATCH] Fill Profile Property Events
|
|
@ -1,14 +1,14 @@
|
|||
From 7882f76fb4a440a3e3158ff1615c7fada2225b95 Mon Sep 17 00:00:00 2001
|
||||
From b46830ad887a5f55ea011faaf83b99d8f9a69da1 Mon Sep 17 00:00:00 2001
|
||||
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
||||
Date: Fri, 19 Jan 2018 08:15:29 -0600
|
||||
Subject: [PATCH] PlayerAdvancementCriterionGrantEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
index 6896b7095..8913e2744 100644
|
||||
index 57918d3d6..67556ed32 100644
|
||||
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
|
||||
@@ -196,6 +196,12 @@ public class AdvancementDataPlayer {
|
||||
@@ -232,6 +232,12 @@ public class AdvancementDataPlayer {
|
||||
boolean flag1 = advancementprogress.isDone();
|
||||
|
||||
if (advancementprogress.a(s)) {
|
|
@ -1,4 +1,4 @@
|
|||
From 3d9485b9cd411e336dac59b8c0cb9c0bc0d82ceb Mon Sep 17 00:00:00 2001
|
||||
From 97ab3dbce9bd88f8593e8cb5f1f01a1c9866fd72 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 24 Jan 2018 20:06:39 -0500
|
||||
Subject: [PATCH] MC-99321 - Dont check for blocked double chest for hoppers
|
||||
|
@ -11,15 +11,14 @@ This removes the necessity to disable the cat on chest behavior to improve perfo
|
|||
now performance will be improved even if you have cat chest detection on.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java
|
||||
index 90267a1fb..91d3308c1 100644
|
||||
index 633c75ffe..68cdd3970 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockChest.java
|
||||
@@ -348,7 +348,7 @@ public class BlockChest extends BlockTileEntity {
|
||||
// Paper end
|
||||
@@ -208,6 +208,7 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC
|
||||
|
||||
if (block == this) {
|
||||
- if (this.e(world, blockposition1)) {
|
||||
+ if (!flag && this.e(world, blockposition1)) { // Paper - check for allowBlocked flag - MC-99321
|
||||
if (blockpropertychesttype1 != BlockPropertyChestType.SINGLE && blockpropertychesttype != blockpropertychesttype1 && iblockdata1.get(BlockChest.FACING) == iblockdata.get(BlockChest.FACING)) {
|
||||
if (!flag && this.a(world, blockposition1)) {
|
||||
+ //if (!flag && this.e(world, blockposition1)) { // Paper - check for allowBlocked flag - MC-99321
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From b2a0e9a92477aef7fad217ffc07a0bb21030249d Mon Sep 17 00:00:00 2001
|
||||
From 9f2c6acdcb96192da5d2ca929a2d729b450b95c2 Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Sat, 27 Jan 2018 17:04:14 -0500
|
||||
Subject: [PATCH] Add ArmorStand Item Meta
|
||||
|
@ -13,10 +13,10 @@ starting point for future additions in this area.
|
|||
Fixes GH-559
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index c2f26577c..851960afb 100644
|
||||
index 6fc0ce050..152a677e5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -96,6 +96,8 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -184,6 +184,8 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
return meta instanceof CraftMetaSpawnEgg ? meta : new CraftMetaSpawnEgg(meta);
|
||||
case KNOWLEDGE_BOOK:
|
||||
return meta instanceof CraftMetaKnowledgeBook ? meta : new CraftMetaKnowledgeBook(meta);
|
||||
|
@ -26,10 +26,10 @@ index c2f26577c..851960afb 100644
|
|||
case CHEST:
|
||||
case TRAPPED_CHEST:
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index cdf16e15a..aa99254ff 100644
|
||||
index cadff64bf..b1e0d6185 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -307,6 +307,8 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -395,6 +395,8 @@ public final class CraftItemStack extends ItemStack {
|
||||
return new CraftMetaSpawnEgg(item.getTag());
|
||||
case KNOWLEDGE_BOOK:
|
||||
return new CraftMetaKnowledgeBook(item.getTag());
|
||||
|
@ -350,23 +350,21 @@ index 000000000..dc372f6db
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 0cdc8007a..2ab4a1cf4 100644
|
||||
index e43a24989..5bff99edd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -129,6 +129,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
.put(CraftMetaFirework.class, "FIREWORK")
|
||||
@@ -134,6 +134,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
.put(CraftMetaCharge.class, "FIREWORK_EFFECT")
|
||||
.put(CraftMetaKnowledgeBook.class, "KNOWLEDGE_BOOK")
|
||||
.put(CraftMetaTropicalFishBucket.class, "TROPICAL_FISH_BUCKET")
|
||||
+ .put(CraftMetaArmorStand.class, "ARMOR_STAND")
|
||||
.put(CraftMetaItem.class, "UNSPECIFIC")
|
||||
.build();
|
||||
|
||||
@@ -1034,7 +1035,15 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
CraftMetaEnchantedBook.STORED_ENCHANTMENTS.NBT,
|
||||
CraftMetaCharge.EXPLOSION.NBT,
|
||||
@@ -1084,6 +1085,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
|
||||
CraftMetaBlockState.BLOCK_ENTITY_TAG.NBT,
|
||||
- CraftMetaKnowledgeBook.BOOK_RECIPES.NBT
|
||||
+ CraftMetaKnowledgeBook.BOOK_RECIPES.NBT,
|
||||
CraftMetaKnowledgeBook.BOOK_RECIPES.NBT,
|
||||
CraftMetaTropicalFishBucket.VARIANT.NBT
|
||||
+ // Paper start
|
||||
+ CraftMetaArmorStand.ENTITY_TAG.NBT,
|
||||
+ CraftMetaArmorStand.INVISIBLE.NBT,
|
||||
|
@ -379,33 +377,36 @@ index 0cdc8007a..2ab4a1cf4 100644
|
|||
}
|
||||
return HANDLED_TAGS;
|
||||
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
index 1f537d584..a29731f1d 100644
|
||||
index f66cc81d9..eb6cf1bb3 100644
|
||||
--- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
+++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java
|
||||
@@ -5,6 +5,8 @@ import static org.hamcrest.Matchers.*;
|
||||
|
||||
@@ -6,6 +6,7 @@ import static org.hamcrest.Matchers.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
+
|
||||
+import com.destroystokyo.paper.inventory.meta.ArmorStandMeta;
|
||||
+import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; // Paper
|
||||
import net.minecraft.server.Block;
|
||||
import net.minecraft.server.ITileEntity;
|
||||
import net.minecraft.server.Item;
|
||||
@@ -275,6 +277,14 @@ public class ItemMetaTest extends AbstractTestingBase {
|
||||
@@ -308,7 +309,18 @@ public class ItemMetaTest extends AbstractTestingBase {
|
||||
cleanStack.setItemMeta(meta);
|
||||
return cleanStack;
|
||||
}
|
||||
+ },
|
||||
+ // Paper start
|
||||
+ new StackProvider(Material.ARMOR_STAND) {
|
||||
+ @Override ItemStack operate(ItemStack cleanStack) {
|
||||
+ @Override
|
||||
+ ItemStack operate(ItemStack cleanStack) {
|
||||
+ final ArmorStandMeta meta = (ArmorStandMeta) cleanStack.getItemMeta();
|
||||
+ meta.setInvisible(true);
|
||||
+ cleanStack.setItemMeta(meta);
|
||||
+ return cleanStack;
|
||||
+ }
|
||||
}
|
||||
+ // paper end
|
||||
);
|
||||
|
||||
assertThat("Forgotten test?", providers, hasSize(ItemStackTest.COMPOUND_MATERIALS.length - 4/* Normal item meta, skulls, eggs and tile entities */));
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From fb1d0169082ac42cca48e8d3721de2f467ab9ed9 Mon Sep 17 00:00:00 2001
|
||||
From a4c8b999c8aaed77e0ec747c47b33db32c02b26d Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sun, 11 Feb 2018 10:43:46 +0000
|
||||
Subject: [PATCH] Extend Player Interact cancellation
|
||||
|
@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds
|
|||
when cancelling interaction.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
index 5ec7f5819..fcb64666e 100644
|
||||
index ce8f76871..126c17d1b 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
|
||||
@@ -110,6 +110,7 @@ public class PlayerInteractManager {
|
||||
|
@ -24,7 +24,7 @@ index 5ec7f5819..fcb64666e 100644
|
|||
// Update any tile entity data for this block
|
||||
TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||
if (tileentity != null) {
|
||||
@@ -250,6 +251,34 @@ public class PlayerInteractManager {
|
||||
@@ -251,6 +252,34 @@ public class PlayerInteractManager {
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
@ -33,16 +33,16 @@ index 5ec7f5819..fcb64666e 100644
|
|||
+ Block block = data.getBlock();
|
||||
+ // Send other half of the door
|
||||
+ if (block instanceof BlockDoor) {
|
||||
+ boolean bottom = data.get(BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER;
|
||||
+ boolean bottom = data.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER;
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? position.up() : position.down()));
|
||||
+ } else if (block instanceof BlockTallPlant) {
|
||||
+ boolean bottom = data.get(BlockTallPlant.HALF) == BlockTallPlant.EnumTallPlantHalf.LOWER;
|
||||
+ boolean bottom = data.get(BlockTallPlant.HALF) == BlockPropertyDoubleBlockHalf.LOWER;
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? position.up() : position.down()));
|
||||
+ } else if (block instanceof BlockPistonExtension) {
|
||||
+ BlockPosition piston = position.shift(data.get(BlockPistonExtension.FACING).opposite());
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, piston));
|
||||
+ } else if (block instanceof BlockBed) {
|
||||
+ if (data.get(BlockBed.PART) == BlockBed.EnumBedPart.FOOT) {
|
||||
+ if (data.get(BlockBed.PART) == BlockPropertyBedPart.FOOT) {
|
||||
+ // Restore head of bed
|
||||
+ BlockPosition head = position.shift(data.get(BlockBed.FACING));
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(world, head));
|
||||
|
@ -57,46 +57,47 @@ index 5ec7f5819..fcb64666e 100644
|
|||
+ // Paper end
|
||||
+
|
||||
public boolean breakBlock(BlockPosition blockposition) {
|
||||
IBlockData iblockdata = this.world.getType(blockposition);
|
||||
// CraftBukkit start - fire BlockBreakEvent
|
||||
BlockBreakEvent event = null;
|
||||
@@ -297,11 +326,7 @@ public class PlayerInteractManager {
|
||||
@@ -299,11 +328,7 @@ public class PlayerInteractManager {
|
||||
}
|
||||
// Let the client know the block still exists
|
||||
((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
|
||||
- // Send other half of the door
|
||||
- if (nmsBlock instanceof BlockDoor) {
|
||||
- boolean bottom = nmsData.get(BlockDoor.HALF) == BlockDoor.EnumDoorHalf.LOWER;
|
||||
- boolean bottom = nmsData.get(BlockDoor.HALF) == BlockPropertyDoubleBlockHalf.LOWER;
|
||||
- ((EntityPlayer) this.player).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down()));
|
||||
- }
|
||||
+ cancelBreakBlock(blockposition, nmsData); // Paper - Move cancellation code to extra "cancelBreakBlock" method
|
||||
// Update any tile entity data for this block
|
||||
TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||
if (tileentity != null) {
|
||||
@@ -468,6 +493,24 @@ public class PlayerInteractManager {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down()));
|
||||
} else if (blockdata.getBlock() instanceof BlockCake) {
|
||||
((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate(); // SPIGOT-1341 - reset health for cake
|
||||
+ // Paper start - extend Player Interact cancellation
|
||||
+ } else if (blockdata.getBlock() instanceof BlockStructure) {
|
||||
@@ -461,7 +486,25 @@ public class PlayerInteractManager {
|
||||
((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, bottom ? blockposition.up() : blockposition.down()));
|
||||
} else if (iblockdata.getBlock() instanceof BlockCake) {
|
||||
((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate(); // SPIGOT-1341 - reset health for cake
|
||||
+ // Paper start - extend Player Interact cancellation // TODO: consider merging this into the extracted method
|
||||
+ } else if (iblockdata.getBlock() instanceof BlockStructure) {
|
||||
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutCloseWindow());
|
||||
+ } else if (blockdata.getBlock() instanceof BlockCommand) {
|
||||
+ } else if (iblockdata.getBlock() instanceof BlockCommand) {
|
||||
+ ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutCloseWindow());
|
||||
+ } else if (blockdata.getBlock() instanceof BlockFlowerPot) {
|
||||
+ // Send a block change to air and then send back the correct block, just to make the client happy
|
||||
+ PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(this.world, blockposition);
|
||||
+ packet.block = Blocks.AIR.getBlockData();
|
||||
+ this.player.playerConnection.sendPacket(packet);
|
||||
+ } else if (iblockdata.getBlock() instanceof BlockFlowerPot) {
|
||||
+ // Send a block change to air and then send back the correct block, just to make the client happy
|
||||
+ PacketPlayOutBlockChange packet = new PacketPlayOutBlockChange(this.world, blockposition);
|
||||
+ packet.block = Blocks.AIR.getBlockData();
|
||||
+ this.player.playerConnection.sendPacket(packet);
|
||||
+
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
|
||||
+ this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(this.world, blockposition));
|
||||
+
|
||||
+ TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||
+ if (tileentity != null) {
|
||||
+ player.playerConnection.sendPacket(tileentity.getUpdatePacket());
|
||||
+ }
|
||||
+ // Paper end - extend Player Interact cancellation
|
||||
}
|
||||
((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-2867
|
||||
enuminteractionresult = (event.useItemInHand() != Event.Result.ALLOW) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
|
||||
+ TileEntity tileentity = this.world.getTileEntity(blockposition);
|
||||
+ if (tileentity != null) {
|
||||
+ player.playerConnection.sendPacket(tileentity.getUpdatePacket());
|
||||
+ }
|
||||
}
|
||||
+ // Paper end - extend Player Interact cancellation
|
||||
((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-2867
|
||||
enuminteractionresult = (event.useItemInHand() != Event.Result.ALLOW) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
|
||||
} else if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 25f4cce9a4f75093d59f3dd1641aae36723e19b0 Mon Sep 17 00:00:00 2001
|
||||
From e325606ca11e0456e20de6f72ca536770e5a021c Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 24 Feb 2018 01:14:55 -0500
|
||||
Subject: [PATCH] Tameable#getOwnerUniqueId API
|
|
@ -1,14 +1,14 @@
|
|||
From b686cac8200d295ec51c9918f87f818868fa3ab7 Mon Sep 17 00:00:00 2001
|
||||
From 1ecf02a1bf80ad65f162f01219f809c6863cdcff Mon Sep 17 00:00:00 2001
|
||||
From: MiniDigger <admin@minidigger.me>
|
||||
Date: Sat, 10 Mar 2018 00:50:24 +0100
|
||||
Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients.
|
||||
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 363e03b65..ef1fa8cf6 100644
|
||||
index d80cd60ab..830b99cd7 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -232,6 +232,11 @@ public class PaperWorldConfig {
|
||||
@@ -182,6 +182,11 @@ public class PaperWorldConfig {
|
||||
disableChestCatDetection = getBoolean("game-mechanics.disable-chest-cat-detection", false);
|
||||
}
|
||||
|
||||
|
@ -21,14 +21,13 @@ index 363e03b65..ef1fa8cf6 100644
|
|||
private void allChunksAreSlimeChunks() {
|
||||
allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 347237055..4b82e43a8 100644
|
||||
index ae4dd621d..4fb300468 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -978,7 +978,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
}
|
||||
@@ -1021,6 +1021,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
||||
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.z_() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving;
|
||||
|
||||
boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.m_() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving;
|
||||
-
|
||||
+ flag2 = flag2 && !world.paperConfig.disablePlayerCrits; // Paper
|
||||
flag2 = flag2 && !this.isSprinting();
|
||||
if (flag2) {
|
|
@ -1,4 +1,4 @@
|
|||
From 5676d0f94137d1699144f04e16f1b34fa2ecc116 Mon Sep 17 00:00:00 2001
|
||||
From 9fda01cd67b4a4ad9eb1ee84b3094affa5ea844e Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sat, 10 Mar 2018 13:03:49 +0000
|
||||
Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Fix NPE when getting location from InventoryEnderChest opened
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/InventoryEnderChest.java b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
index cd7de2b53..37b494b78 100644
|
||||
index ac81d3f86..f50bae012 100644
|
||||
--- a/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
+++ b/src/main/java/net/minecraft/server/InventoryEnderChest.java
|
||||
@@ -5,7 +5,7 @@ import org.bukkit.inventory.InventoryHolder;
|
|
@ -0,0 +1,37 @@
|
|||
From 93093b0262f159749ed17fe570dc6c53640d2942 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 10 Mar 2018 16:33:15 -0500
|
||||
Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
|
||||
index 77cf6b8e9..9d9671eae 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
|
||||
@@ -25,6 +25,12 @@ public class BlockIceFrost extends BlockIce {
|
||||
EnumDirection enumdirection = aenumdirection[j];
|
||||
|
||||
blockposition_b.j(blockposition).d(enumdirection);
|
||||
+
|
||||
+ // Paper start - Prevent Frosted Ice from loading/holding chunks
|
||||
+ if (!world.isChunkLoaded(blockposition_b.getX() >> 4, blockposition_b.getZ() >> 4, true))
|
||||
+ continue;
|
||||
+ // Paper end - Prevent Frosted Ice from loading/holding chunks
|
||||
+
|
||||
IBlockData iblockdata1 = world.getType(blockposition_b);
|
||||
|
||||
if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_b)) {
|
||||
@@ -89,6 +95,10 @@ public class BlockIceFrost extends BlockIce {
|
||||
EnumDirection enumdirection = aenumdirection[l];
|
||||
|
||||
blockposition_b.j(blockposition).d(enumdirection);
|
||||
+ // Paper start - Prevent Frosted Ice from loading/holding chunks
|
||||
+ if (!((World) iblockaccess).isChunkLoaded(blockposition_b.getX() >> 4, blockposition_b.getZ() >> 4, true))
|
||||
+ continue;
|
||||
+ // Paper end - Prevent Frosted Ice from loading/holding chunks
|
||||
if (iblockaccess.getType(blockposition_b).getBlock() == this) {
|
||||
++j;
|
||||
if (j >= i) {
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From c774215f627fd1de37b36e0ddf37bfb2514419ab Mon Sep 17 00:00:00 2001
|
||||
From 2c3e67315b5181b36cb57ac67ebdd9597143ef48 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 11 Mar 2018 14:13:33 -0400
|
||||
Subject: [PATCH] Disable Explicit Network Manager Flushing
|
||||
|
@ -12,10 +12,10 @@ flushing on the netty event loop, so it won't do the flush on the main thread.
|
|||
Renable flushing by passing -Dpaper.explicit-flush=true
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
index b93a26e8f..3d32e0056 100644
|
||||
index 424464d09..909ad36fb 100644
|
||||
--- a/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
|
||||
@@ -78,6 +78,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -66,6 +66,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
// Paper start - NetworkClient implementation
|
||||
public int protocolVersion;
|
||||
public java.net.InetSocketAddress virtualHost;
|
||||
|
@ -23,7 +23,7 @@ index b93a26e8f..3d32e0056 100644
|
|||
// Paper end
|
||||
|
||||
public NetworkManager(EnumProtocolDirection enumprotocoldirection) {
|
||||
@@ -255,7 +256,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
@@ -236,7 +237,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
}
|
||||
|
||||
if (this.channel != null) {
|
||||
|
@ -31,7 +31,7 @@ index b93a26e8f..3d32e0056 100644
|
|||
+ if (enableExplicitFlush) this.channel.eventLoop().execute(() -> this.channel.flush()); // Paper - we don't need to explicit flush here, but allow opt in incase issues are found to a better version
|
||||
}
|
||||
|
||||
}
|
||||
if (this.u++ % 20 == 0) {
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 25ff513d84565b3f16325cd6e338d2837fcad079 Mon Sep 17 00:00:00 2001
|
||||
From 2ba4f6de1959bc2a38b489f254828ff3706a03a4 Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Wed, 11 Oct 2017 15:56:26 +0200
|
||||
Subject: [PATCH] Implement extended PaperServerListPingEvent
|
||||
|
@ -177,33 +177,33 @@ index 000000000..350410527
|
|||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3092913f5..f82e22b23 100644
|
||||
index 4654e22c8..97581d995 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -768,7 +768,7 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
if (i - this.Z >= 5000000000L) {
|
||||
this.Z = i;
|
||||
this.q.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.I(), this.H()));
|
||||
- GameProfile[] agameprofile = new GameProfile[Math.min(this.H(), 12)];
|
||||
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.H(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
|
||||
int j = MathHelper.nextInt(this.r, 0, this.H() - agameprofile.length);
|
||||
@@ -870,7 +870,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
if (i - this.Y >= 5000000000L) {
|
||||
this.Y = i;
|
||||
this.n.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.B(), this.A()));
|
||||
- GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), 12)];
|
||||
+ GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), org.spigotmc.SpigotConfig.playerSample)]; // Paper
|
||||
int j = MathHelper.nextInt(this.o, 0, this.A() - agameprofile.length);
|
||||
|
||||
for (int k = 0; k < agameprofile.length; ++k) {
|
||||
@@ -1115,10 +1115,12 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
|
||||
return "1.12.2";
|
||||
@@ -1220,10 +1220,12 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati
|
||||
return "1.13-pre7";
|
||||
}
|
||||
|
||||
+ public int getPlayerCount() { return H(); } // Paper - OBFHELPER
|
||||
public int H() {
|
||||
return this.v.getPlayerCount();
|
||||
+ public int getPlayerCount() { return A(); } // Paper - OBFHELPER
|
||||
public int A() {
|
||||
return this.s.getPlayerCount();
|
||||
}
|
||||
|
||||
+ public int getMaxPlayers() { return I(); } // Paper - OBFHELPER
|
||||
public int I() {
|
||||
return this.v.getMaxPlayers();
|
||||
+ public int getMaxPlayers() { return B(); } // Paper - OBFHELPER
|
||||
public int B() {
|
||||
return this.s.getMaxPlayers();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
index 313bb0007..f3c25367d 100644
|
||||
index c9edd289a..8aa121e2f 100644
|
||||
--- a/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/PacketStatusListener.java
|
||||
@@ -30,6 +30,8 @@ public class PacketStatusListener implements PacketStatusInListener {
|
||||
|
@ -226,7 +226,7 @@ index 313bb0007..f3c25367d 100644
|
|||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java
|
||||
index 981582212..ac161f505 100644
|
||||
index 2179664a0..616fcbf13 100644
|
||||
--- a/src/main/java/net/minecraft/server/ServerPing.java
|
||||
+++ b/src/main/java/net/minecraft/server/ServerPing.java
|
||||
@@ -29,6 +29,7 @@ public class ServerPing {
|
||||
|
@ -237,7 +237,7 @@ index 981582212..ac161f505 100644
|
|||
public ServerPing.ServerPingPlayerSample b() {
|
||||
return this.b;
|
||||
}
|
||||
@@ -164,10 +165,12 @@ public class ServerPing {
|
||||
@@ -176,10 +177,12 @@ public class ServerPing {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
|
@ -251,10 +251,10 @@ index 981582212..ac161f505 100644
|
|||
this.c = agameprofile;
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index cc1f3ac96..4f9fd4bc6 100644
|
||||
index b39096f04..d89224e7d 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
@@ -281,7 +281,7 @@ public class SpigotConfig
|
||||
@@ -285,7 +285,7 @@ public class SpigotConfig
|
||||
public static int playerSample;
|
||||
private static void playerSample()
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
From 433c2829dede94f23af5de8fa6ceb5481d3196a9 Mon Sep 17 00:00:00 2001
|
||||
From d3414ed95127b00fea16ba31ff5bffabb265c257 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Fri, 16 Mar 2018 22:59:43 -0400
|
||||
Subject: [PATCH] Improved Async Task Scheduler
|
|
@ -1,4 +1,4 @@
|
|||
From 817b481e30e24f5323278304bde07985a9d5adf2 Mon Sep 17 00:00:00 2001
|
||||
From 19cf35731b41ad71fec4fb25af08f7f1a7d0c935 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 18 Mar 2018 11:45:57 -0400
|
||||
Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
|
||||
|
@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
|
|||
This will allow you to change the players name or skin on login.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
index eaac25dc3..2842956bf 100644
|
||||
index 7dbc6f437..02bbb0d1d 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -1,5 +1,7 @@
|
||||
|
@ -17,7 +17,7 @@ index eaac25dc3..2842956bf 100644
|
|||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.exceptions.AuthenticationUnavailableException;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
@@ -23,6 +25,7 @@ import org.apache.logging.log4j.LogManager;
|
||||
@@ -20,6 +22,7 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
|
@ -25,7 +25,7 @@ index eaac25dc3..2842956bf 100644
|
|||
import org.bukkit.craftbukkit.util.Waitable;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||
import org.bukkit.event.player.PlayerPreLoginEvent;
|
||||
@@ -290,8 +293,16 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
@@ -281,8 +284,16 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
java.util.UUID uniqueId = i.getId();
|
||||
final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server;
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
From 8122b5281bcc841d9eb9d5b53cef8a34adc69fd7 Mon Sep 17 00:00:00 2001
|
||||
From d8cf6f1f10e675b557b889766262bef7af449357 Mon Sep 17 00:00:00 2001
|
||||
From: MiniDigger <admin@minidigger.me>
|
||||
Date: Sun, 18 Mar 2018 15:44:44 +0100
|
||||
Subject: [PATCH] Call PortalCreateEvent for exit portals
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
index f49729796..42e4b2d01 100644
|
||||
index 402d8d7d6..f36373450 100644
|
||||
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
@@ -3,10 +3,17 @@ package net.minecraft.server;
|
||||
@@ -3,16 +3,23 @@ package net.minecraft.server;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectIterator;
|
||||
|
@ -26,7 +26,14 @@ index f49729796..42e4b2d01 100644
|
|||
import org.bukkit.util.Vector;
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -47,6 +54,9 @@ public class PortalTravelAgent {
|
||||
public class PortalTravelAgent {
|
||||
|
||||
- private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL;
|
||||
+ private static final BlockPortal a = (BlockPortal) Blocks.NETHER_PORTAL; private static final BlockPortal PORTAL_BLOCK = a; // Paper - OBFHELPER
|
||||
public final WorldServer world; // Paper - private -> public
|
||||
private final Random c;
|
||||
private final Long2ObjectMap<PortalTravelAgent.ChunkCoordinatesPortal> d = new Long2ObjectOpenHashMap(4096);
|
||||
@@ -48,6 +55,9 @@ public class PortalTravelAgent {
|
||||
byte b0 = 1;
|
||||
byte b1 = 0;
|
||||
|
||||
|
@ -36,7 +43,7 @@ index f49729796..42e4b2d01 100644
|
|||
for (int l = -2; l <= 2; ++l) {
|
||||
for (int i1 = -2; i1 <= 2; ++i1) {
|
||||
for (int j1 = -1; j1 < 3; ++j1) {
|
||||
@@ -55,11 +65,22 @@ public class PortalTravelAgent {
|
||||
@@ -56,11 +66,22 @@ public class PortalTravelAgent {
|
||||
int i2 = k + i1 * 0 - l * 1;
|
||||
boolean flag2 = j1 < 0;
|
||||
|
||||
|
@ -60,7 +67,7 @@ index f49729796..42e4b2d01 100644
|
|||
// CraftBukkit start
|
||||
return new BlockPosition(i, k, k);
|
||||
}
|
||||
@@ -403,6 +424,9 @@ public class PortalTravelAgent {
|
||||
@@ -404,6 +425,9 @@ public class PortalTravelAgent {
|
||||
l5 = -l5;
|
||||
}
|
||||
|
||||
|
@ -68,13 +75,14 @@ index f49729796..42e4b2d01 100644
|
|||
+ Map<BlockPosition, IBlockData> nmsBlocks = new HashMap<>(); // Paper
|
||||
+
|
||||
if (d0 < 0.0D) {
|
||||
i1 = MathHelper.clamp(i1, 70, this.world.ab() - 10);
|
||||
i1 = MathHelper.clamp(i1, 70, this.world.aa() - 10);
|
||||
j5 = i1;
|
||||
@@ -415,7 +439,11 @@ public class PortalTravelAgent {
|
||||
@@ -416,8 +440,11 @@ public class PortalTravelAgent {
|
||||
l3 = j2 + (l2 - 1) * l5 - k2 * k5;
|
||||
boolean flag1 = i3 < 0;
|
||||
|
||||
- this.world.setTypeUpdate(new BlockPosition(j3, k3, l3), flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
|
||||
- blockposition_mutableblockposition.c(j3, k3, l3);
|
||||
- this.world.setTypeUpdate(blockposition_mutableblockposition, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
|
||||
+ // Paper start
|
||||
+ BlockPosition pos = new BlockPosition(j3, k3, l3);
|
||||
+ nmsBlocks.putIfAbsent(pos, flag1 ? Blocks.OBSIDIAN.getBlockData() : Blocks.AIR.getBlockData());
|
||||
|
@ -83,20 +91,30 @@ index f49729796..42e4b2d01 100644
|
|||
}
|
||||
}
|
||||
}
|
||||
@@ -431,7 +459,11 @@ public class PortalTravelAgent {
|
||||
i4 = j2 + (i3 - 1) * l5;
|
||||
boolean flag2 = i3 == 0 || i3 == 3 || j3 == -1 || j3 == 3;
|
||||
|
||||
- this.world.setTypeAndData(new BlockPosition(k3, l3, i4), flag2 ? Blocks.OBSIDIAN.getBlockData() : iblockdata, 2);
|
||||
@@ -427,7 +454,11 @@ public class PortalTravelAgent {
|
||||
for (l2 = -1; l2 < 4; ++l2) {
|
||||
if (k2 == -1 || k2 == 2 || l2 == -1 || l2 == 3) {
|
||||
blockposition_mutableblockposition.c(i5 + k2 * k5, j5 + l2, j2 + k2 * l5);
|
||||
- this.world.setTypeAndData(blockposition_mutableblockposition, Blocks.OBSIDIAN.getBlockData(), 3);
|
||||
+ // Paper start
|
||||
+ BlockPosition pos = new BlockPosition(k3, l3, i4);
|
||||
+ nmsBlocks.putIfAbsent(pos, flag2 ? Blocks.OBSIDIAN.getBlockData() : iblockdata);
|
||||
+ BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ());
|
||||
+ nmsBlocks.putIfAbsent(pos, Blocks.OBSIDIAN.getBlockData());
|
||||
+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
|
||||
+ // Paper end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,6 +479,13 @@ public class PortalTravelAgent {
|
||||
}
|
||||
@@ -437,10 +468,22 @@ public class PortalTravelAgent {
|
||||
for (l2 = 0; l2 < 2; ++l2) {
|
||||
for (i3 = 0; i3 < 3; ++i3) {
|
||||
blockposition_mutableblockposition.c(i5 + l2 * k5, j5 + i3, j2 + l2 * l5);
|
||||
- this.world.setTypeAndData(blockposition_mutableblockposition, iblockdata, 18);
|
||||
+
|
||||
+ // Paper start
|
||||
+ BlockPosition pos = new BlockPosition(blockposition_mutableblockposition.getX(), blockposition_mutableblockposition.getY(), blockposition_mutableblockposition.getZ());
|
||||
+ nmsBlocks.putIfAbsent(pos, PORTAL_BLOCK.getBlockData());
|
||||
+ bukkitBlocks.add(this.world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()));
|
||||
+ // paper end
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From f66fc891df81485d65a13598e72d1fc97298470c Mon Sep 17 00:00:00 2001
|
||||
From dcfb0b8e176f2f568f19bc1b4277dc320fea2a49 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 18 Mar 2018 12:29:48 -0400
|
||||
Subject: [PATCH] Player.setPlayerProfile API
|
||||
|
@ -6,23 +6,23 @@ Subject: [PATCH] Player.setPlayerProfile API
|
|||
This can be useful for changing name or skins after a player has logged in.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 4b82e43a8..35fde8b23 100644
|
||||
index 4fb300468..02f5d61c8 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -59,7 +59,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
protected int bS;
|
||||
protected float bT = 0.02F;
|
||||
private int f;
|
||||
- private final GameProfile g;
|
||||
+ private GameProfile g; public void setProfile(GameProfile profile) { this.g = profile; } // Paper - OBFHELPER
|
||||
private ItemStack bV;
|
||||
private final ItemCooldown bW;
|
||||
@@ -67,7 +67,7 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
protected int bZ;
|
||||
protected float ca = 0.02F;
|
||||
private int g;
|
||||
- private final GameProfile h;
|
||||
+ private final GameProfile h; public void setProfile(GameProfile profile) { this.h = profile; } // Paper - OBFHELPER
|
||||
private ItemStack cd;
|
||||
private final ItemCooldown ce;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
index 2842956bf..8aeded425 100644
|
||||
index 02bbb0d1d..e73b07f42 100644
|
||||
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
||||
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
||||
@@ -41,7 +41,7 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
@@ -38,7 +38,7 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
public final NetworkManager networkManager;
|
||||
private LoginListener.EnumProtocolState g;
|
||||
private int h;
|
||||
|
@ -31,7 +31,7 @@ index 2842956bf..8aeded425 100644
|
|||
private final String j;
|
||||
private SecretKey loginKey;
|
||||
private EntityPlayer l;
|
||||
@@ -294,12 +294,12 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
@@ -285,12 +285,12 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
||||
final org.bukkit.craftbukkit.CraftServer server = LoginListener.this.server.server;
|
||||
|
||||
// Paper start
|
||||
|
@ -48,7 +48,7 @@ index 2842956bf..8aeded425 100644
|
|||
uniqueId = i.getId();
|
||||
// Paper end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 77c50ba14..598b210ce 100644
|
||||
index c2cd5ac4b..12af78209 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1,6 +1,8 @@
|
||||
|
@ -60,7 +60,7 @@ index 77c50ba14..598b210ce 100644
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.io.BaseEncoding;
|
||||
@@ -1096,8 +1098,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1139,8 +1141,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
hiddenPlayers.put(player.getUniqueId(), hidingPlugins);
|
||||
|
||||
// Remove this player from the hidden player's EntityTrackerEntry
|
||||
|
@ -76,7 +76,7 @@ index 77c50ba14..598b210ce 100644
|
|||
EntityTrackerEntry entry = tracker.trackedEntities.get(other.getId());
|
||||
if (entry != null) {
|
||||
entry.clear(getHandle());
|
||||
@@ -1138,8 +1146,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1181,8 +1189,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
hiddenPlayers.remove(player.getUniqueId());
|
||||
|
||||
|
@ -91,7 +91,7 @@ index 77c50ba14..598b210ce 100644
|
|||
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other));
|
||||
|
||||
@@ -1148,6 +1161,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1191,6 +1204,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
entry.updatePlayer(getHandle());
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
From a98fa1d1bf527e9056477711ad1e3bfef9e5b7b2 Mon Sep 17 00:00:00 2001
|
||||
From 728da88527f9ef0f97324222e0e3266ace89829b Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 21 Mar 2018 20:52:07 -0400
|
||||
Subject: [PATCH] Fix Dragon Server Crashes
|
||||
|
@ -7,11 +7,11 @@ If the dragon tries to find "ground" and hits a hole, or off edge,
|
|||
it will infinitely keep looking for non air and eventually crash.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
|
||||
index 054a7ef6c..deee5c4cc 100644
|
||||
index 41b5a4519..b78d3fe50 100644
|
||||
--- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
|
||||
+++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java
|
||||
@@ -51,7 +51,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded
|
||||
double d2 = this.a.bw.locY + (double) (this.a.bw.length / 2.0F);
|
||||
double d2 = this.a.bD.locY + (double) (this.a.bD.length / 2.0F);
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(MathHelper.floor(d0), MathHelper.floor(d2), MathHelper.floor(d1));
|
||||
|
||||
- while (this.a.world.isEmpty(blockposition_mutableblockposition)) {
|
|
@ -1,4 +1,4 @@
|
|||
From 9e931d8f67acf7dd52c07c52967e54a8ce685e81 Mon Sep 17 00:00:00 2001
|
||||
From 1239414baf466c554e8b32f4d0a2b62888dbd362 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 22 Mar 2018 01:40:24 -0400
|
||||
Subject: [PATCH] getPlayerUniqueId API
|
||||
|
@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
|
|||
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 6095948e8..80702f6f6 100644
|
||||
index d605e5792..0b361d82f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1346,6 +1346,26 @@ public final class CraftServer implements Server {
|
||||
@@ -1379,6 +1379,26 @@ public final class CraftServer implements Server {
|
||||
return recipients.size();
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 392108a766bc09e0cbc5232bda2e91e63a877aa1 Mon Sep 17 00:00:00 2001
|
||||
From 10565b35573ebcedd4d04cd758e98b2ae9378382 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
||||
Date: Mon, 26 Mar 2018 18:30:53 +0300
|
||||
Subject: [PATCH] Make player data saving configurable
|
||||
|
@ -23,17 +23,17 @@ index ec89ecfca..b602bbf12 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
index eba1228fd..4e33cc2f2 100644
|
||||
index a562e1e46..cbfdb3cf7 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java
|
||||
@@ -142,6 +142,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
|
||||
@@ -144,6 +144,7 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData {
|
||||
}
|
||||
|
||||
public void save(EntityHuman entityhuman) {
|
||||
+ if(!com.destroystokyo.paper.PaperConfig.savePlayerData) return; // Paper - Make player data saving configurable
|
||||
try {
|
||||
NBTTagCompound nbttagcompound = entityhuman.save(new NBTTagCompound());
|
||||
File file = new File(this.playerDir, entityhuman.bn() + ".dat.tmp");
|
||||
File file = new File(this.playerDir, entityhuman.bu() + ".dat.tmp");
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 342fd0abbc9127651a9aafabe10a7b2afa2bf98d Mon Sep 17 00:00:00 2001
|
||||
From b14bde8370c3facc41743eccbbdca1c9d214a16e Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Wed, 11 Oct 2017 18:22:50 +0200
|
||||
Subject: [PATCH] Make legacy ping handler more reliable
|
||||
|
@ -28,7 +28,7 @@ respond to the request.
|
|||
[2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java
|
||||
index 4c1a0181a..a89a86e6d 100644
|
||||
index 41115108f..07c53f505 100644
|
||||
--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java
|
||||
+++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java
|
||||
@@ -14,6 +14,7 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
|
@ -57,27 +57,27 @@ index 4c1a0181a..a89a86e6d 100644
|
|||
bytebuf.markReaderIndex();
|
||||
boolean flag = true;
|
||||
|
||||
@@ -50,6 +60,10 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
break;
|
||||
@@ -53,6 +63,10 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
break;
|
||||
|
||||
default:
|
||||
default:
|
||||
+ // Paper start - Replace with improved version below
|
||||
+ if (bytebuf.readUnsignedByte() != 0x01 || bytebuf.readUnsignedByte() != 0xFA) return;
|
||||
+ readLegacy1_6(channelhandlercontext, bytebuf);
|
||||
+ /*
|
||||
boolean flag1 = bytebuf.readUnsignedByte() == 1;
|
||||
boolean flag1 = bytebuf.readUnsignedByte() == 1;
|
||||
|
||||
flag1 &= bytebuf.readUnsignedByte() == 250;
|
||||
@@ -73,6 +87,8 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
} finally {
|
||||
bytebuf1.release();
|
||||
}
|
||||
flag1 &= bytebuf.readUnsignedByte() == 250;
|
||||
@@ -76,6 +90,8 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
} finally {
|
||||
bytebuf1.release();
|
||||
}
|
||||
+ */
|
||||
+ // Paper end
|
||||
}
|
||||
}
|
||||
|
||||
bytebuf.release();
|
||||
@@ -92,6 +108,90 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
bytebuf.release();
|
||||
@@ -93,6 +109,90 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From fdff041cd1df94bc3a0173545b6e171c3cdf4579 Mon Sep 17 00:00:00 2001
|
||||
From 5e73439660c4df0b0212c9f7024fdc4c0fb2a8d2 Mon Sep 17 00:00:00 2001
|
||||
From: Minecrell <minecrell@minecrell.net>
|
||||
Date: Wed, 11 Oct 2017 19:30:51 +0200
|
||||
Subject: [PATCH] Call PaperServerListPingEvent for legacy pings
|
||||
|
@ -84,7 +84,7 @@ index 000000000..74c012fd4
|
|||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java
|
||||
index a89a86e6d..2762bcc2e 100644
|
||||
index 07c53f505..91acfceec 100644
|
||||
--- a/src/main/java/net/minecraft/server/LegacyPingHandler.java
|
||||
+++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java
|
||||
@@ -9,6 +9,7 @@ import java.net.InetSocketAddress;
|
||||
|
@ -95,45 +95,47 @@ index a89a86e6d..2762bcc2e 100644
|
|||
|
||||
public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
|
||||
@@ -41,11 +42,19 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
MinecraftServer minecraftserver = this.b.d();
|
||||
int i = bytebuf.readableBytes();
|
||||
String s;
|
||||
+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper
|
||||
@@ -44,11 +45,20 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
MinecraftServer minecraftserver = this.b.d();
|
||||
int i = bytebuf.readableBytes();
|
||||
String s;
|
||||
+ com.destroystokyo.paper.event.server.PaperServerListPingEvent event; // Paper
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort()));
|
||||
- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.H()), Integer.valueOf(minecraftserver.I())});
|
||||
+ // Paper start - Call PaperServerListPingEvent and use results
|
||||
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null);
|
||||
+ if (event == null) {
|
||||
+ channelhandlercontext.close();
|
||||
+ break;
|
||||
+ }
|
||||
+ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers());
|
||||
+ // Paper end
|
||||
this.a(channelhandlercontext, this.a(s));
|
||||
break;
|
||||
switch (i) {
|
||||
case 0:
|
||||
LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort()));
|
||||
- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())});
|
||||
+ // Paper start - Call PaperServerListPingEvent and use results
|
||||
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null);
|
||||
+ if (event == null) {
|
||||
+ channelhandlercontext.close();
|
||||
+ break;
|
||||
+ }
|
||||
+ s = String.format("%s\u00a7%d\u00a7%d", PaperLegacyStatusClient.getUnformattedMotd(event), event.getNumPlayers(), event.getMaxPlayers());
|
||||
+
|
||||
+ // Paper end
|
||||
this.a(channelhandlercontext, this.a(s));
|
||||
break;
|
||||
|
||||
@@ -55,7 +64,15 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
@@ -57,8 +67,15 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort()));
|
||||
- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.H()), Integer.valueOf(minecraftserver.I())});
|
||||
+ // Paper start - Call PaperServerListPingEvent and use results
|
||||
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null);
|
||||
+ if (event == null) {
|
||||
+ channelhandlercontext.close();
|
||||
+ break;
|
||||
+ }
|
||||
+ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(),
|
||||
+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
|
||||
+ // Paper end
|
||||
this.a(channelhandlercontext, this.a(s));
|
||||
break;
|
||||
- LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort()));
|
||||
- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())});
|
||||
+ // Paper start - Call PaperServerListPingEvent and use results
|
||||
+ event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null);
|
||||
+ if (event == null) {
|
||||
+ channelhandlercontext.close();
|
||||
+ break;
|
||||
+ }
|
||||
+ s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", event.getProtocolVersion(), event.getVersion(),
|
||||
+ PaperLegacyStatusClient.getMotd(event), event.getNumPlayers(), event.getMaxPlayers());
|
||||
+ // Paper end
|
||||
this.a(channelhandlercontext, this.a(s));
|
||||
break;
|
||||
|
||||
@@ -169,8 +186,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
@@ -170,8 +187,16 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter {
|
||||
|
||||
a.debug("Ping: (1.6) from {}", ctx.channel().remoteAddress());
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From 8f87642299aca3ce9cdb278c2a249ef44c78299a Mon Sep 17 00:00:00 2001
|
||||
From 475d170af8eca9b33672045e8ec912903c1e1721 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sat, 31 Mar 2018 17:04:26 +0100
|
||||
Subject: [PATCH] Flag to disable the channel limit
|
||||
|
@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs.
|
|||
provide an optional flag to disable this check, at your own risk.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 598b210ce..c0f4cec4d 100644
|
||||
index 12af78209..3b76c7080 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -93,6 +93,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -132,6 +132,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// Paper start
|
||||
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
|
||||
private String resourcePackHash;
|
||||
|
@ -20,15 +20,15 @@ index 598b210ce..c0f4cec4d 100644
|
|||
// Paper end
|
||||
|
||||
public CraftPlayer(CraftServer server, EntityPlayer entity) {
|
||||
@@ -1341,7 +1342,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1385,7 +1386,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void addChannel(String channel) {
|
||||
- com.google.common.base.Preconditions.checkState( channels.size() < 128, "Too many channels registered" ); // Spigot
|
||||
+ com.google.common.base.Preconditions.checkState( DISABLE_CHANNEL_LIMIT || channels.size() < 128, "Too many channels registered" ); // Spigot // Paper - flag to disable channel limit
|
||||
- com.google.common.base.Preconditions.checkState( channels.size() < 128, "Too many channels registered" ); // Spigot
|
||||
+ com.google.common.base.Preconditions.checkState( DISABLE_CHANNEL_LIMIT || channels.size() < 128, "Too many channels registered" ); // Spigot // Paper - flag to disable channel limit
|
||||
channel = StandardMessenger.validateAndCorrectChannel(channel);
|
||||
if (channels.add(channel)) {
|
||||
server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel));
|
||||
}
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
From 109b24e9f12f5bfdc5f0a4608078b71b2acf0c40 Mon Sep 17 00:00:00 2001
|
||||
From de65a13614de10f2b1156623744886ef1972815b Mon Sep 17 00:00:00 2001
|
||||
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
|
||||
Date: Sun, 1 Apr 2018 02:29:37 +0300
|
||||
Subject: [PATCH] Add method to open already placed sign
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
index a0128426f..d85b5defc 100644
|
||||
index 9e2fc4947..4b9ecb4a6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java
|
||||
@@ -507,4 +507,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
@@ -508,4 +508,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
entity.remove();
|
||||
}
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
From d308df8c419762a2bef93e351ecded6ff14bbcce Mon Sep 17 00:00:00 2001
|
||||
From 0603e9586214f19e3688d2e77b0cceda6d0af5a3 Mon Sep 17 00:00:00 2001
|
||||
From: Kyle Wood <demonwav@gmail.com>
|
||||
Date: Thu, 1 Mar 2018 19:38:14 -0600
|
||||
Subject: [PATCH] Load version history at server start
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index 854455711..39a3d46ff 100644
|
||||
index 7ff2fa535..a329887ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@@ -203,6 +203,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -211,6 +211,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
// Paper start
|
||||
com.destroystokyo.paper.PaperConfig.init((File) options.valueOf("paper-settings"));
|
||||
com.destroystokyo.paper.PaperConfig.registerCommands();
|
|
@ -1,4 +1,4 @@
|
|||
From 61350e5dcf4f5833c142aadaba0fb41f27056974 Mon Sep 17 00:00:00 2001
|
||||
From 86b8ecd4561a6f79d1fc63cf647acdb61988f002 Mon Sep 17 00:00:00 2001
|
||||
From: Brokkonaut <hannos17@gmx.de>
|
||||
Date: Sat, 14 Apr 2018 20:20:46 +0200
|
||||
Subject: [PATCH] Configurable sprint interruption on attack
|
||||
|
@ -6,24 +6,23 @@ Subject: [PATCH] Configurable sprint interruption on attack
|
|||
If the sprint interruption is disabled players continue sprinting when they attack entities.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index ef1fa8cf6..5a2fbf7c7 100644
|
||||
index 830b99cd7..87d2dd131 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -502,4 +502,9 @@ public class PaperWorldConfig {
|
||||
disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents);
|
||||
log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled"));
|
||||
@@ -424,4 +424,8 @@ public class PaperWorldConfig {
|
||||
squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D);
|
||||
}
|
||||
+
|
||||
|
||||
+ public boolean disableSprintInterruptionOnAttack;
|
||||
+ private void disableSprintInterruptionOnAttack() {
|
||||
+ disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
index 35fde8b23..0b51903e2 100644
|
||||
index 02f5d61c8..fc5263f08 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHuman.java
|
||||
@@ -1030,7 +1030,11 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
@@ -1073,7 +1073,11 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
|
||||
this.motX *= 0.6D;
|
||||
this.motZ *= 0.6D;
|
|
@ -1,22 +1,22 @@
|
|||
From a1cad034bac6f2931248130c5a65a134a0ccb6b0 Mon Sep 17 00:00:00 2001
|
||||
From d9383d732dda96c14becde6ac9fec90dfea7f475 Mon Sep 17 00:00:00 2001
|
||||
From: 0x22 <0x22@futureclient.net>
|
||||
Date: Thu, 26 Apr 2018 04:41:11 -0400
|
||||
Subject: [PATCH] Fix exploit that allowed colored signs to be created
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
index 74a665142..4f82d8aae 100644
|
||||
index d71efd62f..5fe01e7ef 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
|
||||
@@ -2221,7 +2221,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
@@ -2497,7 +2497,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
String[] lines = new String[4];
|
||||
|
||||
for (int i = 0; i < astring.length; ++i) {
|
||||
- lines[i] = EnumChatFormat.a(new ChatComponentText(EnumChatFormat.a(astring[i])).toPlainText());
|
||||
- lines[i] = EnumChatFormat.b(new ChatComponentText(EnumChatFormat.b(astring[i])).getString());
|
||||
+ lines[i] = SharedConstants.a(astring[i]); //Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
|
||||
}
|
||||
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
|
||||
this.server.getPluginManager().callEvent(event);
|
||||
--
|
||||
2.17.1
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From a29a10be54631b0f9e7b99f343dc3d22b726c3d9 Mon Sep 17 00:00:00 2001
|
||||
From 03cfbe82ae05485c6623a88ff810729f97e83ea3 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 30 Apr 2018 13:15:55 -0400
|
||||
Subject: [PATCH] EndermanEscapeEvent
|
||||
|
@ -8,18 +8,22 @@ Fires an event anytime an enderman intends to teleport away from the player
|
|||
You may cancel this, enabling ranged attacks to damage the enderman for example.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index 2f59e7071..e8ea231dc 100644
|
||||
index 96e29539b..a9020083d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
@@ -1,5 +1,6 @@
|
||||
@@ -1,6 +1,10 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.Optional;
|
||||
+import com.destroystokyo.paper.event.entity.EndermanEscapeEvent;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Predicate;
|
||||
@@ -62,6 +63,12 @@ public class EntityEnderman extends EntityMonster {
|
||||
setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true);
|
||||
+import com.google.common.base.Function;
|
||||
+import com.google.common.base.Predicate;
|
||||
+
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Function;
|
||||
@@ -56,6 +60,12 @@ public class EntityEnderman extends EntityMonster {
|
||||
setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true);
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
|
@ -31,34 +35,34 @@ index 2f59e7071..e8ea231dc 100644
|
|||
@Override
|
||||
public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) {
|
||||
if (!super.setGoalTarget(entityliving, reason, fireEvent)) {
|
||||
@@ -182,7 +189,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
if (this.world.D() && this.ticksLived >= this.bA + 600) {
|
||||
float f = this.aw();
|
||||
@@ -168,7 +178,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
if (this.world.K() && this.ticksLived >= this.bE + 600) {
|
||||
float f = this.az();
|
||||
|
||||
- if (f > 0.5F && this.world.h(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||
+ if (f > 0.5F && this.world.h(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
|
||||
- if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
|
||||
+ if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper
|
||||
this.setGoalTarget((EntityLiving) null);
|
||||
this.dm();
|
||||
this.dz();
|
||||
}
|
||||
@@ -264,7 +271,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
@@ -247,7 +257,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
if (this.isInvulnerable(damagesource)) {
|
||||
return false;
|
||||
- } else if (damagesource instanceof EntityDamageSourceIndirect) {
|
||||
+ } else if (damagesource instanceof EntityDamageSourceIndirect && tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper
|
||||
for (int i = 0; i < 64; ++i) {
|
||||
if (this.dm()) {
|
||||
if (this.dz()) {
|
||||
return true;
|
||||
@@ -275,7 +282,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
@@ -258,7 +268,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
} else {
|
||||
boolean flag = super.damageEntity(damagesource, f);
|
||||
|
||||
- if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0) {
|
||||
+ if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper
|
||||
this.dm();
|
||||
this.dz();
|
||||
}
|
||||
|
||||
@@ -382,7 +389,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
@@ -347,7 +357,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
|
||||
static class PathfinderGoalPlayerWhoLookedAtTarget extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
||||
|
||||
|
@ -67,13 +71,13 @@ index 2f59e7071..e8ea231dc 100644
|
|||
private EntityHuman j;
|
||||
private int k;
|
||||
private int l;
|
||||
@@ -440,7 +447,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
@@ -399,7 +409,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
} else {
|
||||
if (this.d != null) {
|
||||
if (this.i.f((EntityHuman) this.d)) {
|
||||
- if (((EntityHuman) this.d).h(this.i) < 16.0D) {
|
||||
+ if (((EntityHuman) this.d).h(this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper
|
||||
this.i.dm();
|
||||
this.i.dz();
|
||||
}
|
||||
|
||||
--
|
|
@ -1,4 +1,4 @@
|
|||
From 4c67ba92848e31471481b803433a1210d5f6f222 Mon Sep 17 00:00:00 2001
|
||||
From f097db6d202bd03f02c915f70be4b4fc49923676 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 30 Apr 2018 13:29:44 -0400
|
||||
Subject: [PATCH] Enderman.teleportRandomly()
|
||||
|
@ -6,29 +6,29 @@ Subject: [PATCH] Enderman.teleportRandomly()
|
|||
Ability to trigger the vanilla "teleport randomly" mechanic of an enderman.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
index e8ea231dc..4f8dd320f 100644
|
||||
index a9020083d..a5b517ba9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
|
||||
@@ -198,6 +198,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
super.M();
|
||||
@@ -187,6 +187,7 @@ public class EntityEnderman extends EntityMonster {
|
||||
super.mobTick();
|
||||
}
|
||||
|
||||
+ public boolean teleportRandomly() { return dm(); } // Paper - OBFHELPER
|
||||
protected boolean dm() {
|
||||
+ public boolean teleportRandomly() { return dz(); } // Paper - OBFHELPER
|
||||
protected boolean dz() {
|
||||
double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D;
|
||||
double d1 = this.locY + (double) (this.random.nextInt(64) - 32);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
|
||||
index f602c2313..7e6af5d02 100644
|
||||
index 5998530a8..f62ea821f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java
|
||||
@@ -15,6 +15,7 @@ public class CraftEnderman extends CraftMonster implements Enderman {
|
||||
@@ -16,6 +16,7 @@ public class CraftEnderman extends CraftMonster implements Enderman {
|
||||
super(server, entity);
|
||||
}
|
||||
|
||||
+ @Override public boolean teleportRandomly() { return getHandle().teleportRandomly(); } // Paper
|
||||
public MaterialData getCarriedMaterial() {
|
||||
IBlockData blockData = getHandle().getCarried();
|
||||
return (blockData == null) ? Material.AIR.getNewData((byte) 0) : CraftMagicNumbers.getMaterial(blockData.getBlock()).getNewData((byte) blockData.getBlock().toLegacyData(blockData));
|
||||
return CraftMagicNumbers.getMaterial(blockData);
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
From da411565a450dfde5e88a3a952b09b3c6f182340 Mon Sep 17 00:00:00 2001
|
||||
From a14f188ea1d13b35c826a3639d2258ade1e36df7 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 30 Apr 2018 17:15:26 -0400
|
||||
Subject: [PATCH] Block Enderpearl Travel Exploit
|
||||
|
@ -12,12 +12,12 @@ This disables that by not saving the thrower when the chunk is unloaded.
|
|||
This is mainly useful for survival servers that do not allow freeform teleporting.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
index 99d681ef1..03a9a96fc 100644
|
||||
index 87d2dd131..5a9c68e4f 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||
@@ -513,4 +513,10 @@ public class PaperWorldConfig {
|
||||
allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders);
|
||||
log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled"));
|
||||
@@ -428,4 +428,10 @@ public class PaperWorldConfig {
|
||||
private void disableSprintInterruptionOnAttack() {
|
||||
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
|
||||
}
|
||||
+
|
||||
+ public boolean disableEnderpearlExploit = true;
|
||||
|
@ -27,17 +27,17 @@ index 99d681ef1..03a9a96fc 100644
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
index 01c7fcc8b..8e6428a0c 100644
|
||||
index fc8c0cab5..b3323aa8e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
|
||||
@@ -271,6 +271,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
if (this.shooterName != null && this.shooterName.isEmpty()) {
|
||||
this.shooterName = null;
|
||||
@@ -242,6 +242,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
|
||||
if (nbttagcompound.hasKeyOfType("owner", 10)) {
|
||||
this.shooterId = GameProfileSerializer.b(nbttagcompound.getCompound("owner"));
|
||||
}
|
||||
+ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooterName = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit
|
||||
|
||||
this.shooter = this.getShooter();
|
||||
}
|
||||
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From 5a88cdc6665f7185634f9938f1406e6709ba4b48 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sat, 10 Mar 2018 16:33:15 -0500
|
||||
Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java
|
||||
index a8dbbf20a..87f40bfcf 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockIceFrost.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockIceFrost.java
|
||||
@@ -50,7 +50,9 @@ public class BlockIceFrost extends BlockIce {
|
||||
for (int k = 0; k < j; ++k) {
|
||||
EnumDirection enumdirection = aenumdirection[k];
|
||||
|
||||
- if (world.getType(blockposition.shift(enumdirection)).getBlock() == this) {
|
||||
+ IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition.shift(enumdirection)); // Paper - don't load chunks
|
||||
+ if (iblockdata1 == null) continue; // Paper
|
||||
+ if (iblockdata1.getBlock() == this) { // Paper
|
||||
++i;
|
||||
if (i >= 4) {
|
||||
return i;
|
||||
@@ -76,7 +78,8 @@ public class BlockIceFrost extends BlockIce {
|
||||
for (int k = 0; k < j; ++k) {
|
||||
EnumDirection enumdirection = aenumdirection[k];
|
||||
BlockPosition blockposition1 = blockposition.shift(enumdirection);
|
||||
- IBlockData iblockdata1 = world.getType(blockposition1);
|
||||
+ IBlockData iblockdata1 = world.getTypeIfLoaded(blockposition1); // Paper - don't load chunks
|
||||
+ if (iblockdata1 == null) continue; // Paper
|
||||
|
||||
if (iblockdata1.getBlock() == this) {
|
||||
this.a(world, blockposition1, iblockdata1, random, false);
|
||||
--
|
||||
2.18.0
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
From 938eb8913fdbb1ba1e093cc56a26bfcf43ca57ce Mon Sep 17 00:00:00 2001
|
||||
From: Zach Brown <zach.brown@destroystokyo.com>
|
||||
Date: Wed, 4 Apr 2018 21:00:43 -0400
|
||||
Subject: [PATCH] MC-124833
|
||||
|
||||
Conflicting reports of what software this bug does and does not affect.
|
||||
Given the trivial impact of fixing it and an overabundance of caution,
|
||||
we'll patch it in Paper as well. This will probably be a short lived
|
||||
patch, with it being fixed in Vanilla proper 1.13
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
index 8b806c303..f0d6d6b85 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityItemFrame.java
|
||||
@@ -103,6 +103,10 @@ public class EntityItemFrame extends EntityHanging {
|
||||
}
|
||||
|
||||
itemstack.a((EntityItemFrame) null);
|
||||
+
|
||||
+ // Paper - MC-124833 - conflicting reports of what server software this does and doesn't affect.
|
||||
+ // It's a one liner with near-zero impact so we'll patch it anyway just in case
|
||||
+ this.setItem(ItemStack.a); // OBFHELPER - ItemStack.EMPTY
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.18.0
|
||||
|
Loading…
Reference in a new issue