Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.

Commit fd8780a

Browse files
committed
silly little progress commit :3
1 parent a744069 commit fd8780a

24 files changed

Lines changed: 338 additions & 120 deletions

src/main/java/io/github/axolotlclient/oldanimations/OldAnimations.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ blocks item positions (rotations) + fix trapdoors and pressure plates and other
3434
old fast smooth lighting shadows
3535
tops of certain blocks have switch uvs
3636
tripwire texture and model changes
37-
couldrons model and texture
37+
cauldrons model and texture
3838
improve fake block mining believability - paneblock and tripwireblock are still not accurate
3939
rod and bow and block positions and swing position.. can be separate options LOL
4040
fix weird fuzzy texture sizes of swords and stuff
41+
fix weird inconsistencies with block item positions between 1.7 and my ported 1.8 code :/
42+
certain mob hitboxes should be visually changed
43+
fast grass always showns in gui/dropped?
44+
is sprint flying different??
45+
need to revamp the sneaking options.. third person sneaking position should be separated from smooth sneaking :p
46+
oh my god. the custom models/textures are a damn nightmare of a mess
4147
*/
4248

4349
public static final String MODID = "axolotlclient-oldanimations";

src/main/java/io/github/axolotlclient/oldanimations/config/OldAnimationsConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class OldAnimationsConfig {
4141
private final OptionCategory categoryBlocking = OptionCategory.create("blockingItemUsing");
4242
private final OptionCategory categorySneaking = OptionCategory.create("sneaking");
4343
private final OptionCategory categoryItems = OptionCategory.create("items");
44-
private final OptionCategory categoryTextures = OptionCategory.create("textures");
44+
private final OptionCategory categoryResources = OptionCategory.create("resources");
4545
private final OptionCategory categoryCombat = OptionCategory.create("combat");
4646
private final OptionCategory categoryGUI = OptionCategory.create("gui");
4747
private final OptionCategory categoryDebugOverlay = OptionCategory.create("debugOverlay");
@@ -170,12 +170,12 @@ public void initConfig() {
170170
stickRod,
171171
stopLineTranslateSneak,
172172
equipLogic,
173-
replaceSkullModel,
174173
disableResourcePackItemTransformations,
175174
fixThirdPersonHeldItemSneakDeSync
176175
);
177-
category.add(categoryTextures);
178-
categoryTextures.add(
176+
category.add(categoryResources);
177+
categoryResources.add(
178+
replaceSkullModel,
179179
fastGrass,
180180
oldDoorTextures,
181181
oldSpongeTexture,
@@ -263,7 +263,7 @@ private void reloadResources() {
263263
}
264264
}
265265
if (needsReload) {
266-
Minecraft.getInstance().reloadResources();
266+
Minecraft.getInstance().submit(() -> Minecraft.getInstance().reloadResources());
267267
}
268268
});
269269
}

src/main/java/io/github/axolotlclient/oldanimations/mixin/CapeLayerMixin.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020

