mirror of
https://github.com/refactorinqq/SLC-1.8.9.git
synced 2024-11-10 10:41:33 +01:00
Animations Mod
This commit is contained in:
parent
8f0cb20a23
commit
aa84d594f9
21
src/main/java/net/silentclient/client/hooks/ChunkHook.java
Normal file
21
src/main/java/net/silentclient/client/hooks/ChunkHook.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package net.silentclient.client.hooks;
|
||||||
|
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.world.chunk.Chunk;
|
||||||
|
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||||
|
|
||||||
|
public class ChunkHook {
|
||||||
|
|
||||||
|
public static IBlockState getBlockState(Chunk chunk, BlockPos pos) {
|
||||||
|
final int y = pos.getY();
|
||||||
|
|
||||||
|
if (y >= 0 && y >> 4 < chunk.getBlockStorageArray().length) {
|
||||||
|
final ExtendedBlockStorage storage = chunk.getBlockStorageArray()[y >> 4];
|
||||||
|
if (storage != null) return storage.get(pos.getX() & 15, y & 15, pos.getZ() & 15);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Blocks.air.getDefaultState();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package net.silentclient.client.hooks;
|
||||||
|
|
||||||
|
import org.lwjgl.LWJGLException;
|
||||||
|
import org.lwjgl.opengl.Display;
|
||||||
|
import org.lwjgl.opengl.DisplayMode;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.mods.settings.RenderMod;
|
||||||
|
|
||||||
|
public class MinecraftHook {
|
||||||
|
|
||||||
|
public static void displayFix(boolean fullscreen, int displayWidth, int displayHeight) throws LWJGLException {
|
||||||
|
Display.setFullscreen(false);
|
||||||
|
if (fullscreen) {
|
||||||
|
if (Client.getInstance().getModInstances() != null && RenderMod.isBorderlessFullScreen()) {
|
||||||
|
System.setProperty("org.lwjgl.opengl.Window.undecorated", "true");
|
||||||
|
} else {
|
||||||
|
Display.setFullscreen(true);
|
||||||
|
DisplayMode displaymode = Display.getDisplayMode();
|
||||||
|
Minecraft.getMinecraft().displayWidth = Math.max(1, displaymode.getWidth());
|
||||||
|
Minecraft.getMinecraft().displayHeight = Math.max(1, displaymode.getHeight());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Client.getInstance().getModInstances() != null && RenderMod.isBorderlessFullScreen()) {
|
||||||
|
System.setProperty("org.lwjgl.opengl.Window.undecorated", "false");
|
||||||
|
} else {
|
||||||
|
Display.setDisplayMode(new DisplayMode(displayWidth, displayHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Display.setResizable(false);
|
||||||
|
Display.setResizable(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void fullScreenFix(boolean fullscreen, int displayWidth, int displayHeight) throws LWJGLException {
|
||||||
|
if (Client.getInstance().getModInstances() != null && RenderMod.isBorderlessFullScreen()) {
|
||||||
|
if (fullscreen) {
|
||||||
|
System.setProperty("org.lwjgl.opengl.Window.undecorated", "true");
|
||||||
|
Display.setDisplayMode(Display.getDesktopDisplayMode());
|
||||||
|
Display.setLocation(0, 0);
|
||||||
|
Display.setFullscreen(false);
|
||||||
|
} else {
|
||||||
|
System.setProperty("org.lwjgl.opengl.Window.undecorated", "false");
|
||||||
|
Display.setDisplayMode(new DisplayMode(displayWidth, displayHeight));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Display.setFullscreen(fullscreen);
|
||||||
|
System.setProperty("org.lwjgl.opengl.Window.undecorated", "false");
|
||||||
|
}
|
||||||
|
|
||||||
|
Display.setResizable(false);
|
||||||
|
Display.setResizable(true);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package net.silentclient.client.hooks;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
|
||||||
|
public class OptiFineHook {
|
||||||
|
public float getCharWidth(FontRenderer renderer, char c) {//Remapped by OptiFineHookTransformer to Optifine if needed
|
||||||
|
return renderer.getCharWidth(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getOptifineBoldOffset(FontRenderer renderer) { //Remapped by FontRendererHookTransformer to Optifine if needed
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,124 @@
|
|||||||
|
package net.silentclient.client.hooks;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||||
|
import net.minecraft.client.resources.model.IBakedModel;
|
||||||
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.mods.render.AnimationsMod;
|
||||||
|
import net.silentclient.client.mods.render.ItemPhysicsMod;
|
||||||
|
import net.silentclient.client.mods.render.UhcOverlayMod;
|
||||||
|
|
||||||
|
public class RenderEntityItemHook {
|
||||||
|
public static int func_177077_a(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_, int func_177078_a) {
|
||||||
|
ItemStack itemstack = itemIn.getEntityItem();
|
||||||
|
Item item = itemstack.getItem();
|
||||||
|
Block block = Block.getBlockFromItem(item);
|
||||||
|
|
||||||
|
if (item == null)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
boolean flag = p_177077_9_.isGui3d();
|
||||||
|
int i = func_177078_a;
|
||||||
|
|
||||||
|
if(Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled()) {
|
||||||
|
if(block != null) {
|
||||||
|
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.15F, (float)p_177077_6_);
|
||||||
|
}else {
|
||||||
|
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + 0.02F, (float)p_177077_6_);
|
||||||
|
GlStateManager.rotate(-90F, 1F, 0F, 0F);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
float f1 = MathHelper.sin(((float)itemIn.getAge() + p_177077_8_) / 10.0F + itemIn.hoverStart) * 0.1F + 0.1F;
|
||||||
|
float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
|
||||||
|
|
||||||
|
GlStateManager.translate((float)p_177077_2_, (float)p_177077_4_ + f1 + 0.25F * f2, (float)p_177077_6_);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled()) {
|
||||||
|
if (flag || Minecraft.getMinecraft().getRenderManager().options != null)
|
||||||
|
{
|
||||||
|
if(Client.getInstance().getModInstances().getModByClass(AnimationsMod.class).isEnabled() && Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "1.7 Throwing").getValBoolean()) {
|
||||||
|
float f3 = 180F - Minecraft.getMinecraft().getRenderManager().playerViewY;
|
||||||
|
GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
|
||||||
|
GlStateManager.rotate(-Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
|
||||||
|
} else {
|
||||||
|
float f3 = (((float)itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float)Math.PI);
|
||||||
|
GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!flag)
|
||||||
|
{
|
||||||
|
float f6 = -0.0F * (float)(i - 1) * 0.5F;
|
||||||
|
float f4 = -0.0F * (float)(i - 1) * 0.5F;
|
||||||
|
float f5 = -0.046875F * (float)(i - 1) * 0.5F;
|
||||||
|
GlStateManager.translate(f6, f4, f5);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled() && !itemIn.onGround) {
|
||||||
|
float angle = System.currentTimeMillis() % (360 * 20) / (float) (4.5 - Client.getInstance().getSettingsManager().getSettingByClass(ItemPhysicsMod.class, "Speed").getValDouble());
|
||||||
|
GlStateManager.rotate(angle, 1F, 1F, 1F);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Client.getInstance().getModInstances().getUhcOverlayMod().isEnabled()) {
|
||||||
|
float ingotScale = (float) Client.getInstance().getSettingsManager().getSettingByClass(UhcOverlayMod.class, "Gold Ingot Scale").getValDouble();
|
||||||
|
float nuggetScale = (float) Client.getInstance().getSettingsManager().getSettingByClass(UhcOverlayMod.class, "Gold Nugget Scale").getValDouble();
|
||||||
|
float appleScale = (float) Client.getInstance().getSettingsManager().getSettingByClass(UhcOverlayMod.class, "Gold Ore Scale").getValDouble();
|
||||||
|
float oreScale = (float) Client.getInstance().getSettingsManager().getSettingByClass(UhcOverlayMod.class, "Gold Apple Scale").getValDouble();
|
||||||
|
float skullScale = (float) Client.getInstance().getSettingsManager().getSettingByClass(UhcOverlayMod.class, "Skull Scale").getValDouble();
|
||||||
|
|
||||||
|
float f6 = -0.0F * (float)(i - 1) * 0.5F;
|
||||||
|
float f4 = -0.0F * (float)(i - 1) * 0.5F;
|
||||||
|
float f5 = -0.046875F * (float)(i - 1) * 0.5F;
|
||||||
|
|
||||||
|
if(item == Items.gold_ingot) {
|
||||||
|
|
||||||
|
if(!Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled()) {
|
||||||
|
GlStateManager.translate(f6, f4 + (ingotScale / 8), f5);
|
||||||
|
}
|
||||||
|
|
||||||
|
GlStateManager.scale(ingotScale, ingotScale, ingotScale);
|
||||||
|
}
|
||||||
|
if(item == Items.gold_nugget) {
|
||||||
|
if(!Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled()) {
|
||||||
|
GlStateManager.translate(f6, f4 + (nuggetScale / 8), f5);
|
||||||
|
}
|
||||||
|
GlStateManager.scale(nuggetScale, nuggetScale, nuggetScale);
|
||||||
|
}
|
||||||
|
if(item == Items.golden_apple) {
|
||||||
|
if(!Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled()) {
|
||||||
|
GlStateManager.translate(f6, f4 + (appleScale / 8), f5);
|
||||||
|
}
|
||||||
|
GlStateManager.scale(appleScale, appleScale, appleScale);
|
||||||
|
}
|
||||||
|
if(block == Blocks.gold_ore) {
|
||||||
|
if(!Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled()) {
|
||||||
|
GlStateManager.translate(f6, f4 + (oreScale / 8), f5);
|
||||||
|
}
|
||||||
|
GlStateManager.scale(oreScale, oreScale, oreScale);
|
||||||
|
}
|
||||||
|
if(item == Items.skull) {
|
||||||
|
if(!Client.getInstance().getModInstances().getItemPhysicsMod().isEnabled()) {
|
||||||
|
GlStateManager.translate(f6, f4 + (skullScale / 8), f5);
|
||||||
|
}
|
||||||
|
GlStateManager.scale(skullScale, skullScale, skullScale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,8 @@
|
|||||||
package net.silentclient.client.mixin.accessors;
|
package net.silentclient.client.mixin.accessors;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiChat;
|
import net.silentclient.client.mixin.wrappers.GuiTextFieldWrapper;
|
||||||
import net.minecraft.client.gui.GuiTextField;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
@Mixin(GuiChat.class)
|
|
||||||
public interface GuiChatAccessor {
|
public interface GuiChatAccessor {
|
||||||
@Accessor
|
GuiTextFieldWrapper silent$getInputField();
|
||||||
GuiTextField getInputField();
|
void silent$setInputField(GuiTextFieldWrapper a);
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,6 @@ import java.io.File;
|
|||||||
|
|
||||||
@Mixin(Minecraft.class)
|
@Mixin(Minecraft.class)
|
||||||
public interface MinecraftAccessor {
|
public interface MinecraftAccessor {
|
||||||
@Accessor
|
|
||||||
TextureManager getRenderEngine();
|
|
||||||
|
|
||||||
@Accessor
|
|
||||||
IMetadataSerializer getMetadataSerializer_();
|
|
||||||
|
|
||||||
@Accessor
|
@Accessor
|
||||||
File getFileAssets();
|
File getFileAssets();
|
||||||
|
|
||||||
@ -24,4 +18,6 @@ public interface MinecraftAccessor {
|
|||||||
|
|
||||||
@Accessor
|
@Accessor
|
||||||
int getLeftClickCounter();
|
int getLeftClickCounter();
|
||||||
|
|
||||||
|
@Accessor boolean isRunning();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
package net.silentclient.client.mixin.ducks;
|
||||||
|
|
||||||
|
import net.silentclient.client.mixin.wrappers.IMetadataSerializerWrapper;
|
||||||
|
import net.silentclient.client.mixin.wrappers.TextureManagerWrapper;
|
||||||
|
|
||||||
|
public interface MinecraftExt {
|
||||||
|
TextureManagerWrapper silent$getRenderEngine();
|
||||||
|
IMetadataSerializerWrapper silent$getMetadataSerializer_();
|
||||||
|
}
|
@ -1,14 +1,17 @@
|
|||||||
package net.silentclient.client.mixin.mixins;
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
import net.minecraft.util.StringUtils;
|
import net.minecraft.util.StringUtils;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.admin.AdminRender;
|
||||||
import net.silentclient.client.cosmetics.*;
|
import net.silentclient.client.cosmetics.*;
|
||||||
import net.silentclient.client.cosmetics.dynamiccurved.DynamicCape;
|
import net.silentclient.client.cosmetics.dynamiccurved.DynamicCape;
|
||||||
import net.silentclient.client.event.impl.EventFovUpdate;
|
import net.silentclient.client.event.impl.EventFovUpdate;
|
||||||
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
import net.silentclient.client.mixin.ducks.AbstractClientPlayerExt;
|
||||||
|
import net.silentclient.client.mods.render.AnimationsMod;
|
||||||
import net.silentclient.client.mods.settings.CosmeticsMod;
|
import net.silentclient.client.mods.settings.CosmeticsMod;
|
||||||
import net.silentclient.client.utils.Players;
|
import net.silentclient.client.utils.Players;
|
||||||
import net.silentclient.client.utils.types.PlayerResponse;
|
import net.silentclient.client.utils.types.PlayerResponse;
|
||||||
@ -62,6 +65,22 @@ public abstract class AbstractClientPlayerMixin implements AbstractClientPlayerE
|
|||||||
cir.setReturnValue(event.getFov());
|
cir.setReturnValue(event.getFov());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "getSkinType", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void mixinSkinType(CallbackInfoReturnable<String> cir) {
|
||||||
|
if(Minecraft.getMinecraft().currentScreen instanceof AdminRender) {
|
||||||
|
cir.setReturnValue("default");
|
||||||
|
cir.cancel();
|
||||||
|
}
|
||||||
|
if(Client.getInstance().getModInstances().getModByClass(AnimationsMod.class).isEnabled() && Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "1.7 Skins").getValBoolean()) {
|
||||||
|
cir.setReturnValue("default");
|
||||||
|
cir.cancel();
|
||||||
|
}
|
||||||
|
if(this.silent$getNameClear().toLowerCase().equals(Client.getInstance().getAccount().getUsername().toLowerCase()) && Client.getInstance().getAccount().getCustomSkin()) {
|
||||||
|
cir.setReturnValue(Client.getInstance().getAccount().getSkinType());
|
||||||
|
cir.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String silent$getCapeType() {
|
public String silent$getCapeType() {
|
||||||
return silent$capeType;
|
return silent$capeType;
|
||||||
|
@ -5,19 +5,23 @@ import net.minecraft.client.entity.EntityPlayerSP;
|
|||||||
import net.minecraft.client.renderer.EntityRenderer;
|
import net.minecraft.client.renderer.EntityRenderer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.cosmetics.StaticResourceLocation;
|
import net.silentclient.client.cosmetics.StaticResourceLocation;
|
||||||
import net.silentclient.client.event.impl.EventCameraRotation;
|
import net.silentclient.client.event.impl.EventCameraRotation;
|
||||||
import net.silentclient.client.event.impl.EventPlayerHeadRotation;
|
import net.silentclient.client.event.impl.EventPlayerHeadRotation;
|
||||||
import net.silentclient.client.event.impl.EventRender3D;
|
import net.silentclient.client.event.impl.EventRender3D;
|
||||||
import net.silentclient.client.event.impl.EventZoomFov;
|
import net.silentclient.client.event.impl.EventZoomFov;
|
||||||
import net.silentclient.client.mixin.ducks.EntityRendererExt;
|
import net.silentclient.client.mixin.ducks.EntityRendererExt;
|
||||||
|
import net.silentclient.client.mods.render.AnimationsMod;
|
||||||
|
import net.silentclient.client.utils.animations.OldSneaking;
|
||||||
import net.silentclient.client.utils.culling.EntityCulling;
|
import net.silentclient.client.utils.culling.EntityCulling;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
|
||||||
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.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
@ -92,6 +96,8 @@ public abstract class EntityRendererMixin implements EntityRendererExt {
|
|||||||
|
|
||||||
@Shadow private Minecraft mc;
|
@Shadow private Minecraft mc;
|
||||||
|
|
||||||
|
@Shadow protected abstract void hurtCameraEffect(float partialTicks);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void silent$loadShader(StaticResourceLocation location) {
|
public void silent$loadShader(StaticResourceLocation location) {
|
||||||
this.loadShader(location.getLocation());
|
this.loadShader(location.getLocation());
|
||||||
@ -114,4 +120,26 @@ public abstract class EntityRendererMixin implements EntityRendererExt {
|
|||||||
|
|
||||||
cir.setReturnValue(event.getFov());
|
cir.setReturnValue(event.getFov());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Redirect(method = "setupCameraTransform", at = @At(value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/EntityRenderer;hurtCameraEffect(F)V"))
|
||||||
|
public void cancelWorldRotation(EntityRenderer entityRenderer, float f) {
|
||||||
|
if(!(Client.getInstance().getModInstances().getOldAnimationsMod().isEnabled() && Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "No Shaking").getValBoolean())) {
|
||||||
|
this.hurtCameraEffect(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "renderHand", at = @At("HEAD"))
|
||||||
|
public void swingProgress(float partialTicks, int xOffset, CallbackInfo ci) {
|
||||||
|
if(mc.thePlayer != null && Client.getInstance().getModInstances().getOldAnimationsMod().isEnabled() && Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "1.7 Punching Animation").getValBoolean()
|
||||||
|
&& mc.objectMouseOver != null
|
||||||
|
&& mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK
|
||||||
|
&& mc.thePlayer != null
|
||||||
|
&& mc.gameSettings.keyBindAttack.isKeyDown() && mc.gameSettings.keyBindUseItem.isKeyDown()
|
||||||
|
&& mc.thePlayer.getItemInUseCount() > 0 && (!mc.thePlayer.isSwingInProgress
|
||||||
|
|| mc.thePlayer.swingProgressInt < 0)) {
|
||||||
|
mc.thePlayer.swingProgressInt = -1;
|
||||||
|
mc.thePlayer.isSwingInProgress = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.GuiChat;
|
||||||
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
|
import net.silentclient.client.mixin.accessors.GuiChatAccessor;
|
||||||
|
import net.silentclient.client.mixin.wrappers.GuiTextFieldWrapper;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
|
@Mixin(GuiChat.class)
|
||||||
|
public class GuiChatMixin implements GuiChatAccessor {
|
||||||
|
|
||||||
|
@Shadow protected GuiTextField inputField;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GuiTextFieldWrapper silent$getInputField() {
|
||||||
|
return new GuiTextFieldWrapper(this.inputField);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void silent$setInputField(GuiTextFieldWrapper a) {
|
||||||
|
if(a == null) {
|
||||||
|
this.inputField = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.inputField = a.getGuiTextField();
|
||||||
|
}
|
||||||
|
}
|
@ -3,6 +3,7 @@ package net.silentclient.client.mixin.mixins;
|
|||||||
import net.minecraft.client.renderer.ItemRenderer;
|
import net.minecraft.client.renderer.ItemRenderer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.silentclient.client.event.impl.EventTransformFirstPersonItem;
|
import net.silentclient.client.event.impl.EventTransformFirstPersonItem;
|
||||||
|
import net.silentclient.client.utils.animations.AnimationHandler;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@ -13,9 +14,24 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
public class ItemRendererMixin {
|
public class ItemRendererMixin {
|
||||||
@Shadow private ItemStack itemToRender;
|
@Shadow private ItemStack itemToRender;
|
||||||
|
|
||||||
|
@Shadow private float prevEquippedProgress;
|
||||||
|
|
||||||
|
@Shadow private float equippedProgress;
|
||||||
|
|
||||||
@Inject(method = "transformFirstPersonItem", at = @At("HEAD"))
|
@Inject(method = "transformFirstPersonItem", at = @At("HEAD"))
|
||||||
public void transformFirstPersonItem(float equipProgress, float swingProgress, CallbackInfo ci) {
|
public void transformFirstPersonItem(float equipProgress, float swingProgress, CallbackInfo ci) {
|
||||||
EventTransformFirstPersonItem event = new EventTransformFirstPersonItem(itemToRender, equipProgress, swingProgress);
|
EventTransformFirstPersonItem event = new EventTransformFirstPersonItem(itemToRender, equipProgress, swingProgress);
|
||||||
event.call();
|
event.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Inject(method = "renderItemInFirstPerson", at = @At("HEAD"), cancellable = true)
|
||||||
|
public void renderItemInFirstPerson(float partialTicks, CallbackInfo ci) {
|
||||||
|
if (itemToRender != null) {
|
||||||
|
ItemRenderer $this = (ItemRenderer) (Object) this;
|
||||||
|
float equipProgress = prevEquippedProgress + (equippedProgress - prevEquippedProgress) * partialTicks;
|
||||||
|
if (AnimationHandler.getInstance().renderItemInFirstPerson($this, itemToRender, equipProgress, partialTicks)) {
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.entity.layers.LayerArmorBase;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(LayerArmorBase.class)
|
||||||
|
public class LayerArmorBaseMixin {
|
||||||
|
@Inject(method = "shouldCombineTextures", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void shouldCombineTextures(CallbackInfoReturnable<Boolean> cir) {
|
||||||
|
if(Client.getInstance().getModInstances().getOldAnimationsMod().isEnabled()) {
|
||||||
|
cir.setReturnValue(true);
|
||||||
|
cir.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.LoadingScreenRenderer;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import net.minecraft.util.MinecraftError;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.gui.font.SilentFontRenderer;
|
||||||
|
import net.silentclient.client.gui.util.RenderUtil;
|
||||||
|
import net.silentclient.client.mixin.accessors.MinecraftAccessor;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
@Mixin(LoadingScreenRenderer.class)
|
||||||
|
public class LoadingScreenRendererMixin {
|
||||||
|
@Shadow private boolean loadingSuccess;
|
||||||
|
|
||||||
|
@Shadow private long systemTime;
|
||||||
|
|
||||||
|
@Shadow private Minecraft mc;
|
||||||
|
|
||||||
|
@Shadow private String currentlyDisplayedText;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kirillsaint
|
||||||
|
* @reason Custom Loading Screen
|
||||||
|
*/
|
||||||
|
@Overwrite
|
||||||
|
public void setLoadingProgress(int progress)
|
||||||
|
{
|
||||||
|
if (progress < 0 && mc.theWorld != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!((MinecraftAccessor) this.mc).isRunning())
|
||||||
|
{
|
||||||
|
if (!this.loadingSuccess)
|
||||||
|
{
|
||||||
|
throw new MinecraftError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
long i = Minecraft.getSystemTime();
|
||||||
|
|
||||||
|
if (i - this.systemTime >= 100L)
|
||||||
|
{
|
||||||
|
this.systemTime = i;
|
||||||
|
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
|
||||||
|
scaledResolution.getScaleFactor();
|
||||||
|
|
||||||
|
GlStateManager.matrixMode(5889);
|
||||||
|
GlStateManager.loadIdentity();
|
||||||
|
GlStateManager.ortho(0.0D, scaledResolution.getScaledWidth_double(), scaledResolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
|
||||||
|
GlStateManager.matrixMode(5888);
|
||||||
|
GlStateManager.loadIdentity();
|
||||||
|
GlStateManager.translate(0.0F, 0.0F, -200.0F);
|
||||||
|
|
||||||
|
|
||||||
|
Gui.drawRect(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), new Color(19, 19, 19).getRGB());
|
||||||
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
RenderUtil.drawCentredImage(new ResourceLocation("silentclient/logos/logo.png"), scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() / 3, 300, 58);
|
||||||
|
Client.getInstance().getSilentFontRenderer().drawCenteredString((currentlyDisplayedText != "" ? currentlyDisplayedText : "Loading") + "...", scaledResolution.getScaledWidth() / 2, scaledResolution.getScaledHeight() - 100, 14, SilentFontRenderer.FontType.TITLE);
|
||||||
|
|
||||||
|
this.mc.updateDisplay();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Thread.yield();
|
||||||
|
}
|
||||||
|
catch (Exception var15)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,10 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.client.gui.*;
|
import net.minecraft.client.gui.*;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.texture.TextureManager;
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
|
import net.minecraft.client.resources.data.IMetadataSerializer;
|
||||||
import net.minecraft.client.shader.Framebuffer;
|
import net.minecraft.client.shader.Framebuffer;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.silentclient.client.Client;
|
import net.silentclient.client.Client;
|
||||||
import net.silentclient.client.event.impl.ClientTickEvent;
|
import net.silentclient.client.event.impl.ClientTickEvent;
|
||||||
@ -13,11 +16,16 @@ import net.silentclient.client.event.impl.EventDebugFps;
|
|||||||
import net.silentclient.client.event.impl.EventScrollMouse;
|
import net.silentclient.client.event.impl.EventScrollMouse;
|
||||||
import net.silentclient.client.gui.GuiNews;
|
import net.silentclient.client.gui.GuiNews;
|
||||||
import net.silentclient.client.gui.util.BackgroundPanorama;
|
import net.silentclient.client.gui.util.BackgroundPanorama;
|
||||||
|
import net.silentclient.client.mixin.ducks.MinecraftExt;
|
||||||
|
import net.silentclient.client.mixin.wrappers.IMetadataSerializerWrapper;
|
||||||
|
import net.silentclient.client.mixin.wrappers.TextureManagerWrapper;
|
||||||
|
import net.silentclient.client.mods.render.AnimationsMod;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.lwjgl.LWJGLException;
|
import org.lwjgl.LWJGLException;
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
import org.lwjgl.opengl.Display;
|
import org.lwjgl.opengl.Display;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Overwrite;
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
@ -27,7 +35,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(Minecraft.class)
|
@Mixin(Minecraft.class)
|
||||||
public abstract class MinecraftMixin {
|
public abstract class MinecraftMixin implements MinecraftExt {
|
||||||
@Inject(method = "startGame", at = @At("HEAD"))
|
@Inject(method = "startGame", at = @At("HEAD"))
|
||||||
public void initClient(CallbackInfo callbackInfo) {
|
public void initClient(CallbackInfo callbackInfo) {
|
||||||
Client.getInstance().init();
|
Client.getInstance().init();
|
||||||
@ -51,6 +59,16 @@ public abstract class MinecraftMixin {
|
|||||||
Client.getInstance().shutdown();
|
Client.getInstance().shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IMetadataSerializerWrapper silent$getMetadataSerializer_() {
|
||||||
|
return new IMetadataSerializerWrapper(this.metadataSerializer_);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextureManagerWrapper silent$getRenderEngine() {
|
||||||
|
return new TextureManagerWrapper(this.renderEngine);
|
||||||
|
}
|
||||||
|
|
||||||
@Redirect(method = "createDisplay", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;setTitle(Ljava/lang/String;)V"))
|
@Redirect(method = "createDisplay", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;setTitle(Ljava/lang/String;)V"))
|
||||||
public void setWindowTitle(String newTitle) {
|
public void setWindowTitle(String newTitle) {
|
||||||
Display.setTitle("Silent Client " + Client.getInstance().getVersion() + " (1.8.9)");
|
Display.setTitle("Silent Client " + Client.getInstance().getVersion() + " (1.8.9)");
|
||||||
@ -70,6 +88,12 @@ public abstract class MinecraftMixin {
|
|||||||
|
|
||||||
@Shadow private static int debugFPS;
|
@Shadow private static int debugFPS;
|
||||||
|
|
||||||
|
@Shadow @Final private IMetadataSerializer metadataSerializer_;
|
||||||
|
|
||||||
|
@Shadow public abstract TextureManager getTextureManager();
|
||||||
|
|
||||||
|
@Shadow private TextureManager renderEngine;
|
||||||
|
|
||||||
@Inject(method = "displayGuiScreen", at = @At("RETURN"), cancellable = true)
|
@Inject(method = "displayGuiScreen", at = @At("RETURN"), cancellable = true)
|
||||||
public void displayGuiScreenInject(GuiScreen guiScreenIn, CallbackInfo ci) {
|
public void displayGuiScreenInject(GuiScreen guiScreenIn, CallbackInfo ci) {
|
||||||
if(Client.backgroundPanorama == null) {
|
if(Client.backgroundPanorama == null) {
|
||||||
@ -122,6 +146,13 @@ public abstract class MinecraftMixin {
|
|||||||
@Inject(method = "rightClickMouse", at = @At("HEAD"))
|
@Inject(method = "rightClickMouse", at = @At("HEAD"))
|
||||||
public void rightClickMouse(CallbackInfo ci) {
|
public void rightClickMouse(CallbackInfo ci) {
|
||||||
new EventClickMouse(1).call();
|
new EventClickMouse(1).call();
|
||||||
|
if (Client.getInstance().getModInstances().getOldAnimationsMod().isEnabled() && Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "1.7 Punching Animation").getValBoolean() &&
|
||||||
|
Minecraft.getMinecraft().playerController.getIsHittingBlock() &&
|
||||||
|
Minecraft.getMinecraft().thePlayer.getHeldItem() != null &&
|
||||||
|
(Minecraft.getMinecraft().thePlayer.getHeldItem().getItemUseAction() != EnumAction.NONE ||
|
||||||
|
Minecraft.getMinecraft().thePlayer.getHeldItem().getItem() instanceof ItemBlock)) {
|
||||||
|
Minecraft.getMinecraft().playerController.resetBlockRemoving();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBiped;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.mods.render.AnimationsMod;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Constant;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||||
|
|
||||||
|
@Mixin(ModelBiped.class)
|
||||||
|
public class ModelBipedMixin {
|
||||||
|
@ModifyConstant(method = "setRotationAngles", constant = @Constant(floatValue = -0.5235988F))
|
||||||
|
private float cancelRotation(float original) {
|
||||||
|
return Client.getInstance().getModInstances().getOldAnimationsMod().isEnabled() && Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "1.7 Block Animation").getValBoolean() ? 0 : original;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
package net.silentclient.client.mixin.mixins;
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.multiplayer.WorldClient;
|
import net.minecraft.client.multiplayer.WorldClient;
|
||||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||||
import net.minecraft.network.play.server.S19PacketEntityStatus;
|
import net.minecraft.network.play.server.S19PacketEntityStatus;
|
||||||
@ -8,6 +9,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
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.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(NetHandlerPlayClient.class)
|
@Mixin(NetHandlerPlayClient.class)
|
||||||
@ -21,4 +23,12 @@ public class NetHandlerPlayClientMixin {
|
|||||||
event.call();
|
event.call();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModifyArg(
|
||||||
|
method = {"handleJoinGame", "handleRespawn"},
|
||||||
|
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V")
|
||||||
|
)
|
||||||
|
private GuiScreen skipTerrainScreen(GuiScreen original) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,36 @@
|
|||||||
package net.silentclient.client.mixin.mixins;
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.entity.RenderEntityItem;
|
import net.minecraft.client.renderer.entity.RenderEntityItem;
|
||||||
|
import net.minecraft.client.resources.model.IBakedModel;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.silentclient.client.hooks.RenderEntityItemHook;
|
||||||
import net.silentclient.client.utils.culling.EntityCulling;
|
import net.silentclient.client.utils.culling.EntityCulling;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
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.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
@Mixin(RenderEntityItem.class)
|
@Mixin(RenderEntityItem.class)
|
||||||
public class RenderEntityItemMixin {
|
public abstract class RenderEntityItemMixin {
|
||||||
|
@Shadow protected abstract int func_177078_a(ItemStack stack);
|
||||||
|
|
||||||
@Inject(method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "doRender(Lnet/minecraft/entity/item/EntityItem;DDDFF)V", at = @At("HEAD"), cancellable = true)
|
||||||
private void checkRenderState(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
|
private void checkRenderState(EntityItem entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) {
|
||||||
if (EntityCulling.renderItem(entity)) {
|
if (EntityCulling.renderItem(entity)) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author kirillsaint
|
||||||
|
* @reason Animations Mod
|
||||||
|
*/
|
||||||
|
@Overwrite
|
||||||
|
private int func_177077_a(EntityItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_)
|
||||||
|
{
|
||||||
|
return RenderEntityItemHook.func_177077_a(itemIn, p_177077_2_, p_177077_4_, p_177077_6_, p_177077_8_, p_177077_9_, func_177078_a(itemIn.getEntityItem()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
package net.silentclient.client.mixin.mixins;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.client.resources.model.IBakedModel;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.EnumAction;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.silentclient.client.Client;
|
||||||
|
import net.silentclient.client.mods.render.AnimationsMod;
|
||||||
|
import net.silentclient.client.utils.animations.AnimationHandler;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(RenderItem.class)
|
||||||
|
public abstract class RenderItemMixin {
|
||||||
|
@Unique
|
||||||
|
private EntityLivingBase lastEntityToRenderFor = null;
|
||||||
|
|
||||||
|
@Inject(method = "renderItemModelForEntity", at = @At("HEAD"))
|
||||||
|
public void renderItemModelForEntity(ItemStack stack, EntityLivingBase entityToRenderFor,
|
||||||
|
ItemCameraTransforms.TransformType cameraTransformType, CallbackInfo ci) {
|
||||||
|
lastEntityToRenderFor = entityToRenderFor;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Shadow protected abstract void renderEffect(IBakedModel model);
|
||||||
|
|
||||||
|
@Redirect(method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderEffect(Lnet/minecraft/client/resources/model/IBakedModel;)V"))
|
||||||
|
public void renderItemEffect(RenderItem instance, IBakedModel model) {
|
||||||
|
if(Client.getInstance().getModInstances().getModByClass(AnimationsMod.class).isEnabled() && Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "1.7 Enchant Glint").getValBoolean()) {
|
||||||
|
AnimationsMod.renderOldEnchantEffect(instance, model);
|
||||||
|
} else {
|
||||||
|
renderEffect(model);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "renderItemModelTransform", at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lnet/minecraft/client/renderer/entity/RenderItem;renderItem(" +
|
||||||
|
"Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resources/model/IBakedModel;)V")
|
||||||
|
)
|
||||||
|
public void renderItemModelForEntity_renderItem(ItemStack stack, IBakedModel model,
|
||||||
|
ItemCameraTransforms.TransformType cameraTransformType, CallbackInfo ci) {
|
||||||
|
if (cameraTransformType == ItemCameraTransforms.TransformType.THIRD_PERSON &&
|
||||||
|
lastEntityToRenderFor instanceof EntityPlayer) {
|
||||||
|
EntityPlayer p = (EntityPlayer) lastEntityToRenderFor;
|
||||||
|
ItemStack heldStack = p.getHeldItem();
|
||||||
|
if (heldStack != null && p.getItemInUseCount() > 0 &&
|
||||||
|
heldStack.getItemUseAction() == EnumAction.BLOCK) {
|
||||||
|
AnimationHandler.getInstance().doSwordBlock3rdPersonTransform();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package net.silentclient.client.mixin.wrappers;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.GuiTextField;
|
||||||
|
|
||||||
|
public class GuiTextFieldWrapper {
|
||||||
|
private final GuiTextField guiTextField;
|
||||||
|
|
||||||
|
public GuiTextFieldWrapper(GuiTextField guiTextField) {
|
||||||
|
this.guiTextField = guiTextField;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GuiTextField getGuiTextField() {
|
||||||
|
return guiTextField;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package net.silentclient.client.mixin.wrappers;
|
||||||
|
|
||||||
|
import net.minecraft.client.resources.data.IMetadataSerializer;
|
||||||
|
|
||||||
|
public class IMetadataSerializerWrapper {
|
||||||
|
private final IMetadataSerializer iMetadataSerializer;
|
||||||
|
|
||||||
|
public IMetadataSerializerWrapper(IMetadataSerializer iMetadataSerializer) {
|
||||||
|
this.iMetadataSerializer = iMetadataSerializer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IMetadataSerializer getiMetadataSerializer() {
|
||||||
|
return iMetadataSerializer;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package net.silentclient.client.mixin.wrappers;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
|
|
||||||
|
public class TextureManagerWrapper {
|
||||||
|
private final TextureManager textureManager;
|
||||||
|
|
||||||
|
public TextureManagerWrapper(TextureManager textureManager) {
|
||||||
|
this.textureManager = textureManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TextureManager getTextureManager() {
|
||||||
|
return textureManager;
|
||||||
|
}
|
||||||
|
}
|
@ -6,8 +6,7 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
|||||||
import net.minecraft.client.renderer.texture.TextureMap;
|
import net.minecraft.client.renderer.texture.TextureMap;
|
||||||
import net.minecraft.client.resources.model.IBakedModel;
|
import net.minecraft.client.resources.model.IBakedModel;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.silentclient.client.mixin.accessors.MinecraftAccessor;
|
import net.silentclient.client.mixin.ducks.MinecraftExt;
|
||||||
import net.silentclient.client.mixin.accessors.RenderItemAccessor;
|
|
||||||
import net.silentclient.client.mods.Mod;
|
import net.silentclient.client.mods.Mod;
|
||||||
import net.silentclient.client.mods.ModCategory;
|
import net.silentclient.client.mods.ModCategory;
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ public class AnimationsMod extends Mod {
|
|||||||
GlStateManager.depthFunc(514);
|
GlStateManager.depthFunc(514);
|
||||||
GlStateManager.disableLighting();
|
GlStateManager.disableLighting();
|
||||||
GlStateManager.blendFunc(768, 1);
|
GlStateManager.blendFunc(768, 1);
|
||||||
((MinecraftAccessor) Minecraft.getMinecraft()).getRenderEngine().bindTexture(RES_ITEM_GLINT);
|
((MinecraftExt) Minecraft.getMinecraft()).silent$getRenderEngine().getTextureManager().bindTexture(RES_ITEM_GLINT);
|
||||||
GlStateManager.matrixMode(5890);
|
GlStateManager.matrixMode(5890);
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
@ -64,7 +63,7 @@ public class AnimationsMod extends Mod {
|
|||||||
GlStateManager.enableLighting();
|
GlStateManager.enableLighting();
|
||||||
GlStateManager.depthFunc(515);
|
GlStateManager.depthFunc(515);
|
||||||
GlStateManager.depthMask(true);
|
GlStateManager.depthMask(true);
|
||||||
((MinecraftAccessor) Minecraft.getMinecraft()).getRenderEngine().bindTexture(TextureMap.locationBlocksTexture);
|
((MinecraftExt) Minecraft.getMinecraft()).silent$getRenderEngine().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
package net.silentclient.client.mods.render;
|
package net.silentclient.client.mods.render;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
|
|
||||||
import net.minecraft.client.resources.FallbackResourceManager;
|
import net.minecraft.client.resources.FallbackResourceManager;
|
||||||
import net.minecraft.client.resources.SimpleReloadableResourceManager;
|
|
||||||
import net.minecraft.client.settings.GameSettings;
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.client.shader.ShaderGroup;
|
import net.minecraft.client.shader.ShaderGroup;
|
||||||
import net.minecraft.client.util.JsonException;
|
import net.minecraft.client.util.JsonException;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.silentclient.client.event.EventTarget;
|
import net.silentclient.client.event.EventTarget;
|
||||||
import net.silentclient.client.event.impl.ClientTickEvent;
|
import net.silentclient.client.event.impl.ClientTickEvent;
|
||||||
import net.silentclient.client.mixin.accessors.MinecraftAccessor;
|
|
||||||
import net.silentclient.client.mixin.accessors.SimpleReloadableResourceManagerAccessor;
|
import net.silentclient.client.mixin.accessors.SimpleReloadableResourceManagerAccessor;
|
||||||
|
import net.silentclient.client.mixin.ducks.MinecraftExt;
|
||||||
import net.silentclient.client.mods.Mod;
|
import net.silentclient.client.mods.Mod;
|
||||||
import net.silentclient.client.mods.ModCategory;
|
import net.silentclient.client.mods.ModCategory;
|
||||||
import net.silentclient.client.mods.Setting;
|
import net.silentclient.client.mods.Setting;
|
||||||
import net.silentclient.client.utils.resource.SaturationResourceManager;
|
import net.silentclient.client.utils.resource.SaturationResourceManager;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class ColorSaturationMod extends Mod {
|
public class ColorSaturationMod extends Mod {
|
||||||
private final Map<String, FallbackResourceManager> domainResourceManagers;
|
private final Map<String, FallbackResourceManager> domainResourceManagers;
|
||||||
private Field cachedFastRender;
|
private Field cachedFastRender;
|
||||||
@ -58,7 +56,7 @@ public class ColorSaturationMod extends Mod {
|
|||||||
@EventTarget
|
@EventTarget
|
||||||
public void tick(ClientTickEvent event) {
|
public void tick(ClientTickEvent event) {
|
||||||
if (this.domainResourceManagers != null && !this.domainResourceManagers.containsKey("colorsaturation")) {
|
if (this.domainResourceManagers != null && !this.domainResourceManagers.containsKey("colorsaturation")) {
|
||||||
this.domainResourceManagers.put("colorsaturation", new SaturationResourceManager(((MinecraftAccessor) this.mc).getMetadataSerializer_()));
|
this.domainResourceManagers.put("colorsaturation", new SaturationResourceManager(((MinecraftExt) this.mc).silent$getMetadataSerializer_().getiMetadataSerializer()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +65,7 @@ public class ColorSaturationMod extends Mod {
|
|||||||
this.domainResourceManagers.remove("colorsaturation");
|
this.domainResourceManagers.remove("colorsaturation");
|
||||||
}
|
}
|
||||||
if (this.domainResourceManagers != null && !this.domainResourceManagers.containsKey("colorsaturation")) {
|
if (this.domainResourceManagers != null && !this.domainResourceManagers.containsKey("colorsaturation")) {
|
||||||
this.domainResourceManagers.put("colorsaturation", new SaturationResourceManager(((MinecraftAccessor) this.mc).getMetadataSerializer_()));
|
this.domainResourceManagers.put("colorsaturation", new SaturationResourceManager(((MinecraftExt) this.mc).silent$getMetadataSerializer_().getiMetadataSerializer()));
|
||||||
}
|
}
|
||||||
shader = null;
|
shader = null;
|
||||||
}
|
}
|
||||||
@ -84,7 +82,7 @@ public class ColorSaturationMod extends Mod {
|
|||||||
this.domainResourceManagers.remove("colorsaturation");
|
this.domainResourceManagers.remove("colorsaturation");
|
||||||
}
|
}
|
||||||
if (this.domainResourceManagers != null && !this.domainResourceManagers.containsKey("colorsaturation")) {
|
if (this.domainResourceManagers != null && !this.domainResourceManagers.containsKey("colorsaturation")) {
|
||||||
this.domainResourceManagers.put("colorsaturation", new SaturationResourceManager(((MinecraftAccessor) this.mc).getMetadataSerializer_()));
|
this.domainResourceManagers.put("colorsaturation", new SaturationResourceManager(((MinecraftExt) this.mc).silent$getMetadataSerializer_().getiMetadataSerializer()));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
this.shader = new ShaderGroup(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(),
|
this.shader = new ShaderGroup(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(),
|
||||||
|
@ -18,7 +18,7 @@ public class ChatCalculator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean runExprReplace(GuiChat chat) {
|
private static boolean runExprReplace(GuiChat chat) {
|
||||||
GuiTextField field = ((GuiChatAccessor) chat).getInputField();
|
GuiTextField field = ((GuiChatAccessor) chat).silent$getInputField().getGuiTextField();
|
||||||
String originalText = field.getText();
|
String originalText = field.getText();
|
||||||
int cursor = field.getCursorPosition();
|
int cursor = field.getCursorPosition();
|
||||||
try {
|
try {
|
||||||
@ -35,7 +35,7 @@ public class ChatCalculator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean runExprAdd(GuiChat chat) {
|
private static boolean runExprAdd(GuiChat chat) {
|
||||||
GuiTextField field = ((GuiChatAccessor) chat).getInputField();
|
GuiTextField field = ((GuiChatAccessor) chat).silent$getInputField().getGuiTextField();
|
||||||
String originalText = field.getText();
|
String originalText = field.getText();
|
||||||
int cursor = field.getCursorPosition();
|
int cursor = field.getCursorPosition();
|
||||||
try {
|
try {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
"mixins": [
|
"mixins": [
|
||||||
"mixins.MinecraftMixin",
|
"mixins.MinecraftMixin",
|
||||||
"mixins.AbstractClientPlayerMixin",
|
"mixins.AbstractClientPlayerMixin",
|
||||||
"accessors.GuiChatAccessor",
|
"mixins.GuiChatMixin",
|
||||||
"accessors.GuiAccessor",
|
"accessors.GuiAccessor",
|
||||||
"accessors.RenderItemAccessor",
|
"accessors.RenderItemAccessor",
|
||||||
"accessors.SimpleReloadableResourceManagerAccessor",
|
"accessors.SimpleReloadableResourceManagerAccessor",
|
||||||
@ -34,6 +34,11 @@
|
|||||||
"mixins.NetworkManagerMixin",
|
"mixins.NetworkManagerMixin",
|
||||||
"mixins.RenderManagerMixin",
|
"mixins.RenderManagerMixin",
|
||||||
"mixins.ItemRendererMixin",
|
"mixins.ItemRendererMixin",
|
||||||
"mixins.RenderGlobalMixin"
|
"mixins.RenderGlobalMixin",
|
||||||
|
"mixins.LayerArmorBaseMixin",
|
||||||
|
"mixins.RenderItemMixin",
|
||||||
|
"mixins.ModelBipedMixin",
|
||||||
|
"mixins.LoadingScreenRendererMixin",
|
||||||
|
"accessors.MinecraftAccessor"
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user