BlockOverlay Mod

This commit is contained in:
kirillsaint 2023-06-30 16:42:55 +06:00
parent 55eebc7e64
commit e74b01de24
2 changed files with 25 additions and 4 deletions

View File

@ -5,20 +5,19 @@ import net.minecraft.client.gui.*;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.resources.data.IMetadataSerializer;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.client.shader.Framebuffer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.event.impl.ClientTickEvent;
import net.silentclient.client.event.impl.EventClickMouse;
import net.silentclient.client.event.impl.EventDebugFps;
import net.silentclient.client.event.impl.EventScrollMouse;
import net.silentclient.client.event.impl.*;
import net.silentclient.client.gui.GuiNews;
import net.silentclient.client.gui.util.BackgroundPanorama;
import net.silentclient.client.mods.render.AnimationsMod;
import org.apache.logging.log4j.Logger;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
@ -72,6 +71,14 @@ public abstract class MinecraftMixin {
new ClientTickEvent().call();
}
@Redirect(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/settings/KeyBinding;setKeyBindState(IZ)V"))
public void keyEvent(int keybinding, boolean keyCode) {
KeyBinding.setKeyBindState(keybinding, keyCode);
KeyEvent event = new KeyEvent(keybinding);
event.call();
}
@Shadow abstract void displayGuiScreen(GuiScreen screen);
@Shadow private static int debugFPS;

View File

@ -3,8 +3,12 @@ package net.silentclient.client.mixin.mixins;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.culling.ICamera;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MovingObjectPosition;
import net.silentclient.client.event.impl.RenderTickEvent;
import net.silentclient.client.mods.render.BlockOverlayMod;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@ -15,4 +19,14 @@ public class RenderGlobalMixin {
public void tickEvent(Entity renderViewEntity, ICamera camera, float partialTicks, CallbackInfo ci) {
new RenderTickEvent().call();
}
/**
* @author kirillsaint
* @reason BlockOverlayMod
*/
@Overwrite
public void drawSelectionBox(EntityPlayer player, MovingObjectPosition movingObjectPositionIn, int p_72731_3_, float partialTicks)
{
BlockOverlayMod.drawSelectionBox(player, movingObjectPositionIn, p_72731_3_, partialTicks);
}
}