Jump to content

Recommended Posts

Posted

I know this has been asked before but after using advice in different threads I finally created a new generator class that compiled with no errors but it makes my client Black-screen on load... the mod works fine before i added the generation code.

 

[spoiler=Generator Class]

package net.minecraft.src;

 

import java.util.Random;

 

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import cpw.mods.fml.common.IWorldGenerator;

 

public class OreGeneration implements IWorldGenerator

{

  @Override

  public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)

  {

      switch(world.provider.dimensionId)

      {

        case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16);

            break;

        case 0: generateOverworld(world, random, chunkX * 16, chunkZ * 16);

            break;

        case -1: generateNether(world, random, chunkX * 16, chunkZ * 16);

            break;

      }

  }

 

  private void generateNether(World world, Random random, int X, int Z)

  {

      for(int i = 0; i < 1; i++)

      {

        int randX = X + random.nextInt(16);

int randY = random.nextInt(20);

int randZ = Z + random.nextInt(16);

 

(new WorldGenMinableNether(mod_soliteOre.block.blockID, 1)).generate(world, random, randX, randY, randZ);

 

      }

  }

 

  private void generateOverworld(World world, Random random, int X, int Z)

  {

     

  }

 

  private void generateEnd(World world, Random random, int X, int Z)

  {

     

  }

}

 

 

 

and then the ore that i want to generate in the nether:

 

[spoiler=Ore Class]

package net.minecraft.src;

 

import cpw.*;

import cpw.mods.*;

import cpw.mods.fml.*;

import cpw.mods.fml.client.*;

import cpw.mods.fml.client.modloader.*;

import cpw.mods.fml.client.registry.*;

import cpw.mods.fml.common.*;

import cpw.mods.fml.common.asm.*;

import cpw.mods.fml.common.asm.transformers.*;

import cpw.mods.fml.common.discovery.*;

import cpw.mods.fml.common.discovery.asm.*;

import cpw.mods.fml.common.event.*;

import cpw.mods.fml.common.functions.*;

import cpw.mods.fml.common.modloader.*;

import cpw.mods.fml.common.network.*;

import cpw.mods.fml.common.registry.*;

import cpw.mods.fml.common.toposort.*;

import cpw.mods.fml.common.versioning.*;

import cpw.mods.fml.relauncher.*;

import cpw.mods.fml.server.*;

import ibxm.*;

import net.*;

import net.minecraft.*;

import net.minecraft.block.*;

import net.minecraft.block.material.*;

import net.minecraft.client.*;

import net.minecraft.client.audio.*;

import net.minecraft.client.entity.*;

import net.minecraft.client.gui.*;

import net.minecraft.client.gui.achievement.*;

import net.minecraft.client.gui.inventory.*;

import net.minecraft.client.model.*;

import net.minecraft.client.multiplayer.*;

import net.minecraft.client.particle.*;

import net.minecraft.client.renderer.*;

import net.minecraft.client.renderer.culling.*;

import net.minecraft.client.renderer.entity.*;

import net.minecraft.client.renderer.texturefx.*;

import net.minecraft.client.renderer.tileentity.*;

import net.minecraft.client.settings.*;

import net.minecraft.client.texturepacks.*;

import net.minecraft.command.*;

import net.minecraft.crash.*;

import net.minecraft.creativetab.*;

import net.minecraft.dispenser.*;

import net.minecraft.enchantment.*;

import net.minecraft.entity.*;

import net.minecraft.entity.ai.*;

import net.minecraft.entity.boss.*;

import net.minecraft.entity.effect.*;

import net.minecraft.entity.item.*;

import net.minecraft.entity.monster.*;

import net.minecraft.entity.passive.*;

import net.minecraft.entity.player.*;

import net.minecraft.entity.projectile.*;

import net.minecraft.inventory.*;

import net.minecraft.item.*;

import net.minecraft.item.crafting.*;

import net.minecraft.nbt.*;

import net.minecraft.network.*;

import net.minecraft.network.packet.*;

import net.minecraft.network.rcon.*;

import net.minecraft.pathfinding.*;

import net.minecraft.potion.*;

import net.minecraft.profiler.*;

import net.minecraft.server.*;

import net.minecraft.server.dedicated.*;

import net.minecraft.server.gui.*;

import net.minecraft.server.integrated.*;

import net.minecraft.server.management.*;

