Jump to content

Recommended Posts

Posted

I am trying to use sided configs, if i run the server through eclipse it creates the config but if i run it on obfuscated code it does not, it outputs that it is but it never does.

 

CommonProxy

 

 

/*******************************************************************************
* Copyright (c) 2012 Viper283.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Viper283
******************************************************************************/
package viper283.core;

import net.minecraft.src.EntityPlayer;
import net.minecraft.src.World;
import cpw.mods.fml.common.network.IGuiHandler;

/**
* @author Viper283
*
*/
public class CommonProxy implements IGuiHandler {

/**
 * 
 */
public void registerRenderInformation() {
	// TODO Auto-generated constructor stub
}
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
		int x, int y, int z) {
	// TODO Auto-generated method stub
	return null;
}
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
		int x, int y, int z) {
	// TODO Auto-generated method stub
	return null;
}

public String config() {
	System.out.println("fhbdjsf");
	return "/config/Viper283/CvC/Config.cfg";
}

}

 

 

 

ClientProxy

 

 

/*******************************************************************************
* Copyright (c) 2012 Viper283.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Viper283
******************************************************************************/
package viper283.core.client;

import net.minecraft.client.Minecraft;
import net.minecraftforge.client.MinecraftForgeClient;
import viper283.core.CommonProxy;

/**
* @author Viper283
*
*/
public class ClientProxy extends CommonProxy {


@Override
public void registerRenderInformation() {

}

public String config() {
	return Minecraft.getMinecraftDir() + "/config/Viper283/CvC/Config.cfg";
}

}

 

 

 

ViperCore

 

 

/*******************************************************************************
* Copyright (c) 2012 Viper283.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Viper283
******************************************************************************/
package viper283.core;

import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;

import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PostInit;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

/**
* @author Viper283
*
*/
@Mod( modid = "CodeViperCore", name = "CodeViperCore", version = Resources.version )
@NetworkMod( channels = { "CodeViperCore" }, clientSideRequired = true, serverSideRequired = false,  packetHandler = PacketHandler.class)
public class ViperCore {

@SidedProxy(clientSide = "viper283.core.client.ClientProxy", serverSide = "viper283.core.CommonProxy")
public static CommonProxy proxy;
@Instance
public static ViperCore instance;
private static String logger = "[CvC]: ";
public static boolean debugText;
public static final List<Object> MODS = new ArrayList<Object>();


public static void registerMod(Object networkmod, String modName, String version)
    {
        String[] versionNumbers = Resources.version.split("\\.");
        String[] addonVersionNumbers = Resources.version.split("\\.");

        if (Integer.parseInt(addonVersionNumbers[0]) != Integer.parseInt(versionNumbers[0]))
        {
            throw new RuntimeException(logger + "CodeViperCore mod major version mismatch, expecting " + version);
        }
        else if (Integer.parseInt(addonVersionNumbers[1]) > Integer.parseInt(versionNumbers[1]))
        {
         throw new RuntimeException(logger + "CodeViperCore too old, need at least " + version);
        }
        else if (Integer.parseInt(addonVersionNumbers[1]) < Integer.parseInt(versionNumbers[1]))
        {
         throw new RuntimeException(logger + "CodeViperCore mod minor version mismatch, need at least " + version);
        }
        else if (Integer.parseInt(addonVersionNumbers[2]) != Integer.parseInt(versionNumbers[2]))
        {
            System.out.println(logger + "CvC mod minor version " + version + " mismatch with version " + version);
        }

        MODS.add(networkmod);
        System.out.println(logger + "Loaded CodeViperCore Mod: " + modName);
    }


@PreInit
public void initConfig(FMLPreInitializationEvent evt) {
	evt.getModMetadata().version = Resources.version;
	Configuration cfg = new Configuration(new File(proxy.config()));
	try {
		cfg.load();
		debugText = cfg.getOrCreateBooleanProperty("Debug Text", cfg.CATEGORY_GENERAL, true).getBoolean(true);
	} catch(Exception e) {
		System.out.println(logger + "Failed to load config for reason: ");
		e.printStackTrace();
	} finally {
		cfg.save();
	}


}

@Init
public void load(FMLInitializationEvent evt) {

}

}

 

 

 

If i am just being a noob them please treat me so. also it does create the config on the client side

Posted

I know this isn't going to be helpful in the slightest, but I noticed

System.out.println("fhbdjsf");

 

So glad I'm not the only one who does that :P

thats how i know that it's meant to be creating the config. i'm glad i'm not the only to lol

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Thanks, I've now installed a slightly newer version and the server is at least starting up now.
    • i have the same issue. Found 1 Create mod class dependency(ies) in createdeco-1.3.3-1.19.2.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Found 11 Create mod class dependency(ies) in createaddition-fabric+1.19.2-20230723a.jar, which are missing from the current create-1.19.2-0.5.1.i.jar Detailed walkthrough of mods which rely on missing Create mod classes: Mod: createaddition-fabric+1.19.2-20230723a.jar Missing classes of create: com/simibubi/create/compat/jei/category/sequencedAssembly/JeiSequencedAssemblySubCategory com/simibubi/create/compat/recipeViewerCommon/SequencedAssemblySubCategoryType com/simibubi/create/compat/rei/CreateREI com/simibubi/create/compat/rei/EmptyBackground com/simibubi/create/compat/rei/ItemIcon com/simibubi/create/compat/rei/category/CreateRecipeCategory com/simibubi/create/compat/rei/category/WidgetUtil com/simibubi/create/compat/rei/category/animations/AnimatedBlazeBurner com/simibubi/create/compat/rei/category/animations/AnimatedKinetics com/simibubi/create/compat/rei/category/sequencedAssembly/ReiSequencedAssemblySubCategory com/simibubi/create/compat/rei/display/CreateDisplay Mod: createdeco-1.3.3-1.19.2.jar Missing classes of create: com/simibubi/create/content/kinetics/fan/SplashingRecipe
    • The crash points to moonlight lib - try other builds or make a test without this mod and the mods requiring it
    • Do you have shaders enabled? There is an issue with the mod simpleclouds - remove this mod or disable shaders, if enabled  
    • Maybe you need to create file in assets/<modid>/items/<itemname>.json with content like this:   { "model": { "type": "minecraft:model", "model": "modname:item/itemname" } }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.