Skip to content

Commit

Permalink
fixed most of the clientside rendering code
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Jan 16, 2014
1 parent 8931171 commit fa7a77a
Show file tree
Hide file tree
Showing 68 changed files with 268 additions and 254 deletions.
23 changes: 12 additions & 11 deletions src/main/java/tconstruct/blocks/BlockLandmine.java
Expand Up @@ -5,6 +5,7 @@
import java.util.Random;

import mantle.blocks.BlockUtils;
import mantle.world.WorldHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
Expand Down Expand Up @@ -50,7 +51,7 @@ public BlockLandmine()
{
super(Material.tnt);
this.setTickRandomly(true);
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F);
this.func_149676_a(0.0625F, 0.0F, 0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F);
}

@Override
Expand Down Expand Up @@ -100,7 +101,7 @@ public boolean isOpaqueCube ()
}

@Override
public boolean renderAsNormalBlock ()
public boolean func_149686_d ()
{
return false;
}
Expand Down Expand Up @@ -379,7 +380,7 @@ public void checkPlacement (World par1World, int par2, int par3, int par4, int p
if (flag)
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
WorldHelper.setBlockToAir(par1World, par2, par3, par4);
}
}
}
Expand All @@ -389,7 +390,7 @@ private boolean checkIfAttachedToBlock (World par1World, int par2, int par3, int
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
{
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockToAir(par2, par3, par4);
WorldHelper.setBlockToAir(par1World, par2, par3, par4);
return false;
}
else
Expand Down Expand Up @@ -623,7 +624,7 @@ public boolean canDropFromExplosion (Explosion par1Explosion)

@SuppressWarnings("incomplete-switch")
@Override
public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
public void func_149719_a (IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int l = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
int i1 = l & 7;
Expand All @@ -633,22 +634,22 @@ public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int par2,
switch (dir)
{
case DOWN:
this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F);
this.func_149676_a(0.0625F, 0.0F, 0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F);
break;
case UP:
this.setBlockBounds(0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F, 1.0F - 0.0625F);
this.func_149676_a(0.0625F, 1.0F - 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F, 1.0F - 0.0625F);
break;
case NORTH:
this.setBlockBounds(0.0625F, 0.0625F, 0.0F, 1.0F - 0.0625F, 1.0F - 0.0625F, 0.0625F);
this.func_149676_a(0.0625F, 0.0625F, 0.0F, 1.0F - 0.0625F, 1.0F - 0.0625F, 0.0625F);
break;
case SOUTH:
this.setBlockBounds(0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F);
this.func_149676_a(0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F, 1.0F);
break;
case EAST:
this.setBlockBounds(1.0F - 0.0625F, 0.0625F, 0.0625F, 1.0F, 1.0F - 0.0625F, 1.0F - 0.0625F);
this.func_149676_a(1.0F - 0.0625F, 0.0625F, 0.0625F, 1.0F, 1.0F - 0.0625F, 1.0F - 0.0625F);
break;
case WEST:
this.setBlockBounds(0.0F, 0.0625F, 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F);
this.func_149676_a(0.0F, 0.0625F, 0.0625F, 0.0625F, 1.0F - 0.0625F, 1.0F - 0.0625F);
break;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/tconstruct/blocks/CastingChannelBlock.java
Expand Up @@ -24,10 +24,10 @@ public class CastingChannelBlock extends BlockContainer
public CastingChannelBlock(int par1)
{
super(par1, Material.rock);
this.setHardness(1F);
this.func_149711_c(1F);
this.func_149752_b(10);
this.setStepSound(soundStoneFootstep);
setCreativeTab(TConstructRegistry.blockTab);
func_149647_a(TConstructRegistry.blockTab);
}

@Override
Expand Down Expand Up @@ -56,7 +56,7 @@ public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer
}

@Override
public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z)
public void func_149719_a (IBlockAccess world, int x, int y, int z)
{
CastingChannelLogic tile = (CastingChannelLogic) world.func_147438_o(x, y, z);
float minX = 0.3125F;
Expand All @@ -72,11 +72,11 @@ public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z)
if (tile.hasTankConnected(ForgeDirection.EAST))
maxX = 1F;

this.setBlockBounds(minX, 0.375F, minZ, maxX, 0.625F, maxZ);
this.func_149676_a(minX, 0.375F, minZ, maxX, 0.625F, maxZ);
}

