9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0047-Reduce-array-allocations.patch
Dreeam acc71b20a9 Updated Upstream (Paper/Purpur)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@89cdcba5 [ci/skip] Replace wiki mention for BlockType#isOccluding (#12446)
PaperMC/Paper@5f0b8292 Re-add chunk position check to regionfile recalculation patch
PaperMC/Paper@04b91129 Update projects dependents GitHub Action (#12436)
PaperMC/Paper@def0532f Fix writing headers and update to be more papery (#12459)
PaperMC/Paper@d22644aa Expand cooldown API (#12435)
PaperMC/Paper@df429932 Fix floating warning log when the kick event is canceled (#12374)
PaperMC/Paper@a820bdae [ci/skip] Some javadoc fixes
PaperMC/Paper@55f20209 Fix CCE in LingeringPotionSplashEvent (#12463)
PaperMC/Paper@1410a22b Fix passengers sending when riding players
PaperMC/Paper@767868dd Fix some components (#12457)
PaperMC/Paper@9cddf136 Fix portal create event block list (#12373)
PaperMC/Paper@a112d370 Fix horse_variant and tropical_fish_pattern (#12472)
PaperMC/Paper@a211ac2e Remove unused warning (#12478)
PaperMC/Paper@ae512811 Add isSuffocating to Block and BlockState (#12445)
PaperMC/Paper@3409e2d7 Mace was not included in the ENCHANTABLE MaterialSetTag (#12476)
PaperMC/Paper@1cfc96bc Add keyStream() API to registries (#12479)
PaperMC/Paper@3222985e [ci/skip] Rebuild patches
PaperMC/Paper@deaccd2c [ci/skip] Add file reference url to help.yml (#12481)
PaperMC/Paper@f86b4352 Add vault change state event (#12069)
PaperMC/Paper@3e3b42cd Update player chat session sync (#12382)
PaperMC/Paper@f8fa4f6f Add method to retrieve FishHook (#12310)
PaperMC/Paper@b9d3147d Use correct placed block position for sound (#12410)
PaperMC/Paper@952338b3 [ci/skip] Add missing exception docs to Player#listPlayer (#12488)
PaperMC/Paper@1db37853 [ci/skip] improve javadoc for off-hand swaps through getHotbarButton (#12489)
PaperMC/Paper@d1810f24 Allow Server#getDefaultGameMode before worlds are initialized (#12490)
PaperMC/Paper@02d20ff7 Fix NPE in Server#getMap before worlds are loaded (#12492)
PaperMC/Paper@9e873f50 Fix inconsistencies between offline/online spawn position getter (#11960)
PaperMC/Paper@fc0c3717 Fix handling of resultant crafting container from craftItemResult (#12307)
PaperMC/Paper@a7a76c8f Add methods for Armadillo (#12031)
PaperMC/Paper@a74400d9 Update adventure to 4.21.0 (#12499)
PaperMC/Paper@1e930763 Fix ipv6 loopback addresses being able to get connection throttled (#12155)
PaperMC/Paper@646b80ca Fix unnecessary map data saves (#12296)
PaperMC/Paper@e663f999 Add combat tracker API (#11853)
PaperMC/Paper@cd4fe5b7 [ci/skip] Drop non-applicable ATs (#12498)
PaperMC/Paper@5acfdd6a Fix save/load NaN Entity Motion (#12269)
PaperMC/Paper@2754d7c3 Add Throw EntityChangeBlockEvent for BrushableBlockEntity#brush (#12133)
PaperMC/Paper@567f63ae Parity for respawn events (#11792)
PaperMC/Paper@bc3d946f Normalizes CraftEntity#toString/getHandle (#12170)
PaperMC/Paper@0e9b94d5 Fix ItemStack amount issues with Chat Components (#12216)
PaperMC/Paper@835b9559 Add a method on InventoryView to get the MenuType (#12193)
PaperMC/Paper@c9411bfb Fix min ItemStack amount check for asHoverEvent (#12505)
PaperMC/Paper@1acf3b38 Infer block entity data in brigadier blockstate argument (#12197)
PaperMC/Paper@b9b3cd65 Use components instead of ChatColor in more places  (#12507)
PaperMC/Paper@ec421715 Add missing spaces back (#12508)

Purpur Changes:
PurpurMC/Purpur@c3870bda Updated Upstream (Paper)
PurpurMC/Purpur@8b5044e0 [ci/skip] add idea project icon
PurpurMC/Purpur@f2f682fb Updated Upstream (Paper)
PurpurMC/Purpur@bdeba761 Updated Upstream (Paper)
PurpurMC/Purpur@96f5b044 drop void damage height/damage migration
PurpurMC/Purpur@6cc78b63 Updated Upstream (Paper)
PurpurMC/Purpur@4ce97c1d [ci/skip] Update occurences of version numbers to 1.21.5 (#1658)
PurpurMC/Purpur@7f5c4036 Updated Upstream (Paper)
PurpurMC/Purpur@4fdf1d11 Updated Upstream (Paper)
PurpurMC/Purpur@8c77678e Updated Upstream (Paper)
2025-05-02 03:10:20 -04:00

304 lines
18 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Sat, 26 Nov 2022 11:25:45 +0100
Subject: [PATCH] Reduce array allocations
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"reduce allocs"
By: Simon Gardling <titaniumtown@gmail.com>
As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
index ba20e87d2105ce53cdaf4049de2388d05fcd1b56..7b686d834e4eb36be5758b0e0a846a70d1e2294b 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
@@ -378,7 +378,6 @@ public final class ChunkEntitySlices {
private static final class BasicEntityList<E extends Entity> {
- private static final Entity[] EMPTY = new Entity[0];
private static final int DEFAULT_CAPACITY = 4;
private E[] storage;
@@ -389,7 +388,7 @@ public final class ChunkEntitySlices {
}
public BasicEntityList(final int cap) {
- this.storage = (E[])(cap <= 0 ? EMPTY : new Entity[cap]);
+ this.storage = (E[])(cap <= 0 ? me.titaniumtown.ArrayConstants.emptyEntityArray : new Entity[cap]);// Gale - JettPack - reduce array allocations
}
public boolean isEmpty() {
@@ -401,7 +400,7 @@ public final class ChunkEntitySlices {
}
private void resize() {
- if (this.storage == EMPTY) {
+ if (this.storage == me.titaniumtown.ArrayConstants.emptyEntityArray) { // Gale - JettPack - reduce array allocations
this.storage = (E[])new Entity[DEFAULT_CAPACITY];
} else {
this.storage = Arrays.copyOf(this.storage, this.storage.length * 2);
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
index 26207443b1223119c03db478d7e816d9cdf8e618..bbd1c262674b42eb9ea2830acb8bf94182f971f9 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
@@ -14,10 +14,8 @@ import net.minecraft.world.level.entity.LevelCallback;
public final class ServerEntityLookup extends EntityLookup {
- private static final Entity[] EMPTY_ENTITY_ARRAY = new Entity[0];
-
private final ServerLevel serverWorld;
- public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
+ public final ReferenceList<Entity> trackerEntities = new ReferenceList<>(me.titaniumtown.ArrayConstants.emptyEntityArray); // Moonrise - entity tracker // Gale - JettPack - reduce array allocations
public ServerEntityLookup(final ServerLevel world, final LevelCallback<Entity> worldCallback) {
super(world, worldCallback);
diff --git a/net/minecraft/nbt/ByteArrayTag.java b/net/minecraft/nbt/ByteArrayTag.java
index 6fbb131b472a3093b137d8ced9889777a133bd5b..cecfd48f57bc11b84c18b4e5a723228fd3c18e23 100644
--- a/net/minecraft/nbt/ByteArrayTag.java
+++ b/net/minecraft/nbt/ByteArrayTag.java
@@ -144,7 +144,7 @@ public final class ByteArrayTag implements CollectionTag {
@Override
public void clear() {
- this.data = new byte[0];
+ this.data = me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
}
@Override
diff --git a/net/minecraft/nbt/IntArrayTag.java b/net/minecraft/nbt/IntArrayTag.java
index a8ea2aeb5a02903a37376fb78b49c10745147411..e50bbf1318e9f16f83723eab1389c189baf840a2 100644
--- a/net/minecraft/nbt/IntArrayTag.java
+++ b/net/minecraft/nbt/IntArrayTag.java
@@ -151,7 +151,7 @@ public final class IntArrayTag implements CollectionTag {
@Override
public void clear() {
- this.data = new int[0];
+ this.data = me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
}
@Override
diff --git a/net/minecraft/nbt/LongArrayTag.java b/net/minecraft/nbt/LongArrayTag.java
index c90024aecb4b2424b3ef37194b0686734ab43db9..fd8a4bfe065698ea320800bc2b22474b1c5c4ca9 100644
--- a/net/minecraft/nbt/LongArrayTag.java
+++ b/net/minecraft/nbt/LongArrayTag.java
@@ -150,7 +150,7 @@ public final class LongArrayTag implements CollectionTag {
@Override
public void clear() {
- this.data = new long[0];
+ this.data = me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
}
@Override
diff --git a/net/minecraft/network/CipherBase.java b/net/minecraft/network/CipherBase.java
index 121685cacef111fbec0057d386f748497bc3a36d..b4a4fafec1a8e279ec1e31e58fee2d5d34fb8289 100644
--- a/net/minecraft/network/CipherBase.java
+++ b/net/minecraft/network/CipherBase.java
@@ -7,8 +7,8 @@ import javax.crypto.ShortBufferException;
public class CipherBase {
private final Cipher cipher;
- private byte[] heapIn = new byte[0];
- private byte[] heapOut = new byte[0];
+ private byte[] heapIn = me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
+ private byte[] heapOut = me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
protected CipherBase(Cipher cipher) {
this.cipher = cipher;
diff --git a/net/minecraft/network/chat/contents/TranslatableContents.java b/net/minecraft/network/chat/contents/TranslatableContents.java
index 8ef16f98996b1ec0c9c3f158248ac95f1b07328f..6780b2493d625603b74e635c4996bb8303ce5b9a 100644
--- a/net/minecraft/network/chat/contents/TranslatableContents.java
+++ b/net/minecraft/network/chat/contents/TranslatableContents.java
@@ -29,7 +29,7 @@ import net.minecraft.util.ExtraCodecs;
import net.minecraft.world.entity.Entity;
public class TranslatableContents implements ComponentContents {
- public static final Object[] NO_ARGS = new Object[0];
+ public static final Object[] NO_ARGS = me.titaniumtown.ArrayConstants.emptyObjectArray; // Gale - JettPack - reduce array allocations
private static final Codec<Object> PRIMITIVE_ARG_CODEC = ExtraCodecs.JAVA.validate(TranslatableContents::filterAllowedArguments);
private static final Codec<Object> ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC)
.xmap(
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
index b127f444b79ef9430121045f328dd77b6b8182b2..3d476a93ecf3b12012db92ef07c0a899aac93388 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
@@ -1220,7 +1220,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get();
- List<Entity> ret = java.util.Arrays.asList(ticking == null ? new Entity[0] : new Entity[] { ticking });
+ List<Entity> ret = java.util.Arrays.asList(ticking == null ? me.titaniumtown.ArrayConstants.emptyEntityArray : new Entity[] { ticking }); // Gale - JettPack - reduce array allocations
return ret;
}
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d8e66642bb33dc00d2e410c2739c0291777c88bc..096354ff2e65321b46bffefc91c0c47d2b114526 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2769,7 +2769,7 @@ public class ServerGamePacketListenerImpl
// SPIGOT-7136 - Allays
if (target instanceof net.minecraft.world.entity.animal.allay.Allay || target instanceof net.minecraft.world.entity.animal.horse.AbstractHorse) { // Paper - Fix horse armor desync
ServerGamePacketListenerImpl.this.send(new net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket(
- target.getId(), java.util.Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values())
+ target.getId(), java.util.Arrays.stream(net.minecraft.world.entity.EquipmentSlot.VALUES_ARRAY) // Gale - JettPack - reduce array allocations
.map((slot) -> com.mojang.datafixers.util.Pair.of(slot, ((LivingEntity) target).getItemBySlot(slot).copy()))
.collect(Collectors.toList()), true)); // Paper - sanitize
}
diff --git a/net/minecraft/server/players/StoredUserList.java b/net/minecraft/server/players/StoredUserList.java
index d445e8f126f077d8419c52fa5436ea963a1a42a4..39483f7b453d6faedeccc1ab1eda76669395ea5a 100644
--- a/net/minecraft/server/players/StoredUserList.java
+++ b/net/minecraft/server/players/StoredUserList.java
@@ -70,7 +70,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
}
public String[] getUserList() {
- return this.map.keySet().toArray(new String[0]);
+ return this.map.keySet().toArray(me.titaniumtown.ArrayConstants.emptyStringArray); // Gale - JettPack - reduce array allocations
}
public boolean isEmpty() {
diff --git a/net/minecraft/util/ZeroBitStorage.java b/net/minecraft/util/ZeroBitStorage.java
index 09fd99c9cbd23b5f3c899bfb00c9b89651948ed8..5c1103ef028e5ffe6ce0eadc861dd3b2c8f3ed9f 100644
--- a/net/minecraft/util/ZeroBitStorage.java
+++ b/net/minecraft/util/ZeroBitStorage.java
@@ -5,7 +5,7 @@ import java.util.function.IntConsumer;
import org.apache.commons.lang3.Validate;
public class ZeroBitStorage implements BitStorage {
- public static final long[] RAW = new long[0];
+ public static final long[] RAW = me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
private final int size;
public ZeroBitStorage(int size) {
diff --git a/net/minecraft/world/entity/EquipmentSlot.java b/net/minecraft/world/entity/EquipmentSlot.java
index 0e44397c9d53ff30a96c9e8e392a363fa9ae0c55..dbf31389f0e9796c80afbffddf6a20cbaf184e6e 100644
--- a/net/minecraft/world/entity/EquipmentSlot.java
+++ b/net/minecraft/world/entity/EquipmentSlot.java
@@ -20,9 +20,12 @@ public enum EquipmentSlot implements StringRepresentable {
SADDLE(EquipmentSlot.Type.SADDLE, 0, 1, 7, "saddle");
public static final int NO_COUNT_LIMIT = 0;
- public static final List<EquipmentSlot> VALUES = List.of(values());
- public static final IntFunction<EquipmentSlot> BY_ID = ByIdMap.continuous(equipmentSlot -> equipmentSlot.id, values(), ByIdMap.OutOfBoundsStrategy.ZERO);
- public static final StringRepresentable.EnumCodec<EquipmentSlot> CODEC = StringRepresentable.fromEnum(EquipmentSlot::values);
+ // Gale start - JettPack - reduce array allocations
+ public static final EquipmentSlot[] VALUES_ARRAY = values();
+ public static final List<EquipmentSlot> VALUES = List.of(VALUES_ARRAY);
+ public static final IntFunction<EquipmentSlot> BY_ID = ByIdMap.continuous(equipmentSlot -> equipmentSlot.id, VALUES_ARRAY, ByIdMap.OutOfBoundsStrategy.ZERO);
+ public static final StringRepresentable.EnumCodec<EquipmentSlot> CODEC = StringRepresentable.fromEnum(() -> VALUES_ARRAY);
+ // Gale end - JettPack - reduce array allocations
public static final StreamCodec<ByteBuf, EquipmentSlot> STREAM_CODEC = ByteBufCodecs.idMapper(BY_ID, equipmentSlot -> equipmentSlot.id);
private final EquipmentSlot.Type type;
private final int index;
diff --git a/net/minecraft/world/entity/EquipmentSlotGroup.java b/net/minecraft/world/entity/EquipmentSlotGroup.java
index 381e0a1c0af7e339713ed1df1c2f21121c1bbd0f..4e847c3f9d761da5dda11dec60582d9d9e630b37 100644
--- a/net/minecraft/world/entity/EquipmentSlotGroup.java
+++ b/net/minecraft/world/entity/EquipmentSlotGroup.java
@@ -24,6 +24,7 @@ public enum EquipmentSlotGroup implements StringRepresentable, Iterable<Equipmen
BODY(9, "body", EquipmentSlot.BODY),
SADDLE(10, "saddle", EquipmentSlot.SADDLE);
+ public static final EquipmentSlotGroup[] VALUES_ARRAY = EquipmentSlotGroup.values(); // Gale - JettPack - reduce array allocations
public static final IntFunction<EquipmentSlotGroup> BY_ID = ByIdMap.continuous(
equipmentSlotGroup -> equipmentSlotGroup.id, values(), ByIdMap.OutOfBoundsStrategy.ZERO
);
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
index 24ecca78dc1140b6fc47d59f2acefca6bc2b0220..18bddc3db6f0e06f1811f2c409f207db2f462f63 100644
--- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java
@@ -1173,7 +1173,7 @@ public final class ItemStack implements DataComponentHolder {
private void addAttributeTooltips(Consumer<Component> tooltipAdder, TooltipDisplay tooltipDisplay, @Nullable Player player) {
if (tooltipDisplay.shows(DataComponents.ATTRIBUTE_MODIFIERS)) {
- for (EquipmentSlotGroup equipmentSlotGroup : EquipmentSlotGroup.values()) {
+ for (EquipmentSlotGroup equipmentSlotGroup : EquipmentSlotGroup.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
MutableBoolean mutableBoolean = new MutableBoolean(true);
this.forEachModifier(equipmentSlotGroup, (attribute, modifier) -> {
if (mutableBoolean.isTrue()) {
diff --git a/net/minecraft/world/item/crafting/ShapedRecipePattern.java b/net/minecraft/world/item/crafting/ShapedRecipePattern.java
index bfda76974ea8d4397e2c2ebf5bdcb5d7e5f0bab5..cabbc93409ca99180d115e2f23419ee1824d5801 100644
--- a/net/minecraft/world/item/crafting/ShapedRecipePattern.java
+++ b/net/minecraft/world/item/crafting/ShapedRecipePattern.java
@@ -121,7 +121,7 @@ public final class ShapedRecipePattern {
}
if (pattern.size() == i3) {
- return new String[0];
+ return me.titaniumtown.ArrayConstants.emptyStringArray; // Gale - JettPack - reduce array allocations
} else {
String[] strings = new String[pattern.size() - i3 - i2];
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
index 20403c3e2582caf3541cd9b051fb5ebff52eb555..96f29ce52dfbaebdaff287e4ae249f6628b22cf7 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -1832,7 +1832,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices slices = ((ServerLevel)this).moonrise$getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) {
- return new org.bukkit.entity.Entity[0];
+ return me.titaniumtown.ArrayConstants.emptyBukkitEntityArray; // Gale - JettPack - reduce array allocations
}
List<org.bukkit.entity.Entity> ret = new java.util.ArrayList<>();
@@ -1843,7 +1843,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
}
}
- return ret.toArray(new org.bukkit.entity.Entity[0]);
+ return ret.toArray(me.titaniumtown.ArrayConstants.emptyBukkitEntityArray); // Gale - JettPack - reduce array allocations
}
// Paper end - rewrite chunk system
diff --git a/net/minecraft/world/level/block/ComposterBlock.java b/net/minecraft/world/level/block/ComposterBlock.java
index a647d76d365a60b95a3eb7927ac426bf70d417f3..7977ecd013c55359f179b4b7f895099b7eb02294 100644
--- a/net/minecraft/world/level/block/ComposterBlock.java
+++ b/net/minecraft/world/level/block/ComposterBlock.java
@@ -419,7 +419,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return new int[0];
+ return me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
}
@Override
@@ -454,7 +454,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return side == Direction.UP ? new int[]{0} : new int[0];
+ return side == Direction.UP ? me.titaniumtown.ArrayConstants.zeroSingletonIntArray : me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
}
@Override
@@ -505,7 +505,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return side == Direction.DOWN ? new int[]{0} : new int[0];
+ return side == Direction.DOWN ? me.titaniumtown.ArrayConstants.zeroSingletonIntArray : me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
}
@Override
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index c5b3b5e5f621f8db152aa190374ae0fe567d6828..f6c3dac2a2a17760ab7015fe75c5a4dd04c11319 100644
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -44,7 +44,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
protected static final int SLOT_FUEL = 1;
protected static final int SLOT_RESULT = 2;
public static final int DATA_LIT_TIME = 0;
- private static final int[] SLOTS_FOR_UP = new int[]{0};
+ private static final int[] SLOTS_FOR_UP = me.titaniumtown.ArrayConstants.zeroSingletonIntArray; // Gale - JettPack - reduce array allocations
private static final int[] SLOTS_FOR_DOWN = new int[]{2, 1};
private static final int[] SLOTS_FOR_SIDES = new int[]{1};
public static final int DATA_LIT_DURATION = 1;