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

Commit 16e90d2

Browse files
committed
apply mipmap to gui blocks
1 parent 95f6c90 commit 16e90d2

6 files changed

Lines changed: 35 additions & 13 deletions

File tree

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@ blocks item positions (rotations) + fix trapdoors and pressure plates and other
4040
MC-57895 - stairs are wrong direction
4141
4242
--- Textures/Models ---
43-
fix weird fuzzy texture sizes of swords and stuff - THIS WAS MIP MAP
44-
fast grass always shown in gui/dropped?
43+
fast grass always shown in gui/dropped despite graphics option
4544
held pressure plates look a bit different?? idk why. THEY'RE BIGGER THAT'S WHY
4645
MC-262869 - top texture of blocks need to be rotated as noted above
4746
MC-262173 - tripwire hook using wrong wood texture
48-
MC-277768 && MC-57574 && MC-195505 - mipmap items/blocks
4947
improve old skull stuff?
50-
anisotrophic filtering on items in 1.7
48+
short grass, oak door, and sponge block have different textures
5149
5250
--- World ---
5351
figure out why hurtTime is off by 1 tick in 1.7... this might also impact other aspects of the game
@@ -70,6 +68,12 @@ figure out how to separate certain models (flowers from flower pot, etc)
7068
framed items are not centered - MC-8662
7169
mobentity blockentity? WHAT THE HELL IS THIS SUPPOSED TO MEAN RAHHH
7270
MC-5270 - suffocation screen order (buggy lava)
71+
3D anaglyph is different apparently
72+
73+
-- Difficult / Impossible --
74+
anisotrophic filtering on items in 1.7 - optifine interheres here
75+
MC-195505 - mipmap blocks - optifine interferes here
76+
fix weird fuzzy texture sizes of swords and stuff - THIS WAS MIP MAP - optifine again
7377
7478
*/
7579

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ public class OldAnimationsConfig {
161161
public final BooleanOption itemModelSideQuadRendering = new BooleanOption("itemModelSideQuadRendering", true);
162162
public final BooleanOption oldFastLeaves = new BooleanOption("oldFastLeaves", true);
163163
public final BooleanOption opaqueLeavesTextures = new BooleanOption("opaqueLeavesTextures", true);
164+
public final BooleanOption guiBlockItemsMipmap = new BooleanOption("guiBlockItemsMipmap", true);
164165

165166
private final BooleanSupplier[] suppliers = new BooleanSupplier[]{
166167
enabled::get,
@@ -173,7 +174,8 @@ public class OldAnimationsConfig {
173174
fenceGateItemModel::get,
174175
fenceGateWallMode::get,
175176
itemModelSideQuadRendering::get,
176-
opaqueLeavesTextures::get
177+
opaqueLeavesTextures::get,
178+
guiBlockItemsMipmap::get
177179
};
178180
private final boolean[] previousStates = {
179181
enabled.get(),
@@ -186,7 +188,8 @@ public class OldAnimationsConfig {
186188
fenceGateItemModel.get(),
187189
fenceGateWallMode.get(),
188190
itemModelSideQuadRendering.get(),
189-
opaqueLeavesTextures.get()
191+
opaqueLeavesTextures.get(),
192+
guiBlockItemsMipmap.get()
190193
};
191194

192195
public static boolean isEnabled() {
@@ -236,7 +239,8 @@ public void initConfig() {
236239
fenceGateItemModel,
237240
itemModelSideQuadRendering,
238241
oldFastLeaves,
239-
opaqueLeavesTextures
242+
opaqueLeavesTextures,
243+
guiBlockItemsMipmap
240244
);
241245
category.add(categoryCombat);
242246
categoryCombat.add(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ public abstract class GameRendererMixin implements Sneaky {
5959
@Shadow
6060
private long lastWorldRenderTime;
6161

62-
@Shadow
63-
private float lastFogBrightness;
6462
@Shadow
6563
private float fogBrightness;
64+
6665
@Shadow
6766
private float renderDistance;
67+
6868
@Unique
6969
private float lastCameraY;
7070

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.github.axolotlclient.oldanimations.util.GlintHandler;
2626
import io.github.axolotlclient.oldanimations.util.OpaqueLeavesHandler;
2727
import net.minecraft.block.Block;
28+
import net.minecraft.client.Minecraft;
2829
import net.minecraft.client.render.entity.ItemRenderer;
2930
import net.minecraft.client.render.model.block.ModelTransformations;
3031
import net.minecraft.client.render.platform.GlStateManager;
@@ -266,4 +267,14 @@ public abstract class ItemRendererMixin {
266267
axolotlclient$fastGraphics = false;
267268
}
268269
}
270+
271+
@ModifyArg(method = "renderGuiItemModel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/texture/Texture;pushFilter(ZZ)V"), index = 1)
272+
private boolean axolotlclient$guiItemsMipmap(boolean original) {
273+
/* MC-57574 and MC-277768. idk why there was 2 bug reports */
274+
/* in 1.7, the gui block items had mipmapping affect them since they were the same blocks used for world rendering */
275+
/* in 1.8, there is a distinction between block items and actual world rendered blocks */
276+
/* luckily it's easy to turn on mipmapping for rendered items */
277+
return OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.guiBlockItemsMipmap.get() ?
278+
Minecraft.getInstance().options.mipmapLevels > 0 : original;
279+
}
269280
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ public abstract class ModelBakeryMixin {
7272

7373

7474
/* i really dont want to do this */
75-
/* in order for 1.7 fast graphics leaves blocks, we need to have them on standby */
76-
/* aka they need to actually exist as their own block*/
75+
/* in order for 1.7 fast graphics leaves blocks to change on the fly, we need to have them on standby */
76+
/* aka they need to actually exist as their own block */
77+
/* if enough people complain ill change this system lol */
7778
List<String> originalLeaves = itemVariants.get(Item.byBlock(Blocks.LEAVES));
7879
List<String> opaqueLeaves = Arrays.asList("oak_leaves_opaque", "spruce_leaves_opaque", "birch_leaves_opaque", "jungle_leaves_opaque");
7980
originalLeaves.addAll(opaqueLeaves);
@@ -212,7 +213,7 @@ public abstract class ModelBakeryMixin {
212213
}
213214
}
214215

215-
//todo: uhm..
216+
//todo: dont delete this
216217
// if (OldAnimationsConfig.instance.oldFastLeavesTextures.get()) {
217218
// String search = "models/block/";
218219
// String suffix = "_leaves.json";

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,7 @@
228228
"oldFastLeaves": "Old Fast Leaves",
229229
"oldFastLeaves.tooltip": "Renders leaves block items as solid when graphics is set to fast. If \"Old Opaque Leaves Textures\" is enabled, this option will not do anything.",
230230
"opaqueLeavesTextures": "Opaque Leaves Textures",
231-
"opaqueLeavesTextures.tooltip": "Uses the old opaque leaves textures from 1.7 when graphics is set to fast."
231+
"opaqueLeavesTextures.tooltip": "Uses the old opaque leaves textures from 1.7 when graphics is set to fast.",
232+
"guiBlockItemsMipmap": "GUI Block Items Mipmap",
233+
"guiBlockItemsMipmap.tooltip": "Allows block items rendered in GUIs to have mipmapping applied to them similar to 1.7. The level of mipmapping is controlled through the in-game option."
232234
}

0 commit comments

Comments
 (0)