25 lines
957 B
Java
25 lines
957 B
Java
package com.thebrokenrail.gulliverreloaded.mixin;
|
|
|
|
import com.thebrokenrail.gulliverreloaded.ScaledEntity;
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
|
|
import net.minecraft.entity.LivingEntity;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
|
|
|
@SuppressWarnings("unused")
|
|
@Environment(EnvType.CLIENT)
|
|
@Mixin(InventoryScreen.class)
|
|
public class MixinInventoryScreen {
|
|
@ModifyVariable(at = @At("HEAD"), method = "drawEntity", argsOnly = true, index = 2)
|
|
private static int adjustEntitySize(int initial, int x, int y, int size, float mouseX, float mouseY, LivingEntity entity) {
|
|
if (entity instanceof ScaledEntity) {
|
|
return (int) (initial / ((ScaledEntity) entity).getScale());
|
|
} else {
|
|
return initial;
|
|
}
|
|
}
|
|
}
|