chore: update to 1.21.3
All checks were successful
ci/woodpecker/push/jfmod Pipeline was successful
ci/woodpecker/tag/jfmod Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-10-23 20:47:39 +02:00
parent d4e40b52c8
commit 8b22c677ec
Signed by: Johannes
GPG Key ID: E76429612C2929F4
5 changed files with 18 additions and 12 deletions

View File

@ -6,11 +6,11 @@ allprojects { group = "io.gitlab.jfronny" }
base.archivesName = "yescheat"
jfMod {
minecraftVersion = "1.21"
yarn("build.1")
loaderVersion = "0.15.11"
libJfVersion = "3.16.0"
fabricApiVersion = "0.100.1+1.21"
minecraftVersion = "1.21.3"
yarn("build.2")
loaderVersion = "0.16.7"
libJfVersion = "3.18.0"
fabricApiVersion = "0.106.1+1.21.3"
modrinth {
projectId = "yescheat"
@ -25,7 +25,7 @@ dependencies {
// Dev env
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil")
modLocalRuntime("com.terraformersmc:modmenu:11.0.0-beta.1")
modLocalRuntime("com.terraformersmc:modmenu:12.0.0-beta.1")
// for modmenu
modLocalRuntime("net.fabricmc.fabric-api:fabric-resource-loader-v0")
modLocalRuntime("net.fabricmc.fabric-api:fabric-screen-api-v1")

View File

@ -1,7 +1,6 @@
pluginManagement {
repositories {
maven("https://maven.fabricmc.net/") // FabricMC
maven("https://maven.frohnmeyer-wds.de/artifacts") // scripts
maven("https://maven.frohnmeyer-wds.de/mirrors")
gradlePluginPortal()
}
}

View File

@ -25,10 +25,9 @@ public class YesCheat implements ModInitializer {
public static synchronized void villagersFollowEmeraldsInit() {
if (!Cfg.villagersFollowEmeralds) throw new IllegalStateException("villagersFollowEmeralds is not enabled but its initializer is called");
if (VILLAGER_TEMPTATIONS == null) {
var tagKey = TagKey.of(RegistryKeys.ITEM, TEMPTATIONS_ID);
VILLAGER_TEMPTATIONS =
new SensorType<>(() -> new TemptationsSensor((Ingredient.fromTag(
TagKey.of(RegistryKeys.ITEM, TEMPTATIONS_ID)
))));
new SensorType<>(() -> new TemptationsSensor(stack -> stack.isIn(tagKey)));
}
}
}

View File

@ -5,11 +5,14 @@ import io.gitlab.jfronny.yescheat.YesCheat;
import net.minecraft.entity.ai.brain.MemoryModuleType;
import net.minecraft.entity.ai.brain.sensor.Sensor;
import net.minecraft.entity.ai.brain.sensor.SensorType;
import net.minecraft.entity.attribute.DefaultAttributeContainer;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.passive.VillagerEntity;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.ArrayList;
@ -33,4 +36,9 @@ public abstract class VillagersFollowEmeralds1 {
newSensors.add(YesCheat.VILLAGER_TEMPTATIONS);
SENSORS = ImmutableList.copyOf(newSensors);
}
@Inject(method = "createVillagerAttributes()Lnet/minecraft/entity/attribute/DefaultAttributeContainer$Builder;", at = @At("RETURN"), cancellable = true)
private static void addTemptationAttributes(CallbackInfoReturnable<DefaultAttributeContainer.Builder> cir) {
cir.setReturnValue(cir.getReturnValue().add(EntityAttributes.TEMPT_RANGE, 10));
}
}

View File

@ -14,7 +14,7 @@ public abstract class VillagersFollowEmeralds2 {
Object[] modified = new Object[original.length + 2];
System.arraycopy(original, 0, modified, 0, original.length);
modified[original.length] = Pair.of(0, new TemptTask(e -> 0.5f));
modified[original.length + 1] = Pair.of(0, new TemptationCooldownTask(MemoryModuleType.TEMPTATION_COOLDOWN_TICKS));
modified[original.length + 1] = Pair.of(0, new TickCooldownTask(MemoryModuleType.TEMPTATION_COOLDOWN_TICKS));
return modified;
}
}