Jump to content

Recommended Posts

Posted

So i have this code for crafting...

GameRegistry.addRecipe(new ItemStack(goldRod, 1), " x", " x ","x ", 'x', Items.gold_ingot);

 

...this code for goldRod...

goldRod = new Item().setUnlocalizedName("goldRod").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("pplus:goldRod").setMaxStackSize(64);

 

...and this error when i craft the goldRod:

 

[spoiler=Crash report]

[21:59:43] [Client thread/FATAL]: Reported exception thrown!

net.minecraft.util.ReportedException: Updating screen events

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1740) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1035) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:951) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1

at net.minecraft.item.ItemStack.onCrafting(ItemStack.java:473) ~[itemStack.class:?]

at net.minecraft.inventory.SlotCrafting.onCrafting(SlotCrafting.java:76) ~[slotCrafting.class:?]

at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:133) ~[slotCrafting.class:?]

at net.minecraft.inventory.Container.slotClick(Container.java:353) ~[Container.class:?]

at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:500) ~[PlayerControllerMP.class:?]

at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:691) ~[GuiContainer.class:?]

at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:434) ~[GuiContainer.class:?]

at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:353) ~[GuiScreen.class:?]

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:317) ~[GuiScreen.class:?]

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1726) ~[Minecraft.class:?]

... 9 more

---- Minecraft Crash Report ----

// Shall we play a game?

 

Time: 2/15/14 9:59 PM

Description: Updating screen events

 

java.lang.ArrayIndexOutOfBoundsException: -1

at net.minecraft.item.ItemStack.onCrafting(ItemStack.java:473)

at net.minecraft.inventory.SlotCrafting.onCrafting(SlotCrafting.java:76)

at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:133)

at net.minecraft.inventory.Container.slotClick(Container.java:353)

at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:500)

at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:691)

at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:434)

at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:353)

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:317)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1726)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1035)

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 net.minecraft.item.ItemStack.onCrafting(ItemStack.java:473)

at net.minecraft.inventory.SlotCrafting.onCrafting(SlotCrafting.java:76)

at net.minecraft.inventory.SlotCrafting.onPickupFromSlot(SlotCrafting.java:133)

at net.minecraft.inventory.Container.slotClick(Container.java:353)

at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:500)

at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:691)

at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:434)

at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:353)

at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:317)

 

-- Affected screen --

Details:

