Jump to content

[1.6.4] Collision with custom block (Solved)


ColdFox

Recommended Posts

I've a block with a tile entity for use a custom model and I've set the block bounds. The problem is that when the player's head gets into the "normal" block area, the player gets pushed away from it as it would happen when the player collides with a entity. Am I missing something?

 

2zp2po4.jpg

 

SlabBlock

 

 

public class SlabBlock extends BlockContainer implements ITileEntityProvider {

public SlabBlock(int id, Block par2Block) {

super(id, par2Block.blockMaterial);

        this.setHardness(par2Block.blockHardness);

        this.setResistance(par2Block.blockResistance / 3.0F);

        this.setStepSound(par2Block.stepSound);

this.setCreativeTab(mod_MoreBlocksMod.tabMoreBlocks);

this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);

 

}

 

public void registerIcons(IconRegister iconReg) {

this.blockIcon = iconReg.registerIcon("minecraft:"+ mod_MoreBlocksMod.blockTypes[this.blockID - mod_MoreBlocksMod.slabBlockIDFinal]);

}

 

/**

    * Called when the block is placed in the world.

    */

    public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)

    {

        int l = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);

        par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);

    }

   

    /**

    * Updates the blocks bounds based on its current state. Args: world, x, y, z

    */

    public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)

    {

        int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);

       

        switch(l){

    case 0:

    this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F);

    break;

    case 1:

    this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);

    break;

    case 2:

    this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);

    break;

    case 3:

    this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);

    break;

    case 4:

    this.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);

    break;

    case 5:

    this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);

    break;

        }

 

    }

   

    /**

    * gets the way this piston should face for that entity that placed it.

    */

    public static int determineOrientation(World par0World, int par1, int par2, int par3, EntityLivingBase par4EntityLivingBase)

    {

        if (MathHelper.abs((float)par4EntityLivingBase.posX - (float)par1) < 2.0F && MathHelper.abs((float)par4EntityLivingBase.posZ - (float)par3) < 2.0F)

        {

            double d0 = par4EntityLivingBase.posY + 1.82D - (double)par4EntityLivingBase.yOffset;

 

            if (d0 - (double)par2 > 2.0D)

            {

                return 1;

            }

 

            if ((double)par2 - d0 > 0.0D)

            {

                return 0;

            }

        }

 

        int l = MathHelper.floor_double((double)(par4EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

        return l == 0 ? 2 : (l == 1 ? 5 : (l == 2 ? 3 : (l == 3 ? 4 : 0)));

    }

 

 

   

public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i,

int j, int k, int l) {

return false;

}

 

public boolean isOpaqueCube() {

return false;

}

 

@Override

public TileEntity createNewTileEntity(World world) {

return new SlabTileEntity();

}

 

 

 

 

SlabTileEntity

 

public SlabTileEntity setBlockTypeAndMeta(Block block, int meta) {

this.blockType = block;

this.blockMetadata = meta;

return this;

}

 

 

Link to comment
Share on other sites

I've run into this, and every time I have it's a pain in the ass to fix.

 

I'll try and find the solution...

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Ah here we are.  You need to override getCollisionBoundingBoxFromPool.

You'll have to work out what bounding box you need, but the syntax looks like this:

 

	public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
	return AxisAlignedBB.getAABBPool(xmin, ymin, zmin, xmax, ymax, zmax);
    }

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Ah here we are.  You need to override getCollisionBoundingBoxFromPool.

You'll have to work out what bounding box you need, but the syntax looks like this:

 

	public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
	return AxisAlignedBB.getAABBPool(xmin, ymin, zmin, xmax, ymax, zmax);
    }

 

So I tried like this:

 

    @Override
    public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
    	int l = par1World.getBlockMetadata(par2, par3, par4);
        switch(l){
    	case 0:
    		return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.5, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1);
    	case 1:
    		return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.0, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 0.5, (double)par4 + 1);
    	case 2:
    		return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.0, (double)par4 + 0.5, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1);
    	case 3:
    		return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.0, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 0.5);
    	case 4:
    		return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.5, (double)par3+0.0, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1);
    	case 5:
    		return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.5, (double)par4 + 0.0, (double)par2 + 0.5, (double)par3 + 1, (double)par4 + 1);
        default:
        	System.err.println("Something went wrong. Invalid metadata.");
        	return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.5, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1);
        }
    }

 

and it's the same :S I also tried with different values but or it's the same, or it's almost like a normal block.

 

EDIT: Fixed, I forgot the method

/**
     * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
     */
    public boolean renderAsNormalBlock()
    {
        return false;
    }

 

:facepalm:

Link to comment
Share on other sites

This is a really old block (like 1.5 or before) but I had the same problem and solved it.

 

I thought that was it, but see if this helps you at all.

 