import net.minecraft.src.*;

import net.minecraft.stats.*;

import net.minecraft.tileentity.*;

import net.minecraft.util.*;

import net.minecraft.village.*;

import net.minecraft.world.*;

import net.minecraft.world.biome.*;

import net.minecraft.world.chunk.*;

import net.minecraft.world.chunk.storage.*;

import net.minecraft.world.demo.*;

import net.minecraft.world.gen.*;

import net.minecraft.world.gen.feature.*;

import net.minecraft.world.gen.layer.*;

import net.minecraft.world.gen.structure.*;

import net.minecraft.world.storage.*;

import net.minecraftforge.*;

import net.minecraftforge.classloading.*;

import net.minecraftforge.client.*;

import net.minecraftforge.client.event.*;

import net.minecraftforge.client.event.sound.*;

import net.minecraftforge.common.*;

import net.minecraftforge.event.*;

import net.minecraftforge.event.entity.*;

import net.minecraftforge.event.entity.item.*;

import net.minecraftforge.event.entity.living.*;

import net.minecraftforge.event.entity.minecart.*;

import net.minecraftforge.event.entity.player.*;

import net.minecraftforge.event.terraingen.*;

import net.minecraftforge.event.world.*;

import net.minecraftforge.liquids.*;

import net.minecraftforge.oredict.*;

import net.minecraftforge.transformers.*;

import paulscode.*;

import paulscode.sound.*;

import paulscode.sound.codecs.*;

 

import java.util.Random;

 

public class mod_soliteOre extends BaseMod{

 

public mod_soliteOre(){}

 

public static BlockSoliteOre block;

 

public void load(){

 

ModLoader.registerBlock(block);

ModLoader.addName(block, "Solite Ore");

GameRegistry.registerWorldGenerator(new OreGeneration());

 

}

public String getVersion(){

return "1.0";

}

 

 

static{

 

block = (BlockSoliteOre)(new BlockSoliteOre(173, 1).setHardness(50.0F)

.setResistance(50.0F)

.setLightValue(0.0F)

.setBlockName("Solite Ore")

.setLightOpacity(0)

.setStepSound(Block.soundStoneFootstep)

.setCreativeTab(CreativeTabs.tabBlock)

.setRequiresSelfNotify()

);block.blockIndexInTexture=block.a1;

block.setBlockBounds(0.0F,0.0F,0.0F,1.0F,1.0F,1.0F);

MinecraftForge.setBlockHarvestLevel(block, "pickaxe", 0);

}

 

 

public void generateNether(World world, java.util.Random rand, int chunkX, int chunkZ){

for(int i = 0; i < 1; i++){

int randPosX = chunkX + rand.nextInt(16);

int randPosY = rand.nextInt(44)+0;

int randPosZ = chunkZ + rand.nextInt(16);

(new WorldGenMinableNether(mod_soliteOre.block.blockID, 16)).generate(world, rand, randPosX, randPosY, randPosZ);

}

}

 

static class BlockSoliteOre extends Block

{

 

int a1 = 0,a2 = 0,a3 = 0,a4 = 0,a5 = 0,a6 = 0;

 

boolean red = false;

 

 

 

 

 

protected BlockSoliteOre(int i, int j)

{

        super(i, j, Material.iron);

a1 = 7;

a2 = 7;

a3 = 7;

a4 = 7;

a5 = 7;

a6 = 7;

 

}

public boolean isPoweringTo(IBlockAccess blockAccess, int i, int j, int k, int l){

return red;

}

public int getBlockTextureFromSide(int i){

 

if (i == 0)

return a1;

 

else if (i == 1)

return a2;

 

else if (i == 2)

return a3;

 

else if (i == 3)

return a4;

 

else if (i == 4)

return a5;

 

else if (i == 5)

return a6;

 

else

return a1;

 

}

 

public String getTextureFile(){return "/gemstones.png";}

public int getRenderType(){

return 0;

}

public int tickRate()

{

    return 10;

}

 

public int quantityDropped(Random par1Random){

return 1;

}

 

public int idDropped(int par1, Random par2Random, int par3){

return mod_solitePowder.block.itemID;

}

}

}

 

 

 

 

why is this crashing my client? and how do i fix it?

 

