Jump to content

Minecraft Crash world when new block added


Mrgreen

Recommended Posts

I may have missed some think and just been really blind to something in the code but I am having a problem were I can create a new item fine and add it to the game all works fine but when i go to add a basic block minecraft loads but when i open a world existing or new it crashes.

 

I can Add what ever code is need to help me with this if anyone has an idea about this.

Thank you 

this is the block class

package green.mods.lapfuel.Blocks;

import green.mods.lapfuel.lib.BlockIDs;
import green.mods.lapfuel.lib.Strings;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;

public class LapronBlock extends Block {

public LapronBlock(int id){
	super(BlockIDs.LAPRON_BLOCK, Material.rock);
	this.setResistance(3F);
	this.setCreativeTab(CreativeTabs.tabBlock);
	this.setUnlocalizedName(Strings.LAPRON_BLOCK_NAME);


}
public void registerIcons(IconRegister iconRegister)
{
         blockIcon = iconRegister.registerIcon("LapronBlock");
}

}

 

 

This is the code for the mod Blocks class

package green.mods.lapfuel.Blocks;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import green.mods.lapfuel.lib.BlockIDs;
import green.mods.lapfuel.lib.Strings;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.MinecraftForge;
import green.mods.lapfuel.core.Main;

public class LapFuelBlocks {




public static Block LapronBlock;

public static void init(){

	LapronBlock = new LapronBlock(BlockIDs.LAPRON_BLOCK);


	LanguageRegistry.addName(LapronBlock, "Lapron Block");
	GameRegistry.registerBlock(LapronBlock, Strings.LAPRON_BLOCK_NAME);
	MinecraftForge.setBlockHarvestLevel(LapronBlock, "pickaxe", 3);

}


}

Link to comment
Share on other sites

I'm not completely positive, but I believe your problem is you haven't added a variable for the material, it should be something like this:

Public LapronBlock(int id, Material mat)

instead of what you currently have it. Try that and if it doesn't work post the error on here.

 

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Link to comment
Share on other sites

Thank you for the help sadly it did not work but i did get the error from eclipse

 

2013-04-29 22:05:21 [iNFO] [sTDERR] java.lang.OutOfMemoryError: Java heap space
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.util.AABBPool.getAABB(AABBPool.java:50)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.util.AxisAlignedBB.expand(AxisAlignedBB.java:111)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.world.World.getCollidingBoundingBoxes(World.java:1690)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.entity.player.EntityPlayerMP.<init>(EntityPlayerMP.java:178)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.server.management.ServerConfigurationManager.createPlayerForUser(ServerConfigurationManager.java:383)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:91)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:674)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)
2013-04-29 22:05:21 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-04-29 22:05:21 [sEVERE] [Minecraft-Server] Encountered an unexpected exception OutOfMemoryError
java.lang.OutOfMemoryError: Java heap space
at net.minecraft.util.AABBPool.getAABB(AABBPool.java:50)
at net.minecraft.util.AxisAlignedBB.expand(AxisAlignedBB.java:111)
at net.minecraft.world.World.getCollidingBoundingBoxes(World.java:1690)
at net.minecraft.entity.player.EntityPlayerMP.<init>(EntityPlayerMP.java:178)
at net.minecraft.server.management.ServerConfigurationManager.createPlayerForUser(ServerConfigurationManager.java:383)
at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:91)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:674)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-04-29 22:05:30 [sEVERE] [Minecraft-Server] This crash report has been saved to: C:\Users\Jordan\Desktop\Hide\Green's Mod\jars\.\crash-reports\crash-2013-04-29_22.05.27-server.txt
2013-04-29 22:05:30 [iNFO] [Minecraft-Server] Stopping server
2013-04-29 22:05:30 [iNFO] [Minecraft-Server] Saving players
2013-04-29 22:05:30 [iNFO] [Minecraft-Server] Saving worlds
2013-04-29 22:05:30 [iNFO] [Minecraft-Server] Saving chunks for level 'Test'/Overworld
2013-04-29 22:05:57 [iNFO] [sTDERR] java.lang.OutOfMemoryError: Java heap space
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at java.util.HashMap.<init>(Unknown Source)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at java.util.HashMap.<init>(Unknown Source)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.nbt.NBTTagCompound.<init>(NBTTagCompound.java:19)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:333)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:127)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.world.gen.ChunkProviderServer.safeSaveChunk(ChunkProviderServer.java:232)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:284)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:906)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:344)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:377)
2013-04-29 22:05:57 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:240)
2013-04-29 22:06:00 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:521)
2013-04-29 22:06:00 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-04-29 22:06:03 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_STARTED to SERVER_STOPPED. Loading cannot continue
2013-04-29 22:06:06 [sEVERE] [ForgeModLoader] 
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
FML{5.1.29.662} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Forge{7.7.1.662} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
LPFUEL{1.0.1} [Lapis Fuel Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
2013-04-29 22:06:06 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available.
2013-04-29 22:06:06 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid
2013-04-29 22:06:06 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.transition(LoadController.java:134)
2013-04-29 22:06:06 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.serverStopped(Loader.java:800)
2013-04-29 22:06:06 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:468)
2013-04-29 22:06:06 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:530)
2013-04-29 22:06:09 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-04-29 22:06:10 [iNFO] [Minecraft-Client] Stopping!

 

Thank You For the Help :)

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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