Skip to content

Commit

Permalink
Made config server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
Majrusz committed Aug 28, 2022
1 parent dfeaa7f commit 0314ffe
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
Binary file modified libs/majrusz-library-1.19.2-2.15.0.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class MajruszsAccessories {
public static final String MOD_ID = "majruszsaccessories";
public static final String NAME = "Majrusz's Accessories";
public static final ConfigHandler CONFIG_HANDLER = new ConfigHandler( ModConfig.Type.COMMON, "common.toml", MOD_ID );
public static final ConfigHandler SERVER_CONFIG = new ConfigHandler( ModConfig.Type.SERVER );

public MajruszsAccessories() {
Integration.initialize();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/majruszsaccessories/Registries.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
import java.util.List;
import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class Registries {
private static final DeferredRegisterHelper HELPER = new DeferredRegisterHelper( MajruszsAccessories.MOD_ID );
static {
CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( Modifiers.DEFAULT_GROUP ) );
SERVER_CONFIG.addGroup( GameModifier.addNewGroup( Modifiers.DEFAULT_GROUP ) );
}

// Groups
Expand Down Expand Up @@ -70,7 +70,7 @@ public static void initialize() {
HELPER.registerAll();
DistExecutor.unsafeRunWhenOn( Dist.CLIENT, ()->()->modEventBus.addListener( Registries::onTextureStitch ) );
modEventBus.addListener( Registries::onEnqueueIMC );
CONFIG_HANDLER.register( ModLoadingContext.get() );
SERVER_CONFIG.register( ModLoadingContext.get() );
}

public static ResourceLocation getLocation( String register ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class AdventurersGuideItem extends AccessoryItem {
static final String ID = Registries.getLocationString( "adventurers_guide" );
static final ConfigGroup GROUP = CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( ID, "AdventurersGuide", "" ) );
static final ConfigGroup GROUP = SERVER_CONFIG.addGroup( GameModifier.addNewGroup( ID, "AdventurersGuide", "" ) );

public static Supplier< AdventurersGuideItem > create() {
GameModifiersHolder< AdventurersGuideItem > holder = AccessoryItem.newHolder( ID, AdventurersGuideItem::new );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class AnglersTrophyItem extends AccessoryItem {
static final String ID = Registries.getLocationString( "anglers_trophy" );
static final ConfigGroup GROUP = CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( ID, "AnglerTrophy", "" ) );
static final ConfigGroup GROUP = SERVER_CONFIG.addGroup( GameModifier.addNewGroup( ID, "AnglerTrophy", "" ) );

public static Supplier< AnglersTrophyItem > create() {
GameModifiersHolder< AnglersTrophyItem > holder = AccessoryItem.newHolder( ID, AnglersTrophyItem::new );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class CertificateOfTamingItem extends AccessoryItem {
static final String ID = Registries.getLocationString( "certificate_of_taming" );
static final ConfigGroup GROUP = CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( ID, "CertificateOfTaming", "" ) );
static final ConfigGroup GROUP = SERVER_CONFIG.addGroup( GameModifier.addNewGroup( ID, "CertificateOfTaming", "" ) );

public static Supplier< CertificateOfTamingItem > create() {
GameModifiersHolder< CertificateOfTamingItem > holder = AccessoryItem.newHolder( ID, CertificateOfTamingItem::new );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class IdolOfFertilityItem extends AccessoryItem {
static final String ID = Registries.getLocationString( "idol_of_fertility" );
static final ConfigGroup GROUP = CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( ID, "IdolOfFertility", "" ) );
static final ConfigGroup GROUP = SERVER_CONFIG.addGroup( GameModifier.addNewGroup( ID, "IdolOfFertility", "" ) );

public static Supplier< IdolOfFertilityItem > create() {
GameModifiersHolder< IdolOfFertilityItem > holder = AccessoryItem.newHolder( ID, IdolOfFertilityItem::new );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class LuckyRockItem extends AccessoryItem {
static final String ID = Registries.getLocationString( "lucky_rock" );
static final ConfigGroup GROUP = CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( ID, "LuckyRock", "" ) );
static final ConfigGroup GROUP = SERVER_CONFIG.addGroup( GameModifier.addNewGroup( ID, "LuckyRock", "" ) );

public static Supplier< LuckyRockItem > create() {
GameModifiersHolder< LuckyRockItem > holder = AccessoryItem.newHolder( ID, LuckyRockItem::new );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class SecretIngredientItem extends AccessoryItem {
static final String ID = Registries.getLocationString( "secret_ingredient" );
static final ConfigGroup GROUP = CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( ID, "SecretIngredient", "" ) );
static final ConfigGroup GROUP = SERVER_CONFIG.addGroup( GameModifier.addNewGroup( ID, "SecretIngredient", "" ) );

public static Supplier< SecretIngredientItem > create() {
GameModifiersHolder< SecretIngredientItem > holder = AccessoryItem.newHolder( ID, SecretIngredientItem::new );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

import java.util.function.Supplier;

import static com.majruszsaccessories.MajruszsAccessories.CONFIG_HANDLER;
import static com.majruszsaccessories.MajruszsAccessories.SERVER_CONFIG;

public class TamedPotatoBeetleItem extends AccessoryItem {
static final String ID = Registries.getLocationString( "tamed_potato_beetle" );
static final ConfigGroup GROUP = CONFIG_HANDLER.addGroup( GameModifier.addNewGroup( ID, "TamedPotatoBeetle", "" ) );
static final ConfigGroup GROUP = SERVER_CONFIG.addGroup( GameModifier.addNewGroup( ID, "TamedPotatoBeetle", "" ) );

public static Supplier< TamedPotatoBeetleItem > create() {
GameModifiersHolder< TamedPotatoBeetleItem > holder = AccessoryItem.newHolder( ID, TamedPotatoBeetleItem::new );
Expand Down

0 comments on commit 0314ffe

Please sign in to comment.