Jump to content

Recommended Posts

Posted

Hey all, I am having a little trouble (okay, a lot of trouble). I just finished coding for a new ore I want to add with my mod, got it so that I could test and everything, and then I get his error.

 

 

---- Minecraft Crash Report ----

// Daisy, daisy...

 

Time: 6/15/13 1:38 PM

Description: Exception getting block type in world

 

java.lang.NullPointerException

at ceepCraft.CeepWorldGeneration.generateSurface(CeepWorldGeneration.java:44)

at ceepCraft.CeepWorldGeneration.generate(CeepWorldGeneration.java:21)

at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:102)

at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)

at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1234)

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:166)

at net.minecraft.world.World.getChunkFromChunkCoords(World.java:525)

at net.minecraft.world.World.getBlockId(World.java:410)

at net.minecraft.world.World.isAirBlock(World.java:434)

at net.minecraft.world.World.getFirstUncoveredBlock(World.java:381)

at net.minecraft.world.WorldProvider.canCoordinateBeSpawn(WorldProvider.java:100)

at net.minecraft.world.WorldServer.createSpawnPosition(WorldServer.java:837)

at net.minecraft.world.WorldServer.initialize(WorldServer.java:801)

at net.minecraft.world.World.<init>(World.java:294)

at net.minecraft.world.WorldServer.<init>(WorldServer.java:107)

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:72)

at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:105)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:430)

at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at ceepCraft.CeepWorldGeneration.generateSurface(CeepWorldGeneration.java:44)

at ceepCraft.CeepWorldGeneration.generate(CeepWorldGeneration.java:21)

at cpw.mods.fml.common.registry.GameRegistry.generateWorld(GameRegistry.java:102)

at net.minecraft.world.gen.ChunkProviderServer.populate(ChunkProviderServer.java:259)

at net.minecraft.world.chunk.Chunk.populateChunk(Chunk.java:1234)

at net.minecraft.world.gen.ChunkProviderServer.loadChunk(ChunkProviderServer.java:153)

at net.minecraft.world.gen.ChunkProviderServer.provideChunk(ChunkProviderServer.java:166)

at net.minecraft.world.World.getChunkFromChunkCoords(World.java:525)

 

-- Requested block coordinates --

Details:

Found chunk: true

Location: World: (-198,64,-354), Chunk: (at 10,4,14 in -13,-23; contains blocks -208,0,-368 to -193,255,-353), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)

Stacktrace:

at net.minecraft.world.World.getBlockId(World.java:410)

at net.minecraft.world.World.isAirBlock(World.java:434)

at net.minecraft.world.World.getFirstUncoveredBlock(World.java:381)

at net.minecraft.world.WorldProvider.canCoordinateBeSpawn(WorldProvider.java:100)

at net.minecraft.world.WorldServer.createSpawnPosition(WorldServer.java:837)

at net.minecraft.world.WorldServer.initialize(WorldServer.java:801)

 

-- Affected level --

Details:

Level name: New World

All players: 0 total; []

Chunk stats: ServerChunkCache: 76 Drop: 0

Level seed: 4695239151734553395

Level generator: ID 00 - default, ver 1. Features enabled: true

Level generator options:

Level spawn location: World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 0 game time, 0 day time

Level dimension: 0

Level storage version: 0x04ABD - Anvil

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true

Stacktrace:

at net.minecraft.world.World.<init>(World.java:294)

at net.minecraft.world.WorldServer.<init>(WorldServer.java:107)

at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:72)

at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:105)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:430)

at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 7 (x86) version 6.1

Java Version: 1.7.0_13, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 938180304 bytes (894 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 2, tcache: 0, allocated: 1, tallocated: 63

FML: MCP v7.51 FML v5.2.2.684 Minecraft Forge 7.8.0.684 4 mods loaded, 4 mods active

mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available

FML{5.2.2.684} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available

Forge{7.8.0.684} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available

CeepCraft{1.0.0} [Ceepcraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available

Profiler Position: N/A (disabled)

Player Count: 0 / 8; []

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

 

 

Now, when I take out this line of code the game loads, but no ore is generated.

 

GameRegistry.registerWorldGenerator(new CeepWorldGeneration());

 

 

Any help is really appreciated. :)

Posted

Here you go. :)

 

 

package ceepCraft;

 

import java.util.Random;

 

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

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

import cpw.mods.fml.common.IWorldGenerator;

 

public class CeepWorldGeneration implements IWorldGenerator{

 

@Override

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

// TODO Auto-generated method stub

 

switch(world.provider.dimensionId){

case -1:

    generateNether(world, random, chunkX * 16, chunkZ * 16);

    break;

case 0:

    generateSurface(world, random, chunkX * 16, chunkZ * 16);

    break;

case 1:

    generateEnd(world, random, chunkX * 16, chunkZ * 16);

    break;

 

}

 

 

}

 

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

// TODO Auto-generated method stub

 

}

 

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

// TODO Auto-generated method stub

 

for(int c = 0; c<16; c++){

int x = chunkX + random.nextInt(16);

int y = random.nextInt(60);

int z = chunkZ + random.nextInt(16);

(new WorldGenMinable(Ceepe.JorganOre.blockID, 10)).generate(world, random, x, y, z);

}

 

}

 

 

private void generateNether(World world, Random random, int chunkX, int chunkZ) {

// TODO Auto-generated method stub

 

}

}

 

 

 

