Jump to content

[SOLVED] [1.8] TileEntitySpecialRenderer works but Crashes MC


queekusme

Recommended Posts

I had a json model rendering correctly then once I added a Tile Entity to it, it stopped rendering. I have a TileEntitySpecialRenderer set up and it works, however it immediately crashes minecraft. I'd like to try to avoid doing all of the raw openGL stuff as although I know how to do it and all, it's fiddly as hell and I already have the block model set up, I just want to find a way to render it without mc crashing.

 

Here's the code I have and a copy of the stack trace it's giving.

 

StackTrace:

 

 

// I bet Cylons wouldn't have this problem.

 

Time: 30/12/15 23:06

Description: Tesselating block model

 

java.lang.ArrayIndexOutOfBoundsException: 3

        at net.minecraftforge.client.model.pipeline.VertexLighterFlat.processQuad(VertexLighterFlat.java:81)

        at net.minecraftforge.client.model.pipeline.QuadGatheringTransformer.put(QuadGatheringTransformer.java:38)

        at net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(LightUtil.java:105)

        at net.minecraft.client.renderer.block.model.BakedQuad.pipe(BakedQuad.java:14)

        at net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer.render(ForgeBlockModelRenderer.java:95)

        at net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer.renderModelAmbientOcclusion(ForgeBlockModelRenderer.java:74)

        at net.minecraft.client.renderer.BlockModelRenderer.renderModel(BlockModelRenderer.java:44)

        at net.minecraft.client.renderer.BlockModelRenderer.renderModel(BlockModelRenderer.java:34)

        at com.queekus.nuclearwarheads.TileEntities.RadarTileEntitySpecialRenderer.renderTileEntityAt(RadarTileEntitySpecialRenderer.java:24)

        at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntityAt(TileEntityRendererDispatcher.java:146)

        at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntity(TileEntityRendererDispatcher.java:126)

        at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:681)

        at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1353)

        at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1266)

        at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1091)

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

        at net.minecraft.client.Minecraft.run(Minecraft.java:376)

        at net.minecraft.client.main.Main.main(Main.java:117)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod).reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

        at GradleStart.main(Unknown Source)

 

 

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

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

 

-- Head --

Stacktrace:

        at net.minecraftforge.client.model.pipeline.VertexLighterFlat.processQuad(VertexLighterFlat.java:81)

        at net.minecraftforge.client.model.pipeline.QuadGatheringTransformer.put(QuadGatheringTransformer.java:38)

        at net.minecraftforge.client.model.pipeline.LightUtil.putBakedQuad(LightUtil.java:105)

        at net.minecraft.client.renderer.block.model.BakedQuad.pipe(BakedQuad.java:14)

        at net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer.render(ForgeBlockModelRenderer.java:95)

        at net.minecraftforge.client.model.pipeline.ForgeBlockModelRenderer.renderModelAmbientOcclusion(ForgeBlockModelRenderer.java:74)

 

-- Block model being tesselated --

Details:

        Block: queekus_nuclearwarheads:radarBlock

        Block location: World: (-224,68,306), Chunk: (at 0,4,2 in -14,19; contains blocks -224,0,304 to -209,255,319), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

        Using AO: true

Stacktrace:

        at net.minecraft.client.renderer.BlockModelRenderer.renderModel(BlockModelRenderer.java:44)

        at net.minecraft.client.renderer.BlockModelRenderer.renderModel(BlockModelRenderer.java:34)

        at com.queekus.nuclearwarheads.TileEntities.RadarTileEntitySpecialRenderer.renderTileEntityAt(RadarTileEntitySpecialRenderer.java:24)

 

-- Block Entity Details --

Details:

        Name: queekus_nuclearwarheads_radarTileEntity // com.queekus.nuclearwarheads.TileEntities.RadarTileEntity

        Block type: ID #199 (tile.radarBlock // com.queekus.nuclearwarheads.Blocks.Radar)

        Block data value: 0 / 0x0 / 0b0000

        Block location: World: (-224,68,306), Chunk: (at 0,4,2 in -14,19; contains blocks -224,0,304 to -209,255,319), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

        Actual block type: ID #199 (tile.radarBlock // com.queekus.nuclearwarheads.Blocks.Radar)

        Actual block data value: 0 / 0x0 / 0b0000

