Jump to content

getIcon() for BlockDoor always returning NullPointerException [SOLVED]


Althonos

Recommended Posts

Hello, so this issue is, whenever I run my mod to generate a custom door, the getIcon() method is always called immediately, before the registerBlockIcons() method. Therefore returning a NullPointerException, I have tried to check if the icon I'm returning is equal to null by using if (icon != null). The issue was, nothing I was returning in the else statement was helping me. Another forum has had the same problem;

 

https://github.com/Chicken-Bones/ForgeMultipart/issues/86#issuecomment-25778634

 

However, the suggested method of solving it, by checking for null and using a pointer if it was null, was not in any way helpful.

 

Relevant Icon Code:

 

 

 

        @Override
public void registerBlockIcons(IIconRegister iconRegister) {

	icons[0] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "lower");
	icons[1] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "upper");

	this.flippedIcons[0] = new IconFlipped(icons[0], true, false);
	this.flippedIcons[1] = new IconFlipped(icons[1], true, false);

}

@Override
public IIcon getIcon(int side, int meta) {

	if (icons[0] != null){
		return icons[0];
	} else {
		IIcon newIcon = icons[0];
		return newIcon;
	}
}

 

 

Relevant Crash Report:

 

 

---- Minecraft Crash Report ----
// You're mean.

Time: 9/29/14 12:31 PM
Description: Unexpected error

java.lang.NullPointerException: Unexpected error
at net.minecraft.block.BlockDoor.getIcon(BlockDoor.java:103)
at net.minecraft.client.renderer.RenderBlocks.getBlockIcon(RenderBlocks.java:8446)
at net.minecraft.client.renderer.RenderBlocks.renderBlockDoor(RenderBlocks.java:7174)
at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:365)
at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:207)
at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1618)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1087)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056)
at net.minecraft.client.Minecraft.run(Minecraft.java:951)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at GradleStart.bounce(GradleStart.java:107)
at GradleStart.startClient(GradleStart.java:100)
at GradleStart.main(GradleStart.java:55)


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