And, when I add in a second block, it names them both the same thing, here is my updated Ceepe code.

 

 

package ceepCraft;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

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

import net.minecraftforge.common.MinecraftForge;

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.registry.GameRegistry;

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

@Mod(modid="CeepCraft", name="Ceepcraft", version="1.0.0")

@NetworkMod(clientSideRequired=true, serverSideRequired=false)

public class Ceepe {

 

@Instance("Ceepcraft")

public static Ceepe instance;

 

@SidedProxy(clientSide="ceepCraft.Ceep.client.ClientProxy",serverSide="ceepCraft.Ceep.CommonProxy")

public static CommonProxy proxy;

 

public static String modid;

 

    @PreInit

    public void preInit(FMLPreInitializationEvent event) {

 

    }

    public final static Block JorganOre = new JorganOre(501,1, Material.iron);;

    public static Block CeeygOre= new CeeygOre(502, 2, Material.iron);

    @Init

    public void load(FMLInitializationEvent event) {

 

            LanguageRegistry.addName(CeeygOre, "Ceeyg Ore");

            MinecraftForge.setBlockHarvestLevel(CeeygOre, "pickaxe", 3);

            GameRegistry.registerBlock(CeeygOre, "ceeygore");

 

            LanguageRegistry.addName(JorganOre, "Jorgan Ore");

            MinecraftForge.setBlockHarvestLevel(JorganOre, "pickaxe", 3);

            GameRegistry.registerBlock(JorganOre, "jorganore");       

 

 

            proxy.registerRenderThings();

    }

   

 

    @PostInit

    public void postInit(FMLPostInitializationEvent event) {

            // Stub Method

 

}

 

}

 

 

 

 

Posted

I wasn't referring to just you, I understand, I was just hoping that someone else might be able to help. Anyways, I fixed them both, it turns out the tutorial I had based everything off of was using old forge code, it was simply a matter of me adjusting to the new. Thank though. :)

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

    • You would have better results asking a more specific question. What have you done? What exactly do you need help with? Please also read the FAQ regarding posting logs.
    • Hi, this is my second post with the same content as no one answered this and it's been a long time since I made the last post, I want to make a client-only mod, everything is ok, but when I use shaders, none of the textures rendered in RenderLevelStageEvent nor the crow entity model are rendered, I want them to be visible, because it's a horror themed mod I've already tried it with different shaders, but it didn't work with any of them and I really want to add support for shaders Here is how i render the crow model in the CrowEntityRenderer<CrowEntity>, by the time i use this method, i know is not the right method but i don't think this is the cause of the problem, the renderType i'm using is entityCutout @Override public void render(CrowEntity p_entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) { super.render(p_entity, entityYaw, partialTick, poseStack, bufferSource, packedLight); ClientEventHandler.getClient().crow.renderToBuffer(poseStack, bufferSource.getBuffer(ClientEventHandler.getClient().crow .renderType(TEXTURE)), packedLight, OverlayTexture.NO_OVERLAY, Utils.rgb(255, 255, 255)); } Here renderLevelStage @Override public void renderWorld(RenderLevelStageEvent e) { horrorEvents.draw(e); } Here is how i render every event public void draw(RenderLevelStageEvent e) { for (HorrorEvent event : currentHorrorEvents) { event.tick(e.getPartialTick()); event.draw(e); } } Here is how i render the crow model on the event @Override public void draw(RenderLevelStageEvent e) { if(e.getStage() == RenderLevelStageEvent.Stage.AFTER_ENTITIES) { float arcProgress = getArcProgress(0.25f); int alpha = (int) Mth.lerp(arcProgress, 0, 255); int packedLight = LevelRenderer.getLightColor(Minecraft.getInstance().level, blockPos); VertexConsumer builder = ClientEventHandler.bufferSource.getBuffer(crow); Crow<CreepyBirdHorrorEvent> model = ClientEventHandler .getClient().crow; model.setupAnim(this); RenderHelper.renderModelInWorld(model, position, offset, e.getCamera(), e.getPoseStack(), builder, packedLight, OverlayTexture.NO_OVERLAY, alpha); builder = ClientEventHandler.bufferSource.getBuffer(eyes); RenderHelper.renderModelInWorld(model, position, offset, e.getCamera(), e.getPoseStack(), builder, 15728880, OverlayTexture.NO_OVERLAY, alpha); } } How i render the model public static void renderModelInWorld(Model model, Vector3f pos, Vector3f offset, Camera camera, PoseStack matrix, VertexConsumer builder, int light, int overlay, int alpha) { matrix.pushPose(); Vec3 cameraPos = camera.getPosition(); double finalX = pos.x - cameraPos.x + offset.x; double finalY = pos.y - cameraPos.y + offset.y; double finalZ = pos.z - cameraPos.z + offset.z; matrix.pushPose(); matrix.translate(finalX, finalY, finalZ); matrix.mulPose(Axis.XP.rotationDegrees(180f)); model.renderToBuffer(matrix, builder, light, overlay, Utils .rgba(255, 255, 255, alpha)); matrix.popPose(); matrix.popPose(); } Thanks in advance
    • Same issue - I have no idea
    • I am trying to develop a modpack for me and my friends to use on our server. Does anyone know how to develop a modpack for a server or could they help take a look at my modpack to potentially help at all?
    • un server de armas realista.  
  • Topics

×
×
  • Create New...

Important Information

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