From 924984594f8eb6f272da25f56d9bf5f1ecd97fa9 Mon Sep 17 00:00:00 2001 From: Etil <81570777+etil2jz@users.noreply.github.com> Date: Mon, 10 Jan 2022 15:46:43 +0100 Subject: [PATCH] And the latest Lithium patches --- ...ithium-entity.fast_powder_snow_check.patch | 35 +++++++++++++++++++ .../0098-lithium-collections.attributes.patch | 32 +++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 patches/server/0097-lithium-entity.fast_powder_snow_check.patch create mode 100644 patches/server/0098-lithium-collections.attributes.patch diff --git a/patches/server/0097-lithium-entity.fast_powder_snow_check.patch b/patches/server/0097-lithium-entity.fast_powder_snow_check.patch new file mode 100644 index 0000000..666fe80 --- /dev/null +++ b/patches/server/0097-lithium-entity.fast_powder_snow_check.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: 2No2Name <2No2Name@web.de> +Date: Sat, 8 Jan 2022 03:51:28 +0100 +Subject: [PATCH] lithium: entity.fast_powder_snow_check + +Original code by CaffeineMC, licensed under GNU Lesser General Public License v3.0 +You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) + +diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java +index df33f1021eda772605bb4423eb2b103d51397557..35a15b012653e493b554c17afa1b01e423ed6d6b 100644 +--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java ++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java +@@ -566,11 +566,11 @@ public abstract class LivingEntity extends Entity { + } + + protected void tryAddFrost() { +- if (!this.getBlockStateOn().isAir()) { ++ //if (!this.getBlockStateOn().isAir()) { // Mirai + int i = this.getTicksFrozen(); + + if (i > 0) { +- AttributeInstance attributemodifiable = this.getAttribute(Attributes.MOVEMENT_SPEED); ++ AttributeInstance attributemodifiable = this.getBlockStateOn().isAir() ? null : this.getAttribute(Attributes.MOVEMENT_SPEED); // Mirai + + if (attributemodifiable == null) { + return; +@@ -580,7 +580,7 @@ public abstract class LivingEntity extends Entity { + + attributemodifiable.addTransientModifier(new AttributeModifier(LivingEntity.SPEED_MODIFIER_POWDER_SNOW_UUID, "Powder snow slow", (double) f, AttributeModifier.Operation.ADDITION)); + } +- } ++ //} // Mirai + + } + diff --git a/patches/server/0098-lithium-collections.attributes.patch b/patches/server/0098-lithium-collections.attributes.patch new file mode 100644 index 0000000..1022bb6 --- /dev/null +++ b/patches/server/0098-lithium-collections.attributes.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: 2No2Name <2No2Name@web.de> +Date: Sun, 9 Jan 2022 17:53:11 +0100 +Subject: [PATCH] lithium: collections.attributes + +Original code by CaffeineMC, licensed under GNU Lesser General Public License v3.0 +You can find the original code on https://github.com/CaffeineMC/lithium-fabric (Yarn mappings) + +diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +index 52ddf38d5a1894a248e142c6b9ebaff5cc921e5b..a4a49fde55ccbbe9a91018b422e61dc17a6922e7 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java ++++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java +@@ -3,6 +3,8 @@ package net.minecraft.world.entity.ai.attributes; + import com.google.common.collect.Maps; + import com.google.common.collect.Multimap; + import com.google.common.collect.Sets; ++import it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap; // Mirai ++import it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet; // Mirai + import java.util.Collection; + import java.util.Map; + import java.util.Set; +@@ -19,8 +21,8 @@ import org.apache.logging.log4j.Logger; + + public class AttributeMap { + private static final Logger LOGGER = LogManager.getLogger(); +- private final Map attributes = Maps.newHashMap(); +- private final Set dirtyAttributes = Sets.newHashSet(); ++ private final Map attributes = new Reference2ReferenceOpenHashMap<>(); // Mirai ++ private final Set dirtyAttributes = new ReferenceOpenHashSet<>(); // Mirai + private final AttributeSupplier supplier; + private final java.util.function.Function createInstance; // Pufferfish +