Files
TinkersConstruct/src/main/java/tconstruct/blocks/SpeedSlab.java
T

69 lines
1.7 KiB
Java
Raw Normal View History

package tconstruct.blocks;
import java.util.List;
import net.minecraft.block.material.Material;
2013-12-31 11:26:08 -05:00
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
2014-01-19 19:43:10 +11:00
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
2013-12-31 11:26:08 -05:00
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
2014-01-19 19:43:10 +11:00
import tconstruct.common.TRepo;
import tconstruct.library.TConstructRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SpeedSlab extends SlabBase
{
2013-12-31 11:26:08 -05:00
public SpeedSlab()
{
2014-01-19 19:43:10 +11:00
super(Material.field_151576_e);
2014-01-15 23:19:27 -05:00
this.func_149647_a(TConstructRegistry.blockTab);
func_149711_c(3F);
}
2013-08-31 05:13:31 -07:00
@Override
@SideOnly(Side.CLIENT)
2014-01-18 02:52:49 -05:00
public void func_149651_a (IIconRegister iconRegister)
{
}
@Override
@SideOnly(Side.CLIENT)
2014-01-19 19:43:10 +11:00
public IIcon func_149691_a (int side, int meta)
{
meta = meta % 8;
2014-01-19 19:43:10 +11:00
return TRepo.speedBlock.func_149691_a(side, meta);
}
@Override
2014-01-19 19:43:10 +11:00
public void func_149666_a (Item b, CreativeTabs tab, List list)
{
for (int iter = 0; iter < 7; iter++)
{
2013-12-31 11:26:08 -05:00
list.add(new ItemStack(b, 1, iter));
}
}
2013-08-31 05:13:31 -07:00
@Override
2014-01-19 19:43:10 +11:00
public void func_149724_b (World world, int x, int y, int z, Entity entity)
{
double boost = 2.2D;
int metadata = world.getBlockMetadata(x, y, z) % 8;
if (metadata == 1 || metadata == 4)
boost = 2.7D;
double mX = Math.abs(entity.motionX);
double mZ = Math.abs(entity.motionZ);
if (mX < 0.5D)
{
entity.motionX *= boost;
}
if (mZ < 0.5D)
{
entity.motionZ *= boost;
}
}
}