-- Head --
Stacktrace:
at net.minecraft.block.BlockDoor.getIcon(BlockDoor.java:103)
at net.minecraft.client.renderer.RenderBlocks.getBlockIcon(RenderBlocks.java:8446)
at net.minecraft.client.renderer.RenderBlocks.renderBlockDoor(RenderBlocks.java:7174)
at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:365)
at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:207)
at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1618)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityClientPlayerMP['Player235'/58, l='MpServer', x=187.50, y=65.62, z=-83.50]]
Chunk stats: MultiplayerChunkCache: 540, 540
Level seed: 0
Level generator: ID 00 - default, ver 1. Features enabled: false
Level generator options: 
Level spawn location: World: (184,64,-92), Chunk: (at 8,4,4 in 11,-6; contains blocks 176,0,-96 to 191,255,-81), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)
Level time: 214 game time, 214 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: 66 total; [EntitySheep['Sheep'/10, l='MpServer', x=165.50, y=68.00, z=-162.50], EntitySheep['Sheep'/11, l='MpServer', x=162.50, y=68.00, z=-161.50], EntitySheep['Sheep'/12, l='MpServer', x=159.50, y=69.00, z=-162.50], EntitySheep['Sheep'/38, l='MpServer', x=248.50, y=66.00, z=-155.50], EntitySheep['Sheep'/39, l='MpServer', x=250.50, y=67.00, z=-157.81], EntitySheep['Sheep'/37, l='MpServer', x=250.50, y=67.00, z=-156.22], EntitySheep['Sheep'/40, l='MpServer', x=252.50, y=66.00, z=-153.50], EntityZombie['Zombie'/2261, l='MpServer', x=151.50, y=32.00, z=-42.50], EntitySquid['Squid'/141, l='MpServer', x=132.34, y=58.34, z=-141.59], EntitySquid['Squid'/140, l='MpServer', x=135.16, y=59.38, z=-140.13], EntitySquid['Squid'/143, l='MpServer', x=140.25, y=59.34, z=-142.50], EntitySquid['Squid'/142, l='MpServer', x=136.69, y=59.34, z=-144.19], EntitySquid['Squid'/145, l='MpServer', x=137.91, y=58.34, z=-147.78], EntitySquid['Squid'/146, l='MpServer', x=127.66, y=58.38, z=-145.03], EntitySquid['Squid'/147, l='MpServer', x=126.31, y=57.94, z=-143.94], EntitySquid['Squid'/148, l='MpServer', x=132.78, y=59.00, z=-147.84], EntitySquid['Squid'/150, l='MpServer', x=128.88, y=58.00, z=-145.91], EntityClientPlayerMP['Player235'/58, l='MpServer', x=187.50, y=65.62, z=-83.50], EntityBat['Bat'/218, l='MpServer', x=161.23, y=36.00, z=-43.40], EntityZombie['Zombie'/2121, l='MpServer', x=247.50, y=43.00, z=-102.03], EntityZombie['Zombie'/2465, l='MpServer', x=154.50, y=14.00, z=-50.50], EntitySpider['Spider'/2464, l='MpServer', x=156.50, y=14.00, z=-50.50], EntityZombie['Zombie'/2504, l='MpServer', x=112.50, y=35.00, z=-69.50], EntitySpider['Spider'/2518, l='MpServer', x=108.50, y=36.00, z=-66.50], EntityZombie['Zombie'/2546, l='MpServer', x=200.63, y=40.00, z=-88.48], EntityBat['Bat'/412, l='MpServer', x=203.88, y=14.13, z=-78.78], EntityBat['Bat'/413, l='MpServer', x=202.66, y=13.26, z=-80.50], EntitySkeleton['Skeleton'/392, l='MpServer', x=256.50, y=30.00, z=-7.50], EntityCreeper['Creeper'/2355, l='MpServer', x=184.50, y=21.00, z=-115.50], EntityCreeper['Creeper'/2354, l='MpServer', x=181.50, y=21.00, z=-118.50], EntityCreeper['Creeper'/2357, l='MpServer', x=174.50, y=21.00, z=-121.50], EntityCreeper['Creeper'/2356, l='MpServer', x=186.50, y=21.00, z=-112.50], EntitySkeleton['Skeleton'/2360, l='MpServer', x=259.50, y=41.00, z=-80.50], EntityZombie['Zombie'/2368, l='MpServer', x=247.09, y=47.00, z=-72.75], EntityZombie['Zombie'/2369, l='MpServer', x=244.50, y=47.00, z=-72.44], EntityCreeper['Creeper'/466, l='MpServer', x=172.28, y=37.00, z=-49.41], EntityCreeper['Creeper'/467, l='MpServer', x=168.61, y=37.00, z=-41.67], EntityWitch['Witch'/464, l='MpServer', x=174.50, y=38.00, z=-50.09], EntityWitch['Witch'/465, l='MpServer', x=171.63, y=38.00, z=-42.63], EntitySkeleton['Skeleton'/575, l='MpServer', x=109.78, y=50.00, z=-17.28], EntityZombie['Zombie'/2810, l='MpServer', x=203.50, y=20.00, z=-42.50], EntityCreeper['Creeper'/2800, l='MpServer', x=247.69, y=42.00, z=-100.50], EntitySkeleton['Skeleton'/2801, l='MpServer', x=162.53, y=18.00, z=-148.91], EntityBat['Bat'/712, l='MpServer', x=119.45, y=38.30, z=-79.83], EntityBat['Bat'/715, l='MpServer', x=116.46, y=40.00, z=-76.26], EntityBat['Bat'/711, l='MpServer', x=121.52, y=37.00, z=-85.27], EntityZombie['Zombie'/787, l='MpServer', x=259.34, y=29.00, z=-79.66], EntityCreeper['Creeper'/940, l='MpServer', x=171.50, y=15.00, z=-42.50], EntityEnderman['Enderman'/937, l='MpServer', x=176.13, y=15.00, z=-46.69], EntityZombie['Zombie'/936, l='MpServer', x=155.50, y=19.00, z=-49.50], EntityEnderman['Enderman'/939, l='MpServer', x=175.22, y=16.00, z=-46.66], EntityWitch['Witch'/2816, l='MpServer', x=130.50, y=30.00, z=-134.50], EntityWitch['Witch'/2817, l='MpServer', x=130.50, y=30.00, z=-133.50], EntityBat['Bat'/1146, l='MpServer', x=262.50, y=29.82, z=-94.50], EntitySkeleton['Skeleton'/3146, l='MpServer', x=110.50, y=49.00, z=-4.50], EntityZombie['Zombie'/1265, l='MpServer', x=249.50, y=33.00, z=-0.97], EntityBat['Bat'/1333, l='MpServer', x=230.63, y=21.02, z=-38.31], EntityCreeper['Creeper'/1312, l='MpServer', x=261.50, y=27.00, z=-77.50], EntityZombie['Zombie'/1581, l='MpServer', x=109.30, y=34.30, z=-69.54], EntitySkeleton['Skeleton'/1577, l='MpServer', x=114.50, y=48.00, z=-12.50], EntityBat['Bat'/1596, l='MpServer', x=173.75, y=12.00, z=-135.25], EntitySkeleton['Skeleton'/1766, l='MpServer', x=265.50, y=36.00, z=-82.50], EntityWitch['Witch'/1815, l='MpServer', x=256.88, y=30.00, z=-9.47], EntityBat['Bat'/1800, l='MpServer', x=227.22, y=23.05, z=-52.16], EntityZombie['Zombie'/2003, l='MpServer', x=170.31, y=38.00, z=-44.69], EntityZombie['Zombie'/2004, l='MpServer', x=137.06, y=14.26, z=-48.50]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2555)
at net.minecraft.client.Minecraft.run(Minecraft.java:980)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at GradleStart.bounce(GradleStart.java:107)
at GradleStart.startClient(GradleStart.java:100)
at GradleStart.main(GradleStart.java:55)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Mac OS X (x86_64) version 10.9.4
Java Version: 1.7.0_67, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 830144952 bytes (791 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 1, tcache: 1, allocated: 12, tallocated: 94
FML: MCP v9.05 FML v7.10.84.1217 Minecraft Forge 10.13.1.1217 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
FML{7.10.84.1217} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.1.1217.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.13.1.1217} [Minecraft Forge] (forgeSrc-1.7.10-10.13.1.1217.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
newblocks{1.0} [New Blocks] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: AMD Radeon HD 6750M OpenGL Engine GL version 2.1 ATI-1.24.35, ATI Technologies Inc.
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because ARB_framebuffer_object is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

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: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)

 

 