@Override
public boolean renderAsNormalBlock ()
public boolean func_149686_d ()
{
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/blocks/ConveyorBase.java
Expand Up @@ -25,8 +25,8 @@ public class ConveyorBase extends MantleBlock
public ConveyorBase(Material material, String name)
{
super(material);
this.setCreativeTab(TConstructRegistry.blockTab);
setBlockBounds(0f, 0f, 0f, 1f, 0.5f, 1f);
this.func_149647_a(TConstructRegistry.blockTab);
func_149676_a(0f, 0f, 0f, 1f, 0.5f, 1f);
texturename = name;
}

Expand Down Expand Up @@ -112,7 +112,7 @@ public boolean func_149646_a (IBlockAccess world, int x, int y, int z, int side

/* Rendering */
@Override
public boolean renderAsNormalBlock ()
public boolean func_149686_d ()
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/CraftingSlab.java
Expand Up @@ -30,7 +30,7 @@ public class CraftingSlab extends InventorySlab
public CraftingSlab(Material material)
{
super(material);
this.setCreativeTab(TConstructRegistry.blockTab);
this.func_149647_a(TConstructRegistry.blockTab);
this.func_149711_c(2f);
this.setStepSound(Block.soundWoodFootstep);
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/CraftingStationBlock.java
Expand Up @@ -23,7 +23,7 @@ public class CraftingStationBlock extends InventoryBlock
public CraftingStationBlock(Material material)
{
super(material);
this.setCreativeTab(TConstructRegistry.blockTab);
this.func_149647_a(TConstructRegistry.blockTab);
this.func_149711_c(2f);
this.setStepSound(Block.soundWoodFootstep);
}
Expand Down Expand Up @@ -56,7 +56,7 @@ public int getTextureIndex (int side)
}

@Override
public boolean renderAsNormalBlock ()
public boolean func_149686_d ()
{
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/DryingRack.java
Expand Up @@ -28,7 +28,7 @@ public class DryingRack extends InventoryBlock
public DryingRack()
{
super(Material.field_151575_d);
this.setCreativeTab(TConstructRegistry.blockTab);
this.func_149647_a(TConstructRegistry.blockTab);
func_149711_c(2.0f);
setStepSound(soundMetalFootstep);
}
Expand Down Expand Up @@ -197,7 +197,7 @@ public void setBlockBoundsBasedOnState (IBlockAccess world, int x, int y, int z)
yMin = 0.75F;
break;
}
this.setBlockBounds(xMin, yMin, zMin, xMax, yMax, zMax);
this.func_149676_a(xMin, yMin, zMin, xMax, yMax, zMax);
}

public void addCollisionBoxesToList (World world, int x, int y, int z, AxisAlignedBB aabb, List list, Entity entity)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/EquipBlock.java
Expand Up @@ -30,7 +30,7 @@ public EquipBlock(Material material)
{
super(material);
this.func_149711_c(0.3f);
this.setBlockBounds(0, 0, 0, 1, 0.25f, 1);
this.func_149676_a(0, 0, 0, 1, 0.25f, 1);
//this.setCreativeTab(ToolConstruct.materialTab);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/GlassBlockConnected.java
Expand Up @@ -29,7 +29,7 @@ public GlassBlockConnected(String location, boolean hasAlpha)
folder = location;
renderPass = hasAlpha ? 1 : 0;
func_149711_c(0.3F);
this.setCreativeTab(TConstructRegistry.blockTab);
this.func_149647_a(TConstructRegistry.blockTab);
}

//For FMP support
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/GlassPane.java
Expand Up @@ -13,6 +13,6 @@ public GlassPane()
this.func_149711_c(0.3F);
this.setStepSound(soundGlassFootstep);
this.func_149663_c("tconstruct.glasspane");
this.setCreativeTab(TConstructRegistry.blockTab);
this.func_149647_a(TConstructRegistry.blockTab);
}
}
18 changes: 9 additions & 9 deletions src/main/java/tconstruct/blocks/GlassPaneConnected.java
Expand Up @@ -572,49 +572,49 @@ public void addCollisionBoxesToList (World par1World, int par2, int par3, int pa
{
if (flag2 && !flag3)
{
this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F);
this.func_149676_a(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F);
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
else if (!flag2 && flag3)
{
this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
this.func_149676_a(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
this.func_149676_a(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F);
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}

if ((!flag || !flag1) && (flag2 || flag3 || flag || flag1))
{
if (flag && !flag1)
{
this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F);
this.func_149676_a(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F);
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
else if (!flag && flag1)
{
this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F);
this.func_149676_a(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F);
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
}
else
{
this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F);
this.func_149676_a(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F);
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
}

@Override
public void setBlockBoundsForItemRender ()
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.func_149676_a(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}

@Override
public void setBlockBoundsBasedOnState (IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
public void func_149719_a (IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
float f = 0.4375F;
float f1 = 0.5625F;
Expand Down Expand Up @@ -659,7 +659,7 @@ else if (!flag && flag1)
f3 = 1.0F;
}

this.setBlockBounds(f, 0.0F, f2, f1, 1.0F, f3);
this.func_149676_a(f, 0.0F, f2, f1, 1.0F, f3);
}

public IIcon getSideTextureIndex ()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/GlassPaneStained.java
Expand Up @@ -14,7 +14,7 @@ public GlassPaneStained()
this.func_149711_c(0.3F);
this.setStepSound(soundGlassFootstep);
this.func_149663_c("tconstruct.glasspanestained");
this.setCreativeTab(TConstructRegistry.blockTab);
this.func_149647_a(TConstructRegistry.blockTab);
}

private static String[] assembleBlockTextures ()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/blocks/GravelOre.java
Expand Up @@ -21,7 +21,7 @@ public class GravelOre extends BlockSand
public GravelOre()
{
super(Material.craftedSnow);
this.setCreativeTab(TConstructRegistry.blockTab);
this.func_149647_a(TConstructRegistry.blockTab);
this.setStepSound(soundGravelFootstep);
}

Expand Down
7 changes: 4 additions & 3 deletions src/main/java/tconstruct/blocks/LavaTankBlock.java
Expand Up @@ -25,6 +25,7 @@
import tconstruct.client.block.TankRender;
import tconstruct.library.TConstructRegistry;
import mantle.blocks.iface.IServantLogic;
import mantle.world.WorldHelper;

public class LavaTankBlock extends BlockContainer
{
Expand All @@ -36,7 +37,7 @@ public LavaTankBlock()
super(Material.rock);
func_149711_c(3F);
func_149752_b(20F);
setCreativeTab(TConstructRegistry.blockTab);
func_149647_a(TConstructRegistry.blockTab);
func_149663_c("TConstruct.LavaTank");
setStepSound(Block.soundGlassFootstep);
}
Expand Down Expand Up @@ -273,13 +274,13 @@ public boolean removeBlockByPlayer (World world, EntityPlayer player, int x, int
NBTTagCompound tag = new NBTTagCompound();
NBTTagCompound liquidTag = new NBTTagCompound();
liquid.writeToNBT(liquidTag);
tag.setCompoundTag("Fluid", liquidTag);
tag.setTag("Fluid", liquidTag);
stack.setTagCompound(tag);
}
if (!player.capabilities.isCreativeMode || player.isSneaking())
dropTankBlock(world, x, y, z, stack);

return world.setBlockToAir(x, y, z);
return WorldHelper.setBlockToAirBool(world, x, y, z);
}

