chore: update to 1.21
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-06-14 14:37:34 +02:00
parent 184fdb4c34
commit d4e40b52c8
Signed by: Johannes
GPG Key ID: E76429612C2929F4
10 changed files with 8 additions and 37 deletions

View File

@ -10,7 +10,6 @@ The following features are implemented:
- Enchantments aren't capped at 255
- The EULA file is ignored
- Container screens aren't closed when moving away from them
- The mending enchantment can be applied at the same time as others
- Blocks can be broken at any distance
- Remove movement checks ("fixes" rubber banding)
- Villagers follow emerald blocks

View File

@ -6,11 +6,11 @@ allprojects { group = "io.gitlab.jfronny" }
base.archivesName = "yescheat"
jfMod {
minecraftVersion = "1.20.5"
minecraftVersion = "1.21"
yarn("build.1")
loaderVersion = "0.15.10"
libJfVersion = "3.15.5"
fabricApiVersion = "0.97.6+1.20.5"
loaderVersion = "0.15.11"
libJfVersion = "3.16.0"
fabricApiVersion = "0.100.1+1.21"
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:10.0.0-beta.1")
modLocalRuntime("com.terraformersmc:modmenu:11.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

@ -9,7 +9,6 @@ public class Cfg {
@Entry public static boolean uncapEnchants = true;
@Entry public static boolean unblockChests = true;
@Entry public static boolean distantContainers = true;
@Entry public static boolean unlockMending = true;
@Entry public static boolean distantBreaking = true;
@Entry public static boolean villagersFollowEmeralds = true;

View File

@ -29,7 +29,6 @@ public class Plugin implements IMixinConfigPlugin {
case "UncapEnchants", "UncapEnchants$Builder" -> Cfg.uncapEnchants;
case "IgnoreEula" -> true;
case "DistantContainers3x3", "DistantContainerXx9" -> Cfg.distantContainers;
case "UnlockMendingInfinity" -> Cfg.unlockMending;
case "DistantBreaking" -> Cfg.distantBreaking;
case "RemoveRubberbanding" -> Cfg.antiRubberband;
case "VillagersFollowEmeralds1", "VillagersFollowEmeralds2" -> Cfg.villagersFollowEmeralds;

View File

@ -11,7 +11,7 @@ import net.minecraft.util.Identifier;
public class YesCheat implements ModInitializer {
public static final String MOD_ID = "yescheat";
private static final Identifier TEMPTATIONS_ID = new Identifier(MOD_ID, "villager_temptations");
private static final Identifier TEMPTATIONS_ID = Identifier.of(MOD_ID, "villager_temptations");
public static SensorType<TemptationsSensor> VILLAGER_TEMPTATIONS;
@Override

View File

@ -15,17 +15,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ItemEnchantmentsComponent.class)
public class UncapEnchants {
@Final @Mutable @Shadow public static int MAX_ENCHANTMENT_LEVEL;
@ModifyArg(method = "<clinit>", at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;intRange(II)Lcom/mojang/serialization/Codec;", remap = false), index = 1)
private static int injectMaxEnchantmentLevel(int x) {
return Integer.MAX_VALUE;
}
@Inject(method = "<clinit>", at = @At("TAIL"))
private static void ae(CallbackInfo ci) {
MAX_ENCHANTMENT_LEVEL = Integer.MAX_VALUE;
}
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lit/unimi/dsi/fastutil/objects/Object2IntOpenHashMap;object2IntEntrySet()Lit/unimi/dsi/fastutil/objects/Object2IntMap$FastEntrySet;", remap = false))
private Object2IntMap.FastEntrySet<RegistryEntry<Enchantment>> object2IntEntrySet(Object2IntOpenHashMap<RegistryEntry<Enchantment>> object2IntOpenHashMap) {
for (Object2IntMap.Entry<RegistryEntry<Enchantment>> entry : object2IntOpenHashMap.object2IntEntrySet()) {
@ -38,12 +32,12 @@ public class UncapEnchants {
@Mixin(ItemEnchantmentsComponent.Builder.class)
public static class Builder {
@Redirect(method = "set(Lnet/minecraft/enchantment/Enchantment;I)V", at = @At(value = "INVOKE", target = "Ljava/lang/Math;min(II)I", remap = false))
@Redirect(method = "set(Lnet/minecraft/registry/entry/RegistryEntry;I)V", at = @At(value = "INVOKE", target = "Ljava/lang/Math;min(II)I", remap = false))
private int min(int a, int b) {
return a;
}
@Redirect(method = "add(Lnet/minecraft/enchantment/Enchantment;I)V", at = @At(value = "INVOKE", target = "Ljava/lang/Math;min(II)I", remap = false))
@Redirect(method = "add(Lnet/minecraft/registry/entry/RegistryEntry;I)V", at = @At(value = "INVOKE", target = "Ljava/lang/Math;min(II)I", remap = false))
private int min2(int a, int b) {
return a;
}

View File

@ -1,17 +0,0 @@
package io.gitlab.jfronny.yescheat.mixin;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.InfinityEnchantment;
import net.minecraft.enchantment.MendingEnchantment;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(InfinityEnchantment.class)
public class UnlockMendingInfinity {
@Inject(method = "canAccept", at = @At("HEAD"), cancellable = true)
private void differs(Enchantment other, CallbackInfoReturnable<Boolean> cir) {
if (other instanceof MendingEnchantment) cir.setReturnValue(true);
}
}

View File

@ -12,7 +12,6 @@
"UnblockChests",
"UncapEnchants",
"UncapEnchants$Builder",
"UnlockMendingInfinity",
"VillagersFollowEmeralds1",
"VillagersFollowEmeralds2"
],

View File

@ -8,8 +8,6 @@
"yescheat.jfconfig.unblockChests.tooltip": "Chests are never blocked",
"yescheat.jfconfig.distantContainers": "Distant Containers",
"yescheat.jfconfig.distantContainers.tooltip": "Distant container screens aren't closed",
"yescheat.jfconfig.unlockMending": "Unblock Mending",
"yescheat.jfconfig.unlockMending.tooltip": "Allows using mending in parallel with infinity",
"yescheat.jfconfig.distantBreaking": "Distant Breaking",
"yescheat.jfconfig.distantBreaking.tooltip": "Removes the maximum distance for breaking blocks",
"yescheat.jfconfig.villagersFollowEmeralds": "Villagers follow Emeralds",