com.yungnickyoung.minecraft.yungsapi.mixin.IncreaseStructureWeightLimitMixinFabric Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of YungsApi-1.21-Fabric Show documentation
Show all versions of YungsApi-1.21-Fabric Show documentation
A common API for YUNG's Minecraft mods
The newest version!
package com.yungnickyoung.minecraft.yungsapi.mixin;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.mojang.serialization.Codec;
import net.minecraft.class_3785;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@SuppressWarnings("UnresolvedMixinReference")
@Mixin(class_3785.class)
public class IncreaseStructureWeightLimitMixinFabric {
/**
* Increases the weight limit that mojang slapped on that was a workaround for https://bugs.mojang.com/browse/MC-203131
* @author - TelepathicGrunt
* @return - The higher weight that is a more reasonable limit.
*/
@WrapOperation(
method = {
"m_dgkaflam",
"method_28886"
},
at = @At(value = "INVOKE", target = "Lcom/mojang/serialization/Codec;intRange(II)Lcom/mojang/serialization/Codec;"),
remap = false,
require = 0
)
private static Codec yungsapi_increaseWeightLimit(int minRange, int maxRange, Operation> original) {
return original.call(minRange, 5000);
}
}