protected void dropTankBlock (World world, int x, int y, int z, ItemStack stack)
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/tconstruct/blocks/OreberryBush.java
Expand Up @@ -142,7 +142,7 @@ else if (l < 8)
}

@Override
public void setBlockBoundsBasedOnState (IBlockAccess iblockaccess, int x, int y, int z)
public void func_149719_a (IBlockAccess iblockaccess, int x, int y, int z)
{
int md = iblockaccess.getBlockMetadata(x, y, z);

Expand Down Expand Up @@ -174,7 +174,7 @@ public void setBlockBoundsBasedOnState (IBlockAccess iblockaccess, int x, int y,
maxX = maxZ = 1.0F;
maxY = 1.0F;
}
setBlockBounds(minX, minY, minZ, maxX, maxY, maxZ);
func_149676_a(minX, minY, minZ, maxX, maxY, maxZ);
}

/* Left-click harvests berries */
Expand All @@ -186,7 +186,7 @@ public void onBlockClicked (World world, int x, int y, int z, EntityPlayer playe
int meta = world.getBlockMetadata(x, y, z);
if (meta >= 12)
{
world.setBlock(x, y, z, this, meta - 4, 3);
world.func_147465_d(x, y, z, this, meta - 4, 3);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.oreBerries, 1, meta % 4 + itemMeat));
}
}
Expand All @@ -205,7 +205,7 @@ public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer
if (world.isRemote)
return true;

world.setBlock(x, y, z, this, meta - 4, 3);
world.func_147465_d(x, y, z, this, meta - 4, 3);
AbilityHelper.spawnItemAtPlayer(player, new ItemStack(TRepo.oreBerries, random.nextInt(3) + 1, meta % 4 + itemMeat));
return true;
}
Expand Down Expand Up @@ -266,12 +266,12 @@ public void func_149674_a (World world, int x, int y, int z, Random random1)
int meta = world.getBlockMetadata(x, y, z);
if (meta < 12)
{
world.setBlock(x, y, z, this, meta + 4, 3);
world.func_147465_d(x, y, z, this, meta + 4, 3);
}
}
/*else if (meta < 8)
{
world.setBlock(x, y, z, blockID, meta + 4, 3);
world.func_147465_d(x, y, z, blockID, meta + 4, 3);
}*/
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/blocks/OreberryBushEssence.java
Expand Up @@ -30,12 +30,12 @@ public void func_149674_a (World world, int x, int y, int z, Random random1)
{
if (meta < 12)
{
world.setBlock(x, y, z,(Block) this, meta + 4, 3);
world.func_147465_d(x, y, z,(Block) this, meta + 4, 3);
}
}
/*else if (meta < 8)
{
world.setBlock(x, y, z, blockID, meta + 4, 3);
world.func_147465_d(x, y, z, blockID, meta + 4, 3);
}*/
}
}
Expand Down

0 comments on commit fa7a77a

Please sign in to comment.