mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 22:45:31 +01:00
some more patches
This commit is contained in:
parent
a30aad98f7
commit
1a33343012
66 changed files with 249 additions and 248 deletions
|
@ -5,10 +5,10 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f1298c6fd 100644
|
||||
index 4c66a0357c06e0b286e38624c874e33e45933fc9..4e1f436cbe47ba08c731be781fb372b20c497de6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -84,6 +84,12 @@ import org.bukkit.persistence.PersistentDataContainer;
|
||||
@@ -85,6 +85,12 @@ import org.bukkit.persistence.PersistentDataContainer;
|
||||
import static org.spigotmc.ValidateUtils.*;
|
||||
// Spigot end
|
||||
|
||||
|
@ -21,7 +21,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
/**
|
||||
* Children must include the following:
|
||||
*
|
||||
@@ -272,6 +278,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -273,6 +279,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@Specific(Specific.To.NBT)
|
||||
static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag");
|
||||
static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues");
|
||||
|
@ -32,7 +32,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
|
||||
// We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304
|
||||
private String displayName;
|
||||
@@ -285,6 +295,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -286,6 +296,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
private int hideFlag;
|
||||
private boolean unbreakable;
|
||||
private int damage;
|
||||
|
@ -43,7 +43,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
|
||||
private static final Set<String> HANDLED_TAGS = Sets.newHashSet();
|
||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
@@ -322,6 +336,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -323,6 +337,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
this.hideFlag = meta.hideFlag;
|
||||
this.unbreakable = meta.unbreakable;
|
||||
this.damage = meta.damage;
|
||||
|
@ -59,7 +59,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
this.unhandledTags.putAll(meta.unhandledTags);
|
||||
this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw());
|
||||
|
||||
@@ -385,6 +408,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -386,6 +409,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
this.persistentDataContainer.put(key, compound.get(key).copy());
|
||||
}
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
|
||||
Set<String> keys = tag.getAllKeys();
|
||||
for (String key : keys) {
|
||||
@@ -523,6 +571,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -524,6 +572,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
this.setDamage(damage);
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
String internal = SerializableMeta.getString(map, "internal", true);
|
||||
if (internal != null) {
|
||||
ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal));
|
||||
@@ -651,6 +727,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -652,6 +728,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
if (this.hasDamage()) {
|
||||
itemTag.putInt(CraftMetaItem.DAMAGE.NBT, this.damage);
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
|
||||
for (Map.Entry<String, Tag> e : this.unhandledTags.entrySet()) {
|
||||
itemTag.put(e.getKey(), e.getValue());
|
||||
@@ -667,6 +760,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -668,6 +761,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
ListTag createStringList(List<String> list) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
@@ -750,7 +858,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -751,7 +859,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Overridden
|
||||
boolean isEmpty() {
|
||||
|
@ -181,7 +181,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
}
|
||||
|
||||
// Paper start
|
||||
@@ -1182,7 +1290,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1183,7 +1291,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
&& (this.hideFlag == that.hideFlag)
|
||||
&& (this.isUnbreakable() == that.isUnbreakable())
|
||||
&& (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage())
|
||||
|
@ -194,7 +194,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
}
|
||||
|
||||
/**
|
||||
@@ -1217,6 +1329,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1218,6 +1330,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
hash = 61 * hash + (this.hasDamage() ? this.damage : 0);
|
||||
hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0);
|
||||
hash = 61 * hash + this.version;
|
||||
|
@ -205,7 +205,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
return hash;
|
||||
}
|
||||
|
||||
@@ -1241,6 +1357,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1242,6 +1358,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
clone.unbreakable = this.unbreakable;
|
||||
clone.damage = this.damage;
|
||||
clone.version = this.version;
|
||||
|
@ -220,7 +220,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
return clone;
|
||||
} catch (CloneNotSupportedException e) {
|
||||
throw new Error(e);
|
||||
@@ -1298,6 +1422,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1299,6 +1423,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
builder.put(CraftMetaItem.DAMAGE.BUKKIT, this.damage);
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
final Map<String, Tag> internalTags = new HashMap<String, Tag>(this.unhandledTags);
|
||||
this.serializeInternal(internalTags);
|
||||
if (!internalTags.isEmpty()) {
|
||||
@@ -1470,6 +1611,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1471,6 +1612,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
CraftMetaArmorStand.SHOW_ARMS.NBT,
|
||||
CraftMetaArmorStand.SMALL.NBT,
|
||||
CraftMetaArmorStand.MARKER.NBT,
|
||||
|
@ -253,7 +253,7 @@ index 3d749e6d6193878f1b4f288946afcec9461dc8df..e29134181d5b032311fe163b48fbe53f
|
|||
// Paper end
|
||||
CraftMetaCompass.LODESTONE_DIMENSION.NBT,
|
||||
CraftMetaCompass.LODESTONE_POS.NBT,
|
||||
@@ -1499,4 +1642,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1500,4 +1643,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
}
|
||||
// Paper end
|
||||
|
|
@ -17,7 +17,7 @@ index be5e603d505566feac61cc7e591d35ce483a92df..2061d7ae62c1335c87aa67fd0cc004c4
|
|||
int k = j;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
index c5944875bd94d9186729e95d0b731d9e68e7b99f..5c89d824ef43792c34c9f2df5851ba8af503cbd9 100644
|
||||
index 2700f7dc650dc19da75e9351f6d558d05be80dc5..5f2042d565974a5509aec8f744e091fe7c576c98 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
|
||||
@@ -299,6 +299,7 @@ public class BeehiveBlockEntity extends BlockEntity {
|
|
@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're
|
|||
debugging in an IDE pre-relocate.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
index 4b209818a20e76e9d857c4bb822f6b24ec8e9f09..12972cf5876da72cc5d097aeedb13c9addd98add 100644
|
||||
index afa93af41bf9b45dd7e49378b7fea088087993d5..128c9d81814ba1fb24895962e5f08495dbedb176 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java
|
||||
@@ -7,8 +7,10 @@ import java.io.InputStream;
|
||||
|
@ -153,7 +153,7 @@ index 4b209818a20e76e9d857c4bb822f6b24ec8e9f09..12972cf5876da72cc5d097aeedb13c9a
|
|||
if ( owner.equals( "org/bukkit/block/Biome" ) )
|
||||
{
|
||||
switch ( name )
|
||||
@@ -339,6 +437,11 @@ public class Commodore
|
||||
@@ -342,6 +440,11 @@ public class Commodore
|
||||
}
|
||||
|
||||
// Paper start - Rewrite plugins
|
||||
|
@ -165,7 +165,7 @@ index 4b209818a20e76e9d857c4bb822f6b24ec8e9f09..12972cf5876da72cc5d097aeedb13c9a
|
|||
if ((owner.equals("org/bukkit/OfflinePlayer") || owner.equals("org/bukkit/entity/Player")) && name.equals("getPlayerProfile") && desc.equals("()Lorg/bukkit/profile/PlayerProfile;")) {
|
||||
super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf);
|
||||
return;
|
||||
@@ -433,6 +536,13 @@ public class Commodore
|
||||
@@ -436,6 +539,13 @@ public class Commodore
|
||||
@Override
|
||||
public void visitLdcInsn(Object value)
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ index 4b209818a20e76e9d857c4bb822f6b24ec8e9f09..12972cf5876da72cc5d097aeedb13c9a
|
|||
if ( value instanceof String && ( (String) value ).equals( "com.mysql.jdbc.Driver" ) )
|
||||
{
|
||||
super.visitLdcInsn( "com.mysql.cj.jdbc.Driver" );
|
||||
@@ -445,6 +555,13 @@ public class Commodore
|
||||
@@ -448,6 +558,13 @@ public class Commodore
|
||||
@Override
|
||||
public void visitInvokeDynamicInsn( String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments )
|
||||
{
|
|
@ -9,10 +9,10 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for
|
|||
spawners.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index fc7719d12b5f6011aec2e41a36b4bacd77672b6d..a9be524edb03c51300bc45d424fcf87c7491a8c0 100644
|
||||
index 04cce4380e6e833b1d5e0a613eb0a167fdfe4e16..713608239cc7518d05b04d3dd79c3af0c358c64e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -134,11 +134,11 @@ public abstract class BaseSpawner {
|
||||
@@ -136,11 +136,11 @@ public abstract class BaseSpawner {
|
||||
|
||||
org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key);
|
||||
if (type != null) {
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 3c7dd373c557f3ceef0173e415d3d6c310fa9e95..5a638da349424a9d3bc5df87d81ba268b8052568 100644
|
||||
index d1b9726228cc0a7bdb1c570603b5d1b8a4d6debe..40b8b863c4662d8a6aa228763be167317232b99f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -116,6 +116,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
|
||||
|
@ -16,7 +16,7 @@ index 3c7dd373c557f3ceef0173e415d3d6c310fa9e95..5a638da349424a9d3bc5df87d81ba268
|
|||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraft.world.scores.PlayerTeam;
|
||||
@@ -3889,6 +3890,38 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3891,6 +3892,38 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.level().clip(raytrace);
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ index 3c7dd373c557f3ceef0173e415d3d6c310fa9e95..5a638da349424a9d3bc5df87d81ba268
|
|||
|
||||
public int getShieldBlockingDelay() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 540422f3148a92a25de8398c8616de307c85d0ae..9e15c5e2adfb46ffa3548b3a2eda225de4c44fb5 100644
|
||||
index 4c9b38fade398be72c5fc2799914df98d9170eaf..e8cc06162f97eef14c47f2e19a979c6b92aa3252 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1,5 +1,6 @@
|
||||
|
@ -66,7 +66,7 @@ index 540422f3148a92a25de8398c8616de307c85d0ae..9e15c5e2adfb46ffa3548b3a2eda225d
|
|||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Sets;
|
||||
import java.util.ArrayList;
|
||||
@@ -226,6 +227,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
@@ -227,6 +228,39 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
return null;
|
||||
}
|
|
@ -7,10 +7,10 @@ Subject: [PATCH] Add sun related API
|
|||
public net.minecraft.world.entity.Mob isSunBurnTick()Z
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e8229f2004b3a729417e99897b641e5bde0fa781..c92b931e2a54122e7a7aeafc5f88faee59c5e0fb 100644
|
||||
index e886f72df8b5b334299236c26115bbc5f72ce9f1..c14f73d745ec34f0970b2e5aac9d68fc069fc1d2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -695,6 +695,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -696,6 +696,13 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ index e969a0acf06d9265fa75fc07bb637752df468c11..8240bb085b619f257f8c0a25775e0b15
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
|
||||
index 7f1efe0d9bc059a86166e8e3c5ef4ad23217f6a7..9c7b7434ccd64668eb5d7bb61d03a9cb4105ea6e 100644
|
||||
index 129f0e6108366dbba1bafb04e01e5e5e6489f577..ac0aeb53176069d0835b6b08c8d871edae846763 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseCommandBlock.java
|
||||
@@ -72,7 +72,7 @@ public abstract class BaseCommandBlock implements CommandSource {
|
|
@ -12,7 +12,7 @@ public net.minecraft.world.entity.animal.Turtle isTravelling()Z
|
|||
public net.minecraft.world.entity.animal.Turtle setTravelling(Z)V
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
index 60e291abb3ebdf8676c13a2138d8eb436d033fa2..d27e5f9dac4703b839ab8444f6b54bf54d58af86 100644
|
||||
index 9fc374c17f6b3ee4ab3c582d05e96321b772f2d6..7153e00a640abfeb134ff1dcb93f363b972a4233 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
|
||||
@@ -14,7 +14,7 @@ public abstract class MoveToBlockGoal extends Goal {
|
||||
|
@ -25,10 +25,10 @@ index 60e291abb3ebdf8676c13a2138d8eb436d033fa2..d27e5f9dac4703b839ab8444f6b54bf5
|
|||
private final int searchRange;
|
||||
private final int verticalSearchRange;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
index ed1f6e77d5fc9b6f5f52b1a10275783b514c162c..652a8150f7343050b6da6c01f4e73a755138d491 100644
|
||||
index 0dab0da65788720e56a568918de458ab7195ef5c..722e323d2ae3f4ac8aa3197fed79f7d926d5ccfa 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java
|
||||
@@ -496,14 +496,18 @@ public class Turtle extends Animal {
|
||||
@@ -491,14 +491,18 @@ public class Turtle extends Animal {
|
||||
|
||||
if (!this.turtle.isInWater() && this.isReachedTarget()) {
|
||||
if (this.turtle.layEggCounter < 1) {
|
||||
|
@ -50,7 +50,7 @@ index ed1f6e77d5fc9b6f5f52b1a10275783b514c162c..652a8150f7343050b6da6c01f4e73a75
|
|||
|
||||
world.setBlock(blockposition1, iblockdata, 3);
|
||||
world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata));
|
||||
@@ -573,7 +577,7 @@ public class Turtle extends Animal {
|
||||
@@ -568,7 +572,7 @@ public class Turtle extends Animal {
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
|
@ -19,10 +19,10 @@ spectate the target entity.
|
|||
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index de062ef7553a7edff3d0fa6f50a9987bb62b9e09..ac4bb5d84689a6e4f8f9b425cee5188436d0efce 100644
|
||||
index 7dae09967ae47ae2ef01d1072ad98f125d0b67e9..859358b6bdffb836acbb653fefbafa592b5704e6 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1983,6 +1983,21 @@ public class ServerPlayer extends Player {
|
||||
@@ -2084,6 +2084,21 @@ public class ServerPlayer extends Player {
|
||||
|
||||
this.camera = (Entity) (entity == null ? this : entity);
|
||||
if (entity1 != this.camera) {
|
|
@ -0,0 +1,35 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 17 Oct 2018 19:17:27 -0400
|
||||
Subject: [PATCH] MC-50319: Check other worlds for shooter of projectiles
|
||||
|
||||
Say a player shoots an arrow through a nether portal, the game
|
||||
would lose the shooter for determining things such as Player Kills,
|
||||
because the entity is in another world.
|
||||
|
||||
If the projectile fails to find the shooter in the current world, check
|
||||
other worlds.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index 01a2c6c3ee4e1500b6ee9986943f84dbe8663860..fec4897ffc07f71efb8725efea341ba2878a1462 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -67,6 +67,18 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
ServerLevel worldserver = (ServerLevel) world;
|
||||
|
||||
this.cachedOwner = worldserver.getEntity(this.ownerUUID);
|
||||
+ // Paper start - check all worlds
|
||||
+ if (this.cachedOwner == null) {
|
||||
+ for (final ServerLevel level : this.level().getServer().getAllLevels()) {
|
||||
+ if (level == this.level()) continue;
|
||||
+ final Entity entity = level.getEntity(this.ownerUUID);
|
||||
+ if (entity != null) {
|
||||
+ this.cachedOwner = entity;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
return this.cachedOwner;
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
index 3e4fde2736feb03af2116cd218358845cd8f99d8..991d728db2a3b64316fc2102cf3aee470327a62e 100644
|
||||
index ee2abc0c39a76a74c151ecc8660d2037f3db0636..485d14d71fb26e6e0d00a43da040bf63d696b66a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -78,7 +78,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 3e6430d5769afbe308703e61f7fb7474811fdf38..6b2a3d3af54af0699a2331cfa6b165d079e38caf 100644
|
||||
index 01ae910d5997981ddbe400a057bb83932e89cbc0..214fbc10dae71634fd377c61b774012771a5d9f8 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -466,9 +466,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -469,9 +469,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
double d0 = entity.getX();
|
||||
double d1 = entity.getY();
|
||||
double d2 = entity.getZ();
|
||||
|
@ -22,7 +22,7 @@ index 3e6430d5769afbe308703e61f7fb7474811fdf38..6b2a3d3af54af0699a2331cfa6b165d0
|
|||
float f = Mth.wrapDegrees(packet.getYRot());
|
||||
float f1 = Mth.wrapDegrees(packet.getXRot());
|
||||
double d6 = d3 - this.vehicleFirstGoodX;
|
||||
@@ -503,6 +503,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -506,6 +506,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
|
||||
|
||||
|
@ -39,7 +39,7 @@ index 3e6430d5769afbe308703e61f7fb7474811fdf38..6b2a3d3af54af0699a2331cfa6b165d0
|
|||
if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
// CraftBukkit end
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
|
||||
@@ -1157,9 +1167,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1182,9 +1192,9 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.allowedPlayerTicks = 20; // CraftBukkit
|
||||
} else {
|
||||
this.awaitingTeleportTime = this.tickCount;
|
||||
|
@ -52,10 +52,10 @@ index 3e6430d5769afbe308703e61f7fb7474811fdf38..6b2a3d3af54af0699a2331cfa6b165d0
|
|||
float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot()));
|
||||
float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot()));
|
||||
|
||||
@@ -1214,6 +1224,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
} else {
|
||||
speed = this.player.getAbilities().walkingSpeed * 10f;
|
||||
}
|
||||
@@ -1240,6 +1250,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
} else {
|
||||
speed = this.player.getAbilities().walkingSpeed * 10f;
|
||||
}
|
||||
+ // Paper start - Prevent moving into unloaded chunks
|
||||
+ if (this.player.level().paperConfig().chunks.preventMovingIntoUnloadedChunks && (this.player.getX() != toX || this.player.getZ() != toZ) && !worldserver.areChunksLoadedForMove(this.player.getBoundingBox().expandTowards(new Vec3(toX, toY, toZ).subtract(this.player.position())))) {
|
||||
+ this.internalTeleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot(), Collections.emptySet());
|
||||
|
@ -63,5 +63,5 @@ index 3e6430d5769afbe308703e61f7fb7474811fdf38..6b2a3d3af54af0699a2331cfa6b165d0
|
|||
+ }
|
||||
+ // Paper end
|
||||
|
||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
||||
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
|
||||
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index ac4bb5d84689a6e4f8f9b425cee5188436d0efce..42898f986d317d44d88c39b56e4655366d5a5a1b 100644
|
||||
index 859358b6bdffb836acbb653fefbafa592b5704e6..6e025c8fdb14e6dcb178055d51efd11112247808 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2458,6 +2458,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -2559,6 +2559,7 @@ public class ServerPlayer extends Player {
|
||||
|
||||
this.setHealth(this.getMaxHealth());
|
||||
this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset
|
|
@ -7,7 +7,7 @@ Mojang was sleeping even if we had no more requests to go after
|
|||
the current one finished, resulting in 100ms lost per profile lookup
|
||||
|
||||
diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
index da26c2e6c5ff88b50606e94cfbff5725da37ac7f..f3e8552e651faf6f50ca1cb66415c8d4484a7f27 100644
|
||||
index b87546f0061458b2b919a1fe00dde1f4eea6cb3e..498623aa5da5fb861615c602019784d66a84e3a0 100644
|
||||
--- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
+++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
|
||||
@@ -44,6 +44,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository {
|
|
@ -35,19 +35,19 @@ index 0000000000000000000000000000000000000000..b60f59cf5cc8eb84a6055b7861857dec
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
||||
index 30237ca94a36197ce21369bdcc7bb1dfafe02680..5e9401f0c2de0743aca9237ee8c4dfba586cfdb9 100644
|
||||
index aa52b271bd556a29f774fde375b713d0d187521b..8188febd6f1039a31619b42af23df18afd2e985c 100644
|
||||
--- a/src/main/java/net/minecraft/Util.java
|
||||
+++ b/src/main/java/net/minecraft/Util.java
|
||||
@@ -81,7 +81,7 @@ public class Util {
|
||||
@@ -86,7 +86,7 @@ public class Util {
|
||||
private static final int DEFAULT_MAX_THREADS = 255;
|
||||
private static final int DEFAULT_SAFE_FILE_OPERATION_RETRIES = 10;
|
||||
private static final String MAX_THREADS_SYSTEM_PROPERTY = "max.bg.threads";
|
||||
private static final AtomicInteger WORKER_COUNT = new AtomicInteger(1);
|
||||
- private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main");
|
||||
+ private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main", -1); // Paper - add -1 priority
|
||||
private static final ExecutorService IO_POOL = makeIoExecutor("IO-Worker-", false);
|
||||
private static final ExecutorService DOWNLOAD_POOL = makeIoExecutor("Download-", true);
|
||||
// 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() {
|
||||
|
||||
@@ -145,14 +145,18 @@ public class Util {
|
||||
@@ -152,15 +152,18 @@ public class Util {
|
||||
return FILENAME_DATE_TIME_FORMATTER.format(ZonedDateTime.now());
|
||||
}
|
||||
|
||||
|
@ -62,15 +62,16 @@ index 30237ca94a36197ce21369bdcc7bb1dfafe02680..5e9401f0c2de0743aca9237ee8c4dfba
|
|||
if (i <= 0) {
|
||||
executorService = MoreExecutors.newDirectExecutorService();
|
||||
} else {
|
||||
- executorService = new ForkJoinPool(i, (forkJoinPool) -> {
|
||||
- ForkJoinWorkerThread forkJoinWorkerThread = new ForkJoinWorkerThread(forkJoinPool) {
|
||||
+ executorService = new java.util.concurrent.ThreadPoolExecutor(i, i,0L, TimeUnit.MILLISECONDS, new java.util.concurrent.LinkedBlockingQueue<Runnable>(), target -> new io.papermc.paper.util.ServerWorkerThread(target, s, priorityModifier));
|
||||
- AtomicInteger atomicInteger = new AtomicInteger(1);
|
||||
- executorService = new ForkJoinPool(i, (pool) -> {
|
||||
- ForkJoinWorkerThread forkJoinWorkerThread = new ForkJoinWorkerThread(pool) {
|
||||
+ executorService = new java.util.concurrent.ThreadPoolExecutor(i, i,0L, TimeUnit.MILLISECONDS, new java.util.concurrent.LinkedBlockingQueue<>(), target -> new io.papermc.paper.util.ServerWorkerThread(target, s, priorityModifier));
|
||||
+ }
|
||||
+ /*
|
||||
@Override
|
||||
protected void onTermination(Throwable throwable) {
|
||||
if (throwable != null) {
|
||||
@@ -168,6 +172,7 @@ public class Util {
|
||||
@@ -176,6 +179,7 @@ public class Util {
|
||||
return forkJoinWorkerThread;
|
||||
}, Util::onThreadException, true);
|
||||
}
|
||||
|
@ -79,10 +80,10 @@ index 30237ca94a36197ce21369bdcc7bb1dfafe02680..5e9401f0c2de0743aca9237ee8c4dfba
|
|||
return executorService;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 88c1c7d0dd8efddcde6d8d81cb89b09c2f6fee2a..9326b35d57d9157f968aac9428dce6462d86da0f 100644
|
||||
index a2daac80fcbe51b7b68ab01416f052d01267f3fe..0090f920f0e0460c5880f0661d29fdc95530abf2 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
|
||||
MinecraftServer.LOGGER.error("Uncaught exception in server thread", throwable);
|
||||
});
|
|
@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet
|
|||
object for every player unless they have per-player time enabled.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 9326b35d57d9157f968aac9428dce6462d86da0f..85ca00396d1f9f845f8f833d0896266b55a1b84d 100644
|
||||
index 0090f920f0e0460c5880f0661d29fdc95530abf2..ec0d9a7221d61a38aabfbb270a122f1c3ceeed23 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1373,12 +1373,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1475,12 +1475,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
|
@ -161,10 +161,10 @@ index 0000000000000000000000000000000000000000..224d4b2cc45b0d02230a76caee9c8857
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
index 1b4b397c08d7c05f5a066274a00a6ec80601624a..b4bd318d61834d70d666577073f18e4c49ded113 100644
|
||||
index 39be45585835eabc8d8bcae0158c094c3dcb1aa3..977b77547f7ba62cef3640cf8d4f1c8e7cded53a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java
|
||||
@@ -49,7 +49,7 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
@@ -50,7 +50,7 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
public CraftContainer(final Inventory inventory, final Player player, int id) {
|
||||
this(new InventoryView() {
|
||||
|
||||
|
@ -173,7 +173,7 @@ index 1b4b397c08d7c05f5a066274a00a6ec80601624a..b4bd318d61834d70d666577073f18e4c
|
|||
private String title = this.originalTitle;
|
||||
|
||||
@Override
|
||||
@@ -75,7 +75,7 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
@@ -76,7 +76,7 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
// Paper start
|
||||
@Override
|
||||
public net.kyori.adventure.text.Component title() {
|
||||
|
@ -182,7 +182,7 @@ index 1b4b397c08d7c05f5a066274a00a6ec80601624a..b4bd318d61834d70d666577073f18e4c
|
|||
}
|
||||
// Paper end
|
||||
|
||||
@@ -247,6 +247,10 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
@@ -253,6 +253,10 @@ public class CraftContainer extends AbstractContainerMenu {
|
||||
this.lastSlots = this.delegate.lastSlots;
|
||||
this.slots = this.delegate.slots;
|
||||
this.remoteSlots = this.delegate.remoteSlots;
|
||||
|
@ -194,10 +194,10 @@ index 1b4b397c08d7c05f5a066274a00a6ec80601624a..b4bd318d61834d70d666577073f18e4c
|
|||
|
||||
// SPIGOT-4598 - we should still delegate the shift click handler
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
index e97c7809fa6572695377e5ca63bf86e5515ef531..c064022d248ff3e0b52c0e815ab90527f9132fb7 100644
|
||||
index 6a47c6adb721f0c6737150d8b0ee18ab70f5f281..75eb794f796b31c0c5ef80a6d27a56711a522f5e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java
|
||||
@@ -492,6 +492,10 @@ public class CraftInventory implements Inventory {
|
||||
@@ -497,6 +497,10 @@ public class CraftInventory implements Inventory {
|
||||
return InventoryType.BREWING;
|
||||
} else if (this.inventory instanceof CraftInventoryCustom.MinecraftInventory) {
|
||||
return ((CraftInventoryCustom.MinecraftInventory) this.inventory).getType();
|
||||
|
@ -253,10 +253,10 @@ index fc0e1212022d1aa3506699b60ef338196eb54eba..da1c1fe0faf6819b15a81d6ad5337094
|
|||
static class MinecraftInventory implements Container {
|
||||
private final NonNullList<ItemStack> items;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java
|
||||
index 7a7f3f53aef601f124d474d9890e23d87dd96900..54e61b9b058bee2167461aaaf828ed7a00949c29 100644
|
||||
index 7db801cc18945ce203d7ea30dc517dd65183f6d6..e97166d3008cae7897519eaaf56b39c927661098 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftTileInventoryConverter.java
|
||||
@@ -28,7 +28,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
@@ -29,7 +29,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
|
||||
@Override
|
||||
public Inventory createInventory(InventoryHolder holder, InventoryType type) {
|
||||
|
@ -265,7 +265,7 @@ index 7a7f3f53aef601f124d474d9890e23d87dd96900..54e61b9b058bee2167461aaaf828ed7a
|
|||
}
|
||||
|
||||
// Paper start
|
||||
@@ -39,7 +39,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
@@ -40,7 +40,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
((RandomizableContainerBlockEntity) te).setCustomName(io.papermc.paper.adventure.PaperAdventure.asVanilla(title));
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,7 @@ index 7a7f3f53aef601f124d474d9890e23d87dd96900..54e61b9b058bee2167461aaaf828ed7a
|
|||
}
|
||||
// Paper end
|
||||
|
||||
@@ -50,10 +50,18 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
@@ -51,10 +51,18 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
((RandomizableContainerBlockEntity) te).setCustomName(CraftChatMessage.fromStringOrNull(title));
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ index 7a7f3f53aef601f124d474d9890e23d87dd96900..54e61b9b058bee2167461aaaf828ed7a
|
|||
return new CraftInventory(tileEntity);
|
||||
}
|
||||
|
||||
@@ -70,7 +78,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
@@ -71,7 +79,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
public Inventory createInventory(InventoryHolder owner, InventoryType type, net.kyori.adventure.text.Component title) {
|
||||
Container tileEntity = getTileEntity();
|
||||
((AbstractFurnaceBlockEntity) tileEntity).setCustomName(io.papermc.paper.adventure.PaperAdventure.asVanilla(title));
|
||||
|
@ -303,7 +303,7 @@ index 7a7f3f53aef601f124d474d9890e23d87dd96900..54e61b9b058bee2167461aaaf828ed7a
|
|||
}
|
||||
// Paper end
|
||||
|
||||
@@ -78,11 +86,19 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
@@ -79,11 +87,19 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) {
|
||||
Container tileEntity = this.getTileEntity();
|
||||
((AbstractFurnaceBlockEntity) tileEntity).setCustomName(CraftChatMessage.fromStringOrNull(title));
|
||||
|
@ -324,7 +324,7 @@ index 7a7f3f53aef601f124d474d9890e23d87dd96900..54e61b9b058bee2167461aaaf828ed7a
|
|||
return new CraftInventoryFurnace((AbstractFurnaceBlockEntity) tileEntity);
|
||||
}
|
||||
}
|
||||
@@ -102,7 +118,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
@@ -103,7 +119,7 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
if (tileEntity instanceof BrewingStandBlockEntity) {
|
||||
((BrewingStandBlockEntity) tileEntity).setCustomName(io.papermc.paper.adventure.PaperAdventure.asVanilla(title));
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ index 7a7f3f53aef601f124d474d9890e23d87dd96900..54e61b9b058bee2167461aaaf828ed7a
|
|||
}
|
||||
// Paper end
|
||||
|
||||
@@ -113,11 +129,19 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
@@ -114,11 +130,19 @@ public abstract class CraftTileInventoryConverter implements CraftInventoryCreat
|
||||
if (tileEntity instanceof BrewingStandBlockEntity) {
|
||||
((BrewingStandBlockEntity) tileEntity).setCustomName(CraftChatMessage.fromStringOrNull(title));
|
||||
}
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Use Vanilla Minecart Speeds
|
|||
CraftBukkit changed the values on flying speed, restore back to vanilla
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
index ceedb9e76bab57a7d04a05cc6fd2ee4005cbf203..8bea12248bf3ae95c629578386292732d0b74630 100644
|
||||
index e390735d411d815dcc4591da58db7017452acf31..b09c4e2a36f653ff6aa0e2c0bc927a8fd7e41ae0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
||||
@@ -108,9 +108,9 @@ public abstract class AbstractMinecart extends Entity {
|
||||
@@ -101,9 +101,9 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
||||
private double derailedX = 0.5;
|
||||
private double derailedY = 0.5;
|
||||
private double derailedZ = 0.5;
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling
|
|||
Only process drops when the block is actually going to be removed
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
|
||||
index d2c2adb0484985897db5f4fdc9b88f0e4b2c3235..d810f6bf9a8a354e5b8994e51ec3672428277dde 100644
|
||||
index 1238317d3e6d968525a10c5480a7d44d56abb071..c4667bea0708d12e228ec2a4c84fcee7e48ca08c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SpongeBlock.java
|
||||
@@ -127,7 +127,11 @@ public class SpongeBlock extends Block {
|
||||
@@ -134,7 +134,11 @@ public class SpongeBlock extends Block {
|
||||
} else if (iblockdata.is(Blocks.KELP) || iblockdata.is(Blocks.KELP_PLANT) || iblockdata.is(Blocks.SEAGRASS) || iblockdata.is(Blocks.TALL_SEAGRASS)) {
|
||||
BlockEntity tileentity = iblockdata.hasBlockEntity() ? world.getBlockEntity(blockposition1) : null;
|
||||
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Don't allow digging into unloaded chunks
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 5f79367fda576300c59774d69089f8f1c4408f8a..c15d2b8862139a6f083547794617d8bd6c462287 100644
|
||||
index e3b7441d875b55ffce295c948f3dc867be09e042..79020edc9fac79e8b186d0f57f956d2189d3dc8e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -119,8 +119,8 @@ public class ServerPlayerGameMode {
|
||||
|
@ -59,10 +59,10 @@ index 5f79367fda576300c59774d69089f8f1c4408f8a..c15d2b8862139a6f083547794617d8bd
|
|||
|
||||
this.level.destroyBlockProgress(this.player.getId(), pos, -1);
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 6b2a3d3af54af0699a2331cfa6b165d079e38caf..52b386b608fab59fe930885c0951f9674a257d69 100644
|
||||
index 214fbc10dae71634fd377c61b774012771a5d9f8..69db503d6259946d079ff828a80cae7e362aa5b4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1562,6 +1562,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1589,6 +1589,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
case START_DESTROY_BLOCK:
|
||||
case ABORT_DESTROY_BLOCK:
|
||||
case STOP_DESTROY_BLOCK:
|
|
@ -18,10 +18,10 @@ index 0dd48e4098191c8b6e29945d62bc473e9f3a1e77..ae51993e0de706cb62c96795ca9de766
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 5c39a02cb9db3d6c45b5cfe845a9be79cf7a1574..58ac20547480173f0b4cd4015fe0fb38d2d211ff 100644
|
||||
index b0de5cfd60a61fcea681f95dabbdc16beeb4242d..6f1e2ce0187460f78f7c0d8855f1f8f5cf897089 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2771,6 +2771,16 @@ public final class CraftServer implements Server {
|
||||
@@ -2803,6 +2803,16 @@ public final class CraftServer implements Server {
|
||||
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
|
||||
}
|
||||
|
|
@ -20,10 +20,10 @@ this is going to be the best soultion all around.
|
|||
Improvements/suggestions welcome!
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d8528c84c9cc1724b5100276ba624cf8627dc6ce..26b2ad3cda2a8b8166ec8eef520ab46ff9076e0f 100644
|
||||
index c8e0d0126c1a6eaded7c4a37f2da8ce1bf9bfadd..760bb3bfa47ee1e4c6a6add7ab823a24ffd9e15e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2576,11 +2576,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2605,11 +2605,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
public void removeVehicle() {
|
||||
|
@ -41,7 +41,7 @@ index d8528c84c9cc1724b5100276ba624cf8627dc6ce..26b2ad3cda2a8b8166ec8eef520ab46f
|
|||
}
|
||||
|
||||
}
|
||||
@@ -2611,7 +2616,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2640,7 +2645,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ index d8528c84c9cc1724b5100276ba624cf8627dc6ce..26b2ad3cda2a8b8166ec8eef520ab46f
|
|||
if (entity.getVehicle() == this) {
|
||||
throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)");
|
||||
} else {
|
||||
@@ -2621,7 +2629,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2650,7 +2658,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) {
|
||||
VehicleExitEvent event = new VehicleExitEvent(
|
||||
(Vehicle) this.getBukkitEntity(),
|
||||
|
@ -62,7 +62,7 @@ index d8528c84c9cc1724b5100276ba624cf8627dc6ce..26b2ad3cda2a8b8166ec8eef520ab46f
|
|||
);
|
||||
// Suppress during worldgen
|
||||
if (this.valid) {
|
||||
@@ -2635,7 +2643,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2664,7 +2672,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
// CraftBukkit end
|
||||
// Spigot start
|
||||
|
@ -72,10 +72,10 @@ index d8528c84c9cc1724b5100276ba624cf8627dc6ce..26b2ad3cda2a8b8166ec8eef520ab46f
|
|||
if (this.valid) {
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 5a638da349424a9d3bc5df87d81ba268b8052568..072f1f4e342141a02e6f94849432f116ba2e0e5c 100644
|
||||
index 40b8b863c4662d8a6aa228763be167317232b99f..d0482485b13346ac84bb52db30879519f7129091 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3469,9 +3469,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3471,9 +3471,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
@Override
|
||||
public void stopRiding() {
|
||||
|
@ -93,10 +93,10 @@ index 5a638da349424a9d3bc5df87d81ba268b8052568..072f1f4e342141a02e6f94849432f116
|
|||
this.dismountVehicle(entity);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index c2935b00737418749fc8c20624a1f6792ba7d071..cc6a9e9566d6f9bf453f3d6fba132c886248bf1c 100644
|
||||
index 0d8261e15a1a66df17727788c387dca8fbe2ae84..110c751dc108dbdc2fd9fdd25ca07df7acc723e5 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1154,7 +1154,13 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1149,7 +1149,13 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@Override
|
||||
public void removeVehicle() {
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Book Size Limits
|
|||
Puts some limits on the size of books.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 52b386b608fab59fe930885c0951f9674a257d69..78b902277521e2e6b33c971f61d27193ab2fc4f8 100644
|
||||
index 69db503d6259946d079ff828a80cae7e362aa5b4..addd60c07b59934095cfcc55024d6c8646a768ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1024,6 +1024,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1029,6 +1029,45 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
@Override
|
||||
public void handleEditBook(ServerboundEditBookPacket packet) {
|
|
@ -69,10 +69,10 @@ index 6fcbf8205e1852d5193a42bfe1154f62ab01e7ad..25881c890c643ce90bdcda6b094d912b
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 03ff64ad395455f21f4ca30faae17fc6a1dc0501..673652231a65e9441ee882c86656b86a86547488 100644
|
||||
index 96ae1fd95956f5e5a1542dcce3fbd9d4b83d49ba..615fb00e50f3c434809f8e1b201d457b9beae8fd 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -58,7 +58,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -60,7 +60,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@Nullable
|
||||
String requestedUsername;
|
||||
@Nullable
|
|
@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and
|
|||
documented as to their purpose.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 42898f986d317d44d88c39b56e4655366d5a5a1b..32ab4a254b04d8d66c62660c7ad9489ea8ecf7f2 100644
|
||||
index 6e025c8fdb14e6dcb178055d51efd11112247808..268567dab735619171c2cdfd566790527c07e64d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -241,6 +241,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -248,6 +248,7 @@ public class ServerPlayer extends Player {
|
||||
private int containerCounter;
|
||||
public boolean wonGame;
|
||||
private int containerUpdateDelay; // Paper
|
||||
|
@ -28,10 +28,10 @@ index 42898f986d317d44d88c39b56e4655366d5a5a1b..32ab4a254b04d8d66c62660c7ad9489e
|
|||
public boolean queueHealthUpdatePacket = false;
|
||||
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 3cd1563480d40ff358dce52891ba4bdc8d119888..1619a0573c6996e0f5494bfab6788ba96c08a6d3 100644
|
||||
index b76024a8dce1ef79f6cbff7403daffd214d7b850..807b649ed6e5ddd4887bf9b5a028b02a58a75348 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -181,6 +181,7 @@ public abstract class PlayerList {
|
||||
@@ -179,6 +179,7 @@ public abstract class PlayerList {
|
||||
|
||||
public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
|
||||
player.isRealPlayer = true; // Paper
|
||||
|
@ -106,10 +106,10 @@ index e8490a58dd4d9bc39a5bb2f9fc109526e031b971..5f590575f95eff8bf0cdcafde7dee0e3
|
|||
public Location getLastDeathLocation() {
|
||||
if (this.getData().contains("LastDeathLocation", 10)) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2d972cd1c 100644
|
||||
index 06e6db108a40ff7e59fbfe1895dae7dbc3a3f3ab..268814e3de4ee19c9e248080d77b20a7c2773bb0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -195,6 +195,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -196,6 +196,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus;
|
||||
private String resourcePackHash;
|
||||
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
|
||||
|
@ -117,7 +117,7 @@ index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2
|
|||
// Paper end
|
||||
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
@@ -1954,6 +1955,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1961,6 +1962,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.firstPlayed = firstPlayed;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2
|
|||
public void readExtraData(CompoundTag nbttagcompound) {
|
||||
this.hasPlayedBefore = true;
|
||||
if (nbttagcompound.contains("bukkit")) {
|
||||
@@ -1976,6 +1989,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1983,6 +1996,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
public void setExtraData(CompoundTag nbttagcompound) {
|
||||
|
@ -145,7 +145,7 @@ index 938f0cc12e7a6569a8d3585a9f58f6490fd387a0..43fb53bfef71912695266eda459d7fa2
|
|||
if (!nbttagcompound.contains("bukkit")) {
|
||||
nbttagcompound.put("bukkit", new CompoundTag());
|
||||
}
|
||||
@@ -1990,6 +2005,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1997,6 +2012,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
data.putLong("firstPlayed", this.getFirstPlayed());
|
||||
data.putLong("lastPlayed", System.currentTimeMillis());
|
||||
data.putString("lastKnownName", handle.getScoreboardName());
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 32ab4a254b04d8d66c62660c7ad9489ea8ecf7f2..a38eb9dfa24388508eddad3d51953441f3c2c69c 100644
|
||||
index 268567dab735619171c2cdfd566790527c07e64d..c46326b7c761057f2d61542e088278553d694d7c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1647,6 +1647,13 @@ public class ServerPlayer extends Player {
|
||||
@@ -1748,6 +1748,13 @@ public class ServerPlayer extends Player {
|
||||
public void disconnect() {
|
||||
this.disconnected = true;
|
||||
this.ejectPassengers();
|
|
@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to
|
|||
be unintentional in the few cases we've seen so far.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 43fb53bfef71912695266eda459d7fa2d972cd1c..8341d66dd5cad3cebdd95cfbc995cc3e8d43d934 100644
|
||||
index 268814e3de4ee19c9e248080d77b20a7c2773bb0..abbbd559ee0301e261419a4e1c2c082174a91881 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2894,6 +2894,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2909,6 +2909,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
public void resetCooldown() {
|
||||
getHandle().resetAttackStrengthTicker();
|
||||
}
|
|
@ -11,10 +11,10 @@ floating in the air.
|
|||
This can replace many uses of BlockPhysicsEvent
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index baee74186c6349efb8e5e9ff087a114c08c7ae72..3f6d9b7c91a14dedeee11968e80de26adeccb510 100644
|
||||
index eec83b6c00fee271fdeb12bd8b812439d1dc4d3b..ec12d394df2c240994b614d1252b220c836d6c89 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -22,7 +22,7 @@ index baee74186c6349efb8e5e9ff087a114c08c7ae72..3f6d9b7c91a14dedeee11968e80de26a
|
|||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.FullChunkStatus;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -666,8 +667,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -669,8 +670,21 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
return false;
|
||||
} else {
|
||||
FluidState fluid = this.getFluidState(pos);
|
|
@ -9,10 +9,10 @@ commands if the server is restarting. Using the default async pool caused issues
|
|||
due to the shutdown logic generally being much later.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index e63632f09d608371aaeaf09a6dac57c1d8a719d4..bbf4db5faf4694e78e01f4e74e277b46a02f7afd 100644
|
||||
index 5a1accff1a7dc2ab40224ec0952a287cd6099aee..2a88cf008c98284954108f2362f46ac14c84200a 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -404,6 +404,24 @@ public class Commands {
|
||||
@@ -458,6 +458,24 @@ public class Commands {
|
||||
if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot
|
||||
// CraftBukkit start
|
||||
// Register Vanilla commands into builtRoot as before
|
||||
|
@ -37,7 +37,7 @@ index e63632f09d608371aaeaf09a6dac57c1d8a719d4..bbf4db5faf4694e78e01f4e74e277b46
|
|||
Map<CommandNode<CommandSourceStack>, CommandNode<SharedSuggestionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues
|
||||
RootCommandNode vanillaRoot = new RootCommandNode();
|
||||
|
||||
@@ -421,7 +439,14 @@ public class Commands {
|
||||
@@ -475,7 +493,14 @@ public class Commands {
|
||||
for (CommandNode node : rootcommandnode.getChildren()) {
|
||||
bukkit.add(node.getName());
|
||||
}
|
||||
|
@ -53,10 +53,10 @@ index e63632f09d608371aaeaf09a6dac57c1d8a719d4..bbf4db5faf4694e78e01f4e74e277b46
|
|||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 85ca00396d1f9f845f8f833d0896266b55a1b84d..c0918bcfa78782c54a548267c2363f1edd197412 100644
|
||||
index ec0d9a7221d61a38aabfbb270a122f1c3ceeed23..ca50e8240c62323c5a0e34aec91e6684a92189c4 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -880,6 +880,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -926,6 +926,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
|
@ -59,19 +59,19 @@ index da6250df1c5f3385b683cffde47754bca4606f5e..3384501f83d445f45aa8233e98c7597d
|
|||
public void removeCommand(String name) {
|
||||
this.children.remove(name);
|
||||
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
index 902671a335da23d3945c363afc8abde6f5a1d444..e6bf044a0de278c568835e6150ce07ed0e39a44e 100644
|
||||
index ae7be8678ab2859b8eb5e04bc31d76271a74c66b..75b7b3cf90d1d67203ae19dc3302f06a57470f92 100644
|
||||
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
|
||||
@@ -43,7 +43,7 @@ import net.minecraft.world.phys.Vec2;
|
||||
@@ -45,7 +45,7 @@ import net.minecraft.world.phys.Vec2;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import com.mojang.brigadier.tree.CommandNode; // CraftBukkit
|
||||
|
||||
-public class CommandSourceStack implements SharedSuggestionProvider {
|
||||
+public class CommandSourceStack implements SharedSuggestionProvider, com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource { // Paper
|
||||
-public class CommandSourceStack implements ExecutionCommandSource<CommandSourceStack>, SharedSuggestionProvider {
|
||||
+public class CommandSourceStack implements ExecutionCommandSource<CommandSourceStack>, SharedSuggestionProvider, com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource { // Paper
|
||||
|
||||
public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(Component.translatable("permissions.requires.player"));
|
||||
public static final SimpleCommandExceptionType ERROR_NOT_ENTITY = new SimpleCommandExceptionType(Component.translatable("permissions.requires.entity"));
|
||||
@@ -176,6 +176,26 @@ public class CommandSourceStack implements SharedSuggestionProvider {
|
||||
@@ -170,6 +170,26 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
|
||||
return this.textName;
|
||||
}
|
||||
|
||||
|
@ -99,10 +99,10 @@ index 902671a335da23d3945c363afc8abde6f5a1d444..e6bf044a0de278c568835e6150ce07ed
|
|||
public boolean hasPermission(int level) {
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index bbf4db5faf4694e78e01f4e74e277b46a02f7afd..148cfe9eac43cafee016d58a1344a97a2e69aa77 100644
|
||||
index 2a88cf008c98284954108f2362f46ac14c84200a..b27256d251e5db5781197319f79f89cc7638c80b 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -440,6 +440,7 @@ public class Commands {
|
||||
@@ -494,6 +494,7 @@ public class Commands {
|
||||
bukkit.add(node.getName());
|
||||
}
|
||||
// Paper start - Async command map building
|
||||
|
@ -110,7 +110,7 @@ index bbf4db5faf4694e78e01f4e74e277b46a02f7afd..148cfe9eac43cafee016d58a1344a97a
|
|||
net.minecraft.server.MinecraftServer.getServer().execute(() -> {
|
||||
runSync(player, bukkit, rootcommandnode);
|
||||
});
|
||||
@@ -447,6 +448,7 @@ public class Commands {
|
||||
@@ -501,6 +502,7 @@ public class Commands {
|
||||
|
||||
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
|
||||
// Paper end - Async command map building
|
||||
|
@ -118,7 +118,7 @@ index bbf4db5faf4694e78e01f4e74e277b46a02f7afd..148cfe9eac43cafee016d58a1344a97a
|
|||
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
|
||||
event.getPlayer().getServer().getPluginManager().callEvent(event);
|
||||
|
||||
@@ -465,6 +467,11 @@ public class Commands {
|
||||
@@ -519,6 +521,11 @@ public class Commands {
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
CommandNode<CommandSourceStack> commandnode2 = (CommandNode) iterator.next();
|
||||
|
@ -131,10 +131,10 @@ index bbf4db5faf4694e78e01f4e74e277b46a02f7afd..148cfe9eac43cafee016d58a1344a97a
|
|||
|
||||
if (commandnode2.canUse(source)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 78b902277521e2e6b33c971f61d27193ab2fc4f8..892a06c76e5e77b43d592c325fcbf32f9d107181 100644
|
||||
index addd60c07b59934095cfcc55024d6c8646a768ea..1a70fe69e6627534aaed691cc1bc0eb98c075707 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -740,8 +740,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -743,8 +743,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
ParseResults<CommandSourceStack> parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack());
|
||||
|
||||
this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> {
|
||||
|
@ -149,7 +149,7 @@ index 78b902277521e2e6b33c971f61d27193ab2fc4f8..892a06c76e5e77b43d592c325fcbf32f
|
|||
});
|
||||
});
|
||||
}
|
||||
@@ -756,7 +760,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -759,7 +763,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip()));
|
||||
}
|
||||
});
|
|
@ -296,7 +296,7 @@ index 5cc5f67284ad01c9154876252450552ed37f24bf..26b236a764177ac16d53f5cbaf83d3e2
|
|||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java b/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java
|
||||
index c864809c7d656cf8e3f1080c2c57aefd0a417240..760a429137350d8ae100e77273318f3ba1ccfcc5 100644
|
||||
index ff48b0de1bdf693e01ea04bc1606c5f80d4c401c..43cff6d2fca55192a0a8d9051a0728327c5dcf4b 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/AbstractCookingRecipe.java
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.world.Container;
|
||||
|
@ -317,10 +317,10 @@ index c864809c7d656cf8e3f1080c2c57aefd0a417240..760a429137350d8ae100e77273318f3b
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/Recipe.java b/src/main/java/net/minecraft/world/item/crafting/Recipe.java
|
||||
index 75ae978b577b6b2399e1476328114e94abd7d6c4..80387cd1bee2bd4c024073cee74222828f9f2c17 100644
|
||||
index 8b631e457f783e55b7c37dd915b699912a9c5b49..e2d6c8ed586ef429cc712139e501df696ed10f6e 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/Recipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/Recipe.java
|
||||
@@ -65,4 +65,10 @@ public interface Recipe<C extends Container> {
|
||||
@@ -69,4 +69,10 @@ public interface Recipe<C extends Container> {
|
||||
}
|
||||
|
||||
org.bukkit.inventory.Recipe toBukkitRecipe(org.bukkit.NamespacedKey id); // CraftBukkit
|
||||
|
@ -332,28 +332,28 @@ index 75ae978b577b6b2399e1476328114e94abd7d6c4..80387cd1bee2bd4c024073cee7422282
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
index 4430c1161c3316566158ab7286e21495edb38991..17bef91546fa85d401b263c3a69fbf464f290eca 100644
|
||||
index 201897bbde809699b53617e09703f5b22bbbe938..d772cf80fa3831e1c79d601ea09a073da089e2c5 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
@@ -26,7 +26,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapedRecipe;
|
||||
@@ -17,7 +17,7 @@ import org.bukkit.craftbukkit.inventory.CraftShapedRecipe;
|
||||
import org.bukkit.inventory.RecipeChoice;
|
||||
// CraftBukkit end
|
||||
|
||||
-public class ShapedRecipe implements CraftingRecipe {
|
||||
+public class ShapedRecipe extends io.papermc.paper.inventory.recipe.RecipeBookExactChoiceRecipe<CraftingContainer> implements CraftingRecipe { // Paper - improve exact recipe choices
|
||||
|
||||
final int width;
|
||||
final int height;
|
||||
@@ -44,6 +44,7 @@ public class ShapedRecipe implements CraftingRecipe {
|
||||
this.recipeItems = ingredients;
|
||||
final ShapedRecipePattern pattern;
|
||||
final ItemStack result;
|
||||
@@ -31,6 +31,7 @@ public class ShapedRecipe implements CraftingRecipe {
|
||||
this.pattern = raw;
|
||||
this.result = result;
|
||||
this.showNotification = showNotification;
|
||||
+ this.checkExactIngredients(); // Paper - improve exact recipe choices
|
||||
}
|
||||
|
||||
public ShapedRecipe(String group, CraftingBookCategory category, int width, int height, NonNullList<Ingredient> ingredients, ItemStack result) {
|
||||
public ShapedRecipe(String group, CraftingBookCategory category, ShapedRecipePattern raw, ItemStack result) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||
index 7f78490ebf459595460ce656b9b9227e5d6b8de6..38f7d1ece27ec1a3deda21fb6a6f0e788c8ed718 100644
|
||||
index 870e07140d835feaa55808101722d4547d5021d0..27b0a79f7a7c47047216aae42944bac2a2151181 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapelessRecipe.java
|
||||
@@ -20,7 +20,7 @@ import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
|
@ -22,18 +22,18 @@ it only impacts data sent from the client.
|
|||
Set -DPaper.maxSignLength=XX to change limit or -1 to disable
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 892a06c76e5e77b43d592c325fcbf32f9d107181..93b1e0b287d195181cb2253b3490ed537efa6b8e 100644
|
||||
index 1a70fe69e6627534aaed691cc1bc0eb98c075707..9b7902fa7ba79ff44b215647f580ea1834b1aa74 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -288,6 +288,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private final MessageSignatureCache messageSignatureCache;
|
||||
@@ -291,6 +291,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault();
|
||||
private final FutureChain chatMessageChain;
|
||||
private boolean waitingForSwitchToConfig;
|
||||
+ private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper
|
||||
|
||||
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
|
||||
super(server, connection, clientData, player); // CraftBukkit
|
||||
@@ -3052,7 +3053,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3060,7 +3061,19 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
@Override
|
||||
public void handleSignUpdate(ServerboundSignUpdatePacket packet) {
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 1619a0573c6996e0f5494bfab6788ba96c08a6d3..72dc59f2081e517587d66d03d9b5910caf0e1c17 100644
|
||||
index 807b649ed6e5ddd4887bf9b5a028b02a58a75348..59fcb123cb1a49cca4072a62aa304e7382a07ccb 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1151,6 +1151,7 @@ public abstract class PlayerList {
|
|
@ -22,10 +22,10 @@ index 2eddeb8d5239bbfeefbf4d3bd363f1ad083299b6..a7c89cdf20cb63792c76de81c1ff9f2c
|
|||
});
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index c9f22e24223c409a7a3aec668f02a59ed5102524..47a1fb476e3825f489fc217ef83fd273b52676a1 100644
|
||||
index 08a1fdd0b6fb688897a7813e8c298265afedf02b..a26138470065a720045e3079e5e96d6c4fa765ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1431,6 +1431,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1450,6 +1450,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
return true;
|
||||
}
|
||||
// Paper end
|
||||
|
@ -34,10 +34,10 @@ index c9f22e24223c409a7a3aec668f02a59ed5102524..47a1fb476e3825f489fc217ef83fd273
|
|||
// Paper start
|
||||
if (DEBUG_ENTITIES) {
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 72dc59f2081e517587d66d03d9b5910caf0e1c17..e06748a8550ffff34ea4e070e143348397d4d438 100644
|
||||
index 59fcb123cb1a49cca4072a62aa304e7382a07ccb..f7e0364b4f5cf73d36f26ad169c93259b727082c 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -225,6 +225,11 @@ public abstract class PlayerList {
|
||||
@@ -223,6 +223,11 @@ public abstract class PlayerList {
|
||||
worldserver1 = worldserver;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,7 @@ index 72dc59f2081e517587d66d03d9b5910caf0e1c17..e06748a8550ffff34ea4e070e1433483
|
|||
player.setServerLevel(worldserver1);
|
||||
String s1 = connection.getLoggableAddress(this.server.logIPs());
|
||||
|
||||
@@ -356,7 +361,7 @@ public abstract class PlayerList {
|
||||
@@ -354,7 +359,7 @@ public abstract class PlayerList {
|
||||
// CraftBukkit start
|
||||
ServerLevel finalWorldServer = worldserver1;
|
||||
Entity entity = EntityType.loadEntityRecursive(nbttagcompound1.getCompound("Entity"), finalWorldServer, (entity1) -> {
|
||||
|
@ -59,10 +59,10 @@ index 72dc59f2081e517587d66d03d9b5910caf0e1c17..e06748a8550ffff34ea4e070e1433483
|
|||
});
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 26b2ad3cda2a8b8166ec8eef520ab46ff9076e0f..bf046bea5fdff67f362c401f1ddbfa9d2863a9d7 100644
|
||||
index 760bb3bfa47ee1e4c6a6add7ab823a24ffd9e15e..75effaa34f06d85ee4e26d9a598acc85c94e9767 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -234,6 +234,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -235,6 +235,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
|
@ -70,9 +70,9 @@ index 26b2ad3cda2a8b8166ec8eef520ab46ff9076e0f..bf046bea5fdff67f362c401f1ddbfa9d
|
|||
|
||||
public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper
|
||||
private CraftEntity bukkitEntity;
|
||||
@@ -2189,6 +2190,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2212,6 +2213,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
nbt.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||
nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ()));
|
||||
}
|
||||
+ if (spawnReason != null) {
|
||||
+ nbt.putString("Paper.SpawnReason", spawnReason.name());
|
||||
|
@ -80,7 +80,7 @@ index 26b2ad3cda2a8b8166ec8eef520ab46ff9076e0f..bf046bea5fdff67f362c401f1ddbfa9d
|
|||
// Save entity's from mob spawner status
|
||||
if (spawnedViaMobSpawner) {
|
||||
nbt.putBoolean("Paper.FromMobSpawner", true);
|
||||
@@ -2335,6 +2339,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2358,6 +2362,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status
|
||||
|
@ -108,10 +108,10 @@ index 26b2ad3cda2a8b8166ec8eef520ab46ff9076e0f..bf046bea5fdff67f362c401f1ddbfa9d
|
|||
|
||||
} catch (Throwable throwable) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index a9be524edb03c51300bc45d424fcf87c7491a8c0..a08c2dee792da1a54005f0a65a9eefabc7bc7c60 100644
|
||||
index 713608239cc7518d05b04d3dd79c3af0c358c64e..231674f1483ad71630ac71ba92efc50f94a5659b 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -187,6 +187,7 @@ public abstract class BaseSpawner {
|
||||
@@ -189,6 +189,7 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
|
||||
entity.spawnedViaMobSpawner = true; // Paper
|
||||
|
@ -133,10 +133,10 @@ index faad948f089575e4988d989790cc1dd13f8a79cd..ee11a52e82091911aa3a196bcc1f7ab8
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index f1df0a172e7e1589b9a6af6fab87ce0251c5a557..e1f75dfcb22918d953d35d345280c61301688ac7 100644
|
||||
index 93363aabee8bafeb1bc1d0d5a94e80b647175509..b06c338ee9205d1f4d562571aba83c83f9abd20b 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -1323,5 +1323,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
@@ -1367,5 +1367,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
public boolean fromMobSpawner() {
|
||||
return getHandle().spawnedViaMobSpawner;
|
||||
}
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index e06748a8550ffff34ea4e070e143348397d4d438..7321e5b9905cf5afb684a9d2d39048f43c245504 100644
|
||||
index f7e0364b4f5cf73d36f26ad169c93259b727082c..ee1b40ef92e343e829040b8df5a2db67846f2982 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -753,9 +753,14 @@ public abstract class PlayerList {
|
||||
@@ -751,9 +751,14 @@ public abstract class PlayerList {
|
||||
|
||||
boolean flag2 = false;
|
||||
|
||||
|
@ -24,7 +24,7 @@ index e06748a8550ffff34ea4e070e143348397d4d438..7321e5b9905cf5afb684a9d2d39048f4
|
|||
ServerLevel worldserver1 = this.server.getLevel(entityplayer.getRespawnDimension());
|
||||
if (worldserver1 != null) {
|
||||
Optional optional;
|
||||
@@ -807,6 +812,7 @@ public abstract class PlayerList {
|
||||
@@ -805,6 +810,7 @@ public abstract class PlayerList {
|
||||
|
||||
location = respawnEvent.getRespawnLocation();
|
||||
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
||||
|
@ -32,7 +32,7 @@ index e06748a8550ffff34ea4e070e143348397d4d438..7321e5b9905cf5afb684a9d2d39048f4
|
|||
} else {
|
||||
location.setWorld(worldserver.getWorld());
|
||||
}
|
||||
@@ -865,6 +871,13 @@ public abstract class PlayerList {
|
||||
@@ -863,6 +869,13 @@ public abstract class PlayerList {
|
||||
if (entityplayer.connection.isDisconnected()) {
|
||||
this.save(entityplayer);
|
||||
}
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] don't go below 0 for pickupDelay, breaks picking up items
|
|||
vanilla checks for == 0
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 5744d726c4e7a970db5c1c3764d530d839d95597..2edc55f09b79ac75788a0ded8b3d2a6800674470 100644
|
||||
index 18c9c7c2b0605bee2936fbb084108dd9791f7ebe..314ba941c72a50b479cb634f3337ded3e63a7622 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -122,6 +122,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -140,6 +140,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
// CraftBukkit start - Use wall time for pickup and despawn timers
|
||||
int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
||||
if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks;
|
||||
|
@ -17,7 +17,7 @@ index 5744d726c4e7a970db5c1c3764d530d839d95597..2edc55f09b79ac75788a0ded8b3d2a68
|
|||
if (this.age != -32768) this.age += elapsedTicks;
|
||||
this.lastTick = MinecraftServer.currentTick;
|
||||
// CraftBukkit end
|
||||
@@ -208,6 +209,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -226,6 +227,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
// CraftBukkit start - Use wall time for pickup and despawn timers
|
||||
int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
||||
if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks;
|
|
@ -6,18 +6,18 @@ Subject: [PATCH] Server Tick Events
|
|||
Fires event at start and end of a server tick
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c0918bcfa78782c54a548267c2363f1edd197412..fb2851e94c178f49ee8046176b196c63254907e7 100644
|
||||
index ca50e8240c62323c5a0e34aec91e6684a92189c4..9f0f73cca985ec3f55a7e83471c2aba8420c91e7 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1286,6 +1286,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1354,6 +1354,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
});
|
||||
isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
|
||||
// Paper end
|
||||
+ new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper
|
||||
|
||||
++this.tickCount;
|
||||
this.tickChildren(shouldKeepTicking);
|
||||
@@ -1307,6 +1308,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.tickRateManager.tick();
|
||||
@@ -1380,6 +1381,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.runAllTasks();
|
||||
}
|
||||
// Paper end
|
||||
|
@ -27,5 +27,5 @@ index c0918bcfa78782c54a548267c2363f1edd197412..fb2851e94c178f49ee8046176b196c63
|
|||
+ new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
|
||||
+ // Paper end
|
||||
this.profiler.push("tallying");
|
||||
long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
|
||||
|
||||
long j = Util.getNanos() - i;
|
||||
int k = this.tickCount % 100;
|
|
@ -11,10 +11,10 @@ Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4
|
|||
public net.minecraft.world.entity.player.Inventory compartments
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index a38eb9dfa24388508eddad3d51953441f3c2c69c..151f1918392e26163323ddf1cfd6cd52abaea9c3 100644
|
||||
index c46326b7c761057f2d61542e088278553d694d7c..c65b5054728418a62923eb4192d55ba30fd8f4fb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -850,6 +850,46 @@ public class ServerPlayer extends Player {
|
||||
@@ -857,6 +857,46 @@ public class ServerPlayer extends Player {
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ index a38eb9dfa24388508eddad3d51953441f3c2c69c..151f1918392e26163323ddf1cfd6cd52
|
|||
@Override
|
||||
public void die(DamageSource damageSource) {
|
||||
this.gameEvent(GameEvent.ENTITY_DIE);
|
||||
@@ -933,7 +973,12 @@ public class ServerPlayer extends Player {
|
||||
@@ -940,7 +980,12 @@ public class ServerPlayer extends Player {
|
||||
this.dropExperience();
|
||||
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
|
||||
if (!event.getKeepInventory()) {
|
|
@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to
|
|||
just do a get call since the value can never be null.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 3f6d9b7c91a14dedeee11968e80de26adeccb510..0c64e65af843034b26147f62c49c6ab12ac5ddd2 100644
|
||||
index ec12d394df2c240994b614d1252b220c836d6c89..53fd518e164ac774aab4484268abc836ccbbf60a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -982,9 +982,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1000,9 +1000,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@Nullable
|
||||
public BlockEntity getBlockEntity(BlockPos blockposition, boolean validate) {
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add Heightmap API
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index c92b931e2a54122e7a7aeafc5f88faee59c5e0fb..e24c43463b3997549e9a7560a464bdeb8823831e 100644
|
||||
index c14f73d745ec34f0970b2e5aac9d68fc069fc1d2..ca02281f12b0d914ad76da57aab56b63bb59d1f1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -222,6 +222,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -223,6 +223,29 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return CraftBlock.at(this.world, new BlockPos(x, y, z));
|
||||
}
|
||||
|
|
@ -9,10 +9,10 @@ public net.minecraft.world.level.BaseSpawner delay(Lnet/minecraft/world/level/Le
|
|||
public net.minecraft.world.level.BaseSpawner setNextSpawnData(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/SpawnData;)V
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index a08c2dee792da1a54005f0a65a9eefabc7bc7c60..369298dfd437c1c83801f3d4ba63484ee1b969fe 100644
|
||||
index 231674f1483ad71630ac71ba92efc50f94a5659b..41f549f16f69f9bc50a004096e6c3c0f6e4d4eaf 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -233,7 +233,13 @@ public abstract class BaseSpawner {
|
||||
@@ -235,7 +235,13 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
|
||||
public void load(@Nullable Level world, BlockPos pos, CompoundTag nbt) {
|
||||
|
@ -26,7 +26,7 @@ index a08c2dee792da1a54005f0a65a9eefabc7bc7c60..369298dfd437c1c83801f3d4ba63484e
|
|||
boolean flag = nbt.contains("SpawnData", 10);
|
||||
|
||||
if (flag) {
|
||||
@@ -256,9 +262,15 @@ public abstract class BaseSpawner {
|
||||
@@ -258,9 +264,15 @@ public abstract class BaseSpawner {
|
||||
this.spawnPotentials = SimpleWeightedRandomList.single(this.nextSpawnData != null ? this.nextSpawnData : new SpawnData());
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ index a08c2dee792da1a54005f0a65a9eefabc7bc7c60..369298dfd437c1c83801f3d4ba63484e
|
|||
this.spawnCount = nbt.getShort("SpawnCount");
|
||||
}
|
||||
|
||||
@@ -275,9 +287,20 @@ public abstract class BaseSpawner {
|
||||
@@ -277,9 +289,20 @@ public abstract class BaseSpawner {
|
||||
}
|
||||
|
||||
public CompoundTag save(CompoundTag nbt) {
|
||||
|
@ -69,10 +69,10 @@ index a08c2dee792da1a54005f0a65a9eefabc7bc7c60..369298dfd437c1c83801f3d4ba63484e
|
|||
nbt.putShort("MaxNearbyEntities", (short) this.maxNearbyEntities);
|
||||
nbt.putShort("RequiredPlayerRange", (short) this.requiredPlayerRange);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||
index 78d987b56a2a0acefafe801332eef4d64dc7715c..2479cc081b5f7c70531f79ec4eda2d1da10c2b05 100644
|
||||
index 777241d3196a7984042967bc67fcf7429a1ddee7..0d39223d1eaa3fe7065eb9dc9f945ca965d3b43e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java
|
||||
@@ -144,4 +144,28 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEnti
|
||||
@@ -226,4 +226,28 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<SpawnerBlockEnti
|
||||
public CraftCreatureSpawner copy() {
|
||||
return new CraftCreatureSpawner(this);
|
||||
}
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index 4e450a3d7f2db7d7d346103cc9467654ca1b8a1f..d25b6431ce617d90fd1d6489a308d6630b92c175 100644
|
||||
index 4286dcc7ec46b446f60e41acd2dcaaa8760fd8b1..6b53e65308fb4118ef2d78ec9d171722ba2301f5 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -297,7 +297,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix sounds when item frames are modified (MC-123450)
|
|||
This also fixes the adding sound playing when the item frame direction is changed.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
index a7ca700b9b1b3c09e9edd596d28e1123c211adc3..dc999068891bfdfd4873ca939b4c4389d63f4415 100644
|
||||
index 78a3c87b74218a0d5792801c07e3a263c15fcd5b..8289ea080aa297f75cdbc8d591d6efa6a0def0ea 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java
|
||||
@@ -331,7 +331,7 @@ public class ItemFrame extends HangingEntity {
|
||||
@@ -326,7 +326,7 @@ public class ItemFrame extends HangingEntity {
|
||||
|
||||
this.onItemChanged(itemstack);
|
||||
this.getEntityData().set(ItemFrame.DATA_ITEM, itemstack);
|
|
@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..3913c407a3bfa7dfa4a5e374a5e79296
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index 9aa8c6c11d5aee83627cb91258c16844f791cd26..b25ebc5f1c54ea3ecc38e96b79e5cca88aafb816 100644
|
||||
index 29bbd44a0d15d78e13d91003fea1460efdf19e88..7f2e4fd1d81d6439475f30e62f0348f38bbc985d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -621,4 +621,16 @@ public class CraftBlock implements Block {
|
||||
@@ -622,4 +622,16 @@ public class CraftBlock implements Block {
|
||||
public String getTranslationKey() {
|
||||
return this.getNMS().getBlock().getDescriptionId();
|
||||
}
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
|
|||
This lets you disable it for some worlds and lower it for others.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index fb2851e94c178f49ee8046176b196c63254907e7..ef6d98d503fdca4322000278de4cf325df56f99d 100644
|
||||
index 9f0f73cca985ec3f55a7e83471c2aba8420c91e7..0752685c28b293a67560e6a81d1aea7bd11c526d 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -722,30 +722,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -768,30 +768,33 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
// CraftBukkit start
|
||||
public void prepareLevels(ChunkProgressListener worldloadlistener, ServerLevel worldserver) {
|
||||
|
@ -26,13 +26,13 @@ index fb2851e94c178f49ee8046176b196c63254907e7..ef6d98d503fdca4322000278de4cf325
|
|||
- ServerChunkCache chunkproviderserver = worldserver.getChunkSource();
|
||||
+ //ChunkProviderServer chunkproviderserver = worldserver.getChunkProvider(); // Paper - move up
|
||||
|
||||
this.nextTickTime = Util.getMillis();
|
||||
this.nextTickTimeNanos = Util.getNanos();
|
||||
- // CraftBukkit start
|
||||
- if (worldserver.getWorld().getKeepSpawnInMemory()) {
|
||||
- chunkproviderserver.addRegionTicket(TicketType.START, new ChunkPos(blockposition), 11, Unit.INSTANCE);
|
||||
-
|
||||
- while (chunkproviderserver.getTickingGenerated() != 441) {
|
||||
- // this.nextTickTime = SystemUtils.getMillis() + 10L;
|
||||
- // this.nextTickTimeNanos = SystemUtils.getNanos() + MinecraftServer.PREPARE_LEVELS_DEFAULT_DELAY_NANOS;
|
||||
- this.executeModerately();
|
||||
- }
|
||||
- }
|
||||
|
@ -46,15 +46,15 @@ index fb2851e94c178f49ee8046176b196c63254907e7..ef6d98d503fdca4322000278de4cf325
|
|||
+ worldserver.addTicketsForSpawn(radiusBlocks, blockposition);
|
||||
+ // Paper end
|
||||
|
||||
// this.nextTickTime = SystemUtils.getMillis() + 10L;
|
||||
// this.nextTickTimeNanos = SystemUtils.getNanos() + MinecraftServer.PREPARE_LEVELS_DEFAULT_DELAY_NANOS;
|
||||
this.executeModerately();
|
||||
// Iterator iterator = this.levels.values().iterator();
|
||||
+ }
|
||||
|
||||
if (true) {
|
||||
ServerLevel worldserver1 = worldserver;
|
||||
@@ -768,7 +771,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// this.nextTickTime = SystemUtils.getMillis() + 10L;
|
||||
@@ -814,7 +817,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// this.nextTickTimeNanos = SystemUtils.getNanos() + MinecraftServer.PREPARE_LEVELS_DEFAULT_DELAY_NANOS;
|
||||
this.executeModerately();
|
||||
// CraftBukkit end
|
||||
- worldloadlistener.stop();
|
||||
|
@ -63,10 +63,10 @@ index fb2851e94c178f49ee8046176b196c63254907e7..ef6d98d503fdca4322000278de4cf325
|
|||
// this.updateMobSpawningFlags();
|
||||
worldserver.setSpawnSettings(this.isSpawningMonsters(), this.isSpawningAnimals());
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 47a1fb476e3825f489fc217ef83fd273b52676a1..dc0a02f08d1c211443f35a10270110791b6fbbcc 100644
|
||||
index a26138470065a720045e3079e5e96d6c4fa765ce..9d269ba80056eec6658501aa8217ee1eadf0aaf3 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1859,12 +1859,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1883,12 +1883,84 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
return ((MapIndex) this.getServer().overworld().getDataStorage().computeIfAbsent(MapIndex.factory(), "idcounts")).getFreeAuxValueForMap();
|
||||
}
|
||||
|
||||
|
@ -191,10 +191,10 @@ index 4d2348df25410a0b5364eec066880326d6667dad..286aad3205ef8a9e21a47ef07893844f
|
|||
this.maxCount = i * i;
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e24c43463b3997549e9a7560a464bdeb8823831e..e790c0c348ad8e2448969516d97a036aeee12fa3 100644
|
||||
index ca02281f12b0d914ad76da57aab56b63bb59d1f1..9cae07b33e1426c17e118fa8648c245753b316e6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1353,15 +1353,21 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1359,15 +1359,21 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public void setKeepSpawnInMemory(boolean keepLoaded) {
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 58ac20547480173f0b4cd4015fe0fb38d2d211ff..53f387da05ed3c9e981cea2141c42fe630b49892 100644
|
||||
index 6f1e2ce0187460f78f7c0d8855f1f8f5cf897089..431750425e90b1e9d6b886e41a6d23d14b26b8ce 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2817,5 +2817,10 @@ public final class CraftServer implements Server {
|
||||
@@ -2849,5 +2849,10 @@ public final class CraftServer implements Server {
|
||||
profile.getProperties().putAll(((CraftPlayer) player).getHandle().getGameProfile().getProperties());
|
||||
return new com.destroystokyo.paper.profile.CraftPlayerProfile(profile);
|
||||
}
|
|
@ -156,10 +156,10 @@ index 42dc999d820e62c6a222afbd9239cc671fc7de53..b850dba2b0fa5bc762b170ed7083cf89
|
|||
} catch (Throwable throwable) {
|
||||
if (dataoutputstream != null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index e790c0c348ad8e2448969516d97a036aeee12fa3..217aac550c3bed7ccb12ed8e8da9294652345d41 100644
|
||||
index 9cae07b33e1426c17e118fa8648c245753b316e6..4b3d04d891edda8c02470bae189fbf17eb4e8a36 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -310,9 +310,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -311,9 +311,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public boolean isChunkGenerated(int x, int z) {
|
||||
|
@ -185,7 +185,7 @@ index e790c0c348ad8e2448969516d97a036aeee12fa3..217aac550c3bed7ccb12ed8e8da92946
|
|||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
@@ -426,20 +440,48 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -427,20 +441,48 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@Override
|
||||
public boolean loadChunk(int x, int z, boolean generate) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot
|
|
@ -25,10 +25,10 @@ P3) Solutions for 1) and especially 2) might not be future-proof, while this
|
|||
server-internal fix makes this change future-proof.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index e5da57b35cd82ee7b4e844cfe74289a71d38779a..24b549cb21926a02d736f0bbb991006b9453068d 100644
|
||||
index fec4897ffc07f71efb8725efea341ba2878a1462..621cb07c02cf318bf1b72c14724a42e0987d5b2f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -165,7 +165,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -185,7 +185,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
||||
Vec3 vec3d = shooter.getDeltaMovement();
|
||||
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] offset item frame ticking
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
index 760e9e96cb567861f40a0b3debb58dc867be4026..66cf0a6cd1525ecf2615809210a26d55f445d07d 100644
|
||||
index 469e4cc75eab1344a159ed5addd53f50cea7bd90..5f4c42c4ba44923cabb873bfad33abc2b1362e73 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -38,7 +38,7 @@ public abstract class HangingEntity extends Entity {
|
|
@ -1,35 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Wed, 17 Oct 2018 19:17:27 -0400
|
||||
Subject: [PATCH] MC-50319: Check other worlds for shooter of projectiles
|
||||
|
||||
Say a player shoots an arrow through a nether portal, the game
|
||||
would lose the shooter for determining things such as Player Kills,
|
||||
because the entity is in another world.
|
||||
|
||||
If the projectile fails to find the shooter in the current world, check
|
||||
other worlds.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index f49dd279ba9e8970f116f956466feb072c4f8420..e5da57b35cd82ee7b4e844cfe74289a71d38779a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -60,6 +60,18 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
return this.cachedOwner;
|
||||
} else if (this.ownerUUID != null && this.level() instanceof ServerLevel) {
|
||||
this.cachedOwner = ((ServerLevel) this.level()).getEntity(this.ownerUUID);
|
||||
+ // Paper start - check all worlds
|
||||
+ if (this.cachedOwner == null) {
|
||||
+ for (final ServerLevel level : this.level().getServer().getAllLevels()) {
|
||||
+ if (level == this.level()) continue;
|
||||
+ final Entity entity = level.getEntity(this.ownerUUID);
|
||||
+ if (entity != null) {
|
||||
+ this.cachedOwner = entity;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
return this.cachedOwner;
|
||||
} else {
|
||||
return null;
|
Loading…
Reference in a new issue