2121
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
2222
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
23+
import com.llamalad7.mixinextras.sugar.Local;
2324
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
25+
import net.minecraft.client.entity.living.player.ClientPlayerEntity;
2426
import net.minecraft.client.render.entity.layer.CapeLayer;
27+
import org.objectweb.asm.Opcodes;
2528
import org.spongepowered.asm.mixin.Dynamic;
2629
import org.spongepowered.asm.mixin.Mixin;
2730
import org.spongepowered.asm.mixin.injection.At;
@@ -55,4 +58,22 @@ public class CapeLayerMixin {
5558
}
5659
return original;
5760
}
61+
62+
@ModifyExpressionValue(method = "render(Lnet/minecraft/client/entity/living/player/ClientPlayerEntity;FFFFFFF)V", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/entity/living/player/ClientPlayerEntity;prevY:D"))
63+
private double axolotlclient$includeSneakOffset$PrevY(double original, @Local(argsOnly = true) ClientPlayerEntity clientPlayerEntity) {
64+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.thirdPersonSneaking.get()) {
65+
/* sneaking moves the eyeheight down by 0.08 units... we must also make sure this applies to other renderings */
66+
original += clientPlayerEntity.isSneaking() ? -0.08F : 0.0F;
67+
}
68+
return original;
69+
}
70+
71+
@ModifyExpressionValue(method = "render(Lnet/minecraft/client/entity/living/player/ClientPlayerEntity;FFFFFFF)V", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/entity/living/player/ClientPlayerEntity;y:D"))
72+
private double axolotlclient$includeSneakOffset$Y(double original, @Local(argsOnly = true) ClientPlayerEntity clientPlayerEntity) {
73+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.thirdPersonSneaking.get()) {
74+
/* sneaking moves the eyeheight down by 0.08 units... we must also make sure this applies to other renderings */
75+
original += clientPlayerEntity.isSneaking() ? -0.08F : 0.0F;
76+
}
77+
return original;
78+
}
5879
}

src/main/java/io/github/axolotlclient/oldanimations/mixin/ClientPlayNetworkHandlerMixin.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,18 @@
2121
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
2222
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
2323
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
24-
import net.minecraft.client.Minecraft;
2524
import net.minecraft.client.network.handler.ClientPlayNetworkHandler;
2625
import net.minecraft.client.options.GameOptions;
2726
import net.minecraft.network.packet.s2c.play.TitlesS2CPacket;
2827
import net.minecraft.world.Difficulty;
2928
import org.spongepowered.asm.mixin.Mixin;
30-
import org.spongepowered.asm.mixin.Shadow;
3129
import org.spongepowered.asm.mixin.injection.At;
3230
import org.spongepowered.asm.mixin.injection.Inject;
3331
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
3432

