Jump to content

My mod is not work for minecraft


Dragonold103

Recommended Posts

I install minecraft with forge that I used to edit, also It works within the editing program but doesn't work for the client minecraft, whys that?

 

I will put out coding of the file if you need it?

 

 

---- Minecraft Crash Report ----
// My bad.

Time: 15/08/13 8:36 PM
Description: There was a severe problem during mod loading that has caused the game to fail

cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: net.PowerfulInventory.Mod.mod_PowerfulInventory
at cpw.mods.fml.common.LoadController.transition(LoadController.java:149)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:520)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:181)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:470)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796)
at net.minecraft.client.main.Main.main(SourceFile:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:57)
at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
Caused by: java.lang.ClassNotFoundException: net.PowerfulInventory.Mod.mod_PowerfulInventory
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:179)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:58)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.ModClassLoader.loadBaseModClass(ModClassLoader.java:101)
at cpw.mods.fml.common.modloader.ModLoaderModContainer.constructMod(ModLoaderModContainer.java:483)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:194)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:105)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:510)
... 10 more
Caused by: java.lang.NullPointerException
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:171)
... 39 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.6.2
Operating System: Windows XP (x86) version 5.1
Java Version: 1.7.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) Client VM (mixed mode, sharing), Oracle Corporation
Memory: 5735336 bytes (5 MB) / 81092608 bytes (77 MB) up to 518979584 bytes (494 MB)
JVM Flags: 2 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx512M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v8.04 FML v6.2.43.829 Minecraft Forge 9.10.0.829 4 mods loaded, 4 mods active
mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{6.2.43.829} [Forge Mod Loader] (coremods) Unloaded->Constructed
Forge{9.10.0.829} [Minecraft Forge] (coremods) Unloaded->Constructed
mod_PowerfulInventory{Not available} [mod_PowerfulInventory] (net) Unloaded->Errored

 

Link to comment
Share on other sites

Is the class mod_PowerfulInventory in the package net.PowerfulInventory.Mod???

 

If it isn't, there is your problem :)

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Is the class mod_PowerfulInventory in the package net.PowerfulInventory.Mod???

 

If it isn't, there is your problem :)

 

It in there and have no idea whats wrong here the base mod file.

 

Base mod:

package net.PowerfulInventory.Mod;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;

import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
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.IPacketHandler;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.Player;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

import net.PowerfulInventory.Mod.EnumToolMod;
import net.PowerfulInventory.Mod.Ore.ModEnumTool;
import net.PowerfulInventory.Mod.Ore.ModOre;
import net.PowerfulInventory.Mod.Ore.WorldGen;
import net.PowerfulInventory.Mod.Tools.ModAxe;
import net.PowerfulInventory.Mod.Tools.ModHS;
import net.PowerfulInventory.Mod.Tools.ModHammer;
import net.PowerfulInventory.Mod.Tools.ModHoe;
import net.PowerfulInventory.Mod.Tools.ModPickaxe;
import net.PowerfulInventory.Mod.Tools.ModShovel;
import net.PowerfulInventory.Mod.Tools.ModSword;
import net.PowerfulInventory.Mod.Tools.ModSynthesis;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStone;
import net.minecraft.block.BlockWorkbench;
import net.minecraft.block.StepSound;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemCoal;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.src.BaseMod;
import net.minecraft.src.ModLoader;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;


public class mod_PowerfulInventory extends BaseMod
{
public static final String version = "Powerful Inventory Version 1.00";

//Starting Tools
public static Item Stick_Left_Half = new ModItem(901, "Stick_Left_Half").setUnlocalizedName("Stick Left Half");
public static Item Stick_Right_Half = new ModItem(902, "Stick_Right_Half").setUnlocalizedName("Stick Right Half");

public static Item Iron_Hammer_Left_Gunpowder_Half = new ModItem(903, "Iron_Hammer_Left_Gunpowder_Half").setUnlocalizedName("Iron Hammer Left Gunpowder Half");
public static Item Iron_Hammer_Right_Lighter_Half = new ModItem(904, "Iron_Hammer_Right_Lighter_Half").setUnlocalizedName("Iron Hammer Right Lighter Half");

public static Item Gold_Hammer_Left_Gunpowder_Half = new ModItem(905, "Gold_Hammer_Left_Gunpowder_Half").setUnlocalizedName("Gold Hammer Left Gunpowder Half");
public static Item Gold_Hammer_Right_Lighter_Half = new ModItem(906, "Gold_Hammer_Right_Lighter_Half").setUnlocalizedName("Gold Hammer Right Lighter Half");

public static Item Diamond_Hammer_Left_Gunpowder_Half = new ModItem(907, "Diamond_Hammer_Left_Gunpowder_Half").setUnlocalizedName("Diamond Hammer Left Gunpowder Half");
public static Item Diamond_Hammer_Right_Lighter_Half = new ModItem(908, "Diamond_Hammer_Right_Lighter_Half").setUnlocalizedName("Diamond Hammer Right Lighter Half");

public static Item Iron_Synthesis = new ModSynthesis(909, "Iron_Synthesis", EnumToolMod.Synthesis_IRON, 0).setUnlocalizedName("Iron Synthesis");
public static Item Gold_Synthesis = new ModSynthesis(910, "Gold_Synthesis", EnumToolMod.Synthesis_GOLD, 0).setUnlocalizedName("Gold Synthesis");
public static Item Diamond_Synthesis = new ModSynthesis(911, "Diamond_Synthesis", EnumToolMod.Synthesis_EMERALD, 0).setUnlocalizedName("Diamond Synthesis");

public static Item Iron_Hammer = new ModHammer(912, "Iron_Hammer", EnumToolMod.Hammer_IRON, 0).setUnlocalizedName("Iron Hammer");
public static Item Gold_Hammer = new ModHammer(913, "Gold_Hammer", EnumToolMod.Hammer_GOLD, 0).setUnlocalizedName("Gold Hammer");
public static Item Diamond_Hammer = new ModHammer(914, "Diamond_Hammer", EnumToolMod.Hammer_EMERALD, 0).setUnlocalizedName("Diamond Hammer");

public static Item Iron_HS = new ModHS(915, "Iron_HS", EnumToolMod.HS_IRON, 0).setUnlocalizedName("Iron HS");
public static Item Gold_HS = new ModHS(916, "Gold_HS", EnumToolMod.HS_GOLD, 0).setUnlocalizedName("Gold HS");
public static Item Diamond_HS = new ModHS(917, "Diamond_HS", EnumToolMod.HS_EMERALD, 0).setUnlocalizedName("Diamond HS");

//Magic 1.0
public static Block Magic_Coal_Ore = new ModOre(918, "Magic_Coal_Ore").setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Magic Coal Ore").setLightValue(1.0F).func_111022_d("Magic_Coal_Ore");
public static Block Magic_Iron_Ore = new ModOre(919, "Magic_Iron_Ore").setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Magic Iron Ore").setLightValue(1.0F).func_111022_d("Magic_Iron_Ore");
public static Block Magic_Gold_Ore = new ModOre(920, "Magic_Gold_Ore").setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Magic Gold Ore").setLightValue(1.0F).func_111022_d("Magic_Gold_Ore");
public static Block Magic_Diamond_Ore = new ModOre(921, "Magic_Diamond_Ore").setHardness(3.0F).setResistance(5.0F).setUnlocalizedName("Magic Diamond Ore").setLightValue(1.0F).func_111022_d("Magic_Diamond_Ore");

public static Item Magic_Coal_Powder = new ModItem(922, "Magic_Coal_Powder").setUnlocalizedName("Magic Coal Powder");
public static Item Magic_Iron_Powder = new ModItem(923, "Magic_Iron_Powder").setUnlocalizedName("Magic Iron Powder");
public static Item Magic_Gold_Powder = new ModItem(924, "Magic_Gold_Powder").setUnlocalizedName("Magic Gold Powder");
public static Item Magic_Diamond_Powder = new ModItem(925, "Magic_Diamond_Powder").setUnlocalizedName("Magic Diamond Powder");

//Power Death 1.0
public static Item Killer_Shine = new ModItem(926, "Killer_Shine").setUnlocalizedName("Killer Shine").func_111206_d("Killer_Shine");
public static Item Killer_Sword = new ModSword(927, ModEnumTool.Killer_Shine).setUnlocalizedName("Killer Sword").func_111206_d("Killer_Sword");
public static Item Killer_Hoe = new ModHoe(930, ModEnumTool.Killer_Shine).setUnlocalizedName("Killer Hoe").func_111206_d("Killer_Hoe");
public static Item Killer_Pickaxe = new ModPickaxe(928, ModEnumTool.Killer_Shine).setUnlocalizedName("Killer Pickaxe").func_111206_d("Killer_Pickaxe");
public static Item Killer_Shovel = new ModShovel(931, ModEnumTool.Killer_Shine).setUnlocalizedName("Killer Shovel").func_111206_d("Killer_Shovel");
public static Item Killer_Axe = new ModAxe(929, ModEnumTool.Killer_Shine).setUnlocalizedName("Killer Axe").func_111206_d("Killer_Axe");

//Power Life 1.0
public static Item Revive_Bleed = new ModItem(932, "Revive_Bleed").setUnlocalizedName("Revive Bleed").func_111206_d("Revive_Bleed");
public static Item Revive_Sword = new ModSword(933, ModEnumTool.Revive_Bleed).setUnlocalizedName("Revive Sword").func_111206_d("Revive_Sword");
public static Item Revive_Hoe = new ModHoe(936, ModEnumTool.Revive_Bleed).setUnlocalizedName("Revive Hoe").func_111206_d("Revive_Hoe");
public static Item Revive_Pickaxe = new ModPickaxe(934, ModEnumTool.Revive_Bleed).setUnlocalizedName("Revive Pickaxe").func_111206_d("Revive_Pickaxe");
public static Item Revive_Shovel = new ModShovel(937, ModEnumTool.Revive_Bleed).setUnlocalizedName("Revive Shovel").func_111206_d("Revive_Shovel");
public static Item Revive_Axe = new ModAxe(935, ModEnumTool.Revive_Bleed).setUnlocalizedName("Revive Axe").func_111206_d("Revive_Axe");

//Tab
public static CreativeTabs PIBlock = new PowerTab(CreativeTabs.getNextID(), mod_PowerfulInventory.Magic_Iron_Ore.blockID, "P I Blocks", "P I Blocks");
public static CreativeTabs PIMaterials = new PowerTab(CreativeTabs.getNextID(), Item.gunpowder.itemID, "P I Materials", "P I Materials");
public static CreativeTabs PITools = new PowerTab(CreativeTabs.getNextID(), Diamond_Hammer.itemID, "P I Tools", "P I Tools");
public static CreativeTabs PICombat = new PowerTab(CreativeTabs.getNextID(), Diamond_Synthesis.itemID, "P I Combat", "P I Combat");

@EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    }

@EventHandler
    public void load()
    {
	GameRegistry.registerWorldGenerator(new WorldGen());

	MinecraftForge.setBlockHarvestLevel(Magic_Coal_Ore, "pickaxe", 0);
	MinecraftForge.setBlockHarvestLevel(Magic_Iron_Ore, "pickaxe", 1);
	MinecraftForge.setBlockHarvestLevel(Magic_Gold_Ore, "pickaxe", 2);
	MinecraftForge.setBlockHarvestLevel(Magic_Diamond_Ore, "pickaxe", 2);

	//Tabs
	//Magic
	Magic_Coal_Ore.setCreativeTab(PIBlock);
	Magic_Iron_Ore.setCreativeTab(PIBlock);
	Magic_Gold_Ore.setCreativeTab(PIBlock);
	Magic_Diamond_Ore.setCreativeTab(PIBlock);


	//Starting Tools
	Stick_Left_Half.setCreativeTab(PIMaterials);
	Stick_Right_Half.setCreativeTab(PIMaterials);
	Iron_Hammer_Left_Gunpowder_Half.setCreativeTab(PIMaterials);
	Iron_Hammer_Right_Lighter_Half.setCreativeTab(PIMaterials);
	Gold_Hammer_Left_Gunpowder_Half.setCreativeTab(PIMaterials);
	Gold_Hammer_Right_Lighter_Half.setCreativeTab(PIMaterials);
	Diamond_Hammer_Left_Gunpowder_Half.setCreativeTab(PIMaterials);
	Diamond_Hammer_Right_Lighter_Half.setCreativeTab(PIMaterials);

	//Magic
	Magic_Coal_Powder.setCreativeTab(PIMaterials);
	Magic_Iron_Powder.setCreativeTab(PIMaterials);
	Magic_Gold_Powder.setCreativeTab(PIMaterials);
	Magic_Diamond_Powder.setCreativeTab(PIMaterials);

	//Power
	Killer_Shine.setCreativeTab(PIMaterials);
	Revive_Bleed.setCreativeTab(PIMaterials);

	//Starting Tools
	Iron_Hammer.setCreativeTab(PITools);
	Gold_Hammer.setCreativeTab(PITools);
	Diamond_Hammer.setCreativeTab(PITools);

	//Power
	Killer_Pickaxe.setCreativeTab(PITools);
	Killer_Axe.setCreativeTab(PITools);
	Killer_Shovel.setCreativeTab(PITools);
	Killer_Hoe.setCreativeTab(PITools);
	Revive_Pickaxe.setCreativeTab(PITools);
	Revive_Axe.setCreativeTab(PITools);
	Revive_Shovel.setCreativeTab(PITools);
	Revive_Hoe.setCreativeTab(PITools);

	//Starting Tools
	Iron_Synthesis.setCreativeTab(PICombat);
	Iron_HS.setCreativeTab(PICombat);
	Gold_Synthesis.setCreativeTab(PICombat);
	Gold_HS.setCreativeTab(PICombat);
	Diamond_Synthesis.setCreativeTab(PICombat);
	Diamond_HS.setCreativeTab(PICombat);

	//Power
	Killer_Sword.setCreativeTab(PICombat);
	Revive_Sword.setCreativeTab(PICombat);



	//Smelting
	//Magic
	GameRegistry.addSmelting(mod_PowerfulInventory.Magic_Coal_Powder.itemID, new ItemStack(Item.coal, 4), 16);
	GameRegistry.addSmelting(mod_PowerfulInventory.Magic_Iron_Powder.itemID, new ItemStack(Item.ingotIron, 2), ;
	GameRegistry.addSmelting(mod_PowerfulInventory.Magic_Gold_Powder.itemID, new ItemStack(Item.ingotGold, 2), ;
	GameRegistry.addSmelting(mod_PowerfulInventory.Magic_Diamond_Powder.itemID, new ItemStack(Item.diamond, 2), ;

	//Crafting
	//Starting Tools
	GameRegistry.addRecipe(new ItemStack(Iron_Synthesis), new Object[]{"zxx", "xbl", "  l", 'x', Item.ingotIron, 'l', Item.stick, 'z', Item.flintAndSteel, 'b', Item.gunpowder});
	GameRegistry.addRecipe(new ItemStack(Gold_Synthesis), new Object[]{"zxx", "xbl", "  l", 'x', Item.ingotGold, 'l', Item.stick, 'z', Item.flintAndSteel, 'b', Item.gunpowder});
	GameRegistry.addRecipe(new ItemStack(Diamond_Synthesis), new Object[]{"zxx", "xbl", "  l", 'x', Item.diamond, 'l', Item.stick, 'z', Item.flintAndSteel, 'b', Item.gunpowder});

	GameRegistry.addRecipe(new ItemStack(Stick_Left_Half, 2), new Object[]{"  x", " xc", "xcv", 'x', Item.stick, 'c', Block.planks, 'v', Block.wood});
	GameRegistry.addRecipe(new ItemStack(Stick_Right_Half, 2), new Object[]{ "x ", "cx", 'x', Item.stick, 'c', Block.planks});
	GameRegistry.addRecipe(new ItemStack(Iron_Hammer_Left_Gunpowder_Half), new Object[]{"xxx", "xcc", "xxx", 'x', Item.ingotIron, 'c', Item.gunpowder});
	GameRegistry.addRecipe(new ItemStack(Iron_Hammer_Right_Lighter_Half), new Object[]{" xx", " cx", " xx", 'x', Item.ingotIron, 'c', Item.flintAndSteel});
	GameRegistry.addRecipe(new ItemStack(Gold_Hammer_Left_Gunpowder_Half), new Object[]{"xxx", "xcc", "xxx", 'x', Item.ingotGold, 'c', Item.gunpowder});
	GameRegistry.addRecipe(new ItemStack(Gold_Hammer_Right_Lighter_Half), new Object[]{" xx", " cx", " xx", 'x', Item.ingotGold, 'c', Item.flintAndSteel});
	GameRegistry.addRecipe(new ItemStack(Diamond_Hammer_Left_Gunpowder_Half), new Object[]{"xxx", "xcc", "xxx", 'x', Item.diamond, 'c', Item.gunpowder});
	GameRegistry.addRecipe(new ItemStack(Diamond_Hammer_Right_Lighter_Half), new Object[]{" xx", " cx", " xx", 'x', Item.diamond, 'c', Item.flintAndSteel});

	GameRegistry.addRecipe(new ItemStack(Iron_Hammer), new Object[]{"xc ", "vb ", 'c', mod_PowerfulInventory.Iron_Hammer_Left_Gunpowder_Half, 'x', mod_PowerfulInventory.Iron_Hammer_Right_Lighter_Half, 'b', mod_PowerfulInventory.Stick_Left_Half, 'v', mod_PowerfulInventory.Stick_Right_Half});
	GameRegistry.addRecipe(new ItemStack(Gold_Hammer), new Object[]{"xc ", "vb ", 'c', mod_PowerfulInventory.Gold_Hammer_Left_Gunpowder_Half, 'x', mod_PowerfulInventory.Gold_Hammer_Right_Lighter_Half, 'b', mod_PowerfulInventory.Stick_Left_Half, 'v', mod_PowerfulInventory.Stick_Right_Half});
	GameRegistry.addRecipe(new ItemStack(Diamond_Hammer), new Object[]{"xc ", "vb ", 'c', mod_PowerfulInventory.Diamond_Hammer_Left_Gunpowder_Half, 'x', mod_PowerfulInventory.Diamond_Hammer_Right_Lighter_Half, 'b', mod_PowerfulInventory.Stick_Left_Half, 'v', mod_PowerfulInventory.Stick_Right_Half});

	GameRegistry.addRecipe(new ItemStack(Iron_HS), new Object[]{"xc", 'x', mod_PowerfulInventory.Iron_Synthesis, 'c', mod_PowerfulInventory.Iron_Hammer});
	GameRegistry.addRecipe(new ItemStack(Gold_HS), new Object[]{"xc", 'x', mod_PowerfulInventory.Gold_Synthesis, 'c', mod_PowerfulInventory.Gold_Hammer});
	GameRegistry.addRecipe(new ItemStack(Diamond_HS), new Object[]{"xc", 'x', mod_PowerfulInventory.Diamond_Synthesis, 'c', mod_PowerfulInventory.Diamond_Hammer});

	//Magic
	GameRegistry.addRecipe(new ItemStack(Magic_Coal_Powder, 4), new Object[]{"x  x", "x  x", 'x', mod_PowerfulInventory.Magic_Coal_Powder});
	GameRegistry.addRecipe(new ItemStack(Magic_Iron_Powder, 2), new Object[]{"x  ", "   ", "  x", 'x', mod_PowerfulInventory.Magic_Iron_Powder});
	GameRegistry.addRecipe(new ItemStack(Magic_Gold_Powder, 2), new Object[]{"x  ", "   ", "  x", 'x', mod_PowerfulInventory.Magic_Gold_Powder});
	GameRegistry.addRecipe(new ItemStack(Magic_Diamond_Powder, 2), new Object[]{"x  ", "   ", "  x", 'x', mod_PowerfulInventory.Magic_Diamond_Powder});

	GameRegistry.addRecipe(new ItemStack(Block.torchWood), new Object[]{"x", "l", 'x', mod_PowerfulInventory.Magic_Coal_Powder, 'l', Item.stick});

	GameRegistry.addRecipe(new ItemStack(Item.swordIron), new Object[]{"x", "x", "l", 'x', mod_PowerfulInventory.Magic_Iron_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.pickaxeIron), new Object[]{"xxx", " l ", " l ",  'x', mod_PowerfulInventory.Magic_Iron_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.axeIron), new Object[]{"xx", "xl", " l", 'x', mod_PowerfulInventory.Magic_Iron_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.hoeIron), new Object[]{"xx", " l", " l", 'x', mod_PowerfulInventory.Magic_Iron_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.shovelIron), new Object[]{"x", "l", "l", 'x', mod_PowerfulInventory.Magic_Iron_Powder, 'l', Item.stick});

	GameRegistry.addRecipe(new ItemStack(Item.swordGold), new Object[]{"x", "x", "l", 'x', mod_PowerfulInventory.Magic_Gold_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.pickaxeGold), new Object[]{"xxx", " l ", " l ",  'x', mod_PowerfulInventory.Magic_Gold_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.axeGold), new Object[]{"xx", "xl", " l", 'x', mod_PowerfulInventory.Magic_Gold_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.hoeGold), new Object[]{"xx", " l", " l", 'x', mod_PowerfulInventory.Magic_Gold_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.shovelGold), new Object[]{"x", "l", "l", 'x', mod_PowerfulInventory.Magic_Gold_Powder, 'l', Item.stick});

	GameRegistry.addRecipe(new ItemStack(Item.swordDiamond), new Object[]{"x", "x", "l", 'x', mod_PowerfulInventory.Magic_Diamond_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.pickaxeDiamond), new Object[]{"xxx", " l ", " l ",  'x', mod_PowerfulInventory.Magic_Diamond_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.axeDiamond), new Object[]{"xx", "xl", " l", 'x', mod_PowerfulInventory.Magic_Diamond_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.hoeDiamond), new Object[]{"xx", " l", " l", 'x', mod_PowerfulInventory.Magic_Diamond_Powder, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Item.shovelDiamond), new Object[]{"x", "l", "l", 'x', mod_PowerfulInventory.Magic_Diamond_Powder, 'l', Item.stick});

	//Power
	GameRegistry.addRecipe(new ItemStack(Killer_Shine, 4), new Object[]{"bwb", "wsw", "bwb", 'b', mod_PowerfulInventory.Magic_Coal_Powder, 'w', mod_PowerfulInventory.Magic_Iron_Powder, 's', Block.stone});
	GameRegistry.addRecipe(new ItemStack(Killer_Sword), new Object[]{"x", "x", "l", 'x', mod_PowerfulInventory.Killer_Shine, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Killer_Pickaxe), new Object[]{"xxx", " l ", " l ",  'x', mod_PowerfulInventory.Killer_Shine, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Killer_Axe), new Object[]{"xx", "xl", " l", 'x', mod_PowerfulInventory.Killer_Shine, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Killer_Hoe), new Object[]{"xx", " l", " l", 'x', mod_PowerfulInventory.Killer_Shine, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Killer_Shovel), new Object[]{"x", "l", "l", 'x', mod_PowerfulInventory.Killer_Shine, 'l', Item.stick});

	GameRegistry.addRecipe(new ItemStack(Revive_Bleed, 4), new Object[]{"wbw", "bsb", "wbw", 'b', mod_PowerfulInventory.Magic_Coal_Powder, 'w', mod_PowerfulInventory.Magic_Iron_Powder, 's', Block.stone});
	GameRegistry.addRecipe(new ItemStack(Revive_Sword), new Object[]{"x", "x", "l", 'x', mod_PowerfulInventory.Revive_Bleed, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Revive_Pickaxe), new Object[]{"xxx", " l ", " l ",  'x', mod_PowerfulInventory.Revive_Bleed, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Revive_Axe), new Object[]{"xx", "xl", " l", 'x', mod_PowerfulInventory.Revive_Bleed, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Revive_Hoe), new Object[]{"xx", " l", " l", 'x', mod_PowerfulInventory.Revive_Bleed, 'l', Item.stick});
	GameRegistry.addRecipe(new ItemStack(Revive_Shovel), new Object[]{"x", "l", "l", 'x', mod_PowerfulInventory.Revive_Bleed, 'l', Item.stick});

	//Register
	//Starting Tools
	GameRegistry.registerItem(Stick_Left_Half, "Stick_Left_Half");
	GameRegistry.registerItem(Stick_Right_Half, "Stick Right Half");
	GameRegistry.registerItem(Iron_Hammer_Left_Gunpowder_Half, "Iron_Hammer_Left Gunpowder_Half");
	GameRegistry.registerItem(Iron_Hammer_Right_Lighter_Half, "Iron Hammer Right Lighter Half");
	GameRegistry.registerItem(Gold_Hammer_Left_Gunpowder_Half, "Gold Hammer Left Gunpowder Half");
	GameRegistry.registerItem(Gold_Hammer_Right_Lighter_Half, "Gold Hammer Right Lighter Half");
	GameRegistry.registerItem(Diamond_Hammer_Left_Gunpowder_Half, "Diamond Hammer Left Gunpowder Half");
	GameRegistry.registerItem(Diamond_Hammer_Right_Lighter_Half, "Diamond Hammer Right Lighter Half");

	GameRegistry.registerItem(Iron_Synthesis, "Iron Synthesis");
	GameRegistry.registerItem(Gold_Synthesis, "Gold Synthesis");
	GameRegistry.registerItem(Diamond_Synthesis, "Diamond Synthesis");

	GameRegistry.registerItem(Iron_Hammer, "Iron Hammer");
	GameRegistry.registerItem(Gold_Hammer, "Gold Hammer");
	GameRegistry.registerItem(Diamond_Hammer, "Diamond Hammer");

	GameRegistry.registerItem(Iron_HS, "Iron HS");
	GameRegistry.registerItem(Gold_HS, "Gold HS");
	GameRegistry.registerItem(Diamond_HS, "Diamond HS");

	//Magic
	GameRegistry.registerBlock(Magic_Coal_Ore, "Magic Coal Ore");
	GameRegistry.registerBlock(Magic_Iron_Ore, "Magic Iron Ore");
	GameRegistry.registerBlock(Magic_Gold_Ore, "Magic Gold Ore");
	GameRegistry.registerBlock(Magic_Diamond_Ore, "Magic Diamond Ore");

	GameRegistry.registerItem(Magic_Coal_Powder, "Magic Coal Powder");
	GameRegistry.registerItem(Magic_Iron_Powder, "Magic Iron Powder");
	GameRegistry.registerItem(Magic_Gold_Powder, "Magic Gold Powder");
	GameRegistry.registerItem(Magic_Diamond_Powder, "Magic Diamond Powder");

	//Power
	GameRegistry.registerItem(Killer_Shine, "Killer Shine");
	GameRegistry.registerItem(Killer_Sword, "Killer Sword");
	GameRegistry.registerItem(Killer_Pickaxe, "Killer Pickaxe");
	GameRegistry.registerItem(Killer_Axe, "Killer Axe");
	GameRegistry.registerItem(Killer_Hoe, "Killer Hoe");
	GameRegistry.registerItem(Killer_Shovel, "Killer Shovel");
	GameRegistry.registerItem(Revive_Bleed, "Revive Dark");
	GameRegistry.registerItem(Revive_Sword, "Revive Sword");
	GameRegistry.registerItem(Revive_Pickaxe, "Revive Pickaxe");
	GameRegistry.registerItem(Revive_Axe, "Revive Axe");
	GameRegistry.registerItem(Revive_Hoe, "Revive Hoe");
	GameRegistry.registerItem(Revive_Shovel, "Revive Shovel");


	//Name
	//Starting Tools
	LanguageRegistry.addName(Stick_Left_Half, "Stick Left Half");
	LanguageRegistry.addName(Stick_Right_Half, "Stick Right Half");

	LanguageRegistry.addName(Iron_Hammer_Left_Gunpowder_Half, "Iron Hammer Left Gunpowder Half");
	LanguageRegistry.addName(Iron_Hammer_Right_Lighter_Half, "Iron Hammer Right Lighter Half");
	LanguageRegistry.addName(Gold_Hammer_Left_Gunpowder_Half, "Gold Hammer Left Gunpowder Half");
	LanguageRegistry.addName(Gold_Hammer_Right_Lighter_Half, "Gold Hammer Right Lighter Half");
	LanguageRegistry.addName(Diamond_Hammer_Left_Gunpowder_Half, "Diamond Hammer Left Gunpowder Half");
	LanguageRegistry.addName(Diamond_Hammer_Right_Lighter_Half, "Diamond Hammer Right Lighter Half");

	LanguageRegistry.addName(Iron_Synthesis, "Iron Synthesis");
	LanguageRegistry.addName(Gold_Synthesis, "Gold Synthesis");
	LanguageRegistry.addName(Diamond_Synthesis, "Diamond Synthesis");

	LanguageRegistry.addName(Iron_Hammer, "Iron Hammer");
	LanguageRegistry.addName(Gold_Hammer, "Gold Hammer");
	LanguageRegistry.addName(Diamond_Hammer, "Diamond Hammer");

	LanguageRegistry.addName(Iron_HS, "Iron HS");
	LanguageRegistry.addName(Gold_HS, "Gold HS");
	LanguageRegistry.addName(Diamond_HS, "Diamond HS");

	//Magic
	LanguageRegistry.addName(Magic_Coal_Ore, "Magic Coal Ore");
	LanguageRegistry.addName(Magic_Iron_Ore, "Magic Iron Ore");
	LanguageRegistry.addName(Magic_Gold_Ore, "Magic Gold Ore");
	LanguageRegistry.addName(Magic_Diamond_Ore, "Magic Diamond Ore");

	LanguageRegistry.addName(Magic_Coal_Powder, "Magic Coal Powder");
	LanguageRegistry.addName(Magic_Iron_Powder, "Magic Iron Powder");
	LanguageRegistry.addName(Magic_Gold_Powder, "Magic Gold Powder");
	LanguageRegistry.addName(Magic_Diamond_Powder, "Magic Diamond Powder");

	//Power
	LanguageRegistry.addName(Killer_Shine, "Killer Shine");
	LanguageRegistry.addName(Killer_Sword, "Killer Sword");
	LanguageRegistry.addName(Killer_Pickaxe, "Killer Pickaxe");
	LanguageRegistry.addName(Killer_Axe, "Killer Axe");
	LanguageRegistry.addName(Killer_Hoe, "Killer Hoe");
	LanguageRegistry.addName(Killer_Shovel, "Killer Shovel");
	LanguageRegistry.addName(Revive_Bleed, "Revive Dark");
	LanguageRegistry.addName(Revive_Sword, "Revive Sword");
	LanguageRegistry.addName(Revive_Pickaxe, "Revive Pickaxe");
	LanguageRegistry.addName(Revive_Axe, "Revive Axe");
	LanguageRegistry.addName(Revive_Hoe, "Revive Hoe");
	LanguageRegistry.addName(Revive_Shovel, "Revive Shovel");

	}

@Override
public String getVersion()
{
	return null;
}

}

Link to comment
Share on other sites

package net.PowerfulInventory.Mod;

public class mod_PowerfulInventory extends BaseMod
{

@EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    }

@EventHandler
    public void load()
    {
}

At least, follow the tutorials to make a working mod class, please.  :'(

Link to comment
Share on other sites

package net.PowerfulInventory.Mod;

public class mod_PowerfulInventory extends BaseMod
{

@EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
    }

@EventHandler
    public void load()
    {
}

At least, follow the tutorials to make a working mod class, please.  :'(

 

I have this in my mod class

Link to comment
Share on other sites

Oh wait I find this that has errors

 

it's in cpw.mods.fml.common.asm.transformers called AccessTransformer

 

Coding of AccessTransformer

 

/*
* Forge Mod Loader
* Copyright (c) 2012-2013 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Contributors:
*     cpw - implementation
*/

package cpw.mods.fml.common.asm.transformers;

import static org.objectweb.asm.Opcodes.ACC_FINAL;
import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
import static org.objectweb.asm.Opcodes.ACC_PROTECTED;
import static org.objectweb.asm.Opcodes.ACC_PUBLIC;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;

import net.minecraft.launchwrapper.IClassTransformer;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode;

import com.google.common.base.Charsets;
import com.google.common.base.Splitter;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.io.LineProcessor;
import com.google.common.io.Resources;

import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper;
import cpw.mods.fml.relauncher.FMLRelaunchLog;

public class AccessTransformer implements IClassTransformer
{
    private static final boolean DEBUG = false;
    private class Modifier
    {
        public String name = "";
        public String desc = "";
        public int oldAccess = 0;
        public int newAccess = 0;
        public int targetAccess = 0;
        public boolean changeFinal = false;
        public boolean markFinal = false;
        protected boolean modifyClassVisibility;

        private void setTargetAccess(String name)
        {
            if (name.startsWith("public")) targetAccess = ACC_PUBLIC;
            else if (name.startsWith("private")) targetAccess = ACC_PRIVATE;
            else if (name.startsWith("protected")) targetAccess = ACC_PROTECTED;

            if (name.endsWith("-f"))
            {
                changeFinal = true;
                markFinal = false;
            }
            else if (name.endsWith("+f"))
            {
                changeFinal = true;
                markFinal = true;
            }
        }
    }

    private Multimap<String, Modifier> modifiers = ArrayListMultimap.create();

    public AccessTransformer() throws IOException
    {
        this("fml_at.cfg");
    }
    protected AccessTransformer(String rulesFile) throws IOException
    {
        readMapFile(rulesFile);
    }

    private void readMapFile(String rulesFile) throws IOException
    {
        File file = new File(rulesFile);
        URL rulesResource;
        if (file.exists())
        {
            rulesResource = file.toURI().toURL();
        }
        else
        {
            rulesResource = Resources.getResource(rulesFile);
        }
        Resources.readLines(rulesResource, Charsets.UTF_8, new LineProcessor<Void>()
        {
            @Override
            public Void getResult()
            {
                return null;
            }

            @Override
            public boolean processLine(String input) throws IOException
            {
                String line = Iterables.getFirst(Splitter.on('#').limit(2).split(input), "").trim();
                if (line.length()==0)
                {
                    return true;
                }
                List<String> parts = Lists.newArrayList(Splitter.on(" ").trimResults().split(line));
                if (parts.size()>2)
                {
                    throw new RuntimeException("Invalid config file line "+ input);
                }
                Modifier m = new Modifier();
                m.setTargetAccess(parts.get(0));
                List<String> descriptor = Lists.newArrayList(Splitter.on(".").trimResults().split(parts.get(1)));
                if (descriptor.size() == 1)
                {
                    m.modifyClassVisibility = true;
                }
                else
                {
                    String nameReference = descriptor.get(1);
                    int parenIdx = nameReference.indexOf('(');
                    if (parenIdx>0)
                    {
                        m.desc = nameReference.substring(parenIdx);
                        m.name = nameReference.substring(0,parenIdx);
                    }
                    else
                    {
                        m.name = nameReference;
                    }
                }
                modifiers.put(descriptor.get(0).replace('/', '.'), m);
                return true;
            }
        });
        System.out.printf("Loaded %d rules from AccessTransformer config file %s\n", modifiers.size(), rulesFile);
    }

    @Override
    public byte[] transform(String name, String transformedName, byte[] bytes)
    {
        if (bytes == null) { return null; }
        boolean makeAllPublic = FMLDeobfuscatingRemapper.INSTANCE.isRemappedClass(name);

        if (DEBUG)
        {
            FMLRelaunchLog.fine("Considering all methods and fields on %s (%s): %b\n", name, transformedName, makeAllPublic);
        }
        if (!makeAllPublic && !modifiers.containsKey(name)) { return bytes; }

        ClassNode classNode = new ClassNode();
        ClassReader classReader = new ClassReader(bytes);
        classReader.accept(classNode, 0);

        if (makeAllPublic)
        {
            // class
            Modifier m = new Modifier();
            m.targetAccess = ACC_PUBLIC;
            m.modifyClassVisibility = true;
            modifiers.put(name,m);
            // fields
            m = new Modifier();
            m.targetAccess = ACC_PUBLIC;
            m.name = "*";
            modifiers.put(name,m);
            // methods
            m = new Modifier();
            m.targetAccess = ACC_PUBLIC;
            m.name = "*";
            m.desc = "<dummy>";
            modifiers.put(name,m);
            if (DEBUG)
            {
                System.out.printf("Injected all public modifiers for %s (%s)\n", name, transformedName);
            }
        }

        Collection<Modifier> mods = modifiers.get(name);
        for (Modifier m : mods)
        {
            if (m.modifyClassVisibility)
            {
                classNode.access = getFixedAccess(classNode.access, m);
                if (DEBUG)
                {
                    System.out.println(String.format("Class: %s %s -> %s", name, toBinary(m.oldAccess), toBinary(m.newAccess)));
                }
                continue;
            }
            if (m.desc.isEmpty())
            {
                for (FieldNode n : classNode.fields)
                {
                    if (n.name.equals(m.name) || m.name.equals("*"))
                    {
                        n.access = getFixedAccess(n.access, m);
                        if (DEBUG)
                        {
                            System.out.println(String.format("Field: %s.%s %s -> %s", name, n.name, toBinary(m.oldAccess), toBinary(m.newAccess)));
                        }

                        if (!m.name.equals("*"))
                        {
                            break;
                        }
                    }
                }
            }
            else
            {
                for (MethodNode n : classNode.methods)
                {
                    if ((n.name.equals(m.name) && n.desc.equals(m.desc)) || m.name.equals("*"))
                    {
                        n.access = getFixedAccess(n.access, m);
                        if (DEBUG)
                        {
                            System.out.println(String.format("Method: %s.%s%s %s -> %s", name, n.name, n.desc, toBinary(m.oldAccess), toBinary(m.newAccess)));
                        }

                        if (!m.name.equals("*"))
                        {
                            break;
                        }
                    }
                }
            }
        }

        ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
        classNode.accept(writer);
        return writer.toByteArray();
    }

    private String toBinary(int num)
    {
        return String.format("%16s", Integer.toBinaryString(num)).replace(' ', '0');
    }

    private int getFixedAccess(int access, Modifier target)
    {
        target.oldAccess = access;
        int t = target.targetAccess;
        int ret = (access & ~7);

        switch (access & 7)
        {
        case ACC_PRIVATE:
            ret |= t;
            break;
        case 0: // default
            ret |= (t != ACC_PRIVATE ? t : 0 /* default */);
            break;
        case ACC_PROTECTED:
            ret |= (t != ACC_PRIVATE && t != 0 /* default */? t : ACC_PROTECTED);
            break;
        case ACC_PUBLIC:
            ret |= (t != ACC_PRIVATE && t != 0 /* default */&& t != ACC_PROTECTED ? t : ACC_PUBLIC);
            break;
        default:
            throw new RuntimeException("The fuck?");
        }

        // Clear the "final" marker on fields only if specified in control field
        if (target.changeFinal && target.desc == "")
        {
            if (target.markFinal)
            {
                ret |= ACC_FINAL;
            }
            else
            {
                ret &= ~ACC_FINAL;
            }
        }
        target.newAccess = ret;
        return ret;
    }

    public static void main(String[] args)
    {
        if (args.length < 2)
        {
            System.out.println("Usage: AccessTransformer <JarPath> <MapFile> [MapFile2]... ");
            System.exit(1);
        }

        boolean hasTransformer = false;
        AccessTransformer[] trans = new AccessTransformer[args.length - 1];
        for (int x = 1; x < args.length; x++)
        {
            try
            {
                trans[x - 1] = new AccessTransformer(args[x]);
                hasTransformer = true;
            }
            catch (IOException e)
            {
                System.out.println("Could not read Transformer Map: " + args[x]);
                e.printStackTrace();
            }
        }

        if (!hasTransformer)
        {
            System.out.println("Culd not find a valid transformer to perform");
            System.exit(1);
        }

        File orig = new File(args[0]);
        File temp = new File(args[0] + ".ATBack");
        if (!orig.exists() && !temp.exists())
        {
            System.out.println("Could not find target jar: " + orig);
            System.exit(1);
        }

        if (!orig.renameTo(temp))
        {
            System.out.println("Could not rename file: " + orig + " -> " + temp);
            System.exit(1);
        }

        try
        {
            processJar(temp, orig, trans);
        }
        catch (IOException e)
        {
            e.printStackTrace();
            System.exit(1);
        }

        if (!temp.delete())
        {
            System.out.println("Could not delete temp file: " + temp);
        }
    }

    private static void processJar(File inFile, File outFile, AccessTransformer[] transformers) throws IOException
    {
        ZipInputStream inJar = null;
        ZipOutputStream outJar = null;

        try
        {
            try
            {
                inJar = new ZipInputStream(new BufferedInputStream(new FileInputStream(inFile)));
            }
            catch (FileNotFoundException e)
            {
                throw new FileNotFoundException("Could not open input file: " + e.getMessage());
            }

            try
            {
                outJar = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outFile)));
            }
            catch (FileNotFoundException e)
            {
                throw new FileNotFoundException("Could not open output file: " + e.getMessage());
            }

            ZipEntry entry;
            while ((entry = inJar.getNextEntry()) != null)
            {
                if (entry.isDirectory())
                {
                    outJar.putNextEntry(entry);
                    continue;
                }

                byte[] data = new byte[4096];
                ByteArrayOutputStream entryBuffer = new ByteArrayOutputStream();

                int len;
                do
                {
                    len = inJar.read(data);
                    if (len > 0)
                    {
                        entryBuffer.write(data, 0, len);
                    }
                }
                while (len != -1);

                byte[] entryData = entryBuffer.toByteArray();

                String entryName = entry.getName();

                if (entryName.endsWith(".class") && !entryName.startsWith("."))
                {
                    ClassNode cls = new ClassNode();
                    ClassReader rdr = new ClassReader(entryData);
                    rdr.accept(cls, 0);
                    String name = cls.name.replace('/', '.').replace('\\', '.');

                    for (AccessTransformer trans : transformers)
                    {
                        entryData = trans.transform(name, name, entryData);
                    }
                }

                ZipEntry newEntry = new ZipEntry(entryName);
                outJar.putNextEntry(newEntry);
                outJar.write(entryData);
            }
        }
        finally
        {
            if (outJar != null)
            {
                try
                {
                    outJar.close();
                }
                catch (IOException e)
                {
                }
            }

            if (inJar != null)
            {
                try
                {
                    inJar.close();
                }
                catch (IOException e)
                {
                }
            }
        }
    }
    public void ensurePublicAccessFor(String modClazzName)
    {
        Modifier m = new Modifier();
        m.setTargetAccess("public");
        m.modifyClassVisibility = true;
        modifiers.put(modClazzName, m);
    }
}

 

this two have errors

 

                for (FieldNode n : classNode.fields)

                for (MethodNode n : classNode.methods)

 

it's the classNode.fields

 

it's say for error "Type mismatch: cannot convert from element type Object to FieldNode" on both

Link to comment
Share on other sites

Your package names have uppercase letters, that does work in eclipse, but not in recompiled minecraft.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

The tutorial works. Read it again.  :-\

 

Maybe that isn't the problem

 

you didnt reobfuscate your mod  run the reobfuscate.bat/.sh program

 

I did but I'll do it again

try reobfuscate_srg.bat/.sh

 

That didn't work, I don't know what is wrong I may have to wait for a update. Also I tried removing the forge src and reinstall it and I get the same problem.

Link to comment
Share on other sites

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache  and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
    • When I came across the 'Exit Code: I got a 1 error in my Minecraft mods, so I decided to figure out what was wrong. First, I took a look at the logs. In the mods folder (usually where you'd find logs or crash reports), I found the latest.log file or the corresponding crash report. I read it through carefully, looking for any lines with errors or warnings. Then I checked the Minecraft Forge support site, where you can often find info on what causes errors and how to fix them. I then disabled half of my mods and tried running the game. If the error disappeared, it meant that the problem was with the disabled mod. I repeated this several times to find the problem mod.
  • Topics

×
×
  • Create New...

Important Information

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