it doesnt drop a log, but i tried using the "test" feature in MCPatcher (I don't normally launch my client with MCPatcher)

 

this is what the log says from there:

 

[spoiler=On Launch]

 

  Reveal hidden contents

 

 

 

 

Posted

what is BUMP!

???

and what you need to generat ore is a gen class

package ashtonsmod.common;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenFlowers;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class WorldGen implements IWorldGenerator{
    
private static final int BlockX = 0;
private int BlockZ;

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,IChunkProvider chunkGenerator, IChunkProvider chunkProvider){
        
  switch(world.provider.dimensionId){
            case 1:
                generateNether(world, random, chunkX * 16, chunkZ * 16);
            case 0:
                generateSurface(world, random, chunkX * 16, chunkZ * 16);
            case -1:
                generateEnd(world, random, chunkX * 16, chunkZ * 16);
  }  
}
    
private void generateNether(World world, Random random, int chunkX, int chunkZ) {
 for(int i = 0; i < 5; i++)
     {
        int xCoord = chunkX + random.nextInt(16);
        int yCoord = random.nextInt(30);
        int zCoord = chunkZ + random.nextInt(16);
        (new WorldGenMinable(mainclass.OreBlock.blockID, MaxVienSize)).generate(world, random, xCoord, yCoord, zCoord);
     }
}

private void generateEnd(World world, Random random, int chunkX, int chunkZ){
}
    
private void generateSurface(World world, Random random, int chunkX,int chunkZ){
}}

and you need to register it in the main mod class under @INT like so;

@Init
public void load(FMLInitializationEvent event)
{
	GameRegistry.registerWorldGenerator(worldGen);
}

Use examples, i have aspergers.

Examples make sense to me.

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

    • One fateful day, my life took an unexpected turn when I received a phone call that would change everything. The voice on the other end claimed to be from my bank, delivering alarming news: my account had been frozen due to suspicious activity. Panic surged through me as I listened, my heart racing at the thought of losing my hard-earned savings. At that moment, I had about 130,000 USD in my bank, equivalent to around 2 BTC. The caller spoke with such authority and urgency that I felt compelled to act immediately. They insisted that the only way to protect my funds was to transfer Bitcoin BTC to them for "safekeeping. In my fear and confusion, I believed I was making a wise decision to secure my finances. Without fully grasping the implications, I complied and transferred the equivalent of my savings in Bitcoin, convinced I was safeguarding my money. It wasn’t until later that the reality of my situation hit me like a ton of bricks. I had been duped, and the weight of my mistake was unbearable. Shame and disbelief washed over me as I realized how easily I had been manipulated. How could I have let this happen? The feeling of vulnerability was overwhelming, and I was left grappling with the consequences of my actions. I learned about a recovery expert named RAPID DIGITAL RECOVERY. Desperate to reclaim what I had lost, I reached out for help. RAPID DIGITAL RECOVERY was knowledgeable and reassuring, explaining that there was a chance to trace the Bitcoin I had sent. With their expertise, they tracked the stolen funds to a peer-to-peer (P2P) exchanger based in the United Kingdom. This revelation sparked a glimmer of hope within me, a sense that perhaps justice could be served. RAPID DIGITAL RECOVERY collaborated with Action Fraud, the UK's national reporting center for fraud and cybercrime, to take decisive action against the scammers. Knowing that law enforcement was involved provided me with a sense of relief. The thought that the culprits behind my suffering could be brought to justice was comforting. In an incredible turn of events, RAPID DIGITAL RECOVERY successfully recovered all my funds, restoring my faith in the possibility of justice and recovery.
    • My game crashed in 1.12.2 here is the crash log https://pastebin.com/6MYu4mGy
    • I created a Modpack Forge in 1.20.1 for my friend and I. There are 135 mods including "Essential". I was able to play an 8 hour session without problem but when I relaunch my world, I crashed when I opened the menu of the game "ESC" or after about 15 minutes of session. I can't find the source of the problem. Latest.log and Debug.log : https://paste.ee/p/B0npvlRw
    • Hello! Faced with the same problem. Can you please describe in more detail how you rewrote the toNetwork and fromNetwork methods?
    • Why not?   Please explain what you have tried, in detail. Step by step is installing the server, placing mod .jar files in the mods folder within the folder you installed the server, and running the run.bat file. If this is not working for you, please post the debug.log from the logs folder to a site like https://mclo.gs and post the link to it here.
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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