Jump to content

Recommended Posts

Posted

Okay, so, I tried to make some custom stairs, but its not working...I'm getting this error:

---- Minecraft Crash Report ----
// Would you like a cupcake?

Time: 4/10/14 6:50 PM
Description: Rendering item

java.lang.NullPointerException: Rendering item
at sureen.core.blocks.SureenStairsBlock.getIcon(SureenStairsBlock.java:441)
at net.minecraft.block.Block.getBlockTextureFromSide(Block.java:720)
at net.minecraft.item.ItemBlock.getIconFromDamage(ItemBlock.java:51)
at net.minecraft.item.Item.getIconIndex(Item.java:471)
at net.minecraft.item.ItemStack.getIconIndex(ItemStack.java:139)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:422)
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:565)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:305)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:132)
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44)
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:678)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1209)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1063)
at net.minecraft.client.Minecraft.run(Minecraft.java:951)
at net.minecraft.client.main.Main.main(Main.java:112)
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:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


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

-- Head --
Stacktrace:
at sureen.core.blocks.SureenStairsBlock.getIcon(SureenStairsBlock.java:441)
at net.minecraft.block.Block.getBlockTextureFromSide(Block.java:720)
at net.minecraft.item.ItemBlock.getIconFromDamage(ItemBlock.java:51)
at net.minecraft.item.Item.getIconIndex(Item.java:471)
at net.minecraft.item.ItemStack.getIconIndex(ItemStack.java:139)
at net.minecraft.client.renderer.entity.RenderItem.renderItemIntoGUI(RenderItem.java:422)

-- Item being rendered --
Details:
Item Type: net.minecraft.item.ItemBlock@5dbb107e
Item Aux: 0
Item NBT: null
Item Foil: false
Stacktrace:
at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:565)
at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:305)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:132)
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44)
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:678)