package draco18s.micromods.peephole;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class BlockPeepHole extends Block {

public BlockPeepHole(int par1, int par2, Material par3Material) {
	super(par1, par2, par3Material);
	this.setBlockName("Peephole");
	setHardness(1.0F);
	setResistance(5.0F);
	setStepSound(soundStoneFootstep);
	setCreativeTab(CreativeTabs.tabBlock);
	setLightOpacity(0);
}

public String getTextureFile() {
	return CommonProxy.BLOCKS_PNG;
}

public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
	int var6 = world.getBlockMetadata(x, y, z);
	switch(var6) {
		case 1:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
			break;
		case 2:
			this.setBlockBounds(0.0F, 0.0F, 0.9375F, 1.0F, 1.0F, 1.0F);
			break;
		case 3:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.0625F);
			break;
		case 4:
			this.setBlockBounds(0.9375F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
			break;
		case 5:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0625F, 1.0F, 1.0F);
			break;
		case 6:
			this.setBlockBounds(0.0F, 0.9375F, 0.0F, 1.0F, 1.0F, 1.0F);
			break;
		case 0:
		case 7:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
			break;
	}
}

public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
	return null;
    }

public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
        super.onBlockAdded(par1World, par2, par3, par4);
        this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
        this.setDefaultDirection(par1World, par2, par3, par4);
        this.onNeighborBlockChange(par1World, par2, par3, par4, this.blockID);
    }

private void setDefaultDirection(World par1World, int par2, int par3, int par4)
    {
        if (!par1World.isRemote)
        {
            int var5 = par1World.getBlockId(par2, par3, par4 - 1);
            int var6 = par1World.getBlockId(par2, par3, par4 + 1);
            int var7 = par1World.getBlockId(par2 - 1, par3, par4);
            int var8 = par1World.getBlockId(par2 + 1, par3, par4);
            int var10 = par1World.getBlockId(par2, par3-1, par4);
            int var11 = par1World.getBlockId(par2, par3+1, par4);
            byte var9 = 7;

            if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6])
            {
                var9 = 3;
            }

            if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5])
            {
                var9 = 2;
            }

            if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8])
            {
                var9 = 5;
            }

            if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7])
            {
                var9 = 4;
            }

            if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11])
            {
                var9 = 1;
            }

            if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10])
            {
                var9 = 6;
            }

            int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0);
            
            if(var99 > 1)
            {
            	par1World.setBlockMetadataWithNotify(par2, par3, par4, 7);
        	}
            else {
            	par1World.setBlockMetadataWithNotify(par2, par3, par4, var9);
            }
        }
    }

public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    {
        int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
        if(var6 == 0 || var6 == 7) {
        	return this.blockIndexInTexture+1;
        }
        else if(var6 == 6) {
        	var6 = 0;
        }
        return par5 != var6 ? this.blockIndexInTexture+1:this.blockIndexInTexture;
    }

public boolean isOpaqueCube()
    {
        return true;
    }

    public boolean renderAsNormalBlock()
    {
        return false;
    }
    
    public void setBlockBoundsForItemRender()
    {
    	this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5F);
    }
    
    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        //int var6 = par1World.getBlockMetadata(par2, par3, par4);
        boolean var7 = canPlaceBlockAt(par1World, par2, par3, par4);

        if (!var7)
        {
            this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0);
            par1World.setBlockWithNotify(par2, par3, par4, 0);
        }

        super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
    }
    
    public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
    {
    	int var5 = par1World.getBlockId(par2, par3, par4 - 1);
        int var6 = par1World.getBlockId(par2, par3, par4 + 1);
        int var7 = par1World.getBlockId(par2 - 1, par3, par4);
        int var8 = par1World.getBlockId(par2 + 1, par3, par4);
        int var10 = par1World.getBlockId(par2, par3-1, par4);
        int var11 = par1World.getBlockId(par2, par3+1, par4);
        
        /*if (var5 == blockID || var6 == blockID || var7 == blockID || var8 == blockID || var10 == blockID || var11 == blockID)
        {
        	return false;
        }*/
        
        byte var9 = 7;

        if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6])
        {
            var9 = 3;
        }

        if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5])
        {
            var9 = 2;
        }

        if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8])
        {
            var9 = 5;
        }

        if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7])
        {
            var9 = 4;
        }

        if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11])
        {
            var9 = 1;
        }

        if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10])
        {
            var9 = 6;
        }

        if (var9 == 7)
        {
        	return false;
        }
        
        int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0);
        
        if (var99 != 1)
        {
        	return false;
        }
        
        return true;
    }
}

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

This is a really old block (like 1.5 or before) but I had the same problem and solved it.

 

I thought that was it, but see if this helps you at all.

 

package draco18s.micromods.peephole;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

