mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Some minecraft patches work
This commit is contained in:
@@ -3,6 +3,8 @@ From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Fri, 25 Nov 2022 16:26:04 +0100
|
||||
Subject: [PATCH] Softly log invalid pool element errors
|
||||
|
||||
Removed since Leaf 1.21.5
|
||||
|
||||
License: MIT (https://opensource.org/licenses/MIT)
|
||||
Gale - https://galemc.org
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Thu, 24 Nov 2022 23:39:32 +0100
|
||||
Subject: [PATCH] Do not log invalid statistics
|
||||
|
||||
License: MIT (https://opensource.org/licenses/MIT)
|
||||
Gale - https://galemc.org
|
||||
|
||||
This patch is based on the following patch:
|
||||
"Ignore statistics warnings"
|
||||
By: Aikar <aikar@aikar.co>
|
||||
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/net/minecraft/stats/ServerStatsCounter.java b/net/minecraft/stats/ServerStatsCounter.java
|
||||
index 6c5205fe1dc6387a77b1edbdcab748d39e775d7f..b26dbe807e5cb0a42f6c06b933397902310e5616 100644
|
||||
--- a/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -113,16 +113,20 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
Util.ifElse(
|
||||
this.getStat(type, string1),
|
||||
stat -> this.stats.put(stat, compound1.getInt(string1)),
|
||||
- () -> LOGGER.warn("Invalid statistic in {}: Don't know what {} is", this.file, string1)
|
||||
+ () -> {
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.warn("Invalid statistic in {}: Don't know what {} is", this.file, string1); // Gale - EMC - do not log invalid statistics
|
||||
+ }
|
||||
);
|
||||
} else {
|
||||
- LOGGER.warn(
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.warn( // Gale - EMC - do not log invalid statistics
|
||||
"Invalid statistic value in {}: Don't know what {} is for key {}", this.file, compound1.get(string1), string1
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
- () -> LOGGER.warn("Invalid statistic type in {}: Don't know what {} is", this.file, string)
|
||||
+ () -> {
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.warn("Invalid statistic type in {}: Don't know what {} is", this.file, string); // Gale - EMC - do not log invalid statistics
|
||||
+ }
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,363 +0,0 @@
|
||||
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 d21ce54ebb5724c04eadf56a2cde701d5eeb5db2..b6af8da084c83ee38bb3ecea6a98feb0c1c74d2a 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 6927124a4ea1f460158bf25679104b6f9e9ccee4..dba08f2668d65ae5483f325af3a79b5a63919c50 100644
|
||||
--- a/net/minecraft/nbt/ByteArrayTag.java
|
||||
+++ b/net/minecraft/nbt/ByteArrayTag.java
|
||||
@@ -174,7 +174,7 @@ public class ByteArrayTag extends CollectionTag<ByteTag> {
|
||||
|
||||
@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/CompoundTag.java b/net/minecraft/nbt/CompoundTag.java
|
||||
index 361bc458e0bb590c43da60a1cd993a2785ee45e9..3bce1e8ef90e95abd8b1111f1160f952d2493e69 100644
|
||||
--- a/net/minecraft/nbt/CompoundTag.java
|
||||
+++ b/net/minecraft/nbt/CompoundTag.java
|
||||
@@ -409,7 +409,7 @@ public class CompoundTag implements Tag {
|
||||
throw new ReportedException(this.createReport(key, ByteArrayTag.TYPE, var3));
|
||||
}
|
||||
|
||||
- return new byte[0];
|
||||
+ return me.titaniumtown.ArrayConstants.emptyByteArray; // Gale - JettPack - reduce array allocations
|
||||
}
|
||||
|
||||
public int[] getIntArray(String key) {
|
||||
@@ -421,7 +421,7 @@ public class CompoundTag implements Tag {
|
||||
throw new ReportedException(this.createReport(key, IntArrayTag.TYPE, var3));
|
||||
}
|
||||
|
||||
- return new int[0];
|
||||
+ return me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||
}
|
||||
|
||||
public long[] getLongArray(String key) {
|
||||
@@ -433,7 +433,7 @@ public class CompoundTag implements Tag {
|
||||
throw new ReportedException(this.createReport(key, LongArrayTag.TYPE, var3));
|
||||
}
|
||||
|
||||
- return new long[0];
|
||||
+ return me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
|
||||
}
|
||||
|
||||
public CompoundTag getCompound(String key) {
|
||||
diff --git a/net/minecraft/nbt/IntArrayTag.java b/net/minecraft/nbt/IntArrayTag.java
|
||||
index 7e27546bcb587d03b6de2ab43244e6c61fdb55f4..c7f35f332117305bf0e34eb8b73ddfa73958e434 100644
|
||||
--- a/net/minecraft/nbt/IntArrayTag.java
|
||||
+++ b/net/minecraft/nbt/IntArrayTag.java
|
||||
@@ -181,7 +181,7 @@ public class IntArrayTag extends CollectionTag<IntTag> {
|
||||
|
||||
@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/ListTag.java b/net/minecraft/nbt/ListTag.java
|
||||
index 8bbe48a4d7d1771d17bec60b70bdf8e086bfd1c7..5ab487178544f6bc6b0c90d7a54b5c3ea1cdfbe9 100644
|
||||
--- a/net/minecraft/nbt/ListTag.java
|
||||
+++ b/net/minecraft/nbt/ListTag.java
|
||||
@@ -258,7 +258,7 @@ public class ListTag extends CollectionTag<Tag> {
|
||||
}
|
||||
}
|
||||
|
||||
- return new int[0];
|
||||
+ return me.titaniumtown.ArrayConstants.emptyIntArray; // Gale - JettPack - reduce array allocations
|
||||
}
|
||||
|
||||
public long[] getLongArray(int index) {
|
||||
@@ -269,7 +269,7 @@ public class ListTag extends CollectionTag<Tag> {
|
||||
}
|
||||
}
|
||||
|
||||
- return new long[0];
|
||||
+ return me.titaniumtown.ArrayConstants.emptyLongArray; // Gale - JettPack - reduce array allocations
|
||||
}
|
||||
|
||||
public double getDouble(int index) {
|
||||
diff --git a/net/minecraft/nbt/LongArrayTag.java b/net/minecraft/nbt/LongArrayTag.java
|
||||
index 7274aa8ccae9294dcdb718cbd4997f841eeb9eba..d33466f2ad3aa967fd2e6c0efa73805ba725b3c2 100644
|
||||
--- a/net/minecraft/nbt/LongArrayTag.java
|
||||
+++ b/net/minecraft/nbt/LongArrayTag.java
|
||||
@@ -185,7 +185,7 @@ public class LongArrayTag extends CollectionTag<LongTag> {
|
||||
|
||||
@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 68727deaedd55aa86e76fbc6cc2cfb67913f7add..bad5787de2034dbb0eabb9458a47a89e30dec886 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 acb1168aba0069f9ac7f47d96f0f4945b37c3888..148be9d5e10d7a770814a10dc40bfb70b71d4021 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1224,7 +1224,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 0f180795a7ab58f4376551ae6c313573696677f0..a3d0d331d367b8ddfd0ac450acd143ce7d3f7a9a 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2786,7 +2786,7 @@ public class ServerGamePacketListenerImpl
|
||||
target.refreshEntityData(ServerGamePacketListenerImpl.this.player);
|
||||
// SPIGOT-7136 - Allays
|
||||
if (target instanceof 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(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) target).getItemBySlot(slot).copy())).collect(Collectors.toList()), true)); // Paper - sanitize
|
||||
+ ServerGamePacketListenerImpl.this.send(new net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket(target.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.VALUES_ARRAY).map((slot) -> Pair.of(slot, ((LivingEntity) target).getItemBySlot(slot).copy())).collect(Collectors.toList()), true)); // Paper - sanitize // Gale - JettPack - reduce array allocations
|
||||
}
|
||||
|
||||
ServerGamePacketListenerImpl.this.player.containerMenu.sendAllDataToRemote(); // Paper - fix slot desync - always refresh player inventory
|
||||
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 c65595c0a55b0aeebb2cf858da99329d2192976e..0a5611b1ece4dbe2887e7fbdef45f58e7f4d53ad 100644
|
||||
--- a/net/minecraft/world/entity/EquipmentSlot.java
|
||||
+++ b/net/minecraft/world/entity/EquipmentSlot.java
|
||||
@@ -19,7 +19,8 @@ public enum EquipmentSlot implements StringRepresentable {
|
||||
BODY(EquipmentSlot.Type.ANIMAL_ARMOR, 0, 1, 6, "body");
|
||||
|
||||
public static final int NO_COUNT_LIMIT = 0;
|
||||
- public static final List<EquipmentSlot> VALUES = List.of(values());
|
||||
+ public static final EquipmentSlot[] VALUES_ARRAY = values(); // Gale - JettPack - reduce array allocations
|
||||
+ public static final List<EquipmentSlot> VALUES = List.of(VALUES_ARRAY); // Gale - JettPack - reduce array allocations
|
||||
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);
|
||||
public static final StreamCodec<ByteBuf, EquipmentSlot> STREAM_CODEC = ByteBufCodecs.idMapper(BY_ID, equipmentSlot -> equipmentSlot.id);
|
||||
diff --git a/net/minecraft/world/entity/EquipmentSlotGroup.java b/net/minecraft/world/entity/EquipmentSlotGroup.java
|
||||
index 028dff862850c63d0b66902e99dd0bf685a7aa0d..b2d8b6883e2527c13794d23d27a4647ab1e255dd 100644
|
||||
--- a/net/minecraft/world/entity/EquipmentSlotGroup.java
|
||||
+++ b/net/minecraft/world/entity/EquipmentSlotGroup.java
|
||||
@@ -29,6 +29,7 @@ public enum EquipmentSlotGroup implements StringRepresentable {
|
||||
private final int id;
|
||||
private final String key;
|
||||
private final Predicate<EquipmentSlot> predicate;
|
||||
+ public static final EquipmentSlotGroup[] VALUES_ARRAY = EquipmentSlotGroup.values(); // Gale - JettPack - reduce array allocations
|
||||
|
||||
private EquipmentSlotGroup(final int id, final String key, final Predicate<EquipmentSlot> predicate) {
|
||||
this.id = id;
|
||||
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
|
||||
index 76f50437396f8f856381d0fbef52953ef7c263f6..f6c0f9275dd737c0142d6e4be07be71ad50b4732 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -1145,7 +1145,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
private void addAttributeTooltips(Consumer<Component> tooltipAdder, @Nullable Player player) {
|
||||
ItemAttributeModifiers itemAttributeModifiers = this.getOrDefault(DataComponents.ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY);
|
||||
if (itemAttributeModifiers.showInTooltip()) {
|
||||
- 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 39e4a6237d105ea4a695659d5f47314184e44d75..b831f189bcee62a41a16017c2bb958aeee728984 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -1849,7 +1849,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
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<>();
|
||||
@@ -1860,7 +1860,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
}
|
||||
|
||||
- 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 86f9c284f434a16888beb60b89f460de2c0450a8..c8ffb634df661a6a4520731be725b51480764976 100644
|
||||
--- a/net/minecraft/world/level/block/ComposterBlock.java
|
||||
+++ b/net/minecraft/world/level/block/ComposterBlock.java
|
||||
@@ -410,7 +410,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
|
||||
@@ -445,7 +445,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
|
||||
@@ -496,7 +496,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 cb4b8567c029e3a53aafda2755e3773ea8b95af7..ad9f009dd6c86e08c193839479b4b3285afd7dfb 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;
|
||||
diff --git a/net/minecraft/world/scores/Team.java b/net/minecraft/world/scores/Team.java
|
||||
index 7b08f2fba99e3eef98f5b36db4081da9ab93f415..9192cb0761c6ec2ddec2c75dbc654d16951d6352 100644
|
||||
--- a/net/minecraft/world/scores/Team.java
|
||||
+++ b/net/minecraft/world/scores/Team.java
|
||||
@@ -70,7 +70,7 @@ public abstract class Team {
|
||||
public final int id;
|
||||
|
||||
public static String[] getAllNames() {
|
||||
- return BY_NAME.keySet().toArray(new String[0]);
|
||||
+ return BY_NAME.keySet().toArray(me.titaniumtown.ArrayConstants.emptyStringArray); // Gale - JettPack - reduce array allocations
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -40,10 +40,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/net/minecraft/world/phys/shapes/EntityCollisionContext.java b/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||
index dafcba6eeba62a5e35ad53c9b38605a17139d8b0..0c65addf32b09991392dcc1de8b477543fd02a81 100644
|
||||
index ebc9360ea64a248418fcac8b446664b0dd019335..b09d1b7c76410580663f2419e3b5e917fedabd54 100644
|
||||
--- a/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||
+++ b/net/minecraft/world/phys/shapes/EntityCollisionContext.java
|
||||
@@ -19,25 +19,35 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
@@ -19,27 +19,39 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
return canAscend;
|
||||
}
|
||||
};
|
||||
@@ -51,39 +51,44 @@ index dafcba6eeba62a5e35ad53c9b38605a17139d8b0..0c65addf32b09991392dcc1de8b47754
|
||||
+ /*
|
||||
private final boolean descending;
|
||||
private final double entityBottom;
|
||||
private final boolean placement;
|
||||
private final ItemStack heldItem;
|
||||
private final Predicate<FluidState> canStandOnFluid;
|
||||
+ */
|
||||
+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
||||
+ private final boolean placement;
|
||||
@Nullable
|
||||
private final Entity entity;
|
||||
|
||||
protected EntityCollisionContext(
|
||||
boolean descending, double entityBottom, ItemStack heldItem, Predicate<FluidState> canStandOnFluid, @Nullable Entity entity
|
||||
boolean descending, boolean placement, double entityBottom, ItemStack heldItem, Predicate<FluidState> canStandOnFluid, @Nullable Entity entity
|
||||
) {
|
||||
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
||||
+ /*
|
||||
this.descending = descending;
|
||||
this.placement = placement;
|
||||
this.entityBottom = entityBottom;
|
||||
this.heldItem = heldItem;
|
||||
this.canStandOnFluid = canStandOnFluid;
|
||||
+ */
|
||||
+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove these and pray no plugin uses them
|
||||
+ this.placement = placement;
|
||||
this.entity = entity;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected EntityCollisionContext(Entity entity, boolean canStandOnFluid) {
|
||||
protected EntityCollisionContext(Entity entity, boolean canStandOnFluid, boolean placement) {
|
||||
+ // Gale start - Airplane - make EntityCollisionContext a live representation - remove unneeded things
|
||||
+ /*
|
||||
this(
|
||||
entity.isDescending(),
|
||||
entity.getY(),
|
||||
@@ -45,16 +55,19 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
canStandOnFluid ? fluidState -> true : (entity instanceof LivingEntity ? ((LivingEntity)entity)::canStandOnFluid : fluidState -> false),
|
||||
placement,
|
||||
@@ -50,16 +62,20 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
: (entity instanceof LivingEntity livingEntity ? fluidState -> livingEntity.canStandOnFluid(fluidState) : fluidState -> false),
|
||||
entity
|
||||
);
|
||||
+ */
|
||||
+ this.placement = placement;
|
||||
+ this.entity = entity;
|
||||
+ // Gale end - Airplane - make EntityCollisionContext a live representation - remove unneeded things
|
||||
}
|
||||
@@ -101,7 +106,7 @@ index dafcba6eeba62a5e35ad53c9b38605a17139d8b0..0c65addf32b09991392dcc1de8b47754
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,12 +77,12 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
@@ -69,12 +85,12 @@ public class EntityCollisionContext implements CollisionContext {
|
||||
|
||||
@Override
|
||||
public boolean isDescending() {
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
|
||||
index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..d985555a029d06ffc73dd10115df47b83c9afafd 100644
|
||||
index 3f83a589442a80e9c16b5e9cd0f50792defd12bc..e945564034f1f0a83dcdd39b8889c7aa61bfd199 100644
|
||||
--- a/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -179,19 +179,25 @@ public class ServerEntity {
|
||||
@@ -172,19 +172,25 @@ public class ServerEntity {
|
||||
packet = ClientboundEntityPositionSyncPacket.of(this.entity);
|
||||
flag3 = true;
|
||||
flag4 = true;
|
||||
@@ -30,23 +30,11 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index a01491bc87d982adadd1890f72e31b893dfa7619..eee00c4d23a8b4c7e66d45d843ffc087fb183702 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -361,6 +361,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
return this.originWorld;
|
||||
}
|
||||
// Paper end - Entity origin API
|
||||
+
|
||||
public float getBukkitYaw() {
|
||||
return this.yRot;
|
||||
}
|
||||
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
index 4c808c7ef336de74048f40bd1cc8b14131a9325d..beebe81e13c99c6ddd9ffb2c7a3fdd74cb9c7afa 100644
|
||||
index bed9b564c493cd84bf53fc49368fda736f3fbc2b..5b22ad7d56754f82ce8448382ab6bafc2055f413 100644
|
||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -23,9 +23,11 @@ public class AttributeMap {
|
||||
@@ -18,9 +18,11 @@ public class AttributeMap {
|
||||
private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||
private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||
private final AttributeSupplier supplier;
|
||||
@@ -58,7 +46,7 @@ index 4c808c7ef336de74048f40bd1cc8b14131a9325d..beebe81e13c99c6ddd9ffb2c7a3fdd74
|
||||
}
|
||||
|
||||
private void onAttributeModified(AttributeInstance instance) {
|
||||
@@ -49,7 +51,7 @@ public class AttributeMap {
|
||||
@@ -44,7 +46,7 @@ public class AttributeMap {
|
||||
|
||||
@Nullable
|
||||
public AttributeInstance getInstance(Holder<Attribute> attribute) {
|
||||
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
||||
index b35fe7112f2ad94e85e98931c403b3ffa8608382..2caeb69306a42d02b7a5c27e00fb969e392ac6ba 100644
|
||||
index db5327dfcaaa4ac767466f6abeec30c50d32db73..679c94142eac06ec0bc6f3b819ee4f7e831c4626 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -794,7 +794,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
@@ -545,7 +545,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
entity.stopRiding();
|
||||
}
|
||||
|
||||
@@ -50,25 +50,23 @@ index b35fe7112f2ad94e85e98931c403b3ffa8608382..2caeb69306a42d02b7a5c27e00fb969e
|
||||
+ entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD);
|
||||
+ // Paper end - Prevent block entity and entity crashes
|
||||
+ }
|
||||
+ this.moonrise$midTickTasks(); // Paper - rewrite chunk system
|
||||
+ //this.moonrise$midTickTasks(); // Paper - rewrite chunk system
|
||||
+ // Gale end - Airplane - remove lambda from ticking guard - copied from guardEntityTick
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
||||
index c4563e827a8333d57aabce1ff8e4c28d7e3a295b..51fa382b930ccbeb605064488ab4df985df94ed6 100644
|
||||
index e813588e03234e4b12b531cd77f725f7d7f9c50c..b20e92a6232b96521f8d5dd7a289007e98863b9e 100644
|
||||
--- a/net/minecraft/world/level/Level.java
|
||||
+++ b/net/minecraft/world/level/Level.java
|
||||
@@ -1506,10 +1506,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -850,8 +850,9 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
||||
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
|
||||
MinecraftServer.LOGGER.error(msg, var6);
|
||||
getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerInternalException(msg, var6))); // Paper - ServerExceptionEvent
|
||||
- entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD);
|
||||
+ entity.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DISCARD); // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
|
||||
// Paper end - Prevent block entity and entity crashes
|
||||
+ //this.moonrise$midTickTasks(); // Paper - rewrite chunk system // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
|
||||
}
|
||||
- this.moonrise$midTickTasks(); // Paper - rewrite chunk system
|
||||
+ this.moonrise$midTickTasks(); // Paper - rewrite chunk system // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
|
||||
}
|
||||
|
||||
// Paper start - Option to prevent armor stands from doing entity lookups
|
||||
@@ -13,10 +13,10 @@ As part of: Pufferfish (https://github.com/pufferfish-gg/Pufferfish)
|
||||
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index baa92ab485928b2e57adb14af00f7e6120694184..3cd6e63ea6c18a26ef1aa394cf53d9e3463f8e50 100644
|
||||
index c71034e9077280ccd7b4d7a9986eb6ec1536472a..a86ede54cfeb416a8c0c85fe90862e65e6505b62 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -231,6 +231,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -190,6 +190,13 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
|
||||
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // Paper - load version history now
|
||||
|
||||
@@ -22,10 +22,10 @@ you to easily disable books, should you want to preemptively remove this
|
||||
functionality before additional exploits are found.
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 1205307b7d2336fa6c5395a65be6643228c49d72..bac7225ea6095a746a71d5be2ba4bf147971827b 100644
|
||||
index 5e921c490814be31fc2843327c0e2cc76bda6620..df7142bbfec170966373dcf4ac50e4bbc5ba4e53 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -1171,6 +1171,11 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -1191,6 +1191,11 @@ public class ServerGamePacketListenerImpl
|
||||
|
||||
@Override
|
||||
public void handleEditBook(ServerboundEditBookPacket packet) {
|
||||
@@ -28,22 +28,22 @@ but is so much cheaper than the suffocation check that it's worth
|
||||
keeping it.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 181eec21013cc37dd252e3df047ad9ddda8ece19..3a44887fa81676d4c06c10eae5d451eace7f595f 100644
|
||||
index bb687f048be9edfde75d13354dd3265593e83e9f..ac86ea5fc03aab1445712a7143f7714eea31b124 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -448,7 +448,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
if (this.isAlive()) {
|
||||
@@ -419,7 +419,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
|
||||
if (this.isAlive() && this.level() instanceof ServerLevel serverLevel1) {
|
||||
boolean flag = this instanceof Player;
|
||||
if (this.level() instanceof ServerLevel serverLevel1) {
|
||||
- if (this.isInWall()) {
|
||||
+ // Gale start - Pufferfish - reduce in wall checks
|
||||
+ long checkStuckInWallInterval = this.level().galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall;
|
||||
+ if ((checkStuckInWallInterval <= 1 || (tickCount % checkStuckInWallInterval == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) {
|
||||
+ // Gale end - Pufferfish - reduce in wall checks
|
||||
this.hurtServer(serverLevel1, this.damageSources().inWall(), 1.0F);
|
||||
} else if (flag && !this.level().getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d = this.level().getWorldBorder().getDistanceToBorder(this) + this.level().getWorldBorder().getDamageSafeZone();
|
||||
@@ -1354,6 +1357,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
- if (this.isInWall()) {
|
||||
+ // Gale start - Pufferfish - reduce in wall checks
|
||||
+ long checkStuckInWallInterval = this.level().galeConfig().smallOptimizations.reducedIntervals.checkStuckInWall;
|
||||
+ if ((checkStuckInWallInterval <= 1 || (tickCount % checkStuckInWallInterval == 0 && couldPossiblyBeHurt(1.0F))) && this.isInWall()) {
|
||||
+ // Gale end - Pufferfish - reduce in wall checks
|
||||
this.hurtServer(serverLevel1, this.damageSources().inWall(), 1.0F);
|
||||
} else if (flag && !serverLevel1.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
|
||||
double d = serverLevel1.getWorldBorder().getDistanceToBorder(this) + serverLevel1.getWorldBorder().getDamageSafeZone();
|
||||
@@ -1367,6 +1370,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
return this.getHealth() <= 0.0F;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ search to attempt respawning the ender dragon whenever a player places
|
||||
an end crystal.
|
||||
|
||||
diff --git a/net/minecraft/world/item/EndCrystalItem.java b/net/minecraft/world/item/EndCrystalItem.java
|
||||
index 1bc4c8be71b445f64134548a85fd81442298c0f1..a1570503d3e4dcc9f1cd0b119ab2e60f7c63b6d8 100644
|
||||
index 05ec512839898f96d9769bb0d00f6ba11dda0c4b..49f94f242a0906e74eb58313cf095a0b04c304c4 100644
|
||||
--- a/net/minecraft/world/item/EndCrystalItem.java
|
||||
+++ b/net/minecraft/world/item/EndCrystalItem.java
|
||||
@@ -49,10 +49,12 @@ public class EndCrystalItem extends Item {
|
||||
@@ -36,7 +36,7 @@ index 1bc4c8be71b445f64134548a85fd81442298c0f1..a1570503d3e4dcc9f1cd0b119ab2e60f
|
||||
+ if (level.galeConfig().gameplayMechanics.tryRespawnEnderDragonAfterEndCrystalPlace) { // Gale - Pufferfish - make ender dragon respawn attempt after placing end crystals configurable
|
||||
EndDragonFight dragonFight = ((ServerLevel)level).getDragonFight();
|
||||
if (dragonFight != null) {
|
||||
dragonFight.tryRespawn(aboveBlockPosition); // Paper - Perf: Do crystal-portal proximity check before entity lookup
|
||||
dragonFight.tryRespawn(aboveBlockPos); // Paper - Perf: Do crystal-portal proximity check before entity lookup
|
||||
}
|
||||
+ } // Gale - Pufferfish - make ender dragon respawn attempt after placing end crystals configurable
|
||||
}
|
||||
@@ -20,10 +20,10 @@ launcher can very easily fill a chunk.
|
||||
Prevent saving Fireworks so that chunk unloads will wipe a chunks fireworks in this case.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
index 774ca9e0b56fd175ae246051de762d0c4256ca58..7f370f938d84240d763f60e51cddc705b3eaf5ea 100644
|
||||
index e0e193078e550225e163149638bf9e053c0531f8..70197071db4e46cd93579d92ff2f8aa7a49083cb 100644
|
||||
--- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
+++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
|
||||
@@ -364,4 +364,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
||||
@@ -354,4 +354,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
|
||||
double d1 = entity.position().z - this.position().z;
|
||||
return DoubleDoubleImmutablePair.of(d, d1);
|
||||
}
|
||||
@@ -17,10 +17,10 @@ Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
Only do an item "suck in" action once per second
|
||||
|
||||
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
index 52a7ed0d991758bad0dcedcb7f97fb15ac6c6d04..8e450c9d0111c0ce44feb386cf8b2715e407bf25 100644
|
||||
index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..bf2f81232ac40218c6d0241b7a0a26cb2272e06b 100644
|
||||
--- a/net/minecraft/world/entity/item/ItemEntity.java
|
||||
+++ b/net/minecraft/world/entity/item/ItemEntity.java
|
||||
@@ -143,7 +143,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -150,7 +150,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
@@ -34,7 +34,7 @@ index 52a7ed0d991758bad0dcedcb7f97fb15ac6c6d04..8e450c9d0111c0ce44feb386cf8b2715
|
||||
}
|
||||
// Paper end - EAR 2
|
||||
|
||||
@@ -227,9 +233,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
@@ -234,9 +240,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
}
|
||||
// CraftBukkit end
|
||||
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
|
||||
@@ -67,18 +67,18 @@ index 52a7ed0d991758bad0dcedcb7f97fb15ac6c6d04..8e450c9d0111c0ce44feb386cf8b2715
|
||||
@Override
|
||||
public BlockPos getBlockPosBelowThatAffectsMyMovement() {
|
||||
diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||
index 8341e7f01606fca90e69384c16fc19bb9e20d1b7..c5a3dc3e704a9f6d67d9049e49cd1b33b6994766 100644
|
||||
index a56d9cdeb6589a053ffaaf2cd599a98ae0a0989a..df5eda70d1d2eafcd32606fb93bb62409e5a8943 100644
|
||||
--- a/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java
|
||||
@@ -21,6 +21,7 @@ import net.minecraft.world.level.block.state.properties.RailShape;
|
||||
public class MinecartHopper extends AbstractMinecartContainer implements Hopper {
|
||||
@@ -22,6 +22,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
|
||||
private static final boolean DEFAULT_ENABLED = true;
|
||||
private boolean enabled = true;
|
||||
private boolean consumedItemThisFrame = false;
|
||||
+ public int pickupImmunity = 0; // Gale - EMC - reduce hopper item checks
|
||||
|
||||
public MinecartHopper(EntityType<? extends MinecartHopper> entityType, Level level) {
|
||||
super(entityType, level);
|
||||
@@ -149,4 +150,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
|
||||
@@ -150,4 +151,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -92,7 +92,7 @@ index 8341e7f01606fca90e69384c16fc19bb9e20d1b7..c5a3dc3e704a9f6d67d9049e49cd1b33
|
||||
+
|
||||
}
|
||||
diff --git a/net/minecraft/world/level/block/entity/Hopper.java b/net/minecraft/world/level/block/entity/Hopper.java
|
||||
index 5f042e294db605827000123252b0df646968f897..e1cc15f28fe8da23b74ff4504c5b2da2236fda3f 100644
|
||||
index 484c2ba2752fbf3ad929e46c2f078e906f6f0637..6ced5a7e27703a7cf5a7495dc3a1a290ce0d18eb 100644
|
||||
--- a/net/minecraft/world/level/block/entity/Hopper.java
|
||||
+++ b/net/minecraft/world/level/block/entity/Hopper.java
|
||||
@@ -11,6 +11,8 @@ public interface Hopper extends Container {
|
||||
@@ -105,10 +105,10 @@ index 5f042e294db605827000123252b0df646968f897..e1cc15f28fe8da23b74ff4504c5b2da2
|
||||
|
||||
double getLevelY();
|
||||
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
index 5cd1326ad5d046c88b2b3449d610a78fa880b4cd..2549dd08b60cd81dcbf3412ed71cfc40729ae468 100644
|
||||
index 9a03934dd4d96184f37b9ff5661eb7bd76150464..c7591bb0b4755f28dffc2b3e6c4600d22480bbf1 100644
|
||||
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
|
||||
@@ -540,7 +540,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
@@ -302,7 +302,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
return false;
|
||||
} else {
|
||||
boolean flag = hopper.isGridAligned() && blockState.isCollisionShapeFullBlock(level, blockPos) && !blockState.is(BlockTags.DOES_NOT_BLOCK_HOPPERS);
|
||||
@@ -117,8 +117,8 @@ index 5cd1326ad5d046c88b2b3449d610a78fa880b4cd..2549dd08b60cd81dcbf3412ed71cfc40
|
||||
for (ItemEntity itemEntity : getItemsAtAndAbove(level, hopper)) {
|
||||
if (addItem(hopper, itemEntity)) {
|
||||
return true;
|
||||
@@ -816,6 +816,34 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
return stack1.getCount() < stack1.getMaxStackSize() && ItemStack.isSameItemSameComponents(stack1, stack2); // Paper - Perf: Optimize Hoppers; used to return true for full itemstacks?!
|
||||
@@ -565,6 +565,34 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
|
||||
return stack1.getCount() <= stack1.getMaxStackSize() && ItemStack.isSameItemSameComponents(stack1, stack2);
|
||||
}
|
||||
|
||||
+ // Gale start - EMC - reduce hopper item checks
|
||||
@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||
index 5d1e83658bb9646cf56885627256f0be7a84831e..54916fe57ceeab24936ce50709402ecf1fcd9a10 100644
|
||||
index 602ed4c5556723e54a80ccc3481af31109d5a0a6..bdbbbc5e0c06c71584e7514623d0c8be168befd7 100644
|
||||
--- a/io/papermc/paper/entity/activation/ActivationRange.java
|
||||
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
|
||||
@@ -53,27 +53,41 @@ public final class ActivationRange {
|
||||
@@ -13,22 +13,22 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
||||
index c11150dada66888e5332ec88d153dea3eca2aa3e..8a20de0780dbcec5f228f549a4134fce9714d170 100644
|
||||
index 20b6cfe278f2bd87dfe2cbf7befef745d36bb845..4973de0813f07d657a1e7b1930af7ab583a39f65 100644
|
||||
--- a/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -393,6 +393,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
||||
public boolean joining = true;
|
||||
@@ -416,6 +416,7 @@ public class ServerPlayer extends Player {
|
||||
public boolean sentListPacket = false;
|
||||
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
|
||||
+ public boolean didPlayerJoinEvent = false; // Gale - EMC - do not process chat/commands before player has joined
|
||||
// CraftBukkit end
|
||||
+ public boolean didPlayerJoinEvent = false; // Gale - EMC - do not process chat/commands before player has joined
|
||||
public boolean isRealPlayer; // Paper
|
||||
public com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
|
||||
public @Nullable String clientBrandName = null; // Paper - Brand support
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 5582c7045a78bd69091c3bd72d221c8cbc90da6f..fdffb9dac6bba5562f584e63d52ecf45383214ab 100644
|
||||
index df7142bbfec170966373dcf4ac50e4bbc5ba4e53..dea2a849a1d1f2dcfc1e63eb873ada999780bf66 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2342,7 +2342,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -2334,7 +2334,7 @@ public class ServerGamePacketListenerImpl
|
||||
this.disconnectAsync(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add proper async disconnect
|
||||
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
|
||||
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
|
||||
@@ -38,10 +38,10 @@ index 5582c7045a78bd69091c3bd72d221c8cbc90da6f..fdffb9dac6bba5562f584e63d52ecf45
|
||||
// CraftBukkit start
|
||||
if (sync) {
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index d37df76d08d53374f862de400a379f8b76e9f241..6ed4b7c5315d7bbeefc94f1320f52e5189f93518 100644
|
||||
index 48eae4ea5999aee4faa5b24a72e7b0b51c598fc8..2726f72c86368fe804dce43dc6c337bfe213cc58 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -330,6 +330,8 @@ public abstract class PlayerList {
|
||||
@@ -334,6 +334,8 @@ public abstract class PlayerList {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Thu, 24 Nov 2022 23:39:32 +0100
|
||||
Subject: [PATCH] Do not log invalid statistics
|
||||
|
||||
License: MIT (https://opensource.org/licenses/MIT)
|
||||
Gale - https://galemc.org
|
||||
|
||||
This patch is based on the following patch:
|
||||
"Ignore statistics warnings"
|
||||
By: Aikar <aikar@aikar.co>
|
||||
As part of: EmpireCraft (https://github.com/starlis/empirecraft)
|
||||
Licensed under: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
diff --git a/net/minecraft/stats/ServerStatsCounter.java b/net/minecraft/stats/ServerStatsCounter.java
|
||||
index b147df7479da03fae19294587cded62c210ea590..dfaead7716ac718bcdbf4c3021aed1b57676af50 100644
|
||||
--- a/net/minecraft/stats/ServerStatsCounter.java
|
||||
+++ b/net/minecraft/stats/ServerStatsCounter.java
|
||||
@@ -117,16 +117,18 @@ public class ServerStatsCounter extends StatsCounter {
|
||||
this.stats
|
||||
.putAll(
|
||||
STATS_CODEC.parse(dynamic.get("stats").orElseEmptyMap())
|
||||
- .resultOrPartial(string -> LOGGER.error("Failed to parse statistics for {}: {}", this.file, string))
|
||||
+ .resultOrPartial(string -> {
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Failed to parse statistics for {}: {}", this.file, string); // Gale - EMC - do not log invalid statistics
|
||||
+ })
|
||||
.orElse(Map.of())
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
- LOGGER.error("Unable to parse Stat data from {}", this.file);
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Unable to parse Stat data from {}", this.file); // Gale - EMC - do not log invalid statistics
|
||||
}
|
||||
} catch (IOException | JsonParseException var8) {
|
||||
- LOGGER.error("Unable to parse Stat data from {}", this.file, var8);
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Unable to parse Stat data from {}", this.file, var8); // Gale - EMC - do not log invalid statistics
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index aab9786db66740d281cf0be3ad921ccdfbc8c27e..52cb71a46161fd8b910b4b9afde2cb489c3a3c8b 100644
|
||||
index dea2a849a1d1f2dcfc1e63eb873ada999780bf66..804afc38f2be37258ee68d601674a2832b61bfc6 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2496,7 +2496,7 @@ public class ServerGamePacketListenerImpl
|
||||
@@ -2416,7 +2416,7 @@ public class ServerGamePacketListenerImpl
|
||||
// CraftBukkit start
|
||||
String rawMessage = message.signedContent();
|
||||
if (rawMessage.isEmpty()) {
|
||||
@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
|
||||
index 64dbee1f67eaa17c93c13bfa38fbe27de57651e4..ecb7edc1b10d23bb1979152341cd4a2b89613a65 100644
|
||||
index 52e0ae233a7b1c88bfbbc27707ef5f18453ec865..741894ed6df81fce41d9f906d6198d038aab44a8 100644
|
||||
--- a/net/minecraft/server/PlayerAdvancements.java
|
||||
+++ b/net/minecraft/server/PlayerAdvancements.java
|
||||
@@ -148,7 +148,7 @@ public class PlayerAdvancements {
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/server/level/WorldGenRegion.java b/net/minecraft/server/level/WorldGenRegion.java
|
||||
index 7fa41dea184b01891f45d8e404bc1cba19cf1bcf..c41f68a84fce082140cf1b18db328cfacae35208 100644
|
||||
index b30f56fbc1fd17259a1d05dc9155fffcab292ca1..1aa26a70177e4ecf9d859fca44adc6a96b853c30 100644
|
||||
--- a/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -312,7 +312,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
@@ -284,7 +284,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
return true;
|
||||
} else {
|
||||
// Paper start - Buffer OOB setBlock calls
|
||||
@@ -37,15 +37,15 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/stats/ServerRecipeBook.java b/net/minecraft/stats/ServerRecipeBook.java
|
||||
index e3985b70cee7f7d56f179aeef8c2a6a6b312d83a..3418d7d3cf1116479f793e76e101d1c68bfe175c 100644
|
||||
index 2158b20458de63897131db3d425d1efcc358cace..40944806284921bd084901c94595fefa78b2c20b 100644
|
||||
--- a/net/minecraft/stats/ServerRecipeBook.java
|
||||
+++ b/net/minecraft/stats/ServerRecipeBook.java
|
||||
@@ -138,7 +138,7 @@ public class ServerRecipeBook extends RecipeBook {
|
||||
try {
|
||||
ResourceKey<Recipe<?>> resourceKey = ResourceKey.create(Registries.RECIPE, ResourceLocation.parse(string));
|
||||
if (!isRecognized.test(resourceKey)) {
|
||||
- LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourceKey);
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.unrecognizedRecipes) LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourceKey); // Gale - Purpur - do not log unrecognized recipes
|
||||
} else {
|
||||
output.accept(resourceKey);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class ServerRecipeBook extends RecipeBook {
|
||||
private void loadRecipes(List<ResourceKey<Recipe<?>>> recipes, Consumer<ResourceKey<Recipe<?>>> output, Predicate<ResourceKey<Recipe<?>>> isRecognized) {
|
||||
for (ResourceKey<Recipe<?>> resourceKey : recipes) {
|
||||
if (!isRecognized.test(resourceKey)) {
|
||||
- LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourceKey);
|
||||
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.unrecognizedRecipes) LOGGER.error("Tried to load unrecognized recipe: {} removed now.", resourceKey); // Gale - Purpur - do not log unrecognized recipes
|
||||
} else {
|
||||
output.accept(resourceKey);
|
||||
}
|
||||
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index 6ed4b7c5315d7bbeefc94f1320f52e5189f93518..7b8cc9e29bf021ce3b73803e820ee9b7926e05da 100644
|
||||
index 2726f72c86368fe804dce43dc6c337bfe213cc58..5abc0655ffc68ce81248467e7420051b2a2f0359 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1263,7 +1263,7 @@ public abstract class PlayerList {
|
||||
@@ -1252,7 +1252,7 @@ public abstract class PlayerList {
|
||||
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldFilterMessageTo, @Nullable ServerPlayer sender, ChatType.Bound boundChatType, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
|
||||
// Paper end
|
||||
boolean flag = this.verifyChatTrusted(message);
|
||||
@@ -17,10 +17,10 @@ Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
|
||||
This can help to hide annoying scanning bots from showing up in console.
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 6689aeacf50d1498e8d23cce696fb4fecbd1cf39..0fdf22af66945c1b6987e07f6c8a167110033b53 100644
|
||||
index 7950f4f88d8a83ed5610b7af4e134557d32da3f0..27fa7bbfc64dd103b7cd1c1216482af3719e3dbb 100644
|
||||
--- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -146,6 +146,15 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
@@ -145,6 +145,15 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
|
||||
public void disconnect(Component reason) {
|
||||
try {
|
||||
@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 3cd6e63ea6c18a26ef1aa394cf53d9e3463f8e50..3c1e6320305fa41b27a78c844dcf6172b244cc9b 100644
|
||||
index a86ede54cfeb416a8c0c85fe90862e65e6505b62..65fa22ea82076542d42d651227e5332692981cc3 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -183,7 +183,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -142,7 +142,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
}
|
||||
|
||||
// Paper start - detect running as root
|
||||
@@ -41,10 +41,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 3c1e6320305fa41b27a78c844dcf6172b244cc9b..f2e24d52240a84ff7ca69ad2c8ec0d1c197467c0 100644
|
||||
index 65fa22ea82076542d42d651227e5332692981cc3..a880ace4cfc64ea8359f08938f20294ec936ba9c 100644
|
||||
--- a/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -295,7 +295,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -253,7 +253,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
|
||||
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
|
||||
// Paper end - Add Velocity IP Forwarding Support
|
||||
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/animal/WaterAnimal.java b/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
index ed4f4c76a53c39c1a912fc0ff0d84f7fdb494b20..8910e2578bf8b7541a98f20ddc34255343ec4e4d 100644
|
||||
index 2b5e091b6ebe17e30d8d0e73999e19eed49e9a9f..ace8766a3640106cf471883029fa6a6272a890e7 100644
|
||||
--- a/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
+++ b/net/minecraft/world/entity/animal/WaterAnimal.java
|
||||
@@ -74,8 +74,11 @@ public abstract class WaterAnimal extends PathfinderMob {
|
||||
@@ -76,8 +76,11 @@ public abstract class WaterAnimal extends PathfinderMob {
|
||||
seaLevel = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(seaLevel);
|
||||
i = level.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(i);
|
||||
// Paper end - Make water animal spawn height configurable
|
||||
@@ -42,10 +42,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/world/entity/projectile/AbstractArrow.java b/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
index 541ee32182b595de7dd6717f8faea00d53c105a3..d206ac2b9cade292b0d69e9aeb0f81227ec0b49e 100644
|
||||
index 595cdb7d013eb0b9282b133a22f51ee865d18623..b8f04b98d2117cfb274a5888d34b9836d3390ae9 100644
|
||||
--- a/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -347,7 +347,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -352,7 +352,7 @@ public abstract class AbstractArrow extends Projectile {
|
||||
this.setInGround(false);
|
||||
Vec3 deltaMovement = this.getDeltaMovement();
|
||||
this.setDeltaMovement(deltaMovement.multiply(this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F));
|
||||
@@ -53,4 +53,4 @@ index 541ee32182b595de7dd6717f8faea00d53c105a3..d206ac2b9cade292b0d69e9aeb0f8122
|
||||
+ if (this.level().galeConfig().gameplayMechanics.arrowMovementResetsDespawnCounter) this.life = 0; // Gale - Purpur - make arrow movement resetting despawn counter configurable
|
||||
}
|
||||
|
||||
public boolean isInGround() { // Paper - protected -> public
|
||||
public boolean isInGround() {
|
||||
@@ -13,10 +13,10 @@ 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/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
||||
index a0d56fcd58f943353b55821557d79c4dc0cdf46b..b4258db165b509d54b9c15a661c5b66ca984ffb3 100644
|
||||
index 5abc0655ffc68ce81248467e7420051b2a2f0359..029003ccbd4820b60369894b2c3d4bd47f697d93 100644
|
||||
--- a/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/net/minecraft/server/players/PlayerList.java
|
||||
@@ -398,7 +398,13 @@ public abstract class PlayerList {
|
||||
@@ -402,7 +402,13 @@ public abstract class PlayerList {
|
||||
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
|
||||
}
|
||||
// Paper end - Configurable player collision
|
||||
@@ -0,0 +1,235 @@
|
||||
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/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 679c94142eac06ec0bc6f3b819ee4f7e831c4626..0d8fe6a658c1ad15f6243af5d2562505c41e3e8d 100644
|
||||
--- a/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -937,7 +937,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 804afc38f2be37258ee68d601674a2832b61bfc6..7142de40a5ff9d1009bb06e73172877e8bf80962 100644
|
||||
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2706,7 +2706,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 8cc5c0716392ba06501542ff5cbe71ee43979e5d..64945449807e49115b9115ee114cd3acad3d1ef8 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 c206187e2e4a3600681caadd4efd6293e42a9177..3958cd983242fc60c1868ce2a3ec804047d118c0 100644
|
||||
--- a/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/net/minecraft/world/item/ItemStack.java
|
||||
@@ -1168,7 +1168,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/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;
|
||||
@@ -13,10 +13,10 @@ 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/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
|
||||
index b260930b445e7621382bbe22e1e1c1c7be26e2f2..e4e32151437148f37fd370f9f88ec1bb84106c65 100644
|
||||
index c3c480cb21f7f952cc09b36e24c462822b663b28..91185d7f8f2206fea9cb1d96611b8409f82694f2 100644
|
||||
--- a/net/minecraft/world/entity/Entity.java
|
||||
+++ b/net/minecraft/world/entity/Entity.java
|
||||
@@ -2021,10 +2021,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1865,10 +1865,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
|
||||
@Deprecated
|
||||
public float getLightLevelDependentMagicValue() {
|
||||
@@ -36,13 +36,13 @@ index b260930b445e7621382bbe22e1e1c1c7be26e2f2..e4e32151437148f37fd370f9f88ec1bb
|
||||
}
|
||||
+ // Gale end - JettPack - optimize sun burn tick - allow passing BlockPos to getLightLevelDependentMagicValue
|
||||
|
||||
public void absMoveTo(double x, double y, double z, float yRot, float xRot) {
|
||||
this.absMoveTo(x, y, z);
|
||||
public void absSnapTo(double x, double y, double z, float yRot, float xRot) {
|
||||
this.absSnapTo(x, y, z);
|
||||
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
|
||||
index 49f4d8d4cc36669f889d9970d1dfdf3af4a720ce..7b5d04de4e657a82f51d6f4ad287693fcaa14f1d 100644
|
||||
index 7f5981f71e6380c09e40a0c80db6a77e74d5113d..6cc000611dc58a5487034ad87af4156059dd37d7 100644
|
||||
--- a/net/minecraft/world/entity/Mob.java
|
||||
+++ b/net/minecraft/world/entity/Mob.java
|
||||
@@ -1596,20 +1596,32 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
@@ -1474,20 +1474,31 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
|
||||
protected void playAttackSound() {
|
||||
}
|
||||
|
||||
@@ -50,12 +50,11 @@ index 49f4d8d4cc36669f889d9970d1dfdf3af4a720ce..7b5d04de4e657a82f51d6f4ad287693f
|
||||
+ private BlockPos cached_eye_blockpos;
|
||||
+ private net.minecraft.world.phys.Vec3 cached_position;
|
||||
+ // Gale end - JettPack - optimize sun burn tick - cache eye blockpos
|
||||
+
|
||||
public boolean isSunBurnTick() {
|
||||
if (this.level().isDay() && !this.level().isClientSide) {
|
||||
if (this.level().isBrightOutside() && !this.level().isClientSide) {
|
||||
- float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
|
||||
- BlockPos blockPos = BlockPos.containing(this.getX(), this.getEyeY(), this.getZ());
|
||||
- boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
- boolean flag = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
- if (lightLevelDependentMagicValue > 0.5F
|
||||
- && this.random.nextFloat() * 30.0F < (lightLevelDependentMagicValue - 0.4F) * 2.0F
|
||||
- && !flag
|
||||
@@ -74,7 +73,7 @@ index 49f4d8d4cc36669f889d9970d1dfdf3af4a720ce..7b5d04de4e657a82f51d6f4ad287693f
|
||||
+ if (this.random.nextFloat() * 30.0F >= (lightLevelDependentMagicValue - 0.4F) * 2.0F) return false;
|
||||
+ // Gale end - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
+
|
||||
+ boolean flag = this.isInWaterRainOrBubble() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
+ boolean flag = this.isInWaterOrRain() || this.isInPowderSnow || this.wasInPowderSnow;
|
||||
+
|
||||
+ return !flag && this.level().canSeeSky(this.cached_eye_blockpos); // Gale - JettPack - optimize sun burn tick - optimizations and cache eye blockpos
|
||||
}
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/level/GameRules.java b/net/minecraft/world/level/GameRules.java
|
||||
index b21337d826ad33ce874301b070ad7f5361a2a493..bbd09a317d01dee709e8964329e68f176e660846 100644
|
||||
index ea9ac158fcb98b90dfda997e3a1dfa34455f34a1..bceb900e2ceeb46faebc9925a5dc5275ac16d31c 100644
|
||||
--- a/net/minecraft/world/level/GameRules.java
|
||||
+++ b/net/minecraft/world/level/GameRules.java
|
||||
@@ -249,7 +249,7 @@ public class GameRules {
|
||||
@@ -277,7 +277,7 @@ public class GameRules {
|
||||
}
|
||||
|
||||
private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules, FeatureFlagSet enabledFeatures) {
|
||||
@@ -13,13 +13,13 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
index beebe81e13c99c6ddd9ffb2c7a3fdd74cb9c7afa..df3724294a3297ebdc11aef3f935bf0cf36b9c95 100644
|
||||
index 5b22ad7d56754f82ce8448382ab6bafc2055f413..93a079df455e371a0ca7ada253dc8b7e16b0146f 100644
|
||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
|
||||
@@ -19,9 +19,11 @@ import org.slf4j.Logger;
|
||||
@@ -14,9 +14,11 @@ import net.minecraft.nbt.ListTag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
public class AttributeMap {
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
- private final Map<Holder<Attribute>, AttributeInstance> attributes = new Object2ObjectOpenHashMap<>();
|
||||
- private final Set<AttributeInstance> attributesToSync = new ObjectOpenHashSet<>();
|
||||
- private final Set<AttributeInstance> attributesToUpdate = new ObjectOpenHashSet<>();
|
||||
@@ -33,20 +33,20 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRA
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
diff --git a/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
index c6e53b56c55ebf2c13b08b9896ffd545b04762d1..c166091d1b33c8f0ea57fb723e9d9b0c83bcedfb 100644
|
||||
index 5677a1d1ca2fc5d179034e2747f334a708a7cc79..e9d1c3c8cd637361e732010950e2a60cfc598c7c 100644
|
||||
--- a/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
+++ b/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
||||
@@ -25,7 +25,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
@@ -20,7 +20,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
static final java.util.regex.Pattern PROP_PATTERN = java.util.regex.Pattern.compile("\\w{0,16}");
|
||||
// Spigot end
|
||||
// CraftBukkit start - add fields
|
||||
- private static final HashMap<InetAddress, Long> throttleTracker = new HashMap<>();
|
||||
+ private static final it.unimi.dsi.fastutil.objects.Object2LongMap<InetAddress> throttleTracker = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>(); // Gale - Dionysus - replace throttle tracker map with optimized collection
|
||||
- private static final java.util.HashMap<java.net.InetAddress, Long> throttleTracker = new java.util.HashMap<>();
|
||||
+ private static final it.unimi.dsi.fastutil.objects.Object2LongMap<java.net.InetAddress> throttleTracker = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>(); // Gale - Dionysus - replace throttle tracker map with optimized collection
|
||||
private static int throttleCounter = 0;
|
||||
// CraftBukkit end
|
||||
private static final boolean BYPASS_HOSTCHECK = Boolean.getBoolean("Paper.bypassHostCheck"); // Paper
|
||||
@@ -84,7 +84,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress();
|
||||
@@ -79,7 +79,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL
|
||||
java.net.InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress();
|
||||
|
||||
synchronized (ServerHandshakePacketListenerImpl.throttleTracker) {
|
||||
- if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) {
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/level/material/FlowingFluid.java b/net/minecraft/world/level/material/FlowingFluid.java
|
||||
index e30499bdcd6600e5c9d4a755c1182fb6dff3735f..c47a33a989d7ffea4f0bbae39fd64869369e9bda 100644
|
||||
index ab8babd32b7d71bc14049c8778525499e715bd12..95ffd0195b9e0792c6b84115d1a1196231b39cec 100644
|
||||
--- a/net/minecraft/world/level/material/FlowingFluid.java
|
||||
+++ b/net/minecraft/world/level/material/FlowingFluid.java
|
||||
@@ -535,7 +535,26 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -484,7 +484,26 @@ public abstract class FlowingFluid extends Fluid {
|
||||
: this.shapes.computeIfAbsent(state, fluidState -> Shapes.box(0.0, 0.0, 0.0, 1.0, fluidState.getHeight(level, pos), 1.0));
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ index e30499bdcd6600e5c9d4a755c1182fb6dff3735f..c47a33a989d7ffea4f0bbae39fd64869
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
return object instanceof FlowingFluid.BlockStatePairKey blockStatePairKey
|
||||
@@ -546,9 +565,7 @@ public abstract class FlowingFluid extends Fluid {
|
||||
@@ -495,9 +514,7 @@ public abstract class FlowingFluid extends Fluid {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@@ -5,12 +5,12 @@ Subject: [PATCH] Cache ShapePairKey hash
|
||||
|
||||
|
||||
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
|
||||
index 976de81d65b6494cdad20f4ec5125fceec86f951..79de4c558f7cbeff7e55b6d9ad2644be46d72cd9 100644
|
||||
index 95bd1139401d49ddf443a64faca8cd30ca3b1a1d..b545ec55430105f74a09d6ae81d4cdc198121f17 100644
|
||||
--- a/net/minecraft/world/level/block/Block.java
|
||||
+++ b/net/minecraft/world/level/block/Block.java
|
||||
@@ -557,7 +557,20 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -610,7 +610,20 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}
|
||||
// Spigot end
|
||||
// CraftBukkit end
|
||||
|
||||
- record ShapePairKey(VoxelShape first, VoxelShape second) {
|
||||
+ // Gale start - cache ShapePairKey hash
|
||||
@@ -30,7 +30,7 @@ index 976de81d65b6494cdad20f4ec5125fceec86f951..79de4c558f7cbeff7e55b6d9ad2644be
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
return other instanceof Block.ShapePairKey shapePairKey && this.first == shapePairKey.first && this.second == shapePairKey.second;
|
||||
@@ -565,7 +578,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -618,7 +631,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
|
||||
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
||||
|
||||
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
|
||||
index 3a44887fa81676d4c06c10eae5d451eace7f595f..830ae2b569b533f2ded23826c48727f1d7fd0272 100644
|
||||
index ac86ea5fc03aab1445712a7143f7714eea31b124..6e93836570859929e4f35d23d9dbcc2ebbc8fb27 100644
|
||||
--- a/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -570,10 +570,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -521,10 +521,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
}
|
||||
|
||||
protected void tryAddFrost() {
|
||||
@@ -28,7 +28,7 @@ index 3a44887fa81676d4c06c10eae5d451eace7f595f..830ae2b569b533f2ded23826c48727f1
|
||||
if (attribute == null) {
|
||||
return;
|
||||
}
|
||||
@@ -581,7 +580,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -532,7 +531,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
float f = -0.05F * this.getPercentFrozen();
|
||||
attribute.addTransientModifier(new AttributeModifier(SPEED_MODIFIER_POWDER_SNOW_ID, f, AttributeModifier.Operation.ADD_VALUE));
|
||||
}
|
||||
Reference in New Issue
Block a user