If I missed out any additional code or information I should have added, please notify me. Thanks for reading.

Link to comment
Share on other sites

Well, if you look closely at your code you're checking if icons[0] is null and then you are returning it (you assign it to newIcon, but then newIcon will be null)  -- so that is probably why you're getting the null pointer exception. 

 

The more interesting question is why icons[0] is null in the first place.  Your registration method looks correct to me.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I've tried just returning icons[0] as well, the code I posted was the alternative suggested. As I said in the first post, I believe the error lies in the fact it is calling getIcons() before anything else (Before registering them), therefore returning null. I also have no idea of changing the order of calling it.

Link to comment
Share on other sites

I just realized something I have from another class..

 

How come this works

 

 

@Override
public void registerBlockIcons(IIconRegister iconRegister) {
    for (int i = 0; i < icons.length; i++) {
    	
    	if (i >=2){
    		
    		icons[i] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "side");
    	} else {
    		
    		icons[i] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "top");
    	}
    }
}

@Override
public IIcon getIcon(int side, int meta) {
    return icons[side];
}

 

 

But not this code?

 

 

@Override
public void registerBlockIcons(IIconRegister iconRegister) {

	icons[0] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "lower");
	icons[1] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "upper");

	this.flippedIcons[0] = new IconFlipped(icons[0], true, false);
	this.flippedIcons[1] = new IconFlipped(icons[1], true, false);

}