3533
@Mixin(ClientPlayNetworkHandler.class)
3634
public abstract class ClientPlayNetworkHandlerMixin {
3735

38-
@Shadow
39-
private Minecraft minecraft;
40-
4136
@ModifyExpressionValue(method = "handleAddXpOrb", at = @At(value = "CONSTANT", args = "doubleValue=32"))
4237
private double axolotlclient$oldOrbRendering(double original) {
4338
return original / (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.xpOrbPosition.get() ?

src/main/java/io/github/axolotlclient/oldanimations/mixin/EntityRenderDispatcherMixin.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
import com.llamalad7.mixinextras.sugar.Local;
2727
import com.mojang.blaze3d.vertex.Tessellator;
2828
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
29-
import io.github.axolotlclient.oldanimations.ducks.Sneaky;
3029
import io.github.axolotlclient.oldanimations.util.PlayerUtil;
31-
import net.minecraft.client.Minecraft;
3230
import net.minecraft.client.entity.living.player.ClientPlayerEntity;
3331
import net.minecraft.client.options.GameOptions;
3432
import net.minecraft.client.render.TextRenderer;
@@ -103,7 +101,7 @@ public abstract class EntityRenderDispatcherMixin {
103101
private void axolotlclient$oldHitBoxBehavior(Args args, @Local(argsOnly = true) Entity entity) {
104102
if (OldAnimationsConfig.isEnabled() && PlayerUtil.INSTANCE.isSelf(entity)) {
105103
/* sneaking compatibility! */
106-
double eyeHeightOffset = OldAnimationsConfig.instance.thirdPersonSneaking.get() ? ((Sneaky) Minecraft.getInstance().gameRenderer).axolotlclient$getEyeHeight() - 1.62F : 0.0F;
104+
double eyeHeightOffset = OldAnimationsConfig.instance.thirdPersonSneaking.get() ? PlayerUtil.INSTANCE.getEyeHeightSneakOffset() - 1.62F : 0.0F;
107105
/* man there were a lot of eyeheight bugs back in the day LOOOL */
108106
double hitBoxOffset = OldAnimationsConfig.instance.hitboxOffset.get() ? 1.62F : 0.0F;
109107
args.set(1, (double) args.get(1) + eyeHeightOffset + hitBoxOffset);

src/main/java/io/github/axolotlclient/oldanimations/mixin/EntityRendererMixin.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import io.github.axolotlclient.modules.freelook.Perspective;
2727
import io.github.axolotlclient.oldanimations.OldAnimations;
2828
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
29-
import io.github.axolotlclient.oldanimations.ducks.Sneaky;
3029
import io.github.axolotlclient.oldanimations.util.PlayerUtil;
3130
import net.minecraft.client.Minecraft;
3231
import net.minecraft.client.render.entity.EntityRenderDispatcher;
@@ -52,7 +51,7 @@ public abstract class EntityRendererMixin {
5251
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.flameOffset.get() && PlayerUtil.INSTANCE.isSelf(entity)) {
5352
/* taken from 1.7 */
5453
/* we must make sure the flame is synced with the interpolated player model position */
55-
original += (OldAnimationsConfig.instance.thirdPersonSneaking.get() ? ((Sneaky) Minecraft.getInstance().gameRenderer).axolotlclient$getEyeHeight() : entity.getEyeHeight());
54+
original += (OldAnimationsConfig.instance.thirdPersonSneaking.get() ? PlayerUtil.INSTANCE.getEyeHeightSneakOffset() : entity.getEyeHeight());
5655
}
5756
return original;
5857
}
@@ -64,7 +63,7 @@ public abstract class EntityRendererMixin {
6463
GlStateManager.pushMatrix();
6564
/* taken from 1.7 */
6665
/* we must make sure the flame is synced with the interpolated player model position */
67-
float eyeHeight = (OldAnimationsConfig.instance.thirdPersonSneaking.get() ? ((Sneaky) Minecraft.getInstance().gameRenderer).axolotlclient$getEyeHeight() : entity.getEyeHeight());
66+
float eyeHeight = (OldAnimationsConfig.instance.thirdPersonSneaking.get() ? PlayerUtil.INSTANCE.getEyeHeightSneakOffset() : entity.getEyeHeight());
6867
GlStateManager.translatef(0.0F, eyeHeight, 0.0F);
6968
}
7069
original.call(instance, entity, dx, dy, dz, tickDelta);

src/main/java/io/github/axolotlclient/oldanimations/mixin/FishingBobberEntityRendererMixin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
2323
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2424
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
25-
import io.github.axolotlclient.oldanimations.ducks.Sneaky;
26-
import net.minecraft.client.Minecraft;
25+
import io.github.axolotlclient.oldanimations.util.PlayerUtil;
2726
import net.minecraft.client.render.entity.FishingBobberRenderer;
2827
import net.minecraft.entity.living.player.PlayerEntity;
2928
import org.spongepowered.asm.mixin.Mixin;
3029
import org.spongepowered.asm.mixin.Unique;
31-
import org.spongepowered.asm.mixin.injection.*;
30+
import org.spongepowered.asm.mixin.injection.At;
31+
import org.spongepowered.asm.mixin.injection.ModifyArgs;
3232
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
3333

3434
@Mixin(FishingBobberRenderer.class)
@@ -57,7 +57,7 @@ public abstract class FishingBobberEntityRendererMixin {
5757
@WrapOperation(method = "render(Lnet/minecraft/entity/FishingBobberEntity;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/living/player/PlayerEntity;getEyeHeight()F"))
5858
private float axolotlclient$useLerpEyeHeight_Fish(PlayerEntity instance, Operation<Float> original) {
5959
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.smoothSneaking.get()) {
60-
return ((Sneaky) Minecraft.getInstance().gameRenderer).axolotlclient$getEyeHeight();
60+
return PlayerUtil.INSTANCE.getEyeHeightSneakOffset();
6161
}
6262
return original.call(instance);
6363
}

src/main/java/io/github/axolotlclient/oldanimations/mixin/ItemEntityRendererMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected ItemEntityRendererMixin(EntityRenderDispatcher dispatcher) {
4949

5050
@ModifyArg(method = "render(Lnet/minecraft/entity/ItemEntity;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/block/ModelTransformations;apply(Lnet/minecraft/client/render/model/block/ModelTransformations$Type;)V", ordinal = 1))
5151
private ModelTransformations.Type axolotlclient$replaceTransform(ModelTransformations.Type type) {
52-
return OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.fastItems.get() ? ModelTransformations.Type.GUI : type;
52+
return OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() ? ModelTransformations.Type.NONE : type;
5353
}
5454

5555
@Inject(method = "render(Lnet/minecraft/entity/ItemEntity;DDDFF)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/ItemRenderer;renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/resource/model/BakedModel;)V", ordinal = 1))
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* This program is free software; you can redistribute it and/or
3+
* modify it under the terms of the GNU Lesser General Public
4+
* License as published by the Free Software Foundation; either
5+
* version 3 of the License, or (at your option) any later version.
6+
*
7+
* This program is distributed in the hope that it will be useful,
8+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10+
* Lesser General Public License for more details.
11+
*
12+
* You should have received a copy of the GNU Lesser General Public License
13+
* along with this program; if not, write to the Free Software Foundation,
14+
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15+
*
16+
* For more information, see the LICENSE file.
17+
*/
18+
19+
package io.github.axolotlclient.oldanimations.mixin;
20+
21+
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
22+
import net.minecraft.client.render.item.ItemModelShaper;
23+
import net.minecraft.client.resource.ModelIdentifier;
24+
import net.minecraft.client.resource.model.BakedModel;
25+
import net.minecraft.client.resource.model.ModelManager;
26+
import net.minecraft.item.ItemStack;
27+
import net.minecraft.item.SkullItem;
28+
import org.spongepowered.asm.mixin.Mixin;
29+
import org.spongepowered.asm.mixin.Shadow;
30+
import org.spongepowered.asm.mixin.injection.At;
31+
import org.spongepowered.asm.mixin.injection.Inject;
32+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
33+
34+
@Mixin(ItemModelShaper.class)
35+
public abstract class ItemModelShaperMixin {
36+
37+
@Shadow
38+
public abstract ModelManager getManager();
39+
40+
@Inject(method = "getModel(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/client/resource/model/BakedModel;", at = @At("HEAD"), cancellable = true)
41+
private void axolotlclient$useCustomModel$skull(ItemStack stack, CallbackInfoReturnable<BakedModel> cir) {
42+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.replaceSkullModel.get() && stack.getItem() instanceof SkullItem) {
43+
String id = switch (stack.getMetadata()) {
44+
case 0 -> "old_skull_skeleton";
45+
case 1 -> "old_skull_wither";
46+
case 2 -> "old_skull_zombie";
47+
case 4 -> "old_skull_creeper";
48+
default -> "old_skull_char";
49+
};
50+
cir.setReturnValue(getManager().getModel(new ModelIdentifier(id, "inventory")));
51+
}
52+
}
53+
}

src/main/java/io/github/axolotlclient/oldanimations/mixin/ItemRendererMixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,11 @@ public abstract class ItemRendererMixin {
283283
}
284284
}
285285

286+
@ModifyArg(method = "renderGuiItemModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/block/ModelTransformations;apply(Lnet/minecraft/client/render/model/block/ModelTransformations$Type;)V"))
287+
private ModelTransformations.Type axolotlclient$disableGuiTransforms(ModelTransformations.Type type, @Local(argsOnly = true) ItemStack itemStack) {
288+
return OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() && !ItemUtil.isBlacklisted(itemStack) ? ModelTransformations.Type.NONE : type;
289+
}
290+
286291
@Unique
287292
private BakedModel axolotlclient$getModel(String model) {
288293
return getModelShaper().getManager().getModel(new ModelIdentifier(model, "inventory"));

0 commit comments

Comments
 (0)