Stacktrace:

        at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntityAt(TileEntityRendererDispatcher.java:146)

        at net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher.renderTileEntity(TileEntityRendererDispatcher.java:126)

        at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:681)

        at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1353)

        at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1266)

 

-- Affected level --

Details:

        Level name: MpServer

        All players: 1 total; [EntityPlayerSP['Player463'/249, l='MpServer', x=-224.58, y=68.00, z=306.61]]

        Chunk stats: MultiplayerChunkCache: 60, 60

        Level seed: 0

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

        Level generator options:

        Level spawn location: -224.00,64.00,256.00 - World: (-224,64,256), Chunk: (at 0,4,0 in -14,16; contains blocks -224,0,256 to -209,255,271), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)

        Level time: 83739 game time, 1171 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: 39 total; [EntityBat['Bat'/137, l='MpServer', x=-194.75, y=14.10, z=264.47], EntityBat['Bat'/138, l='MpServer', x=-194.25, y=37.10, z=268.25], EntityPig['Pig'/139, l='MpServer', x=-203.06, y=69.00, z=311.16], EntityCow['Cow'/140, l='MpServer', x=-196.84, y=63.00, z=360.19], EntityChicken['Chick

en'/79, l='MpServer', x=-263.41, y=71.00, z=283.56], EntityPig['Pig'/80, l='MpServer', x=-261.50, y=73.00, z=270.09], EntityPig['Pig'/81, l='MpServer', x=-266.47, y=65.00, z=343.53],EntityCow['Cow'/82, l='MpServer', x=-257.94, y=68.00, z=343.59], EntitySquid['Squid'/147, l='MpServer', x=-186.77, y=62.38, z=362.45], EntityBat['Bat'/83, l='MpServer', x=-258.50, y=19.10, z=353.75], EntityCow['Cow'/84, l='MpServer', x=-256.41, y=65.00, z=367.53], EntitySheep['Sheep'/89, l='MpServer', x=-255.63, y=74.00, z=264.78], EntityPlayerSP['Player463'/249, l='MpServer', x=-224.58, y=68.00,z=306.61], EntitySheep['Sheep'/90, l='MpServer', x=-241.41, y=65.00, z=287.53],EntityCow['Cow'/154, l='MpServer', x=-169.22, y=68.00, z=322.16], EntitySheep['Sheep'/91, l='MpServer', x=-247.56, y=72.00, z=273.19], EntityCow['Cow'/92, l='MpServer', x=-249.03, y=68.00, z=306.06], EntityPig['Pig'/93, l='MpServer', x=-253.88, y=69.00, z=331.22], EntityBat['Bat'/94, l='MpServer', x=-253.25, y=49.09, z

=350.53], EntityPig['Pig'/95, l='MpServer', x=-244.31, y=69.00, z=343.44], EntityBat['Bat'/96, l='MpServer', x=-240.75, y=11.10, z=357.75], EntityBat['Bat'/97,l='MpServer', x=-255.63, y=50.84, z=353.44], EntityPig['Pig'/98, l='MpServer', x=-251.97, y=66.00, z=355.06], EntityCow['Cow'/163, l='MpServer', x=-159.22, y=63.00, z=302.81], EntityChicken['Chicken'/164, l='MpServer', x=-153.81, y=69.00, z=299.41], EntityPig['Pig'/103, l='MpServer', x=-226.88, y=64.00, z=267.00], Enti

tyCow['Cow'/167, l='MpServer', x=-150.41, y=65.00, z=328.75], EntityChicken['Chicken'/104, l='MpServer', x=-227.47, y=68.00, z=264.78], EntityCow['Cow'/168, l='

MpServer', x=-147.66, y=64.00, z=327.91], EntityPig['Pig'/105, l='MpServer', x=-232.56, y=70.00, z=264.78], EntityBat['Bat'/106, l='MpServer', x=-231.44, y=39.91, z=346.41], EntityPig['Pig'/107, l='MpServer', x=-232.16, y=72.00, z=347.63],EntityBat['Bat'/108, l='MpServer', x=-238.59, y=27.10, z=353.25], EntityBat['Bat

'/109, l='MpServer', x=-235.63, y=35.66, z=361.41], EntityBat['Bat'/177, l='MpServer', x=-144.50, y=23.03, z=373.72], EntitySheep['Sheep'/116, l='MpServer', x=-219.31, y=69.00, z=268.03], EntityPig['Pig'/117, l='MpServer', x=-211.47, y=65.00, z=272.56], EntityPig['Pig'/118, l='MpServer',x=-215.47, y=68.00, z=342.41], EntityBat['Bat'/119, l='MpServer', x=-223.09, y=16.00, z=356.13]]

        Retry entities: 0 total; []

        Server brand: fml,forge

        Server type: Integrated singleplayer server

Stacktrace:

        at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392)

        at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2614)

        at net.minecraft.client.Minecraft.run(Minecraft.java:398)

        at net.minecraft.client.main.Main.main(Main.java:117)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:497)

        at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

        at GradleStart.main(Unknown Source)

 