Screen name: net.minecraft.client.gui.inventory.GuiCrafting

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Player484'/230, l='MpServer', x=211.67, y=67.62, z=262.02]]

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: (212,64,256), Chunk: (at 4,4,0 in 13,16; contains blocks 208,0,256 to 223,255,271), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 4282 game time, 4282 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: 129 total; [EntityEnderman['Enderman'/39, l='MpServer', x=137.34, y=21.00, z=266.86], EntityHorse['Horse'/37, l='MpServer', x=136.78, y=68.00, z=192.09], EntityZombie['Zombie'/42, l='MpServer', x=134.50, y=15.00, z=274.88], EntityEnderman['Enderman'/43, l='MpServer', x=138.41, y=16.00, z=275.84], EntityZombie['Zombie'/40, l='MpServer', x=139.44, y=37.00, z=262.63], EntityZombie['Zombie'/41, l='MpServer', x=138.38, y=37.00, z=262.13], EntityCreeper['Creeper'/44, l='MpServer', x=139.59, y=19.00, z=279.66], EntityBat['Bat'/45, l='MpServer', x=142.75, y=20.10, z=274.63], EntityCreeper['Creeper'/51, l='MpServer', x=151.00, y=15.00, z=189.56], EntitySkeleton['Skeleton'/55, l='MpServer', x=145.50, y=42.00, z=260.50], EntitySkeleton['Skeleton'/54, l='MpServer', x=154.50, y=12.00, z=252.94], EntityHorse['Horse'/53, l='MpServer', x=144.94, y=67.00, z=196.00], EntityBat['Bat'/52, l='MpServer', x=155.50, y=23.10, z=196.75], EntitySkeleton['Skeleton'/59, l='MpServer', x=152.94, y=21.00, z=303.59], EntityZombie['Zombie'/58, l='MpServer', x=145.94, y=24.00, z=301.50], EntityCreeper['Creeper'/57, l='MpServer', x=150.94, y=17.00, z=273.50], EntityZombie['Zombie'/56, l='MpServer', x=141.30, y=12.30, z=282.56], EntityZombie['Zombie'/63, l='MpServer', x=157.66, y=22.00, z=307.34], EntitySkeleton['Skeleton'/62, l='MpServer', x=148.88, y=17.00, z=295.31], EntityCreeper['Creeper'/61, l='MpServer', x=144.50, y=24.00, z=303.50], EntitySkeleton['Skeleton'/60, l='MpServer', x=145.50, y=17.00, z=290.50], EntityZombie['Zombie'/64, l='MpServer', x=156.34, y=23.00, z=306.69], EntitySkeleton['Skeleton'/65, l='MpServer', x=154.50, y=21.00, z=306.50], EntitySkeleton['Skeleton'/66, l='MpServer', x=155.38, y=24.00, z=307.34], EntityBat['Bat'/76, l='MpServer', x=162.25, y=30.10, z=283.75], EntityZombie['Zombie'/77, l='MpServer', x=170.50, y=19.00, z=273.50], EntityCreeper['Creeper'/78, l='MpServer', x=170.50, y=19.00, z=276.50], EntityZombie['Zombie'/79, l='MpServer', x=171.75, y=18.00, z=275.13], EntityCreeper['Creeper'/73, l='MpServer', x=175.50, y=29.00, z=235.50], EntityZombie['Zombie'/74, l='MpServer', x=160.41, y=17.00, z=263.72], EntityEnderman['Enderman'/75, l='MpServer', x=169.44, y=14.00, z=279.00], EntityZombie['Zombie'/85, l='MpServer', x=170.88, y=19.00, z=300.50], EntityBat['Bat'/84, l='MpServer', x=175.31, y=17.10, z=300.47], EntityCreeper['Creeper'/87, l='MpServer', x=173.63, y=26.00, z=314.00], EntityZombie['Zombie'/86, l='MpServer', x=173.41, y=29.00, z=304.94], EntityZombie['Zombie'/81, l='MpServer', x=171.97, y=14.00, z=288.53], EntityHorse['Horse'/80, l='MpServer', x=173.50, y=68.00, z=273.81], EntityZombie['Zombie'/83, l='MpServer', x=160.70, y=21.00, z=294.30], EntityZombie['Zombie'/82, l='MpServer', x=172.50, y=13.00, z=294.50], EntityPig['Pig'/93, l='MpServer', x=186.50, y=65.00, z=188.50], EntityPig['Pig'/92, l='MpServer', x=190.50, y=66.00, z=190.81], EntityHorse['Horse'/95, l='MpServer', x=180.82, y=67.00, z=254.30], EntityCreeper['Creeper'/94, l='MpServer', x=178.50, y=53.00, z=244.97], EntityCreeper['Creeper'/89, l='MpServer', x=173.50, y=19.00, z=326.50], EntitySkeleton['Skeleton'/88, l='MpServer', x=161.50, y=35.00, z=310.50], EntityPig['Pig'/91, l='MpServer', x=191.50, y=64.00, z=188.50], EntitySheep['Sheep'/102, l='MpServer', x=181.13, y=67.00, z=272.75], EntityBat['Bat'/103, l='MpServer', x=183.59, y=22.10, z=294.75], EntitySkeleton['Skeleton'/100, l='MpServer', x=191.69, y=19.00, z=282.31], EntityCreeper['Creeper'/101, l='MpServer', x=190.00, y=34.00, z=272.34], EntityHorse['Horse'/98, l='MpServer', x=180.09, y=67.00, z=266.09], EntityBat['Bat'/99, l='MpServer', x=185.28, y=23.10, z=282.25], EntitySkeleton['Skeleton'/96, l='MpServer', x=190.84, y=33.00, z=268.59], EntityZombie['Zombie'/97, l='MpServer', x=184.41, y=55.00, z=266.09], EntityZombie['Zombie'/110, l='MpServer', x=182.97, y=14.00, z=338.50], EntityBat['Bat'/108, l='MpServer', x=188.88, y=27.10, z=320.75], EntityCreeper['Creeper'/109, l='MpServer', x=184.72, y=16.00, z=327.34], EntityZombie['Zombie'/106, l='MpServer', x=183.50, y=17.00, z=332.06], EntityBat['Bat'/107, l='MpServer', x=177.75, y=17.10, z=332.53], EntitySkeleton['Skeleton'/104, l='MpServer', x=176.91, y=55.00, z=291.63], EntityCreeper['Creeper'/105, l='MpServer', x=185.25, y=28.00, z=320.78], EntityItem['item.tile.mushroom'/119, l='MpServer', x=199.13, y=33.13, z=269.13], EntitySheep['Sheep'/118, l='MpServer', x=193.97, y=66.00, z=253.70], EntityZombie['Zombie'/117, l='MpServer', x=199.56, y=63.00, z=215.47], EntityPig['Pig'/116, l='MpServer', x=194.47, y=65.00, z=194.69], EntityZombie['Zombie'/127, l='MpServer', x=197.49, y=19.63, z=306.41], EntityItem['item.item.rottenFlesh'/126, l='MpServer', x=204.13, y=65.13, z=274.78], EntitySkeleton['Skeleton'/125, l='MpServer', x=195.94, y=14.00, z=289.37], EntityCreeper['Creeper'/124, l='MpServer', x=200.59, y=23.00, z=279.00], EntityCreeper['Creeper'/123, l='MpServer', x=198.50, y=21.00, z=282.50], EntityHorse['Horse'/122, l='MpServer', x=195.48, y=67.00, z=259.99], EntityZombie['Zombie'/121, l='MpServer', x=196.53, y=59.00, z=272.58], EntityItem['item.item.rottenFlesh'/120, l='MpServer', x=197.31, y=66.13, z=266.94], EntityPig['Pig'/137, l='MpServer', x=223.50, y=71.00, z=199.50], EntityPig['Pig'/136, l='MpServer', x=222.88, y=76.00, z=191.13], EntityHorse['Donkey'/139, l='MpServer', x=219.50, y=69.00, z=222.97], EntityPig['Pig'/138, l='MpServer', x=221.31, y=70.00, z=202.50], EntitySkeleton['Skeleton'/141, l='MpServer', x=208.31, y=23.00, z=296.25], EntitySheep['Sheep'/140, l='MpServer', x=207.81, y=66.00, z=261.13], EntityPig['Pig'/143, l='MpServer', x=217.53, y=66.70, z=303.60], EntityZombie['Zombie'/142, l='MpServer', x=210.53, y=12.00, z=304.84], EntityPig['Pig'/129, l='MpServer', x=209.94, y=68.00, z=185.59], EntityChicken['Chicken'/131, l='MpServer', x=223.76, y=76.72, z=187.40], EntityPig['Pig'/130, l='MpServer', x=215.44, y=74.00, z=186.84], EntityChicken['Chicken'/135, l='MpServer', x=216.59, y=75.00, z=187.44], EntityPig['Pig'/134, l='MpServer', x=217.94, y=75.00, z=191.13], EntityChicken['Chicken'/152, l='MpServer', x=234.44, y=71.00, z=191.56], EntityChicken['Chicken'/153, l='MpServer', x=232.47, y=75.00, z=185.53], EntityChicken['Chicken'/154, l='MpServer', x=230.66, y=75.00, z=189.56], EntityChicken['Chicken'/155, l='MpServer', x=224.53, y=77.00, z=187.63], EntityChicken['Chicken'/156, l='MpServer', x=224.44, y=75.00, z=195.41], EntityHorse['Donkey'/157, l='MpServer', x=229.97, y=69.00, z=232.88], EntitySheep['Sheep'/158, l='MpServer', x=224.16, y=65.00, z=262.75], EntityPig['Pig'/159, l='MpServer', x=229.91, y=69.00, z=285.69], EntityZombie['Zombie'/144, l='MpServer', x=227.45, y=38.47, z=324.29], EntityZombie['Zombie'/171, l='MpServer', x=250.44, y=47.00, z=291.09], EntityWolf['Wolf'/175, l='MpServer', x=245.04, y=78.76, z=319.58], EntityZombie['Zombie'/174, l='MpServer', x=253.94, y=52.00, z=305.34], EntitySpider['Spider'/173, l='MpServer', x=243.78, y=49.00, z=297.16], EntityZombie['Zombie'/172, l='MpServer', x=246.69, y=51.00, z=302.38], EntityWolf['Wolf'/163, l='MpServer', x=232.38, y=64.00, z=329.34], EntityWolf['Wolf'/162, l='MpServer', x=235.38, y=67.00, z=324.41], EntityWolf['Wolf'/161, l='MpServer', x=234.25, y=70.00, z=297.22], EntityPig['Pig'/160, l='MpServer', x=225.38, y=70.00, z=296.13], EntityHorse['Horse'/186, l='MpServer', x=259.50, y=67.00, z=269.50], EntityHorse['Horse'/187, l='MpServer', x=259.09, y=66.00, z=267.09], EntityHorse['Horse'/184, l='MpServer', x=259.70, y=63.95, z=259.17], EntityHorse['Horse'/185, l='MpServer', x=262.09, y=64.00, z=263.09], EntityWolf['Wolf'/190, l='MpServer', x=259.50, y=75.00, z=301.50], EntityWolf['Wolf'/191, l='MpServer', x=269.50, y=69.00, z=302.25], EntityZombie['Zombie'/188, l='MpServer', x=257.53, y=52.00, z=300.97], EntityWolf['Wolf'/189, l='MpServer', x=264.38, y=70.00, z=296.78], EntityHorse['Horse'/179, l='MpServer', x=252.13, y=68.00, z=342.13], EntityWolf['Wolf'/176, l='MpServer', x=246.34, y=71.00, z=333.25], EntityZombie['Zombie'/183, l='MpServer', x=270.00, y=17.00, z=200.56], EntitySkeleton['Skeleton'/207, l='MpServer', x=272.13, y=16.00, z=328.50], EntitySkeleton['Skeleton'/206, l='MpServer', x=274.91, y=40.00, z=307.41], EntityHorse['Horse'/201, l='MpServer', x=283.03, y=72.00, z=235.59], EntityHorse['Horse'/200, l='MpServer', x=279.25, y=72.00, z=235.94], EntityHorse['Horse'/203, l='MpServer', x=288.00, y=72.00, z=237.47], EntityHorse['Horse'/199, l='MpServer', x=284.56, y=72.00, z=234.44], EntityHorse['Horse'/198, l='MpServer', x=277.91, y=70.00, z=237.50], EntitySkeleton['Skeleton'/193, l='MpServer', x=271.03, y=45.00, z=335.34], EntityBat['Bat'/192, l='MpServer', x=271.50, y=13.10, z=327.50], EntitySpider['Spider'/194, l='MpServer', x=270.88, y=44.00, z=341.66], EntityBat['Bat'/218, l='MpServer', x=285.50, y=54.00, z=313.53], EntityBat['Bat'/208, l='MpServer', x=288.23, y=25.30, z=326.38], EntityBat['Bat'/209, l='MpServer', x=278.40, y=29.00, z=337.36], EntityClientPlayerMP['Player484'/230, l='MpServer', x=211.67, y=67.62, z=262.02]]

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 8 (amd64) version 6.2

