Skip to content

Commit a6541e9

Browse files
committed
wish i was done here but i am not LOOL
1 parent b53b543 commit a6541e9

18 files changed

+238
-86
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@
2828
public class OldAnimations implements ClientModInitializer {
2929

3030
/*
31-
blocks item positions (rotations) + trapdoors + pressure plates
32-
pressure plates look a bit different?? idk why THEYRE BIGGER THATS WHY
31+
blocks item positions (rotations) + fix trapdoors and pressure plates and other crap
32+
held pressure plates look a bit different?? idk why THEYRE BIGGER THATS WHY
3333
third person item positions toggle?
3434
old fence fate model
35-
move sprint keybind option in controls menu
35+
old fast smooth lighting shadows
36+
tops of certain blocks have switch uvs
37+
tripwire texture and model changes
38+
couldrons model and texture
3639
*/
3740

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

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +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");
4445
private final OptionCategory categoryCombat = OptionCategory.create("combat");
4546
private final OptionCategory categoryGUI = OptionCategory.create("gui");
4647
private final OptionCategory categoryDebugOverlay = OptionCategory.create("debugOverlay");
@@ -58,7 +59,7 @@ public class OldAnimationsConfig {
5859
public final BooleanOption show1_7_10 = new BooleanOption("show1_7_10", false);
5960
public final BooleanOption debugInfo = new BooleanOption("debugInfo", true);
6061
public final BooleanOption disableDebugBackground = new BooleanOption("disableDebugBackground", true);
61-
public final BooleanOption alwaysShowCrosshair = new BooleanOption("alwaysShowCrosshair", true);
62+
public final BooleanOption alwaysShowCrosshair = new BooleanOption("alwaysShowCrosshair", false);
6263
public final BooleanOption debugTextSpacing = new BooleanOption("debugTextSpacing", true);
6364
public final BooleanOption debugTextColorScheme = new BooleanOption("debugTextColorScheme", true);
6465
public final BooleanOption debugTextShadow = new BooleanOption("debugTextShadow", true);
@@ -107,18 +108,25 @@ public class OldAnimationsConfig {
107108
public final BooleanOption oldDoorTextures = new BooleanOption("oldDoorTextures", false);
108109
public final BooleanOption oldDifficultyButtonLogic = new BooleanOption("oldDifficultyButtonLogic", false);
109110
public final BooleanOption moveSprintKeybind = new BooleanOption("moveSprintKeybind", false);
111+
public final BooleanOption thirdPersonCapePosition = new BooleanOption("thirdPersonCapePosition", false);
112+
public final BooleanOption oldSpongeTexture = new BooleanOption("oldSpongeTexture", false);
113+
public final BooleanOption oldTallGrassTexture = new BooleanOption("oldTallGrassTexture", false);
110114

111115
private final Supplier<Boolean>[] suppliers = new Supplier[] {
112116
enabled::get,
113117
replaceSkullModel::get,
114118
fastGrass::get,
115-
oldDoorTextures::get
119+
oldDoorTextures::get,
120+
oldSpongeTexture::get,
121+
oldTallGrassTexture::get
116122
};
117123
private final boolean[] previousStates = {
118124
enabled.get(),
119125
replaceSkullModel.get(),
120126
fastGrass.get(),
121-
oldDoorTextures.get()
127+
oldDoorTextures.get(),
128+
oldSpongeTexture.get(),
129+
oldTallGrassTexture.get()
122130
};
123131

124132
public static boolean isEnabled() {
@@ -143,7 +151,8 @@ public void initConfig() {
143151
categorySneaking.add(
144152
smoothSneaking,
145153
slowUpSneak,
146-
thirdPersonSneaking
154+
thirdPersonSneaking,
155+
thirdPersonCapePosition
147156
);
148157
category.add(categoryItems);
149158
categoryItems.add(
@@ -157,10 +166,16 @@ public void initConfig() {
157166
stopLineTranslateSneak,
158167
equipLogic,
159168
replaceSkullModel,
160-
oldDoorTextures,
161169
disableResourcePackItemTransformations,
162170
fixThirdPersonHeldItemSneakDeSync
163171
);
172+
category.add(categoryTextures);
173+
categoryTextures.add(
174+
fastGrass,
175+
oldDoorTextures,
176+
oldSpongeTexture,
177+
oldTallGrassTexture
178+
);
164179
category.add(categoryCombat);
165180
categoryCombat.add(
166181
oldSwingVisual,
@@ -213,8 +228,7 @@ public void initConfig() {
213228
flameOffset,
214229
oldPickupArm,
215230
fixCameraPitch,
216-
xpOrbPosition,
217-
fastGrass
231+
xpOrbPosition
218232
);
219233

220234
/* reload the resources upon toggling certain options */
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 com.mojang.blaze3d.platform.GlStateManager;
22+
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
23+
import net.minecraft.client.entity.living.player.ClientPlayerEntity;
24+
import net.minecraft.client.render.entity.layer.CapeLayer;
25+
import org.spongepowered.asm.mixin.Mixin;
26+
import org.spongepowered.asm.mixin.injection.At;
27+
import org.spongepowered.asm.mixin.injection.Inject;
28+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
29+
30+
@Mixin(CapeLayer.class)
31+
public abstract class CapeLayerMixin {
32+
33+
@Inject(method = "render(Lnet/minecraft/client/entity/living/player/ClientPlayerEntity;FFFFFFF)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;translatef(FFF)V"))
34+
private void axolotlClient$addSneakingTranslation(ClientPlayerEntity clientPlayerEntity, float f, float g, float h, float i, float j, float k, float l, CallbackInfo ci) {
35+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.thirdPersonCapePosition.get() && clientPlayerEntity.isSneaking()) {
36+
/* honestly, idk why the cape is positioned differently in 1.8 versus 1.7.... weird lol */
37+
/* this is a rough estimation of where it should be positioned... not ideal, but its better than nothing lol */
38+
GlStateManager.translatef(0.0F, 0.0125F, 0.0F);
39+
}
40+
}
41+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public abstract class ClientPlayNetworkHandlerMixin {
3939
private Minecraft minecraft;
4040

4141
@ModifyExpressionValue(method = "handleAddXpOrb", at = @At(value = "CONSTANT", args = "doubleValue=32"))
42-
private double ornitheAnimations$oldOrbRendering(double original) {
42+
private double axolotlclient$oldOrbRendering(double original) {
4343
return original / (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.xpOrbPosition.get() ?
4444
32.0D : 1.0D /* renders the xp orbs similar to 1.7 by oddly offsetting them */
4545
);

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2323
import com.mojang.blaze3d.platform.GlStateManager;
2424
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
25-
import io.github.axolotlclient.oldanimations.util.ItemBlacklist;
25+
import io.github.axolotlclient.oldanimations.util.ItemUtil;
2626
import net.minecraft.block.Block;
2727
import net.minecraft.client.Minecraft;
2828
import net.minecraft.client.render.entity.layer.HeldItemLayer;
@@ -33,7 +33,6 @@
3333
import net.minecraft.item.Item;
3434
import net.minecraft.item.ItemStack;
3535
import net.minecraft.item.Items;
36-
import net.minecraft.text.LiteralText;
3736
import org.spongepowered.asm.mixin.Mixin;
3837
import org.spongepowered.asm.mixin.Unique;
3938
import org.spongepowered.asm.mixin.injection.*;
@@ -81,7 +80,7 @@ public abstract class HeldItemLayerMixin {
8180

8281
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/HeldItemRenderer;render(Lnet/minecraft/entity/living/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/block/ModelTransformations$Type;)V"))
8382
private void axolotlclient$applyHeldItemLayerTransforms(LivingEntity livingEntity, float f, float g, float h, float i, float j, float k, float l, CallbackInfo ci) {
84-
if (!OldAnimationsConfig.isEnabled() || ItemBlacklist.isPresent(itemStack)) return;
83+
if (!OldAnimationsConfig.isEnabled() || ItemUtil.isBlacklisted(itemStack)) return;
8584
Item item = itemStack.getItem();
8685
float var7;
8786
/* original transformations from 1.7 */
@@ -107,7 +106,7 @@ public abstract class HeldItemLayerMixin {
107106
GlStateManager.scalef(var7, -var7, var7);
108107
GlStateManager.rotatef(-100.0F, 1.0F, 0.0F, 0.0F);
109108
GlStateManager.rotatef(45.0F, 0.0F, 1.0F, 0.0F);
110-
} else if (item.isHandheld()) {
109+
} else if (item.isHandheld() && !ItemUtil.isBlazeRod(itemStack)) {
111110
var7 = 0.625F;
112111
if (item.shouldRotate()) {
113112
GlStateManager.rotatef(180.0F, 0.0F, 0.0F, 1.0F);
@@ -130,7 +129,7 @@ public abstract class HeldItemLayerMixin {
130129

131130
@ModifyArg(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/HeldItemRenderer;render(Lnet/minecraft/entity/living/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/block/ModelTransformations$Type;)V"), index = 2)
132131
private ModelTransformations.Type axolotlclient$changeTransformType(ModelTransformations.Type type) {
133-
return areItemPositionsEnabled() && OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() && !ItemBlacklist.isPresent(itemStack) ? ModelTransformations.Type.NONE : type;
132+
return areItemPositionsEnabled() && OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() && !ItemUtil.isBlacklisted(itemStack) ? ModelTransformations.Type.NONE : type;
134133
}
135134

136135
@Unique

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import com.llamalad7.mixinextras.sugar.Local;
2424
import com.mojang.blaze3d.platform.GlStateManager;
2525
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
26-
import io.github.axolotlclient.oldanimations.util.ItemBlacklist;
26+
import io.github.axolotlclient.oldanimations.util.ItemUtil;
2727
import net.minecraft.client.entity.living.player.ClientPlayerEntity;
2828
import net.minecraft.client.render.HeldItemRenderer;
2929
import net.minecraft.client.render.item.ItemRenderer;
@@ -96,17 +96,21 @@ public abstract class HeldItemRendererMixin {
9696

9797
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/ItemRenderer;renderHeldItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/living/LivingEntity;Lnet/minecraft/client/render/model/block/ModelTransformations$Type;)V"))
9898
private void axolotlclient$applyHeldItemTransforms(LivingEntity livingEntity, ItemStack itemStack, ModelTransformations.Type type, CallbackInfo ci) {
99-
if (!areItemPositionsEnabled()) return;
100-
if (renderer.isGui3d(itemStack) || ItemBlacklist.isPresent(itemStack)) return;
101-
/* original transformations from 1.7 */
102-
GlStateManager.translatef(0.0F, -0.3F, 0.0F);
103-
GlStateManager.scalef(1.5F, 1.5F, 1.5F);
104-
GlStateManager.rotatef(50.0F, 0.0F, 1.0F, 0.0F);
105-
GlStateManager.rotatef(335.0F, 0.0F, 0.0F, 1.0F);
106-
GlStateManager.translatef(-0.9375F, -0.0625F, 0.0F);
107-
/* we need to adapt the 1.7 transformations to fit in 1.8 */
108-
GlStateManager.rotatef(180.0F, 0.0F, 1.0F, 0.0F);
109-
GlStateManager.translatef(-0.5F, 0.5F, 0.03125F);
99+
if (!areItemPositionsEnabled() || ItemUtil.isBlacklisted(itemStack)) return;
100+
if (renderer.isGui3d(itemStack)) {
101+
/* blocks */
102+
GlStateManager.rotatef(90.0F + (ItemUtil.shouldRotateBlock(itemStack) ? 180.0F : 0.0F), 0.0F, 1.0F, 0.0F);
103+
} else {
104+
/* original transformations from 1.7 */
105+
GlStateManager.translatef(0.0F, -0.3F, 0.0F);
106+
GlStateManager.scalef(1.5F, 1.5F, 1.5F);
107+
GlStateManager.rotatef(50.0F, 0.0F, 1.0F, 0.0F);
108+
GlStateManager.rotatef(335.0F, 0.0F, 0.0F, 1.0F);
109+
GlStateManager.translatef(-0.9375F, -0.0625F, 0.0F);
110+
/* we need to adapt the 1.7 transformations to fit in 1.8 */
111+
GlStateManager.rotatef(180.0F, 0.0F, 1.0F, 0.0F);
112+
GlStateManager.translatef(-0.5F, 0.5F, 0.03125F);
113+
}
110114
}
111115

112116
@Inject(method = "renderInFirstPerson", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/HeldItemRenderer;render(Lnet/minecraft/entity/living/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/block/ModelTransformations$Type;)V"))
@@ -119,7 +123,7 @@ public abstract class HeldItemRendererMixin {
119123

120124
@ModifyArg(method = "renderInFirstPerson", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/HeldItemRenderer;render(Lnet/minecraft/entity/living/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/block/ModelTransformations$Type;)V"), index = 2)
121125
private ModelTransformations.Type axolotlclient$changeTransformType(ModelTransformations.Type mode) {
122-
return areItemPositionsEnabled() && OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() && !ItemBlacklist.isPresent(item) ? ModelTransformations.Type.NONE : mode;
126+
return areItemPositionsEnabled() && OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() && !ItemUtil.isBlacklisted(item) ? ModelTransformations.Type.NONE : mode;
123127
}
124128

125129
@Expression("? != null")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public abstract class ItemRendererMixin {
225225
private void axolotlclient$reverseTransformations(ItemStack itemStack, BakedModel bakedModel, ModelTransformations.Type type, CallbackInfo ci) {
226226
/* we can replicate ModelTransformations.Type.NONE by just reversing the default transformations! */
227227
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.itemPositions.get() &&
228-
!OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() && !ItemBlacklist.isPresent(itemStack)) {
228+
!OldAnimationsConfig.instance.disableResourcePackItemTransformations.get() && !ItemUtil.isBlacklisted(itemStack)) {
229229
float scale;
230230
float scale2 = 0.0625F;
231231
if (type == ModelTransformations.Type.FIRST_PERSON && !isGui3d(itemStack)) {
@@ -255,7 +255,7 @@ public abstract class ItemRendererMixin {
255255
GlStateManager.scalef(scale, scale, scale);
256256
GlStateManager.rotatef(35.0F, 0.0F, 0.0F, 1.0F);
257257
GlStateManager.rotatef(-90.0F, 0.0F, 1.0F, 0.0F);
258-
GlStateManager.translatef(0.0F, -1.25F * scale2, 3.5F * scale2);
258+
GlStateManager.translatef(0.0F, (ItemUtil.isBlazeRod(itemStack) ? -0.75F : -1.25F) * scale2, 3.5F * scale2);
259259
} else {
260260
scale = 1.0F / 0.55F;
261261
GlStateManager.scalef(scale, scale, scale);

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,32 @@ public abstract class ModelBakeryMixin {
7878
});
7979
}
8080

81+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.oldTallGrassTexture.get()) {
82+
/* tall grass */
83+
if ("minecraft:models/block/tall_grass.json".equals(identifier.toString())) {
84+
((BlockModelAccessor) original).getTextures().put("cross", "blocks/old_tallgrass");
85+
}
86+
if ("minecraft:models/item/tall_grass.json".equals(identifier.toString())) {
87+
((BlockModelAccessor) original).getTextures().put("layer0", "blocks/old_tallgrass");
88+
}
89+
/* double grass*/
90+
if ("minecraft:models/block/double_grass_top.json".equals(identifier.toString())) {
91+
((BlockModelAccessor) original).getTextures().put("cross", "blocks/old_double_plant_grass_top");
92+
}
93+
if ("minecraft:models/item/double_grass.json".equals(identifier.toString())) {
94+
((BlockModelAccessor) original).getTextures().put("layer0", "blocks/old_double_plant_grass_top");
95+
}
96+
if ("minecraft:models/block/double_grass_bottom.json".equals(identifier.toString())) {
97+
((BlockModelAccessor) original).getTextures().put("cross", "blocks/old_double_plant_grass_bottom");
98+
}
99+
}
100+
101+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.oldSpongeTexture.get() &&
102+
"minecraft:models/block/sponge.json".equals(identifier.toString())) {
103+
/* lowk this texture is UGGLYYYYYY */
104+
((BlockModelAccessor) original).getTextures().put("all", "blocks/old_sponge");
105+
}
106+
81107
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.replaceSkullModel.get()) {
82108
/* defines our 1.7 skull model! */
83109
String path = identifier.getPath();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public abstract class OptionsScreenMixin extends Screen {
6969

7070
@Inject(method = "buttonClicked", at = @At(value = "FIELD", opcode = Opcodes.GETFIELD, target = "Lnet/minecraft/client/gui/widget/ButtonWidget;id:I", ordinal = 2))
7171
private void axolotlclient$onlySetIfInWorld(ButtonWidget buttonWidget, CallbackInfo ci) {
72-
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.disableSkinCustomizationButton.get() && minecraft.world == null && buttonWidget.id == 108) {
72+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.oldDifficultyButtonLogic.get() && minecraft.world == null && buttonWidget.id == 108) {
7373
/* this is so silly... but the alternatives are not fun :p */
7474
options.difficulty = Difficulty.byId(options.difficulty.getId() + 1 & 3);
7575
difficultyButton.message = getButtonLabel(options.difficulty);
@@ -80,7 +80,7 @@ public abstract class OptionsScreenMixin extends Screen {
8080
private int axolotlclient$onlySetIfInWorld(int original) {
8181
/* because we're going to be able to toggle this button while not in a world, we can avoid the game crashing by */
8282
/* checking if the world is valid before we set the difficulty */
83-
return OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.disableSkinCustomizationButton.get() && minecraft.world == null ? -1 : original;
83+
return OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.oldDifficultyButtonLogic.get() && minecraft.world == null ? -1 : original;
8484
}
8585

8686
@ModifyArg(method = "buttonClicked", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/Difficulty;byId(I)Lnet/minecraft/world/Difficulty;"), index = 0)

0 commit comments

Comments
 (0)