chore: update to 1.20.5
This commit is contained in:
parent
654a70ca42
commit
184fdb4c34
|
@ -1,15 +1,16 @@
|
|||
plugins {
|
||||
id("jfmod") version "1.5-SNAPSHOT"
|
||||
id("jfmod") version "1.6-SNAPSHOT"
|
||||
}
|
||||
|
||||
allprojects { group = "io.gitlab.jfronny" }
|
||||
base.archivesName = "yescheat"
|
||||
|
||||
jfMod {
|
||||
minecraftVersion = "1.20.4"
|
||||
minecraftVersion = "1.20.5"
|
||||
yarn("build.1")
|
||||
loaderVersion = "0.15.0"
|
||||
libJfVersion = "3.14.1"
|
||||
loaderVersion = "0.15.10"
|
||||
libJfVersion = "3.15.5"
|
||||
fabricApiVersion = "0.97.6+1.20.5"
|
||||
|
||||
modrinth {
|
||||
projectId = "yescheat"
|
||||
|
@ -18,11 +19,15 @@ jfMod {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v2:${jfMod.libJfVersion.get()}")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api:0.91.1+${jfMod.minecraftVersion.get()}")
|
||||
modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v2")
|
||||
modImplementation("net.fabricmc.fabric-api:fabric-api")
|
||||
|
||||
// Dev env
|
||||
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny:${jfMod.libJfVersion.get()}")
|
||||
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil:${jfMod.libJfVersion.get()}")
|
||||
modLocalRuntime("com.terraformersmc:modmenu:9.0.0-pre.1")
|
||||
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")
|
||||
// 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")
|
||||
}
|
|
@ -26,7 +26,7 @@ public class Plugin implements IMixinConfigPlugin {
|
|||
if (mixinClassName.startsWith("Debug")) return true;
|
||||
return switch (mixinClassName) {
|
||||
case "UnblockChests" -> Cfg.unblockChests;
|
||||
case "UncapEnchants" -> Cfg.uncapEnchants;
|
||||
case "UncapEnchants", "UncapEnchants$Builder" -> Cfg.uncapEnchants;
|
||||
case "IgnoreEula" -> true;
|
||||
case "DistantContainers3x3", "DistantContainerXx9" -> Cfg.distantContainers;
|
||||
case "UnlockMendingInfinity" -> Cfg.unlockMending;
|
||||
|
|
|
@ -16,7 +16,6 @@ public class YesCheat implements ModInitializer {
|
|||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
System.out.println("Ae");
|
||||
if (Cfg.villagersFollowEmeralds) {
|
||||
villagersFollowEmeraldsInit();
|
||||
Registry.register(Registries.SENSOR_TYPE, TEMPTATIONS_ID, VILLAGER_TEMPTATIONS);
|
||||
|
|
|
@ -1,18 +1,26 @@
|
|||
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.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 {
|
||||
@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) {
|
||||
MAX_BREAK_SQUARED_DISTANCE = Double.MAX_VALUE;
|
||||
/**
|
||||
* @author JFronny
|
||||
* @reason Allow interacting with entities from any distance
|
||||
*/
|
||||
@Overwrite
|
||||
public double getEntityInteractionRange() {
|
||||
return Double.MAX_VALUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,51 @@
|
|||
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 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.Inject;
|
||||
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 {
|
||||
@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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "io.gitlab.jfronny.yescheat.mixin",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"plugin": "io.gitlab.jfronny.yescheat.Plugin",
|
||||
"mixins": [
|
||||
"DistantBreaking",
|
||||
|
@ -12,6 +11,7 @@
|
|||
"RemoveRubberbanding",
|
||||
"UnblockChests",
|
||||
"UncapEnchants",
|
||||
"UncapEnchants$Builder",
|
||||
"UnlockMendingInfinity",
|
||||
"VillagersFollowEmeralds1",
|
||||
"VillagersFollowEmeralds2"
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
"minecraft:emerald_block",
|
||||
"minecraft:emerald_ore",
|
||||
"minecraft:deepslate_emerald_ore",
|
||||
"#c:emeralds"
|
||||
"#c:gems/emerald"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue