Jump to content

Recommended Posts

Posted

Hey, I'm having problems with my mod that simply adds a few items with crafting recipes and has vanilla mobs drop them.

 

My crash report is as follows:

 

  Reveal hidden contents

 

 

This happens whenever I try to play in a Single Player world, but not on a Server.

 

If I could have some help on how to solve this, that would be great as the crash report doesn't list any of my classes or processes as creating the problem. Maybe I'm missing a class that handles this stuff?

 

EDIT: I'm aware the problem occurs when the game tries to save the world chunks, but I have no idea how to resolve it.

Posted
  On 3/11/2014 at 2:35 PM, stijnhero said:

Something in your code is null I think can I see some source?

 

HaggisMain.java

 

  Reveal hidden contents

 

 

CustomDrops.java

 

  Reveal hidden contents

 

Posted

Looks normal too me only that you should register the food in the preinit.

 

Do your proxy's have any code?

or is there anything else that could create an error.

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

Posted

Can you provide the full log? (ForgeModLoader-client-0.log / ForgeModLoader-server-0.log)

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted
  On 3/11/2014 at 2:55 PM, stijnhero said:

Looks normal too me only that you should register the food in the preinit.

 

Do your proxy's have any code?

or is there anything else that could create an error.

 

The food is registered in the PreInit and the proxies are the same as they've always been:

CommonProxy.java

 

  Reveal hidden contents

 

 

ClientProxy.java

 

  Reveal hidden contents

 

 

The only thing I can think of is the fact that my custom drops don't work even though I've now added this line to the PreInit in my main class:

MinecraftForge.EVENT_BUS.register(new CustomDrops());

Posted

you need to put @SubscribeEvent above this line: public void onEntityDrop(LivingDropsEvent event)

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

Posted
  On 3/11/2014 at 3:47 PM, stijnhero said:

you need to put @SubscribeEvent above this line: public void onEntityDrop(LivingDropsEvent event)

 

Thanks, that fixed the problem of the mob drops, but I still have the crashes.

Posted

Sorry that I can't provide a solution but I can provide a quick tip: move the registration of your crafting recipes from the preInit-method to the init-method. It's nothing severe but more common to register advance stuff (things that require items or such already registered) in the init method.

Posted
  On 3/11/2014 at 6:25 PM, WorldsEnder said:

Sorry that I can't provide a solution but I can provide a quick tip: move the registration of your crafting recipes from the preInit-method to the init-method. It's nothing severe but more common to register advance stuff (things that require items or such already registered) in the init method.

 

Do you mean in:

@EventHandler // used in 1.6.2
//@Init       // used in 1.5.2
public void load(FMLInitializationEvent event) {
        proxy.registerRenderers();
}

 

I was registering my stuff in there at first but it didn't actually work until I moved it to PreInit

Posted

I just don't advice registering all your items in your main class file this is how I do it:

@EventHandler
public void preInit(FMLPreInitializationEvent event){
	BlocksItems.InitItems();
	BlocksItems.InitBlocks();
	BlocksItems.WorldGen();
	Config.InitRecipes();
	Config.registerMolecules();
	Config.registerSamples();
	Config.registerMineralProps();
	Config.registerTileEntity();
        proxy.registerRenderers();
}

 

and then in my blockitems file(sorry it's a mess i need to clean it up more)

public class BlocksItems {
//items
public static Item Emptyjar;
public static Item Sample;
public static Item Mineral;

//blocks
public static Block OrePlutonium;
public static Block Evaporite;
public static Block BlockSlowHeatConductant;
public static Block BlockMediumHeatConductant;
public static Block BlockFastHeatConductant;
//	public static Block ResearchTableIdle;
//	public static Block ResearchTableActive;

public static void WorldGen(){
	GameRegistry.registerWorldGenerator(new WorldGen(), 1);

}

public static void InitItems(){
	Emptyjar = new ItemEmptyjar().setUnlocalizedName("Emptyjar").setCreativeTab(MolecularScience.MItems);
        Sample = new ItemSample().setUnlocalizedName("sample");
        Mineral = new ItemMineral().setUnlocalizedName("Mineral");
        
        GameRegistry.registerItem(Emptyjar,"Emptyjar");
        GameRegistry.registerItem(Sample,"Sample");
        GameRegistry.registerItem(Mineral,"Mineral");
}

public static void InitBlocks(){
        OrePlutonium = new BlockOre(Material.rock, 2).setHardness(3.0F).setBlockName("Plutoniumore");
        Evaporite = new BlockEvaporite(Material.rock).setHardness(3.0F).setBlockName("Evaporite");
        BlockSlowHeatConductant = new BlockHeatConductant(Material.rock, 50).setHardness(3.0F).setBlockName("BlockSlowHeatConductant");
        BlockMediumHeatConductant = new BlockHeatConductant(Material.rock, 25).setHardness(3.0F).setBlockName("BlockMediumHeatConductant");
        BlockFastHeatConductant = new BlockHeatConductant(Material.rock, 5).setHardness(3.0F).setBlockName("BlockFastHeatConductant");
//        ResearchTableIdle = new ResearchTable(false).setBlockName("ResearchTableIdle").setCreativeTab(MolecularScience.Blocks);
//        ResearchTableActive = new ResearchTable(true).setBlockName("ResearchTableActive");
        
        GameRegistry.registerBlock(OrePlutonium, "Plutoniumore");
        GameRegistry.registerBlock(Evaporite, "Evaporite");
        GameRegistry.registerBlock(BlockSlowHeatConductant, "BlockSlowHeatConductant");
        GameRegistry.registerBlock(BlockMediumHeatConductant, "BlockMediumHeatConductant");
        GameRegistry.registerBlock(BlockFastHeatConductant, "BlockFastHeatConductant");
//        GameRegistry.registerBlock(ResearchTableIdle, "ResearchTableIdle");
//        GameRegistry.registerBlock(ResearchTableActive, "ResearchTableActive");
}
}

 

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

Posted
  On 3/11/2014 at 8:35 PM, stijnhero said:

I just don't advice registering all your items in your main class file this is how I do it:

@EventHandler
public void preInit(FMLPreInitializationEvent event){
	BlocksItems.InitItems();
	BlocksItems.InitBlocks();
	BlocksItems.WorldGen();
	Config.InitRecipes();
	Config.registerMolecules();
	Config.registerSamples();
	Config.registerMineralProps();
	Config.registerTileEntity();
        proxy.registerRenderers();
}

 

and then in my blockitems file(sorry it's a mess i need to clean it up more)

public class BlocksItems {
//items
public static Item Emptyjar;
public static Item Sample;
public static Item Mineral;

//blocks
public static Block OrePlutonium;
public static Block Evaporite;
public static Block BlockSlowHeatConductant;
public static Block BlockMediumHeatConductant;
public static Block BlockFastHeatConductant;
//	public static Block ResearchTableIdle;
//	public static Block ResearchTableActive;

public static void WorldGen(){
	GameRegistry.registerWorldGenerator(new WorldGen(), 1);

}

public static void InitItems(){
	Emptyjar = new ItemEmptyjar().setUnlocalizedName("Emptyjar").setCreativeTab(MolecularScience.MItems);
        Sample = new ItemSample().setUnlocalizedName("sample");
        Mineral = new ItemMineral().setUnlocalizedName("Mineral");
        
        GameRegistry.registerItem(Emptyjar,"Emptyjar");
        GameRegistry.registerItem(Sample,"Sample");
        GameRegistry.registerItem(Mineral,"Mineral");
}

public static void InitBlocks(){
        OrePlutonium = new BlockOre(Material.rock, 2).setHardness(3.0F).setBlockName("Plutoniumore");
        Evaporite = new BlockEvaporite(Material.rock).setHardness(3.0F).setBlockName("Evaporite");
        BlockSlowHeatConductant = new BlockHeatConductant(Material.rock, 50).setHardness(3.0F).setBlockName("BlockSlowHeatConductant");
        BlockMediumHeatConductant = new BlockHeatConductant(Material.rock, 25).setHardness(3.0F).setBlockName("BlockMediumHeatConductant");
        BlockFastHeatConductant = new BlockHeatConductant(Material.rock, 5).setHardness(3.0F).setBlockName("BlockFastHeatConductant");
//        ResearchTableIdle = new ResearchTable(false).setBlockName("ResearchTableIdle").setCreativeTab(MolecularScience.Blocks);
//        ResearchTableActive = new ResearchTable(true).setBlockName("ResearchTableActive");
        
        GameRegistry.registerBlock(OrePlutonium, "Plutoniumore");
        GameRegistry.registerBlock(Evaporite, "Evaporite");
        GameRegistry.registerBlock(BlockSlowHeatConductant, "BlockSlowHeatConductant");
        GameRegistry.registerBlock(BlockMediumHeatConductant, "BlockMediumHeatConductant");
        GameRegistry.registerBlock(BlockFastHeatConductant, "BlockFastHeatConductant");
//        GameRegistry.registerBlock(ResearchTableIdle, "ResearchTableIdle");
//        GameRegistry.registerBlock(ResearchTableActive, "ResearchTableActive");
}
}

 

You mean set up and register my items in a class and then just call it in the PreInit method?

 

I originally did something like that but decided just to do it in less classes. Was that a bad decision? xD

Posted
  On 3/11/2014 at 9:34 PM, stijnhero said:

No but why would you want that?

 

It bothers me that I can almost spawn in items on a normal bukkit server but nobody can see them and if i try to click or take them out of the inventory GUI they disappear. It just doesn't seem neat or practical. I also don't know many servers that will want to use it as a server mod.

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

    • Read the posts above yours, it tells you exactly how to do it, instructions are the same if it's making a forge installation or a vanilla one, just make a new folder for the game directory.
    • Yes that’s the full log, I managed to get it working last night, the anvil fix mod is what was causing it to crash
    • Hey guys, i'm currently developping a mod with forge 1.12.2 2860 and i'm using optifine and gradle 4.9. The thing is i'm trying to figure out how to show the player's body in first person. So far everything's going well since i've try to use a shader. The player's body started to blink dark when using a shader. I've try a lot of shader like chocapic, zeus etc etc but still the same issue. So my question is : How should i apply the current shader to the body ? At the same time i'm also drawing a HUD so maybe it could be the problem?   Here is the issue :    And here is the code where i'm trying to display the body :    private static void renderFirstPersonBody(EntityPlayerSP player, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); try { // Préparation OpenGL GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.enableAlpha(); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // Éclairage correct pour shaders GlStateManager.enableLighting(); RenderHelper.enableStandardItemLighting(); GlStateManager.enableRescaleNormal(); // Active la lightmap pour les shaders mc.entityRenderer.enableLightmap(); // Position de rendu interpolée double px = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; double py = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double pz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; GlStateManager.translate( px - mc.getRenderManager().viewerPosX, py - mc.getRenderManager().viewerPosY, pz - mc.getRenderManager().viewerPosZ ); // Rendu du joueur sans la tête Render<?> render = mc.getRenderManager().getEntityRenderObject(player); if (render instanceof RenderPlayer) { RenderPlayer renderPlayer = (RenderPlayer) render; boolean oldHeadHidden = renderPlayer.getMainModel().bipedHead.isHidden; boolean oldHeadwearHidden = renderPlayer.getMainModel().bipedHeadwear.isHidden; renderPlayer.getMainModel().bipedHead.isHidden = true; renderPlayer.getMainModel().bipedHeadwear.isHidden = true; setArmorHeadVisibility(renderPlayer, false); renderPlayer.doRender(player, 0, 0, 0, player.rotationYaw, partialTicks); renderPlayer.getMainModel().bipedHead.isHidden = oldHeadHidden; renderPlayer.getMainModel().bipedHeadwear.isHidden = oldHeadwearHidden; setArmorHeadVisibility(renderPlayer, !oldHeadwearHidden); } // Nettoyage post rendu mc.entityRenderer.disableLightmap(); GlStateManager.disableRescaleNormal(); } catch (Exception e) { // silent fail } finally { GlStateManager.popAttrib(); GlStateManager.popMatrix(); } }   Ty for your help. 
    • Item successfully registered, but there was a problem with the texture of the item, it did not insert and has just the wrong texture.     
    • Keep on using the original Launcher Run Vanilla 1.12.2 once and close the game Download Optifine and run optifine as installer (click on the optifine jar) Start the launcher and make sure the Optifine profile is selected - then test it again  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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