-- System Details --

Details:

        Minecraft Version: 1.8

        Operating System: Windows 8.1 (amd64) version 6.3

        Java Version: 1.8.0_45, Oracle Corporation

        Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), OracleCorporation

        Memory: 257820664 bytes (245 MB) / 778043392 bytes (742 MB) up to 1886912512 bytes (1799 MB)

        JVM Flags: 0 total;

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

        FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1577 4 mods loaded, 4 mods active

        States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

        UCHIJAAAA      mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)

        UCHIJAAAA      FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1577.jar)

        UCHIJAAAA      Forge{11.14.4.1577} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1577.jar)

        UCHIJAAAA      queekus_nuclearwarheads{1.0} [Nuclear Warheads] (queekus_nuclearwarheads-1.0.jar)

        Loaded coremods (and transformers):

        GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.4226' Renderer: 'Intel® HD Graphics 4000'

        Launched Version: 1.8

        LWJGL: 2.9.1

        OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.4226, Intel

        GL Caps: Using GL 1.3 multitexturing.

Using GL 1.3 texture combiners.

Using framebuffer objects because OpenGL 3.0 is supported and separate blending

is supported.

Shaders are available because OpenGL 2.1 is supported.

VBOs are available because OpenGL 1.5 is supported.

 

        Using VBOs: No

        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)

 

 

 

Radar.java

 

 

package com.queekus.nuclearwarheads.Blocks;

 

import com.queekus.nuclearwarheads.NuclearWarHeads;

import com.queekus.nuclearwarheads.TileEntities.RadarTileEntity;

import net.minecraft.block.Block;

import net.minecraft.block.BlockContainer;

import net.minecraft.block.material.Material;

import net.minecraft.block.state.IBlockState;

import net.minecraft.item.Item;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.BlockPos;

import net.minecraft.util.EnumFacing;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

import java.util.Random;

 

public class Radar extends BlockContainer {

 

    public Radar(Material material){

        super(material);

        setHardness(2.0f);

        setResistance(10.0f);

        setStepSound(Block.soundTypeStone);

        setUnlocalizedName("radarBlock");

        setCreativeTab(NuclearWarHeads.nuclearWarheadTab);

        setHarvestLevel("pickaxe", 0);

 

        setBlockBounds(0,0,0,1,0.3f,1);

 

        GameRegistry.registerBlock(this, "radarBlock");

    }

 

    @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new RadarTileEntity(); }

 

    @Override public int isProvidingStrongPower(IBlockAccess worldIn, BlockPos pos, IBlockState state, EnumFacing side) {

        RadarTileEntity tile = (RadarTileEntity) worldIn.getTileEntity(pos);

        if (tile != null) { return (int)tile.getRedstoneOutput(); }

        return 1;

    }

 

    @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) {

        return Item.getItemFromBlock(NuclearWarHeads.carbonBlock);

    }

 

    @Override public int getRenderType() { return 3; }

    @Override public boolean isOpaqueCube() { return false; }

}

 

 

 

 

RadarTileEntity.java

 

 

package com.queekus.nuclearwarheads.TileEntities;

 

import net.minecraft.nbt.NBTTagCompound;

import net.minecraft.server.gui.IUpdatePlayerListBox;

import net.minecraft.tileentity.TileEntity;

 

 

public class RadarTileEntity extends TileEntity implements IUpdatePlayerListBox {

 

    private float redstoneOutput = 0;

    private float cumulativeTicks = 0;

 

    public RadarTileEntity() {

 

    }

 

    @Override public void update() {

        //System.out.println(redstoneOutput);

        cumulativeTicks += 1;

        if(cumulativeTicks >= 20) {

            cumulativeTicks = 0;

            if(redstoneOutput == 0){ redstoneOutput = 15; markDirty(); return; }

            redstoneOutput--;

        }

    }

 

    @Override public void writeToNBT(NBTTagCompound compound) {

        compound.setFloat("redstoneOutput",redstoneOutput);

        super.writeToNBT(compound);

    }

 

    @Override

    public void readFromNBT(NBTTagCompound compound) {

        super.readFromNBT(compound);

        this.redstoneOutput = compound.getFloat("redstoneOutput");

    }

 

    public float getRedstoneOutput() { return redstoneOutput; }

}

 

 

 

 

RadarTileEntitySpecialRenderer.java

 

 

package com.queekus.nuclearwarheads.TileEntities;

 

import net.minecraft.block.state.IBlockState;

import net.minecraft.client.Minecraft;

import net.minecraft.client.renderer.GlStateManager;

import net.minecraft.client.renderer.Tessellator;

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

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.BlockPos;

import net.minecraft.world.World;

import net.minecraftforge.client.model.IFlexibleBakedModel;

 

public class RadarTileEntitySpecialRenderer extends TileEntitySpecialRenderer{

 

    @Override

    public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialTick, int destroyStage) {

        GlStateManager.pushMatrix();

 

        World world = te.getWorld();

        IBlockState state = te.getBlockType().getDefaultState();

        BlockPos pos = te.getPos();

 

        IFlexibleBakedModel model = (IFlexibleBakedModel) Minecraft.getMinecraft().getBlockRendererDispatcher().getModelFromBlockState(state, world, pos);

        Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer().renderModel(world, model, state, pos, Tessellator.getInstance().getWorldRenderer());

 

        GlStateManager.popMatrix();

    }

}

 

 

 

block/radarBlock.json

 

 

{

"__comment": "Designed by - with BDcraft Cubik PRO 0.95 Beta - http://bdcraft.net",

"textures": {

    "radarBlockSide": "queekus_nuclearwarheads:blocks/radarBlockSide",

    "radarBlockTop": "queekus_nuclearwarheads:blocks/radarBlockTop",

    "particle":"queekus_nuclearwarheads:blocks/radarBlockTop"

},

"elements": [

{

    "from": [ 1, 0, 1 ],

    "to": [ 15, 5, 15 ],

    "faces": {

        "down":  { "uv": [ 0, 0, 1, 1 ], "texture": "#radarBlockTop" },

        "up":    { "uv": [ 0, 0, 16, 16 ], "texture": "#radarBlockTop" },

        "north": { "uv": [ 0, 10, 16, 16 ], "texture": "#radarBlockSide" },

        "south": { "uv": [ 0, 10, 16, 16 ], "texture": "#radarBlockSide" },

        "west":  { "uv": [ 0, 10, 16, 16 ], "texture": "#radarBlockSide" },

        "east":  { "uv": [ 0, 10, 16, 16 ], "texture": "#radarBlockSide" }

    }

}

]

}

 

 

 

blockstates/radarBlock.json

 

 

{

  "variants": {

    "normal": { "model": "queekus_nuclearwarheads:radarBlock" }

  }

}

 

 

 

If you require any additional information just let me know, Thanks for any help you can give.

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



×
×
  • Create New...

Important Information

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