mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-16 01:54:46 +00:00
81 lines
2.0 KiB
Java
81 lines
2.0 KiB
Java
package com.cricketcraft.chisel.block;
|
|
|
|
import com.cricketcraft.chisel.Configurations;
|
|
import com.cricketcraft.chisel.client.GeneralChiselClient;
|
|
import com.cricketcraft.chisel.client.render.BlockSpikesRenderer;
|
|
import com.cricketcraft.chisel.utils.General;
|
|
|
|
import net.minecraft.block.Block;
|
|
import net.minecraft.block.material.Material;
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.util.AxisAlignedBB;
|
|
import net.minecraft.util.IIcon;
|
|
import net.minecraft.world.World;
|
|
import cpw.mods.fml.common.FMLCommonHandler;
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
public class BlockSpikes extends Block
|
|
{
|
|
public IIcon iconBase;
|
|
public IIcon iconSpike;
|
|
|
|
public BlockSpikes(Material mat)
|
|
{
|
|
super(Material.circuits);
|
|
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 1.0f / 16, 1.0f);
|
|
}
|
|
|
|
@Override
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity)
|
|
{
|
|
if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT)
|
|
return;
|
|
|
|
double dy = entity.posY - entity.prevPosY;
|
|
|
|
GeneralChiselClient.speedupPlayer(world, entity, Configurations.concreteVelocity);
|
|
}
|
|
|
|
@Override
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
|
|
@Override
|
|
public boolean renderAsNormalBlock()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public int getRenderType()
|
|
{
|
|
return BlockSpikesRenderer.id;
|
|
}
|
|
|
|
@Override
|
|
public int damageDropped(int meta)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public void registerBlockIcons(IIconRegister register)
|
|
{
|
|
blockIcon = iconBase = register.registerIcon(General.getName(this) + "base");
|
|
iconSpike = register.registerIcon(General.getName(this) + "spike");
|
|
}
|
|
}
|