Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ASM Issues[1.6.4]


Recommended Posts

So, I'm trying to just replace certain class files on runtime, not inject into them. Basically, I am thrown an error below when I try to use the mod.

 

Error: http://pastebin.com/hAcK8m9Q

 

However, this shouldn't be happening. The block file in question is

 

 

 

package yamhaven.easycoloredlights.blocks;
//hi
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.util.Icon;
import yamhaven.easycoloredlights.lib.BlockInfo;
import yamhaven.easycoloredlights.lib.ModInfo;
  
public class WhiteColoredLightBlock extends net.minecraft.block.Block {
public WhiteColoredLightBlock(int id) {
	super(id, Material.glass);
	setUnlocalizedName(BlockInfo.whiteColoredLightBlock_unlocalizedName);
	setHardness(0.3F);
	setStepSound(Block.soundGlassFootstep);
	setCreativeTab(CreativeTabs.tabDecorations);
	setLightValue(1.0F);

	//Accepts RGB floats ranging from 0.0 to 1.0
	addColorLightValue(1.0F,1.0F,1.0F);
}

@SideOnly(Side.CLIENT)
private Icon blockIcon;

@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister icon) {
	blockIcon = icon.registerIcon(ModInfo.ID.toLowerCase() + ":" + BlockInfo.whiteColoredLightBlock_unlocalizedName);
}

@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int par2) {
	return blockIcon;
}
}

 

 

 

And it's loaded from the preinit of the main class:

 

 

 

package yamhaven.easycoloredlights;

import yamhaven.easycoloredlights.blocks.Blocks;
import yamhaven.easycoloredlights.lib.ConfigHandler;
import yamhaven.easycoloredlights.lib.ModInfo;
import yamhaven.easycoloredlights.proxy.CommonProxy;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
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;

@Mod(modid = ModInfo.ID, name = ModInfo.NAME, version = ModInfo.VERSION)
@NetworkMod (channels = {ModInfo.CHANNEL}, clientSideRequired = true, serverSideRequired = true)

public class EasyColoredLights {
@SidedProxy(clientSide = ModInfo.PROXY_LOCATION + ".ClientProxy", serverSide = ModInfo.PROXY_LOCATION + ".CommonProxy")
public static CommonProxy proxy;

@EventHandler
public static void preInit(FMLPreInitializationEvent event) {
	ConfigHandler.init(event.getSuggestedConfigurationFile());
}

@EventHandler
public static void init(FMLInitializationEvent event) {
	Blocks.init();
	Blocks.addNames();
	Blocks.addBlockRecipes();
}

@EventHandler
public static void postInit(FMLPostInitializationEvent event) {

}
}

 

 

 

 

 

package yamhaven.easycoloredlights.lib;

import java.io.File;

import net.minecraft.client.Minecraft;
import net.minecraftforge.common.Configuration;
import yamhaven.easycoloredlights.lib.BlockIds;
import yamhaven.easycoloredlights.lib.BlockInfo;

public class ConfigHandler {
public static void init(File configFile) {
	Configuration config = new Configuration(configFile);
	config.load();
	BlockIds.whiteLightBlockID_actual = config.getBlock(BlockInfo.whiteColoredLighBlock_name, BlockIds.whiteLightBlockID_default).getInt();
	BlockIds.blackLightBlockID_actual = config.getBlock(BlockInfo.blackColoredLighBlock_name, BlockIds.blackLightBlockID_default).getInt();
	BlockIds.redLightBlockID_actual = config.getBlock(BlockInfo.redColoredLighBlock_name, BlockIds.redLightBlockID_default).getInt();
	BlockIds.greenLightBlockID_actual = config.getBlock(BlockInfo.greenColoredLighBlock_name, BlockIds.greenLightBlockID_default).getInt();
	BlockIds.blueLightBlockID_actual = config.getBlock(BlockInfo.blueColoredLighBlock_name, BlockIds.blueLightBlockID_default).getInt();
	config.save();
}
}

 

 

 

What could be causing this, and how do I fix it?

Link to post
Share on other sites

Why are you trying to do this with ASM?

Seems something you can do in basic java.

Also I dont see your coremod side, as you say that's the thing thats injecting stuff we'd need to see it.

 

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to post
Share on other sites
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.