From ae5c52b5e6ba5f44db57d8d1d0c79d4b14fd48f8 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:41:00 -0500 Subject: [PATCH 1/2] Make AttributeTemplater ecord public --- patches/net/minecraft/world/effect/MobEffect.java.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/net/minecraft/world/effect/MobEffect.java.patch b/patches/net/minecraft/world/effect/MobEffect.java.patch index 1daf7ed3ab..94408844fa 100644 --- a/patches/net/minecraft/world/effect/MobEffect.java.patch +++ b/patches/net/minecraft/world/effect/MobEffect.java.patch @@ -50,7 +50,7 @@ } - static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) { -+ static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation, @Nullable it.unimi.dsi.fastutil.ints.Int2DoubleFunction curve) { ++ public static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation, @Nullable it.unimi.dsi.fastutil.ints.Int2DoubleFunction curve) { + + public AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) { + this(id, amount, operation, null); From 61612124818ca791b58bd7e1a8ac630ee3adfbe4 Mon Sep 17 00:00:00 2001 From: TelepathicGrunt <40846040+TelepathicGrunt@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:30:33 -0500 Subject: [PATCH 2/2] AT access to record --- patches/net/minecraft/world/effect/MobEffect.java.patch | 2 +- src/main/resources/META-INF/accesstransformer.cfg | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/patches/net/minecraft/world/effect/MobEffect.java.patch b/patches/net/minecraft/world/effect/MobEffect.java.patch index 94408844fa..ed25ba16ea 100644 --- a/patches/net/minecraft/world/effect/MobEffect.java.patch +++ b/patches/net/minecraft/world/effect/MobEffect.java.patch @@ -49,7 +49,7 @@ return this.requiredFeatures; } -- static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) { +- public static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) { + public static record AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation, @Nullable it.unimi.dsi.fastutil.ints.Int2DoubleFunction curve) { + + public AttributeTemplate(ResourceLocation id, double amount, AttributeModifier.Operation operation) { diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index e50564837a..9f04978b10 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -195,6 +195,8 @@ public net.minecraft.world.damagesource.DamageSources source(Lnet/minecraft/reso public net.minecraft.world.damagesource.DamageSources source(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/entity/Entity;)Lnet/minecraft/world/damagesource/DamageSource; # source public net.minecraft.world.damagesource.DamageSources source(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity;)Lnet/minecraft/world/damagesource/DamageSource; # source public net.minecraft.world.damagesource.DamageSources damageTypes # damageTypes +public net.minecraft.world.effect.MobEffect$AttributeTemplate (Lnet/minecraft/resources/ResourceLocation;DLnet/minecraft/world/entity/ai/attributes/AttributeModifier$Operation;)V # constructor +public net.minecraft.world.effect.MobEffect$AttributeTemplate # AttributeTemplate protected net.minecraft.world.entity.Entity ENTITY_COUNTER # ENTITY_COUNTER public net.minecraft.world.entity.Entity getEncodeId()Ljava/lang/String; # getEncodeId public net.minecraft.world.entity.ExperienceOrb value # value