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

Commit c07c723

Browse files
committed
fix compatibility with radium
1 parent 14ebec2 commit c07c723

4 files changed

Lines changed: 39 additions & 28 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var client = "3.1.10-beta.1"
1414
var config = "3.1.13"
1515
var osl = "0.17.2"
1616
var legacyLwjgl3 = "1.2.11"
17-
version = "1.1.0"
17+
version = "1.1.0-beta.2"
1818
group = "io.github.axolotlclient.oldanimations"
1919
base.archivesName = "AxolotlClient-OldAnimations"
2020

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
22+
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
23+
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
24+
import net.minecraft.block.entity.BlockEntity;
25+
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
26+
import org.spongepowered.asm.mixin.Mixin;
27+
28+
@Mixin(BlockEntityRenderDispatcher.class)
29+
public abstract class BlockEntityRenderDispatcherMixin {
30+
31+
@WrapMethod(method = "render(Lnet/minecraft/block/entity/BlockEntity;FI)V")
32+
private void disableBlockEntityMiningProgress(BlockEntity blockEntity, float tickDelta, int blockMiningProgress, Operation<Void> original) {
33+
if (blockMiningProgress == -1 || !OldAnimationsConfig.isEnabled() || !OldAnimationsConfig.instance.blockEntityMiningProgress.get()) {
34+
original.call(blockEntity, tickDelta, blockMiningProgress);
35+
}
36+
}
37+
}

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,47 +18,20 @@
1818

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

21-
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
2221
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
2322
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2423
import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig;
2524
import net.minecraft.block.BeaconBlock;
2625
import net.minecraft.block.Block;
2726
import net.minecraft.block.Blocks;
2827
import net.minecraft.block.state.BlockState;
29-
import net.minecraft.client.render.world.BlockMiningProgress;
3028
import net.minecraft.client.render.world.WorldRenderer;
3129
import org.spongepowered.asm.mixin.Mixin;
3230
import org.spongepowered.asm.mixin.injection.At;
3331

34-
import java.util.Collection;
35-
import java.util.Collections;
36-
import java.util.Map;
37-
3832
@Mixin(WorldRenderer.class)
3933
public class WorldRendererMixin {
4034

41-
@WrapWithCondition(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/world/WorldRenderer;setupMiningProgressState()V"))
42-
private boolean axolotlclient$removeMiningProgressGLState(WorldRenderer instance) {
43-
/* we should stop setting these GL states */
44-
return !OldAnimationsConfig.isEnabled() || !OldAnimationsConfig.instance.blockEntityMiningProgress.get();
45-
}
46-
47-
@WrapOperation(method = "renderEntities", at = @At(value = "INVOKE", target = "Ljava/util/Map;values()Ljava/util/Collection;"))
48-
private <V extends BlockMiningProgress> Collection<V> axolotlclient$doNotRenderMiningProgress(Map<Integer, BlockMiningProgress> instance, Operation<Collection<V>> original) {
49-
/* goodbye france. hello paris */
50-
if (OldAnimationsConfig.isEnabled() && OldAnimationsConfig.instance.blockEntityMiningProgress.get()) {
51-
return Collections.emptyList();
52-
}
53-
return original.call(instance);
54-
}
55-
56-
@WrapWithCondition(method = "renderEntities", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/world/WorldRenderer;restoreMiningProgressState()V"))
57-
private boolean axolotlclient$removeMiningProgressGLState2(WorldRenderer instance) {
58-
/* we should stop setting these GL states again */
59-
return !OldAnimationsConfig.isEnabled() || !OldAnimationsConfig.instance.blockEntityMiningProgress.get();
60-
}
61-
6235
@WrapOperation(method = "renderMiningProgress", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/state/BlockState;getBlock()Lnet/minecraft/block/Block;", ordinal = 0))
6336
private Block axolotlclient$skipBlockEntityCheck(BlockState instance, Operation<Block> original) {
6437
/* this should remove the blockentity check stopping the mining progress from showing on them. */

src/main/resources/oldanimations.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"client": [
99
"AmbientOcclusionFaceMixin",
1010
"BeaconRendererMixin",
11+
"BlockEntityRenderDispatcherMixin",
1112
"BlockMixin",
1213
"BlockModelAccessor",
1314
"BlockModelRendererMixin",

0 commit comments

Comments
 (0)