chore: update to 1.20.5
ci/woodpecker/push/jfmod Pipeline was successful Details
ci/woodpecker/tag/jfmod Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2024-04-25 21:47:03 +02:00
parent 654a70ca42
commit 184fdb4c34
Signed by: Johannes
GPG Key ID: E76429612C2929F4
7 changed files with 75 additions and 26 deletions

View File

@ -1,15 +1,16 @@
plugins { plugins {
id("jfmod") version "1.5-SNAPSHOT" id("jfmod") version "1.6-SNAPSHOT"
} }
allprojects { group = "io.gitlab.jfronny" } allprojects { group = "io.gitlab.jfronny" }
base.archivesName = "yescheat" base.archivesName = "yescheat"
jfMod { jfMod {
minecraftVersion = "1.20.4" minecraftVersion = "1.20.5"
yarn("build.1") yarn("build.1")
loaderVersion = "0.15.0" loaderVersion = "0.15.10"
libJfVersion = "3.14.1" libJfVersion = "3.15.5"
fabricApiVersion = "0.97.6+1.20.5"
modrinth { modrinth {
projectId = "yescheat" projectId = "yescheat"
@ -18,11 +19,15 @@ jfMod {
} }
dependencies { dependencies {
modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v2:${jfMod.libJfVersion.get()}") modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v2")
modImplementation("net.fabricmc.fabric-api:fabric-api:0.91.1+${jfMod.minecraftVersion.get()}") modImplementation("net.fabricmc.fabric-api:fabric-api")
// Dev env // Dev env
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny:${jfMod.libJfVersion.get()}") modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil:${jfMod.libJfVersion.get()}") modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil")
modLocalRuntime("com.terraformersmc:modmenu:9.0.0-pre.1") modLocalRuntime("com.terraformersmc:modmenu:10.0.0-beta.1")
// for modmenu
modLocalRuntime("net.fabricmc.fabric-api:fabric-resource-loader-v0")
modLocalRuntime("net.fabricmc.fabric-api:fabric-screen-api-v1")
modLocalRuntime("net.fabricmc.fabric-api:fabric-key-binding-api-v1")
} }

View File

@ -26,7 +26,7 @@ public class Plugin implements IMixinConfigPlugin {
if (mixinClassName.startsWith("Debug")) return true; if (mixinClassName.startsWith("Debug")) return true;
return switch (mixinClassName) { return switch (mixinClassName) {
case "UnblockChests" -> Cfg.unblockChests; case "UnblockChests" -> Cfg.unblockChests;
case "UncapEnchants" -> Cfg.uncapEnchants; case "UncapEnchants", "UncapEnchants$Builder" -> Cfg.uncapEnchants;
case "IgnoreEula" -> true; case "IgnoreEula" -> true;
case "DistantContainers3x3", "DistantContainerXx9" -> Cfg.distantContainers; case "DistantContainers3x3", "DistantContainerXx9" -> Cfg.distantContainers;
case "UnlockMendingInfinity" -> Cfg.unlockMending; case "UnlockMendingInfinity" -> Cfg.unlockMending;

View File

@ -16,7 +16,6 @@ public class YesCheat implements ModInitializer {
@Override @Override
public void onInitialize() { public void onInitialize() {
System.out.println("Ae");
if (Cfg.villagersFollowEmeralds) { if (Cfg.villagersFollowEmeralds) {
villagersFollowEmeraldsInit(); villagersFollowEmeraldsInit();
Registry.register(Registries.SENSOR_TYPE, TEMPTATIONS_ID, VILLAGER_TEMPTATIONS); Registry.register(Registries.SENSOR_TYPE, TEMPTATIONS_ID, VILLAGER_TEMPTATIONS);

View File

@ -1,18 +1,26 @@
package io.gitlab.jfronny.yescheat.mixin; package io.gitlab.jfronny.yescheat.mixin;
import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import org.spongepowered.asm.mixin.*; 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;
@Mixin(ServerPlayNetworkHandler.class) @Mixin(PlayerEntity.class)
public class DistantBreaking { public class DistantBreaking {
@Mutable /**
@Shadow @Final public static double MAX_BREAK_SQUARED_DISTANCE; * @author JFronny
* @reason Allow breaking blocks from any distance
*/
@Overwrite
public boolean canInteractWithBlockAt(BlockPos pos, double additionalRange) {
return true;
}
@Inject(method = "<clinit>", at = @At("TAIL")) /**
private static void yescheat$postInit(CallbackInfo ci) { * @author JFronny
MAX_BREAK_SQUARED_DISTANCE = Double.MAX_VALUE; * @reason Allow interacting with entities from any distance
*/
@Overwrite
public double getEntityInteractionRange() {
return Double.MAX_VALUE;
} }
} }

View File

@ -1,14 +1,51 @@
package io.gitlab.jfronny.yescheat.mixin; package io.gitlab.jfronny.yescheat.mixin;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import net.minecraft.component.type.ItemEnchantmentsComponent;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import org.spongepowered.asm.mixin.Mixin; import net.minecraft.registry.entry.RegistryEntry;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg; import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(EnchantmentHelper.class) @Mixin(ItemEnchantmentsComponent.class)
public class UncapEnchants { public class UncapEnchants {
@ModifyArg(method = "getLevelFromNbt", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(III)I"), index = 2) @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) { private static int injectMaxEnchantmentLevel(int x) {
return Integer.MAX_VALUE; 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()) {
int i = entry.getIntValue();
if (i >= 0) continue;
throw new IllegalArgumentException("Enchantment " + entry.getKey() + " has invalid level " + i);
}
return new Object2IntOpenHashMap<RegistryEntry<Enchantment>>().object2IntEntrySet();
}
@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))
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))
private int min2(int a, int b) {
return a;
}
}
} }

View File

@ -2,7 +2,6 @@
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "io.gitlab.jfronny.yescheat.mixin", "package": "io.gitlab.jfronny.yescheat.mixin",
"compatibilityLevel": "JAVA_16",
"plugin": "io.gitlab.jfronny.yescheat.Plugin", "plugin": "io.gitlab.jfronny.yescheat.Plugin",
"mixins": [ "mixins": [
"DistantBreaking", "DistantBreaking",
@ -12,6 +11,7 @@
"RemoveRubberbanding", "RemoveRubberbanding",
"UnblockChests", "UnblockChests",
"UncapEnchants", "UncapEnchants",
"UncapEnchants$Builder",
"UnlockMendingInfinity", "UnlockMendingInfinity",
"VillagersFollowEmeralds1", "VillagersFollowEmeralds1",
"VillagersFollowEmeralds2" "VillagersFollowEmeralds2"

View File

@ -3,6 +3,6 @@
"minecraft:emerald_block", "minecraft:emerald_block",
"minecraft:emerald_ore", "minecraft:emerald_ore",
"minecraft:deepslate_emerald_ore", "minecraft:deepslate_emerald_ore",
"#c:emeralds" "#c:gems/emerald"
] ]
} }