File tree Expand file tree Collapse file tree 4 files changed +23
-17
lines changed
src/main/java/ru/zznty/create_factory_logistics Expand file tree Collapse file tree 4 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,17 @@ dependencies {
2020 implementation(project(path : " :create_factory_abstractions-${ minecraft_version} " , configuration : ' namedElements' )) { transitive false }
2121 include project(" :create_factory_abstractions-${ minecraft_version} " )
2222
23+ modCompileOnly " net.liukrast:extra_gauges-${ minecraft_version} :${ extra_gauges_version} " , {
24+ transitive = false
25+ }
26+
27+ // modLocalRuntime "net.liukrast:extra_gauges-${minecraft_version}:${extra_gauges_version}", {
28+ // transitive = false
29+ // }
30+
2331 modLocalRuntime " curse.maven:create-vibrant-vaults-1251719:6463890"
2432// modLocalRuntime "curse.maven:create-enchantment-industry-688768:6549319"
25- modLocalRuntime " curse.maven:create-extra-gauges-1263228:6916170"
2633// modLocalRuntime "curse.maven:create-dragon-minus-1216624:6552025"
27- // modLocalRuntime "net.liukrast:extra_gauges-${minecraft_version}:1.1.1", {
28- // transitive = false
29- // }
3034}
3135
3236// This block of code expands all declared replace properties in the specified resource targets.
Original file line number Diff line number Diff line change 11package ru .zznty .create_factory_logistics .compat .extra_gauges ;
22
33import com .simibubi .create .content .logistics .factoryBoard .FactoryPanelBehaviour ;
4+ import net .liukrast .eg .api .logistics .board .AbstractPanelBehaviour ;
45import net .neoforged .fml .ModList ;
5- import org .jetbrains .annotations .Nullable ;
66
77public final class AbstractPanelBehaviourStub {
8- @ Nullable
9- private static Class <?> clazz ;
8+ private static final boolean isInstalled = ModList .get ().isLoaded ("extra_gauges" );
109
11- static {
12- try {
13- clazz = ModList .get ().isLoaded ("extra_gauges" ) ?
14- Class .forName ("net.liukrast.eg.api.logistics.board.AbstractPanelBehaviour" ) : null ;
15- } catch (ClassNotFoundException e ) {
16- // ignore
17- }
10+ public static boolean shouldTick (FactoryPanelBehaviour instance ) {
11+ if (!isInstalled ) return false ;
12+
13+ return shouldTickInstalled (instance );
1814 }
1915
20- public static boolean is (FactoryPanelBehaviour instance ) {
21- return clazz != null && clazz .isInstance (instance );
16+ private static boolean shouldTickInstalled (FactoryPanelBehaviour instance ) {
17+ if (instance instanceof AbstractPanelBehaviour behaviour ) {
18+ return behaviour .skipOriginalTick ();
19+ }
20+ return false ;
2221 }
2322}
Original file line number Diff line number Diff line change 2121import net .minecraft .world .MenuProvider ;
2222import net .minecraft .world .item .ItemStack ;
2323import org .joml .Math ;
24+ import org .spongepowered .asm .mixin .Debug ;
2425import org .spongepowered .asm .mixin .Mixin ;
2526import org .spongepowered .asm .mixin .Shadow ;
2627import org .spongepowered .asm .mixin .Unique ;
3536import java .util .*;
3637import java .util .stream .Collectors ;
3738
39+ @ Debug (export = true )
3840@ Mixin (FactoryPanelBehaviour .class )
3941public abstract class FactoryPanelRequestMixin extends FilteringBehaviour implements MenuProvider {
4042 @ Shadow
@@ -199,7 +201,7 @@ private int getConfigRequestIntervalInTicks() {
199201 private void tickRequests (Operation <Void > original ) {
200202 FactoryPanelBehaviour source = (FactoryPanelBehaviour ) (Object ) this ;
201203
202- if (AbstractPanelBehaviourStub .is (source )) {
204+ if (AbstractPanelBehaviourStub .shouldTick (source )) {
203205 // we don't want to override mixins from extra gauges so skip to the original
204206 original .call ();
205207 return ;
Original file line number Diff line number Diff line change @@ -52,3 +52,4 @@ ponder_version = 1.0.56
5252flywheel_version = 1.0.4
5353registrate_version = MC1.21-1.3.0+62
5454jei_version = 19.21.0.247
55+ extra_gauges_version = 2.0.5
You can’t perform that action at this time.
0 commit comments