public class BlockPeepHole extends Block {

public BlockPeepHole(int par1, int par2, Material par3Material) {
	super(par1, par2, par3Material);
	this.setBlockName("Peephole");
	setHardness(1.0F);
	setResistance(5.0F);
	setStepSound(soundStoneFootstep);
	setCreativeTab(CreativeTabs.tabBlock);
	setLightOpacity(0);
}

public String getTextureFile() {
	return CommonProxy.BLOCKS_PNG;
}

public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
	int var6 = world.getBlockMetadata(x, y, z);
	switch(var6) {
		case 1:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
			break;
		case 2:
			this.setBlockBounds(0.0F, 0.0F, 0.9375F, 1.0F, 1.0F, 1.0F);
			break;
		case 3:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.0625F);
			break;
		case 4:
			this.setBlockBounds(0.9375F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
			break;
		case 5:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0625F, 1.0F, 1.0F);
			break;
		case 6:
			this.setBlockBounds(0.0F, 0.9375F, 0.0F, 1.0F, 1.0F, 1.0F);
			break;
		case 0:
		case 7:
			this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
			break;
	}
}

public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
    {
	return null;
    }

public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
        super.onBlockAdded(par1World, par2, par3, par4);
        this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
        this.setDefaultDirection(par1World, par2, par3, par4);
        this.onNeighborBlockChange(par1World, par2, par3, par4, this.blockID);
    }

private void setDefaultDirection(World par1World, int par2, int par3, int par4)
    {
        if (!par1World.isRemote)
        {
            int var5 = par1World.getBlockId(par2, par3, par4 - 1);
            int var6 = par1World.getBlockId(par2, par3, par4 + 1);
            int var7 = par1World.getBlockId(par2 - 1, par3, par4);
            int var8 = par1World.getBlockId(par2 + 1, par3, par4);
            int var10 = par1World.getBlockId(par2, par3-1, par4);
            int var11 = par1World.getBlockId(par2, par3+1, par4);
            byte var9 = 7;

            if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6])
            {
                var9 = 3;
            }

            if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5])
            {
                var9 = 2;
            }

            if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8])
            {
                var9 = 5;
            }

            if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7])
            {
                var9 = 4;
            }

            if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11])
            {
                var9 = 1;
            }

            if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10])
            {
                var9 = 6;
            }

            int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0);
            
            if(var99 > 1)
            {
            	par1World.setBlockMetadataWithNotify(par2, par3, par4, 7);
        	}
            else {
            	par1World.setBlockMetadataWithNotify(par2, par3, par4, var9);
            }
        }
    }

public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
    {
        int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
        if(var6 == 0 || var6 == 7) {
        	return this.blockIndexInTexture+1;
        }
        else if(var6 == 6) {
        	var6 = 0;
        }
        return par5 != var6 ? this.blockIndexInTexture+1:this.blockIndexInTexture;
    }

public boolean isOpaqueCube()
    {
        return true;
    }

    public boolean renderAsNormalBlock()
    {
        return false;
    }
    
    public void setBlockBoundsForItemRender()
    {
    	this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5F);
    }
    
    public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
    {
        //int var6 = par1World.getBlockMetadata(par2, par3, par4);
        boolean var7 = canPlaceBlockAt(par1World, par2, par3, par4);

        if (!var7)
        {
            this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0);
            par1World.setBlockWithNotify(par2, par3, par4, 0);
        }

        super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
    }
    
    public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
    {
    	int var5 = par1World.getBlockId(par2, par3, par4 - 1);
        int var6 = par1World.getBlockId(par2, par3, par4 + 1);
        int var7 = par1World.getBlockId(par2 - 1, par3, par4);
        int var8 = par1World.getBlockId(par2 + 1, par3, par4);
        int var10 = par1World.getBlockId(par2, par3-1, par4);
        int var11 = par1World.getBlockId(par2, par3+1, par4);
        
        /*if (var5 == blockID || var6 == blockID || var7 == blockID || var8 == blockID || var10 == blockID || var11 == blockID)
        {
        	return false;
        }*/
        
        byte var9 = 7;

        if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6])
        {
            var9 = 3;
        }

        if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5])
        {
            var9 = 2;
        }

        if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8])
        {
            var9 = 5;
        }

        if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7])
        {
            var9 = 4;
        }

        if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11])
        {
            var9 = 1;
        }

        if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10])
        {
            var9 = 6;
        }

        if (var9 == 7)
        {
        	return false;
        }
        
        int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0);
        
        if (var99 != 1)
        {
        	return false;
        }
        
        return true;
    }
}

 

I forgot to override the method renderAsNormalBlock() so the tile entity had a normal block "size". Thanks anyway ;)

Link to comment
Share on other sites

I forgot to override the method renderAsNormalBlock() so the tile entity had a normal block "size". Thanks anyway ;)

 

That would do it!

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.



×
×
  • Create New...

Important Information

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