mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-24 01:19:19 +00:00
Update 1.20.4
This commit is contained in:
@@ -142,7 +142,7 @@ index 06648f9751fd8a322d0809ffebf6a544596ee1a4..40e957a4364c8017072dcd81fcb7cf2c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||
index 84fc2adf591f02a14862f7c1cd645c2efde55c3d..8a601f7d10ea985b2383a5be31c0ba8596a16d7b 100644
|
||||
index e464ada187fd1f15efef29a0e5033aeb0c688059..31ae491fdac6e27a3569c8c421cc49e7eab5d4b5 100644
|
||||
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
|
||||
@@ -17,6 +17,7 @@ import javax.annotation.Nullable;
|
||||
@@ -153,7 +153,7 @@ index 84fc2adf591f02a14862f7c1cd645c2efde55c3d..8a601f7d10ea985b2383a5be31c0ba85
|
||||
|
||||
public class CompoundTag implements Tag {
|
||||
public static final Codec<CompoundTag> CODEC = Codec.PASSTHROUGH.comapFlatMap((dynamic) -> {
|
||||
@@ -416,7 +417,7 @@ public class CompoundTag implements Tag {
|
||||
@@ -420,7 +421,7 @@ public class CompoundTag implements Tag {
|
||||
throw new ReportedException(this.createReport(key, ByteArrayTag.TYPE, var3));
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ index 84fc2adf591f02a14862f7c1cd645c2efde55c3d..8a601f7d10ea985b2383a5be31c0ba85
|
||||
}
|
||||
|
||||
public int[] getIntArray(String key) {
|
||||
@@ -428,7 +429,7 @@ public class CompoundTag implements Tag {
|
||||
@@ -432,7 +433,7 @@ public class CompoundTag implements Tag {
|
||||
throw new ReportedException(this.createReport(key, IntArrayTag.TYPE, var3));
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ index 84fc2adf591f02a14862f7c1cd645c2efde55c3d..8a601f7d10ea985b2383a5be31c0ba85
|
||||
}
|
||||
|
||||
public long[] getLongArray(String key) {
|
||||
@@ -440,7 +441,7 @@ public class CompoundTag implements Tag {
|
||||
@@ -444,7 +445,7 @@ public class CompoundTag implements Tag {
|
||||
throw new ReportedException(this.createReport(key, LongArrayTag.TYPE, var3));
|
||||
}
|
||||
|
||||
@@ -227,10 +227,10 @@ index b0517b9483a8cfd74997f89efdc0d8559b80ae4a..e7cfc98aa6dc19c5adad4c797ae7292a
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 7e5712f0fffe2a8606c47bdfe4bfa5191aaf5bfc..3579766177a5ad627fef0ba27948e962d1140415 100644
|
||||
index 49bed177db75c73f09dfd6b48dc88ae3432f5e84..4b3c4e8b404ee8fca48ceb333438a1ecb70c5cb3 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -172,6 +172,7 @@ import org.bukkit.event.weather.LightningStrikeEvent;
|
||||
@@ -178,6 +178,7 @@ import org.bukkit.event.world.GenericGameEvent;
|
||||
import org.bukkit.event.world.TimeSkipEvent;
|
||||
// CraftBukkit end
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList; // Paper
|
||||
@@ -238,16 +238,16 @@ index 7e5712f0fffe2a8606c47bdfe4bfa5191aaf5bfc..3579766177a5ad627fef0ba27948e962
|
||||
|
||||
public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
@@ -1047,7 +1048,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1070,7 +1071,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ);
|
||||
BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw);
|
||||
|
||||
- iblockdata.randomTick(this, blockposition2, this.randomTickRandom);
|
||||
+ iblockdata.randomTick(this, blockposition2.immutable(), this.randomTickRandom); // Leaves - reduce array allocations
|
||||
// We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
|
||||
// TODO CHECK ON UPDATE (ping the Canadian)
|
||||
}
|
||||
@@ -1348,7 +1349,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
|
||||
// TODO CHECK ON UPDATE (ping the Canadian)
|
||||
@@ -1376,7 +1377,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
public static List<Entity> getCurrentlyTickingEntities() {
|
||||
Entity ticking = currentlyTickingEntity.get();
|
||||
@@ -257,10 +257,10 @@ index 7e5712f0fffe2a8606c47bdfe4bfa5191aaf5bfc..3579766177a5ad627fef0ba27948e962
|
||||
return ret;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 55e9f1e3124ee1c876ed37cf291df77ac0ee596c..afbefe01fe7b4a129d8bd471658d5ee64507477e 100644
|
||||
index 6ecfad2ef86a6d2cd280c847e159977285999134..9e1e99a5afa972527d036a32339b571816b325fe 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -239,6 +239,7 @@ import org.bukkit.inventory.EquipmentSlot;
|
||||
@@ -243,6 +243,7 @@ import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.SmithingInventory;
|
||||
// CraftBukkit end
|
||||
@@ -268,7 +268,7 @@ index 55e9f1e3124ee1c876ed37cf291df77ac0ee596c..afbefe01fe7b4a129d8bd471658d5ee6
|
||||
|
||||
public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl implements ServerGamePacketListener, ServerPlayerConnection, TickablePacketListener {
|
||||
|
||||
@@ -780,13 +781,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -783,13 +784,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
|
||||
// CraftBukkit start
|
||||
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
|
||||
@@ -284,7 +284,7 @@ index 55e9f1e3124ee1c876ed37cf291df77ac0ee596c..afbefe01fe7b4a129d8bd471658d5ee6
|
||||
return;
|
||||
}
|
||||
// Paper end
|
||||
@@ -3200,7 +3201,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -3202,7 +3203,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
// Paper start
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||
@@ -294,10 +294,10 @@ index 55e9f1e3124ee1c876ed37cf291df77ac0ee596c..afbefe01fe7b4a129d8bd471658d5ee6
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 1c4f272219e68373eaae93fc5ea9af7d8f3fd6f9..e6834c3388cba6d014871efb3ab2b9538ca18c3f 100644
|
||||
index 89b3184be952fd0803520dd0f717f3acfc3cb496..adf510f28ce9a9c83821e23e0e46dfc32659c6a7 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -43,6 +43,7 @@ import org.bukkit.craftbukkit.util.Waitable;
|
||||
@@ -44,6 +44,7 @@ import org.bukkit.craftbukkit.util.Waitable;
|
||||
import org.bukkit.event.player.AsyncPlayerPreLoginEvent;
|
||||
import org.bukkit.event.player.PlayerPreLoginEvent;
|
||||
// CraftBukkit end
|
||||
@@ -305,20 +305,18 @@ index 1c4f272219e68373eaae93fc5ea9af7d8f3fd6f9..e6834c3388cba6d014871efb3ab2b953
|
||||
|
||||
public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, TickablePacketListener {
|
||||
|
||||
@@ -157,8 +158,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -138,8 +139,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
|
||||
@Override
|
||||
public void handleHello(ServerboundHelloPacket packet) {
|
||||
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
|
||||
- Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]);
|
||||
+ // Gale start - JettPack - reduce array allocations
|
||||
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", ArrayConstants.emptyObjectArray);
|
||||
+ Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", ArrayConstants.emptyObjectArray);
|
||||
+ // Gale end - JettPack - reduce array allocations
|
||||
// Paper start - validate usernames
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
|
||||
if (!this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation && !validateUsername(packet.name())) {
|
||||
@@ -251,7 +254,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
- if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) Validate.validState(Player.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]); // Paper - config username validation
|
||||
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", ArrayConstants.emptyObjectArray); // Leaves - reduce array allocations
|
||||
+ if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation && !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) Validate.validState(Player.isValidUsername(packet.name()), "Invalid characters in username", ArrayConstants.emptyObjectArray); // Paper - config username validation // Leaves - reduce array allocations
|
||||
this.requestedUsername = packet.name();
|
||||
GameProfile gameprofile = this.server.getSingleplayerProfile();
|
||||
|
||||
@@ -218,7 +219,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
|
||||
@Override
|
||||
public void handleKey(ServerboundKeyPacket packet) {
|
||||
@@ -328,18 +326,18 @@ index 1c4f272219e68373eaae93fc5ea9af7d8f3fd6f9..e6834c3388cba6d014871efb3ab2b953
|
||||
final String s;
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 683691fa61d02be951a0f759b1983ce9c5cd3863..1bc21038e33faa9c1f24acedabeb84741e31de05 100644
|
||||
index 2818f21777560f271379884e0cf3ef26bd99196a..cd962621ee0d8bd17926a90ce960c46f1ae5a8dd 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -123,6 +123,7 @@ import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent.RespawnReason;
|
||||
// CraftBukkit end
|
||||
@@ -122,6 +122,7 @@ import org.bukkit.event.player.PlayerSpawnChangeEvent;
|
||||
|
||||
+import top.leavesmc.leaves.util.ArrayConstants;
|
||||
import top.leavesmc.leaves.bot.ServerBot;
|
||||
import top.leavesmc.leaves.util.ReturnPortalManager; // Leaves - return portal fix
|
||||
+import top.leavesmc.leaves.util.ArrayConstants;
|
||||
|
||||
public abstract class PlayerList {
|
||||
@@ -736,7 +737,7 @@ public abstract class PlayerList {
|
||||
|
||||
@@ -734,7 +735,7 @@ public abstract class PlayerList {
|
||||
while (iterator.hasNext()) {
|
||||
entityplayer = (ServerPlayer) iterator.next();
|
||||
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
|
||||
@@ -349,10 +347,10 @@ index 683691fa61d02be951a0f759b1983ce9c5cd3863..1bc21038e33faa9c1f24acedabeb8474
|
||||
|
||||
// Instead of kicking then returning, we need to store the kick reason
|
||||
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
index 09fc086548b9d0f97849f56f41e3a5be87f5091a..455efedffb3301a9883107dc35499f493a06a4ef 100644
|
||||
index 665120a62525f56912263a3e1b6f12f6c3e15dec..7fd220838520bf0f971d6fbe6d9286592d590253 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
@@ -27,6 +27,7 @@ import javax.annotation.Nullable;
|
||||
@@ -25,6 +25,7 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.util.GsonHelper;
|
||||
import org.slf4j.Logger;
|
||||
@@ -360,7 +358,7 @@ index 09fc086548b9d0f97849f56f41e3a5be87f5091a..455efedffb3301a9883107dc35499f49
|
||||
|
||||
public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
|
||||
@@ -96,7 +97,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
@@ -79,7 +80,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
}
|
||||
|
||||
public String[] getUserList() {
|
||||
@@ -398,10 +396,10 @@ index 2e324276ea4cd9e528c6a3f9a9ba394b378fe075..8d949983a30f27a60982f6b406151408
|
||||
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) {
|
||||
this.type = type;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index eea0eb67b3f74574d8dcd8cad30394f3a49cb2cd..8360805905810eae915a61b2e41aedf232c106da 100644
|
||||
index c5be586d14751991c95626adb76d7a99612f7daa..2b34c1b58bc0f25462834bdc2e79c6936553729b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -3146,7 +3146,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -3143,7 +3143,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@Nullable
|
||||
private Map<EquipmentSlot, ItemStack> collectEquipmentChanges() {
|
||||
Map<EquipmentSlot, ItemStack> map = null;
|
||||
@@ -411,10 +409,10 @@ index eea0eb67b3f74574d8dcd8cad30394f3a49cb2cd..8360805905810eae915a61b2e41aedf2
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 115c25ec168145ae78797eeed830de66aa4546b1..c233c1e9f3162e6835d02ec1f3ef8267f8f1d7b2 100644
|
||||
index 339782b10101189fdf70d41330d2e793713d1544..a4193814174821614e8c47d7662d567a352102bc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -1081,7 +1081,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1082,7 +1082,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@Override
|
||||
protected void dropCustomDeathLoot(DamageSource source, int lootingMultiplier, boolean allowDrops) {
|
||||
super.dropCustomDeathLoot(source, lootingMultiplier, allowDrops);
|
||||
@@ -423,7 +421,7 @@ index 115c25ec168145ae78797eeed830de66aa4546b1..c233c1e9f3162e6835d02ec1f3ef8267
|
||||
int j = aenumitemslot.length;
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
@@ -1143,7 +1143,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1144,7 +1144,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
}
|
||||
|
||||
boolean flag = true;
|
||||
@@ -432,7 +430,7 @@ index 115c25ec168145ae78797eeed830de66aa4546b1..c233c1e9f3162e6835d02ec1f3ef8267
|
||||
int j = aenumitemslot.length;
|
||||
|
||||
for (int k = 0; k < j; ++k) {
|
||||
@@ -1230,7 +1230,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1231,7 +1231,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
float f = localDifficulty.getSpecialMultiplier();
|
||||
|
||||
this.enchantSpawnedWeapon(random, f);
|
||||
@@ -441,7 +439,7 @@ index 115c25ec168145ae78797eeed830de66aa4546b1..c233c1e9f3162e6835d02ec1f3ef8267
|
||||
int i = aenumitemslot.length;
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
@@ -1449,7 +1449,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -1450,7 +1450,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
t0.setInvulnerable(this.isInvulnerable());
|
||||
if (flag) {
|
||||
t0.setCanPickUpLoot(this.canPickUpLoot());
|
||||
@@ -464,10 +462,10 @@ index 94396ad1a3c280787d36c6c18256d10340ace488..ae0de0d0cb970a10a8a612cf34810a36
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index a314d3aa9b2cf22bc34ac54ba1552138ad39191a..e46f323e0b11bc22b7c4c07f313cbba501eb0cc0 100644
|
||||
index fdfbca595e5bff701bf6d9dd7990d67fbb16795f..c85ae98b7d50e7f08035417d2f4d43099c02041c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -1027,7 +1027,7 @@ public final class ItemStack {
|
||||
@@ -1052,7 +1052,7 @@ public final class ItemStack {
|
||||
int k;
|
||||
|
||||
if (ItemStack.shouldShowInTooltip(i, ItemStack.TooltipPart.MODIFIERS)) {
|
||||
@@ -477,10 +475,10 @@ index a314d3aa9b2cf22bc34ac54ba1552138ad39191a..e46f323e0b11bc22b7c4c07f313cbba5
|
||||
k = aenumitemslot.length;
|
||||
|
||||
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 17bef91546fa85d401b263c3a69fbf464f290eca..131d9b730f1c3dfa4c8c4a63a6567fe3ebd6191e 100644
|
||||
index d772cf80fa3831e1c79d601ea09a073da089e2c5..4699f5fd794a7ef1f430e801bd35f1c62452aa8e 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/crafting/ShapedRecipe.java
|
||||
@@ -25,6 +25,7 @@ import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
@@ -16,6 +16,7 @@ import org.bukkit.craftbukkit.inventory.CraftRecipe;
|
||||
import org.bukkit.craftbukkit.inventory.CraftShapedRecipe;
|
||||
import org.bukkit.inventory.RecipeChoice;
|
||||
// CraftBukkit end
|
||||
@@ -488,37 +486,28 @@ index 17bef91546fa85d401b263c3a69fbf464f290eca..131d9b730f1c3dfa4c8c4a63a6567fe3
|
||||
|
||||
public class ShapedRecipe extends io.papermc.paper.inventory.recipe.RecipeBookExactChoiceRecipe<CraftingContainer> implements CraftingRecipe { // Paper - improve exact recipe choices
|
||||
|
||||
@@ -226,7 +227,7 @@ public class ShapedRecipe extends io.papermc.paper.inventory.recipe.RecipeBookEx
|
||||
}
|
||||
|
||||
if (pattern.size() == l) {
|
||||
- return new String[0];
|
||||
+ return ArrayConstants.emptyStringArray; // Leaves - reduce array allocations
|
||||
} else {
|
||||
String[] astring = new String[pattern.size() - l - k];
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
|
||||
index 2bfbdaeb2b0d99dfd956cd5936403fe8b0eeae64..7ad1545631604aa55f6d4fbdcbaefe6dc647f35c 100644
|
||||
index 6c2e8049c2197ddc912c1a0fc99c87beae81e25b..be13baa7b51c4ad377b50d8ca8f7cfad3c870390 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/enchantment/Enchantments.java
|
||||
@@ -44,8 +44,10 @@ public class Enchantments {
|
||||
public static final Enchantment MULTISHOT = Enchantments.register("multishot", new MultiShotEnchantment(Enchantment.Rarity.RARE, new EquipmentSlot[]{EquipmentSlot.MAINHAND}));
|
||||
public static final Enchantment QUICK_CHARGE = Enchantments.register("quick_charge", new QuickChargeEnchantment(Enchantment.Rarity.UNCOMMON, new EquipmentSlot[]{EquipmentSlot.MAINHAND}));
|
||||
public static final Enchantment PIERCING = Enchantments.register("piercing", new ArrowPiercingEnchantment(Enchantment.Rarity.COMMON, new EquipmentSlot[]{EquipmentSlot.MAINHAND}));
|
||||
- public static final Enchantment MENDING = Enchantments.register("mending", new MendingEnchantment(Enchantment.Rarity.RARE, EquipmentSlot.values()));
|
||||
- public static final Enchantment VANISHING_CURSE = Enchantments.register("vanishing_curse", new VanishingCurseEnchantment(Enchantment.Rarity.VERY_RARE, EquipmentSlot.values()));
|
||||
@@ -43,8 +43,10 @@ public class Enchantments {
|
||||
public static final Enchantment MULTISHOT = register("multishot", new MultiShotEnchantment(Enchantment.Rarity.RARE, EquipmentSlot.MAINHAND));
|
||||
public static final Enchantment QUICK_CHARGE = register("quick_charge", new QuickChargeEnchantment(Enchantment.Rarity.UNCOMMON, EquipmentSlot.MAINHAND));
|
||||
public static final Enchantment PIERCING = register("piercing", new ArrowPiercingEnchantment(Enchantment.Rarity.COMMON, EquipmentSlot.MAINHAND));
|
||||
- public static final Enchantment MENDING = register("mending", new MendingEnchantment(Enchantment.Rarity.RARE, EquipmentSlot.values()));
|
||||
- public static final Enchantment VANISHING_CURSE = register("vanishing_curse", new VanishingCurseEnchantment(Enchantment.Rarity.VERY_RARE, EquipmentSlot.values()));
|
||||
+ // Leaves start - reduce array allocations
|
||||
+ public static final Enchantment MENDING = Enchantments.register("mending", new MendingEnchantment(Enchantment.Rarity.RARE, EquipmentSlot.VALUES));
|
||||
+ public static final Enchantment VANISHING_CURSE = Enchantments.register("vanishing_curse", new VanishingCurseEnchantment(Enchantment.Rarity.VERY_RARE, EquipmentSlot.VALUES));
|
||||
+ // Leaves end - reduce array allocations
|
||||
|
||||
public Enchantments() {}
|
||||
|
||||
private static Enchantment register(String name, Enchantment enchantment) {
|
||||
return Registry.register(BuiltInRegistries.ENCHANTMENT, name, enchantment);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index cdfeb7f87efdfe689a43b3d13656c8f682b5400e..cabd335e0a52e992bb2e1fbd3215ee10715c993b 100644
|
||||
index 614c37b11f7820bedc576fce74829c1950ed7756..302f0f5c3a8137e1eb1b90a25e92e82e308c02c4 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -94,6 +94,7 @@ import org.bukkit.craftbukkit.util.CraftSpawnCategory;
|
||||
@@ -97,6 +97,7 @@ import org.bukkit.craftbukkit.util.CraftSpawnCategory;
|
||||
import org.bukkit.entity.SpawnCategory;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
// CraftBukkit end
|
||||
@@ -526,7 +515,7 @@ index cdfeb7f87efdfe689a43b3d13656c8f682b5400e..cabd335e0a52e992bb2e1fbd3215ee10
|
||||
|
||||
public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@@ -1828,7 +1829,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1848,7 +1849,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
|
||||
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
|
||||
if (slices == null) {
|
||||
@@ -536,10 +525,10 @@ index cdfeb7f87efdfe689a43b3d13656c8f682b5400e..cabd335e0a52e992bb2e1fbd3215ee10
|
||||
return slices.getChunkEntities();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
index 10d3912ef043eefdf89105332e29b0d2bf4a5539..3bc33b552743be03c6b895e0d217152a65454807 100644
|
||||
index de8b5cab7925c1c46478952ed2cb2bd40f9a9c48..3ea1c2a9a3e6dfb65d95b5ed92d21f401a1c0cd2 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
|
||||
@@ -43,6 +43,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
@@ -44,6 +44,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import org.bukkit.craftbukkit.inventory.CraftBlockInventoryHolder;
|
||||
import org.bukkit.craftbukkit.util.DummyGeneratorAccess;
|
||||
// CraftBukkit end
|
||||
@@ -547,7 +536,7 @@ index 10d3912ef043eefdf89105332e29b0d2bf4a5539..3bc33b552743be03c6b895e0d217152a
|
||||
|
||||
public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
|
||||
@@ -415,7 +416,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -422,7 +423,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(Direction side) {
|
||||
@@ -556,7 +545,7 @@ index 10d3912ef043eefdf89105332e29b0d2bf4a5539..3bc33b552743be03c6b895e0d217152a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -464,7 +465,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -471,7 +472,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(Direction side) {
|
||||
@@ -565,7 +554,7 @@ index 10d3912ef043eefdf89105332e29b0d2bf4a5539..3bc33b552743be03c6b895e0d217152a
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -506,7 +507,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
@@ -513,7 +514,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(Direction side) {
|
||||
@@ -596,10 +585,10 @@ index eeed0ccbf0fc04e12dea5e8602f67d862fbd3600..0caf6040c2da342971c37a9af5d83f32
|
||||
private static final int[] SLOTS_FOR_SIDES = new int[]{1};
|
||||
public static final int DATA_LIT_DURATION = 1;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
index 36af81f0957d17e170d229059c66f4eb4539dfeb..487d09aaadd9cf1b239cf9773fa71cbff6e6a77e 100644
|
||||
index b3a90d6ef0e17c236e0b3c46e2d0012671afdaa7..f273d6ab29d8c2a36a4a00ef341d2a8e7ce3e8c3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
|
||||
@@ -9,7 +9,6 @@ import net.minecraft.nbt.CompoundTag;
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.nbt.NbtAccounter;
|
||||
import net.minecraft.nbt.NbtIo;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -607,7 +596,7 @@ index 36af81f0957d17e170d229059c66f4eb4539dfeb..487d09aaadd9cf1b239cf9773fa71cbf
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -18,6 +17,7 @@ import java.io.FileInputStream;
|
||||
@@ -21,6 +20,7 @@ import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import org.bukkit.craftbukkit.entity.CraftPlayer;
|
||||
// CraftBukkit end
|
||||
@@ -615,7 +604,7 @@ index 36af81f0957d17e170d229059c66f4eb4539dfeb..487d09aaadd9cf1b239cf9773fa71cbf
|
||||
|
||||
public class PlayerDataStorage {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class PlayerDataStorage {
|
||||
@@ -124,7 +124,7 @@ public class PlayerDataStorage {
|
||||
String[] astring = this.playerDir.list();
|
||||
|
||||
if (astring == null) {
|
||||
|
||||
Reference in New Issue
Block a user