Skip to content

Commit 8b9420f

Browse files
committed
quickly update deps oopsies
1 parent 55e7bc5 commit 8b9420f

11 files changed

Lines changed: 197 additions & 320 deletions

File tree

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mappings_18=1.8.9+build.28
1515
fabric_loader=0.17.2
1616

1717
osl=0.16.3
18-
config=3.0.20-beta.1
19-
client=3.1.5
18+
config=3.0.22
19+
client=3.1.6
2020

21-
legacy_lwjgl3=1.2.9
21+
legacy_lwjgl3=1.2.10

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ blocks item positions (rotations) + fix trapdoors and pressure plates and other
4242
MC-57895 - stairs are wrong direction
4343
4444
--- Textures/Models ---
45-
fix weird fuzzy texture sizes of swords and stuff
45+
fix weird fuzzy texture sizes of swords and stuff - THIS WAS MIP MAP
4646
fast grass always shown in gui/dropped?
4747
held pressure plates look a bit different?? idk why. THEY'RE BIGGER THAT'S WHY
4848
MC-262869 - top texture of blocks need to be rotated as noted above

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public class OldAnimationsConfig {
158158
public final BooleanOption fenceGateItemModel = new BooleanOption("fenceGateItemModel", true);
159159
public final BooleanOption fenceGateWallMode = new BooleanOption("fenceGateWallMode", true);
160160
public final BooleanOption defaultWolfCollarColor = new BooleanOption("defaultWolfCollarColor", true);
161+
public final BooleanOption itemModelSideQuadRendering = new BooleanOption("itemModelSideQuadRendering", true);
161162

162163
private final Supplier<Boolean>[] suppliers = new Supplier[] {
163164
enabled::get,
@@ -168,7 +169,8 @@ public class OldAnimationsConfig {
168169
fastSmoothLighting::get,
169170
modelShadeAndAmbientOcclusion::get,
170171
fenceGateItemModel::get,
171-
fenceGateWallMode::get
172+
fenceGateWallMode::get,
173+
itemModelSideQuadRendering::get
172174
};
173175
private final boolean[] previousStates = {
174176
enabled.get(),
@@ -179,7 +181,8 @@ public class OldAnimationsConfig {
179181
fastSmoothLighting.get(),
180182
modelShadeAndAmbientOcclusion.get(),
181183
fenceGateItemModel.get(),
182-
fenceGateWallMode.get()
184+
fenceGateWallMode.get(),
185+
itemModelSideQuadRendering.get()
183186
};
184187

185188
public static boolean isEnabled() {
@@ -226,7 +229,8 @@ public void initConfig() {
226229
skullModel,
227230
fastGrass,
228231
fire,
229-
fenceGateItemModel
232+
fenceGateItemModel,
233+
itemModelSideQuadRendering
230234
);
231235
category.add(categoryCombat);
232236
categoryCombat.add(

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

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,103 @@
1818

1919
package io.github.axolotlclient.oldanimations.mixin;
2020

21+
import com.google.common.collect.Lists;
22+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
23+
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
24+
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
25+
import net.minecraft.client.render.model.block.BlockElement;
26+
import net.minecraft.client.render.model.block.BlockElementFace;
27+
import net.minecraft.client.render.model.block.BlockElementTexture;
2128
import net.minecraft.client.render.model.block.ItemModelGenerator;
29+
import net.minecraft.client.render.texture.TextureAtlasSprite;
30+
import net.minecraft.util.math.Direction;
31+
import org.lwjgl.util.vector.Vector3f;
2232
import org.spongepowered.asm.mixin.Mixin;
33+
import org.spongepowered.asm.mixin.Shadow;
34+
import org.spongepowered.asm.mixin.Unique;
35+
import org.spongepowered.asm.mixin.injection.At;
36+
37+
import java.util.Collections;
38+
import java.util.List;
2339

2440
@Mixin(ItemModelGenerator.class /* unmapped - C_4311621 */)
2541
public abstract class ItemModelGeneratorMixin {
2642

43+
@Shadow
44+
protected abstract List<BlockElement> addSideElements(TextureAtlasSprite textureAtlasSprite, String string, int i);
45+
46+
@WrapOperation(method = "processFrames", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/block/ItemModelGenerator;addSideElements(Lnet/minecraft/client/render/texture/TextureAtlasSprite;Ljava/lang/String;I)Ljava/util/List;"))
47+
private List<BlockElement> axolotlclient$itemModelSideQuadRendering(ItemModelGenerator instance, TextureAtlasSprite textureAtlasSprite, String string, int i, Operation<List<BlockElement>> original) {
48+
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.itemModelSideQuadRendering.get()) {
49+
return axolotlclient$oldAddSideElements(textureAtlasSprite, string, i);
50+
}
51+
return addSideElements(textureAtlasSprite, string, i);
52+
}
53+
54+
@Unique
55+
private List<BlockElement> axolotlclient$oldAddSideElements(TextureAtlasSprite textureAtlasSprite, String string, int i) {
56+
List<BlockElement> list = Lists.newArrayList();
57+
58+
int width = textureAtlasSprite.getWidth();
59+
int height = textureAtlasSprite.getHeight();
60+
float uMin = 0.0F;
61+
float vMin = 0.0F;
62+
float uMax = 16.0F;
63+
float vMax = 16.0F;
64+
65+
float f = 0.5F * (uMin - uMax) / width;
66+
float g = 0.5F * (vMax - vMin) / height;
67+
68+
for (int i10 = 0; i10 < width; i10++) {
69+
float h = (float) i10 / width;
70+
float l = uMin + (uMax - uMin) * ((float) i10 / width) - f;
71+
list.add(new BlockElement(
72+
new Vector3f(h * 16.0F, 0.0F, 7.5F), new Vector3f(h * 16.0F, 16.0F, 8.5F),
73+
Collections.singletonMap(
74+
Direction.WEST,
75+
new BlockElementFace(null, i, string, new BlockElementTexture(new float[]{l, vMin, l, vMax}, 0))
76+
), null, true
77+
));
78+
}
79+
80+
for (int var14 = 0; var14 < width; var14++) {
81+
float i12 = (float) var14 / width;
82+
float m = uMin + (uMax - uMin) * i12 - f;
83+
float q = i12 + 1.0F / width;
84+
list.add(new BlockElement(
85+
new Vector3f(q * 16.0F, 0.0F, 7.5F), new Vector3f(q * 16.0F, 16.0F, 8.5F),
86+
Collections.singletonMap(
87+
Direction.EAST,
88+
new BlockElementFace(null, i, string, new BlockElementTexture(new float[]{m, vMin, m, vMax}, 0))
89+
), null, true
90+
));
91+
}
92+
93+
for (int var15 = 0; var15 < height; var15++) {
94+
float j = (float) var15 / height;
95+
float n = vMax + (vMin - vMax) * j - g;
96+
float r = j + 1.0F / height;
97+
list.add(new BlockElement(
98+
new Vector3f(0.0F, r * 16.0F, 7.5F), new Vector3f(16.0F, r * 16.0F, 8.5F),
99+
Collections.singletonMap(
100+
Direction.UP,
101+
new BlockElementFace(null, i, string, new BlockElementTexture(new float[]{uMin, n, uMax, n}, 0))
102+
), null, true
103+
));
104+
}
105+
106+
for (int var16 = 0; var16 < height; var16++) {
107+
float k = (float) var16 / height;
108+
float o = vMax + (vMin - vMax) * ((float) var16 / height) - g;
109+
list.add(new BlockElement(
110+
new Vector3f(0.0F, k * 16.0F, 7.5F), new Vector3f(16.0F, k * 16.0F, 8.5F),
111+
Collections.singletonMap(
112+
Direction.DOWN,
113+
new BlockElementFace(null, i, string, new BlockElementTexture(new float[]{uMin, o, uMax, o}, 0))
114+
), null, true
115+
));
116+
}
117+
118+
return list;
119+
}
27120
}

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@
2121
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
2222
import com.llamalad7.mixinextras.sugar.Local;
2323
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
24-
import io.github.axolotlclient.oldanimations.util.OldItemModelGenerator;
2524
import net.minecraft.client.render.model.block.*;
26-
import net.minecraft.client.render.texture.TextureAtlas;
2725
import net.minecraft.client.resource.model.ModelBakery;
2826
import net.minecraft.item.Item;
2927
import net.minecraft.item.Items;
3028
import net.minecraft.resource.Identifier;
3129
import net.minecraft.util.math.Direction;
3230
import org.lwjgl.util.vector.Vector3f;
33-
import org.spongepowered.asm.mixin.Final;
3431
import org.spongepowered.asm.mixin.Mixin;
3532
import org.spongepowered.asm.mixin.Shadow;
3633
import org.spongepowered.asm.mixin.Unique;
@@ -52,10 +49,6 @@ public abstract class ModelBakeryMixin {
5249
@Shadow
5350
protected abstract Identifier getModelsJsonLocation(Identifier identifier);
5451

55-
@Shadow
56-
@Final
57-
private TextureAtlas blockAtlas;
58-
5952
@Unique
6053
private static final Map<String, String> SKULL_TEXTURES = Map.of(
6154
"char", "items/skull_steve",
@@ -68,14 +61,6 @@ public abstract class ModelBakeryMixin {
6861
@Unique
6962
private static final Identifier BUILTIN_GENERATED = new Identifier("minecraft:builtin/generated");
7063

71-
@Unique
72-
private final OldItemModelGenerator oldItemModelGenerator = new OldItemModelGenerator();
73-
74-
@ModifyReturnValue(method = "generateItemModels(Lnet/minecraft/client/render/model/block/BlockModel;)Lnet/minecraft/client/render/model/block/BlockModel;", at = @At(value = "RETURN"))
75-
private BlockModel axolotlclient$useOurItemModelGenerator(BlockModel original, @Local(argsOnly = true) BlockModel blockModel) {
76-
return oldItemModelGenerator.generate(blockAtlas, blockModel);
77-
}
78-
7964
@Inject(method = "registerItemVariants", at = @At("TAIL"))
8065
private void axolotlclient$registerCustomModels(CallbackInfo ci) {
8166
//TODO: There HAS to be a better way of doing this T_T

src/main/java/io/github/axolotlclient/oldanimations/util/OldItemModelGenerator.java

Lines changed: 0 additions & 138 deletions
This file was deleted.

src/main/resources/assets/axolotlclient-oldanimations/lang/en_us.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,5 +222,7 @@
222222
"fenceGateWallMode": "Fence Gate Wall Connection",
223223
"fenceGateWallMode.tooltip": "Fixes a bug introduced in 1.8 where the fence gate will prematurely enter \"wall\" mode.",
224224
"defaultWolfCollarColor": "Default Wolf Collar Color",
225-
"defaultWolfCollarColor.tooltip": "Changes the default wolf collar color from orange to red like in 1.7 and 1.9+. Only works in singleplayer!"
225+
"defaultWolfCollarColor.tooltip": "Changes the default wolf collar color from orange to red like in 1.7 and 1.9+. Only works in singleplayer!",
226+
"itemModelSideQuadRendering": "Item Model Side Rendering",
227+
"itemModelSideQuadRendering.tooltip": "Renders the side elements of an item using 1.7's rendering logic."
226228
}

src/main/resources/assets/minecraft/models/block/cube.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/main/resources/assets/minecraft/models/block/half_slab.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)