Skip to content

Commit

Permalink
Fix loader-specific configurable types sometimes not working
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Sep 25, 2024
1 parent 6a92922 commit 4415d9b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class ConfigurableTypesFabric {

static {
public static void load() {
ConfigurableTypeCommon.PARTICLE.setAction(new ParticleActionFabric<>());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.Commands;
import org.cyclops.cyclopscore.config.ConfigHandlerFabric;
import org.cyclops.cyclopscore.config.ConfigurableTypesFabric;
import org.cyclops.cyclopscore.helper.IModHelpersFabric;
import org.cyclops.cyclopscore.helper.ModBaseCommon;
import org.cyclops.cyclopscore.helper.ModHelpersFabric;
Expand All @@ -25,6 +26,10 @@
*/
public abstract class ModBaseFabric<T extends ModBaseFabric<T>> extends ModBaseCommon<T> implements ModInitializer {

static {
ConfigurableTypesFabric.load();
}

private boolean loaded = false;
private final ICommonProxyCommon proxy;
private final ConfigHandlerFabric configHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
public class ConfigurableTypesForge {

static {
public static void load() {
ConfigurableTypeCommon.BLOCK.setAction(new BlockActionForge<>());
ConfigurableTypeCommon.ITEM.setAction(new ItemActionForge<>());
ConfigurableTypeCommon.GUI.setAction(new GuiActionForge<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.apache.logging.log4j.Level;
import org.cyclops.cyclopscore.config.ConfigHandlerCommon;
import org.cyclops.cyclopscore.config.ConfigHandlerForge;
import org.cyclops.cyclopscore.config.ConfigurableTypesForge;
import org.cyclops.cyclopscore.helper.IModHelpersForge;
import org.cyclops.cyclopscore.helper.ModBaseCommon;
import org.cyclops.cyclopscore.helper.ModHelpersForge;
Expand All @@ -32,6 +33,10 @@
*/
public abstract class ModBaseForge<T extends ModBaseForge<T>> extends ModBaseCommon<T> {

static {
ConfigurableTypesForge.load();
}

private final ICommonProxyCommon proxy;
private final ConfigHandlerCommon configHandler;
private final IEventBus modEventBus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
public class ConfigurableTypesNeoForge {

static {
public static void load() {
ConfigurableTypeCommon.GUI.setAction(new GuiActionNeoForge<>());
ConfigurableTypeCommon.PARTICLE.setAction(new ParticleActionNeoForge<>());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.cyclops.cyclopscore.config.ConfigHandler;
import org.cyclops.cyclopscore.config.ConfigHandlerCommon;
import org.cyclops.cyclopscore.config.ConfigHandlerNeoForge;
import org.cyclops.cyclopscore.config.ConfigurableTypesNeoForge;
import org.cyclops.cyclopscore.helper.IModHelpersNeoForge;
import org.cyclops.cyclopscore.helper.LoggerHelper;
import org.cyclops.cyclopscore.helper.ModBaseCommon;
Expand All @@ -55,6 +56,10 @@
// TODO: rename to ModBaseNeoForge in next major
public abstract class ModBase<T extends ModBase<T>> extends ModBaseCommon<T> {

static {
ConfigurableTypesNeoForge.load();
}

public static final EnumReferenceKey<String> REFKEY_TEXTURE_PATH_GUI = EnumReferenceKey.create("texture_path_gui", String.class);
public static final EnumReferenceKey<String> REFKEY_TEXTURE_PATH_MODELS = EnumReferenceKey.create("texture_path_models", String.class);
public static final EnumReferenceKey<String> REFKEY_TEXTURE_PATH_SKINS = EnumReferenceKey.create("texture_path_skins", String.class);
Expand Down

0 comments on commit 4415d9b

Please sign in to comment.