-- Screen render details --
Details:
Screen name: net.minecraft.client.gui.inventory.GuiContainerCreative
Mouse location: Scaled: (137, 42). Absolute: (274, 394)
Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player231'/181, l='MpServer', x=305.62, y=82.15, z=-2632.52]]
Chunk stats: MultiplayerChunkCache: 225, 225
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (196,64,248), Chunk: (at 4,4,8 in 12,15; contains blocks 192,0,240 to 207,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)
Level time: 163254 game time, 5061 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 44 total; [EntityTTSnim['TTSnim'/275, l='MpServer', x=300.47, y=75.00, z=-2632.09], EntityBat['Bat'/274, l='MpServer', x=291.64, y=22.48, z=-2671.41], EntityTTSnim['TTSnim'/276, l='MpServer', x=299.94, y=63.00, z=-2580.50], EntityClientPlayerMP['Player231'/181, l='MpServer', x=305.62, y=82.15, z=-2632.52], EntityBat['Bat'/283, l='MpServer', x=317.97, y=41.10, z=-2667.31], EntityNeola['Neola'/284, l='MpServer', x=310.50, y=63.00, z=-2552.84], EntityTTSnim['TTSnim'/256, l='MpServer', x=258.50, y=65.00, z=-2559.88], EntityTTSnim['TTSnim'/325, l='MpServer', x=384.34, y=71.00, z=-2515.50], EntityTTSnim['TTSnim'/257, l='MpServer', x=259.81, y=64.00, z=-2561.25], EntityTTSnim['TTSnim'/217, l='MpServer', x=204.72, y=69.00, z=-2576.47], EntityBat['Bat'/263, l='MpServer', x=280.69, y=36.01, z=-2683.95], EntityBat['Bat'/266, l='MpServer', x=280.25, y=40.10, z=-2614.56], EntityTTSnim['TTSnim'/213, l='MpServer', x=202.72, y=63.00, z=-2631.34], EntityNeola['Neola'/332, l='MpServer', x=403.03, y=75.00, z=-2739.19], EntityTTSnim['TTSnim'/214, l='MpServer', x=194.28, y=63.00, z=-2629.25], EntityChicken['Chicken'/264, l='MpServer', x=278.47, y=69.00, z=-2683.47], EntityTTSnim['TTSnim'/215, l='MpServer', x=196.59, y=70.00, z=-2614.91], EntityBat['Bat'/265, l='MpServer', x=285.17, y=20.18, z=-2659.06], EntityTTSnim['TTSnim'/305, l='MpServer', x=358.16, y=68.00, z=-2534.50], EntityTTSnim['TTSnim'/239, l='MpServer', x=242.50, y=75.00, z=-2600.94], EntityTTSnim['TTSnim'/238, l='MpServer', x=243.50, y=75.00, z=-2601.91], EntityTTSnim['TTSnim'/237, l='MpServer', x=242.09, y=75.00, z=-2601.91], EntityBat['Bat'/236, l='MpServer', x=240.47, y=34.00, z=-2648.50], EntityTTSnim['TTSnim'/235, l='MpServer', x=248.55, y=68.81, z=-2671.06], EntityTTSnim['TTSnim'/232, l='MpServer', x=224.16, y=74.00, z=-2636.84], EntityTTSnim['TTSnim'/231, l='MpServer', x=236.06, y=75.00, z=-2635.97], EntityTTSnim['TTSnim'/230, l='MpServer', x=231.31, y=66.00, z=-2654.88], EntityTTSnim['TTSnim'/229, l='MpServer', x=233.81, y=71.00, z=-2650.41], EntityBat['Bat'/228, l='MpServer', x=233.39, y=38.01, z=-2644.50], EntityTomboy['_TomBoy_'/314, l='MpServer', x=379.53, y=5.00, z=-2688.28], EntityTTSnim['TTSnim'/226, l='MpServer', x=219.28, y=70.00, z=-2567.97], EntityBat['Bat'/289, l='MpServer', x=329.28, y=45.60, z=-2677.30], EntityTTSnim['TTSnim'/252, l='MpServer', x=262.78, y=70.00, z=-2666.50], EntityBat['Bat'/290, l='MpServer', x=332.16, y=36.10, z=-2666.31], EntityTTSnim['TTSnim'/253, l='MpServer', x=264.25, y=71.00, z=-2668.22], EntityPig['Pig'/291, l='MpServer', x=329.06, y=68.00, z=-2565.13], EntityBat['Bat'/250, l='MpServer', x=268.80, y=34.66, z=-2690.38], EntityBat['Bat'/251, l='MpServer', x=263.18, y=36.00, z=-2685.60], EntityBat['Bat'/248, l='MpServer', x=261.39, y=35.84, z=-2690.71], EntityCow['Cow'/294, l='MpServer', x=349.47, y=61.00, z=-2673.34], EntityPig['Pig'/295, l='MpServer', x=346.63, y=68.00, z=-2556.22], EntityBat['Bat'/249, l='MpServer', x=262.50, y=35.71, z=-2686.60], EntityChicken['Chicken'/246, l='MpServer', x=260.56, y=68.00, z=-2707.19], EntityBat['Bat'/247, l='MpServer', x=260.25, y=36.10, z=-2703.25]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:418)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2556)
at net.minecraft.client.Minecraft.run(Minecraft.java:973)
at net.minecraft.client.main.Main.main(Main.java:112)
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:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_51, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 750138592 bytes (715 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 30227 (1692712 bytes; 1 MB) allocated, 595 (33320 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 13, tallocated: 95
FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 6 mods loaded, 6 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
craftygirls{Alpha v0.5} [The Crafty Girls Core Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Radial{Alpha v0.2} [Radial] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
sureencore{V1.0} [sureen Core] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: GeForce GT 635/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 966 (54096 bytes; 0 MB) allocated, 605 (33880 bytes; 0 MB) used
Anisotropic Filtering: Off (1)

 

I have the feeling it's something wrong with my coding...I don't quite understand all of how BlockStairs works to begin with...and I have the feeling I need more then just BlockStairs to make this work...I've tried 2 different methods for this. One is by creating a block that extends BlockStairs:

package craftygirls.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;

public class CraftyStairs extends BlockStairs {
public CraftyStairs(Block par1, int par2) {
	super(par1, par2);
}
}

And one where I literally just copied BlockStairs and called it through the registry in main (I didn't copy the BlockStairs coding, I just copied the Init section that has my stairs in it):

StefStairs = new new BlockStairs(CraftyGirlsMain.StefPlanks, 0).setBlockName("ttsnimstairs").setHardness(5.0F).setResistance(5.0F).setCreativeTab(CraftyGirlsCoreTabs).setBlockTextureName("craftygirls:planks_ttsnim");
	GameRegistry.registerBlock(StefStairs, "ttsnimstairs");
	StefBrick.setHarvestLevel("axe", 3);

So...I'm left with the question...am I just stupid and the answer is clear? Or are stairs actually super complicated and I need help on this? Cause I can't seem to figure this out...so any help would be greatly appreciated.

Posted

This is all you have to do.

 

Create a custom class in your mod and make it extend BlockStairs.

 

package mod.xtronius.bc_mod.blocks.Misc;

 

import mod.xtronius.bc_mod.creativetab.CreativeTab;

import net.minecraft.block.Block;

import net.minecraft.block.BlockStairs;

 

public class BCBlockStairs extends BlockStairs {

 

public BCBlockStairs(int par1, Block par2Block, int par3) {

super(par1, par2Block, par3);

 

this.setLightOpacity(0);

this.setCreativeTab(CreativeTab.tabsBC_ModDecorativeBlocks);

}

public boolean isOpaqueCube(){

return false;

}

}

 

 

Then Just initialize just like you would initialize any other block.

 

Also Why do you have the word new typed two times?

StefStairs = new new BlockStairs(CraftyGirlsMain.StefPlanks, 0).setBlockName("ttsnimstairs").setHardness(5.0F).setResistance(5.0F).setCreativeTab(CraftyGirlsCoreTabs).setBlockTextureName("craftygirls:planks_ttsnim");

GameRegistry.registerBlock(StefStairs, "ttsnimstairs");

StefBrick.setHarvestLevel("axe", 3);

Don't be afraid to ask question when modding, there are no stupid question! Unless you don't know java then all your questions are stupid!

Posted

Whoops, that was an accident...I retyped the code by hand when I posted it here... -smacks forehead- I'm dumb...I had to initialize the planks before the stairs but didn't for some reason...so it really was something super simple that I did wrong...

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

    • I want to create block with entity, that will have height of 3 or more(configurable) and I tried to change first VoxelShape by increasing collision box on height I want and for changing block height on visual side i tried to configure BlockModelBuilder:  base.element() .from(0, 0, 0) .to(16f, 48f, 16f) .face(Direction.UP).texture("#top").end() .face(Direction.DOWN).texture("#bottom").end() .face(Direction.NORTH).texture("#side").end() .face(Direction.SOUTH).texture("#side").end() .face(Direction.WEST).texture("#side").end() .face(Direction.EAST).texture("#side").end() .end(); but, getting crash with next error: Position y out of range, must be within [-16, 32]. Found: %d [48.0]; Looks like game wont to block height modified by more than 32. Is there any way to fix that problem?
    • As long as the packets you are sending aren't lost, there's nothing wrong with what you're currently doing. Although, this sounds like something that would benefit from you making your own datapack registry instead of trying to arbitrarily sync static maps. Check out `DataPackRegistryEvent.NewRegistry`.
    • Hey all, I've been working a lot with datapacks lately, and I'm wondering what the most efficient way to get said data from server to client is.  I'm currently using packets, but given that a lot of the data I'm storing involves maps along the lines of Map<ResourceLocation, CustomDataType>, it can easily start to get messy if I need to transmit a lot of that data all at once. Recently I started looking into the ReloadableServerResources class, which is where Minecraft stores its built-ins.  I see you can access it via the server from the server's resources.managers, and it seems like this can be done even from the client to appropriately retrieve data from the server, unless I'm misunderstanding.  However, from what I can tell, this only works via built-in methods such as getRecipeManager() or getLootTables(), etc.  These are all SimpleJsonResourceReloadListeners, just like my datapack entries are, so it seems like it could be possible for me to access my datapack entries similarly?  But I don't see anywhere in ReloadableServerResources that stores loaded modded entries, so either I'm looking in the wrong place or it doesn't seem to be a thing. Are packets really the best way of doing this, or am I missing a method that would let me use ReloadableServerResources or something similar?
    • Hi, everyone! I'm new to minecraft modding stuff and want ask you some questions. 1. I checked forge references and saw there com.mojang and net.minecraft (not net.minecraftforge) and as I understand it's original game packages with all minecraft logic inside including renderers and so on, right? 2. Does it mean that forge has a limited set of instruments which doesn't cover all the aspects of the game? If make my question more specific then does forge provide such instruments that allow me totally change minecraft itself, like base mechanics and etc.? Or I have to use "original game packages" to implement such things? 3. I actively learning basic concepts with forge documentation and tutorials. So in my plans make different inventory system like in diabloids. Is that possible with forge? 4. It is last question related to the second one. So how deeply I can change minecraft with forge? I guess all my questions above because of that I haven't globally understanding what forge is and how it works inside and how it works with minecraft. It would be great if you provide some links or topics about it or explain it by yourself but I guess it's to big to be explained in that post at once. Anyway, thank you all for any help!
    • Im trying add to block a hole in center, just a usual block and in center of it on up side, there is should be a hole. I tried to add it via BlockModelBuilder, but its not working. Problem is that it only can change block size outside. I tried it to do with VoxelShape and its working, but its has been on server side and looks like its just changed collision shape, but for client, there is a texture covering this hole. I tried to use: base.renderType("cutout"); and removed some pixels from texture. I thought its should work, but game optimization makes block inside looks transparent. So, only custom model?
  • Topics

×
×
  • Create New...

Important Information

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