Java Version: 1.7.0_51, Oracle Corporation

Java VM Version: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 776139232 bytes (740 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

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

AABB Pool Size: 11943 (668808 bytes; 0 MB) allocated, 3 (168 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94

FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 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

pplus{1.0} [Peaceful+] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: AMD Radeon HD 6670 GL version 4.3.12618 Compatibility Profile Context 13.251.0.0, ATI Technologies Inc.

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: 1847 (103432 bytes; 0 MB) allocated, 21 (1176 bytes; 0 MB) used

Anisotropic Filtering: Off (1)

#@!@# Game crashed! Crash report saved to: #@!@# C:\forge\eclipse\.\crash-reports\crash-2014-02-15_21.59.43-client.txt

AL lib: (EE) alc_cleanup: 1 device not closed

 

 

 

I think is a forge error because the code for crafting give that error on every recipe i try to make.

I installed Forge 10.12.0.1029 after i used Forge 10.12.0.1024 (Minecraft 1.7.2)

Posted

I found the solution. In 1.6.4 the code above run perfectly but in 1.7.2 I need to write "new Object[]{the stuff}"

GameRegistry.addRecipe(new ItemStack(goldRod, 1), new Object[]{"  x", " x ","x  ", 'x', Items.gold_ingot});  

Posted

goldRod = new Item().setUnlocalizedName("goldRod").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("pplus:goldRod").setMaxStackSize(64);

 

Rather than try to use the base class Item, why not create your own Item class derived from Item. Also, register your new Item class.

 

 

Posted

You have to register your items with the Item/Block regestry. Else shit explodes. Basics of modding. Not a support issue.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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

    • Hello, I have this same problem. Did you manage to find a solution? Any help would be appreciated. Thanks.
    • log: https://mclo.gs/QJg3wYX as stated in the title, my game freezes upon loading into the server after i used a far-away waystone in it. The modpack i'm using is better minecraft V18. Issue only comes up in this specific server, singleplayer and other servers are A-okay. i've already experimented with removing possible culprits like modernfix and various others to no effect. i've also attempted a full reinstall of the modpack profile. Issue occurs shortly after the 'cancel' button dissapears on the 'loading world' section of the loading screen.   thanks in advance.
    • 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
  • Topics

×
×
  • Create New...

Important Information

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