@Override
public IIcon getIcon(int side, int meta) {
	return icons[0];
        }

 

 

 

Also, I have tried to use console print, and it prints inside of the main, but whenever I place the block it auto-crashes Minecraft so it never shows anything inside of getIcons. However, if I place it in registerBlockIcon, it prints the statement during Minecraft startup. So why is it still null while passing the icons[0]?

 

Edit:

I printed text and icons[0] inside of registerIcons, it printed the name of the png file with some weird syntax, so I think it is assigned properly.

Link to comment
Share on other sites

Can you show the code where you declare the icons[] array?  Do you do it differently in each case, because in your first example it seems you've already got a length implying that the array is declared with a size already, and possibly already initialized somehow...

 

Can you show the code where you register the block itself?

 

It is possible that perhaps you're somehow placing a block that is improperly registered I guess. 

 

But it is a strange problem, as the code generally looks okay to me.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Here's my full door class for your reference.

 

 

package com.zacharysturtz;

import java.util.Random;

import javax.swing.JOptionPane;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.IconFlipped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class BlockCustomDoor extends BlockDoor {

public Item placerItem;
public String blockName = "orangedoor";
public IIcon[] flippedIcons;
        public IIcon[] icons;

public BlockCustomDoor() {
	super(Material.wood);
	setBlockName(Constants.MODID + "_" + blockName);

	float f = 0.5F;
	float f1 = 1.0F;
	this.setLightOpacity(0);
	this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f);

	GameRegistry.registerBlock(this, blockName);

}

public IIcon getBlockTexture(IBlockAccess par1IBlockAccess, int par2,
		int par3, int par4, int par5) {

	if (par5 == 1 || par5 == 0) {
		return icons[0];
	}

	int meta = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
	boolean flag = (meta & 4) != 0;
	int halfMeta = meta & 3;
	boolean flipped = false;

	if (flag) {
		if (halfMeta == 0 && par5 == 2)
			flipped = !flipped;
		else if (halfMeta == 1 && par5 == 5)
			flipped = !flipped;
		else if (halfMeta == 2 && par5 == 3)
			flipped = !flipped;
		else if (halfMeta == 3 && par5 == 4)
			flipped = !flipped;
	} else {
		if (halfMeta == 0 && par5 == 5)
			flipped = !flipped;
		else if (halfMeta == 1 && par5 == 3)
			flipped = !flipped;
		else if (halfMeta == 2 && par5 == 4)
			flipped = !flipped;
		else if (halfMeta == 3 && par5 == 2)
			flipped = !flipped;
		if ((meta & 16) != 0)
			flipped = !flipped;
	}

	if (flipped)
		return flippedIcons[(meta &  != 0 ? 1 : 0];
	else
		return (meta &  != 0 ? icons[1] : icons[0];
}

@Override
public void registerBlockIcons(IIconRegister iconRegister) {

                icons = new IIcon[2];
	icons[0] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "lower");
	icons[1] = iconRegister.registerIcon(Constants.MODID + ":" + blockName + "upper");

                flippedIcons = new IIcon[2];
	this.flippedIcons[0] = new IconFlipped(icons[0], true, false);
	this.flippedIcons[1] = new IconFlipped(icons[1], true, false);

}

@Override
public IIcon getIcon(int side, int meta) {

		return icons[0];
}
}

 

 

I tried several different locations of calling icons = new IIcon[2];

 

Full Item Class

 

 

