Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package BlocksPers;
- import fr.shyfe.dcedo.proxy.ClientProxy;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.item.ItemStack;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.util.MathHelper;
- import net.minecraft.world.World;
- public class flagSpawn extends Block {
- public flagSpawn(Material material) {
- super(material);
- }
- @Override
- public TileEntity createTileEntity(World world, int metadata)
- {
- return new TileEntityFlagSpawn();
- }
- @Override
- public boolean hasTileEntity(int metadata)
- {
- return true;
- }
- public boolean isOpaqueCube()
- {
- return false;
- }
- public boolean renderAsNormalBlock()
- {
- return false;
- }
- public int getRenderType()
- {
- return ClientProxy.tesrRenderId;
- }
- public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
- {
- if(stack.getItemDamage() == 0)
- {
- TileEntity tile = world.getTileEntity(x, y, z);
- if(tile instanceof TileEntityFlagSpawn)
- {
- int direction = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
- ((TileEntityFlagSpawn)tile).setDirection((byte)direction);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement