|
18 | 18 |
|
19 | 19 | package io.github.axolotlclient.oldanimations.mixin; |
20 | 20 |
|
21 | | -import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; |
22 | 21 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; |
23 | 22 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
24 | 23 | import io.github.axolotlclient.oldanimations.config.OldAnimationsConfig; |
25 | 24 | import net.minecraft.block.BeaconBlock; |
26 | 25 | import net.minecraft.block.Block; |
27 | 26 | import net.minecraft.block.Blocks; |
28 | 27 | import net.minecraft.block.state.BlockState; |
29 | | -import net.minecraft.client.render.world.BlockMiningProgress; |
30 | 28 | import net.minecraft.client.render.world.WorldRenderer; |
31 | 29 | import org.spongepowered.asm.mixin.Mixin; |
32 | 30 | import org.spongepowered.asm.mixin.injection.At; |
33 | 31 |
|
34 | | -import java.util.Collection; |
35 | | -import java.util.Collections; |
36 | | -import java.util.Map; |
37 | | - |
38 | 32 | @Mixin(WorldRenderer.class) |
39 | 33 | public class WorldRendererMixin { |
40 | 34 |
|
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 | | - |
62 | 35 | @WrapOperation(method = "renderMiningProgress", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/state/BlockState;getBlock()Lnet/minecraft/block/Block;", ordinal = 0)) |
63 | 36 | private Block axolotlclient$skipBlockEntityCheck(BlockState instance, Operation<Block> original) { |
64 | 37 | /* this should remove the blockentity check stopping the mining progress from showing on them. */ |
|
0 commit comments