package com.zacharysturtz;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemDoor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class orangeDoorItem extends Item {
public Block doorBlock;

String itemName = "orangedooricon";

public orangeDoorItem(Block block){
	setUnlocalizedName(Constants.MODID + "_" + itemName);
	setCreativeTab(CreativeTabs.tabBlock);
	doorBlock = block;
	maxStackSize = 1;

	GameRegistry.registerItem(this, itemName);

}

public boolean onItemUse(ItemStack par1ItemStack,
		EntityPlayer par2EntityPlayer, World par3World, int par4, int par5,
		int par6, int par7, float par8, float par9, float par10) {
	if (par7 != 1) {
		return false;
	} else {
		++par5;
		Block block = this.doorBlock;

		if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7,
				par1ItemStack)
				&& par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6,
						par7, par1ItemStack)) {
			if (!block.canPlaceBlockAt(par3World, par4, par5, par6)) {
				return false;
			} else {
				int i1 = MathHelper
						.floor_double((double) ((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3;
				ItemDoor.placeDoorBlock(par3World, par4, par5, par6, i1,
						block);
				--par1ItemStack.stackSize;
				return true;
			}
		} else {
			return false;
		}
	}
}

@Override
public void registerIcons(IIconRegister iconRegister) {
	itemIcon = iconRegister.registerIcon(Constants.MODID + ":" + itemName);
}
}

 

 

Also, any println statements in the getBlockTexture method are never called. This might be of use as well, here is the relevant BlockDoor class that gives the error.

 

BlockDoor Relevant Methods

 

 

/**
     * Gets the block's texture. Args: side, meta
     */
    @SideOnly(Side.CLIENT)
    public IIcon getIcon(int p_149691_1_, int p_149691_2_)
    {
        return this.field_150016_b[0];
    }

    @SideOnly(Side.CLIENT)
    public IIcon getIcon(IBlockAccess p_149673_1_, int p_149673_2_, int p_149673_3_, int p_149673_4_, int p_149673_5_)
    {
        if (p_149673_5_ != 1 && p_149673_5_ != 0)
        {
            int i1 = this.func_150012_g(p_149673_1_, p_149673_2_, p_149673_3_, p_149673_4_);
            int j1 = i1 & 3;
            boolean flag = (i1 & 4) != 0;
            boolean flag1 = false;
            boolean flag2 = (i1 &  != 0;

            if (flag)
            {
                if (j1 == 0 && p_149673_5_ == 2)
                {
                    flag1 = !flag1;
                }
                else if (j1 == 1 && p_149673_5_ == 5)
                {
                    flag1 = !flag1;
                }
                else if (j1 == 2 && p_149673_5_ == 3)
                {
                    flag1 = !flag1;
                }
                else if (j1 == 3 && p_149673_5_ == 4)
                {
                    flag1 = !flag1;
                }
            }
            else
            {
                if (j1 == 0 && p_149673_5_ == 5)
                {
                    flag1 = !flag1;
                }
                else if (j1 == 1 && p_149673_5_ == 3)
                {
                    flag1 = !flag1;
                }
                else if (j1 == 2 && p_149673_5_ == 4)
                {
                    flag1 = !flag1;
                }
                else if (j1 == 3 && p_149673_5_ == 2)
                {
                    flag1 = !flag1;
                }

                if ((i1 & 16) != 0)
                {
                    flag1 = !flag1;
                }
            }

            return flag2 ? this.field_150017_a[flag1?1:0] : this.field_150016_b[flag1?1:0];
        }
        else
        {
            return this.field_150016_b[0];   //ERROR IS RIGHT HERE
        }
    }

    @SideOnly(Side.CLIENT)
    public void registerBlockIcons(IIconRegister p_149651_1_)
    {
        this.field_150017_a = new IIcon[2];
        this.field_150016_b = new IIcon[2];
        this.field_150017_a[0] = p_149651_1_.registerIcon(this.getTextureName() + "_upper");
        this.field_150016_b[0] = p_149651_1_.registerIcon(this.getTextureName() + "_lower");
        this.field_150017_a[1] = new IconFlipped(this.field_150017_a[0], true, false);
        this.field_150016_b[1] = new IconFlipped(this.field_150016_b[0], true, false);
    } 

 

 

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.