package com.lothrazar.cyclicmagic.block;

import com.lothrazar.cyclicmagic.util.UtilEntity;

import net.minecraft.block.BlockBasePressurePlate;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.util.SoundEvent;

public class BlockLaunch extends BlockBasePressurePlate {

	private final static float angle = 90;
	private float power;
	private SoundEvent sound;
	public BlockLaunch(float p, SoundEvent s) {
		super(Material.WOOD);
		power = p;
		sound = s;
	}

	@Override
	protected void playClickOnSound(World worldIn, BlockPos pos) {

		//SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_ON
		worldIn.playSound((EntityPlayer) null, pos, this.sound, SoundCategory.BLOCKS,0.3F, 0.5F);

	}

	@Override
	protected void playClickOffSound(World worldIn, BlockPos pos) {

//		worldIn.playSound((EntityPlayer) null, pos, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS,0.3F, 0.5F);

	}

	@Override
	protected int computeRedstoneStrength(World worldIn, BlockPos pos) {
		return 0;
	}

	@Override
	protected int getRedstoneStrength(IBlockState state) {
		return 0;
	}

	@Override
	protected IBlockState setRedstoneStrength(IBlockState state, int strength) {
		return null;
	}


	@Override
	public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entity) {

		if (entity instanceof EntityLivingBase){
			UtilEntity.launch((EntityLivingBase) entity, angle, power);
			
			this.playClickOnSound(worldIn, pos);
		}
	}

}

@@ -34,17 +34,16 @@
 .block;%0A
-%0A
 import c
@@ -84,17 +84,16 @@
 Entity;%0A
-%0A
 import n
@@ -131,24 +131,108 @@
 ssurePlate;%0A
+import net.minecraft.block.SoundType;%0Aimport net.minecraft.block.material.MapColor;%0A
 import net.m
@@ -655,17 +655,16 @@
 Plate %7B%0A
-%0A
 %09private
@@ -683,21 +683,21 @@
 c float 
-angle
+ANGLE
  = 90;%0A%09
@@ -806,20 +806,94 @@
 aterial.
-WOOD
+CLAY, MapColor.GRASS);//same as BlockSlime%0A%09%09this.setSoundType(SoundType.SLIME
 );%0A%09%09pow
@@ -912,25 +912,24 @@
 und = s;%0A%09%7D%0A
-%0A
 %09@Override%0A%09
@@ -994,56 +994,8 @@
 s) %7B
-%0A%0A%09%09//SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_ON
 %0A%09%09w
@@ -1062,32 +1062,33 @@
 Category.BLOCKS,
+ 
 0.3F, 0.5F);%0A%0A%09%7D
@@ -1076,37 +1076,35 @@
 S, 0.3F, 0.5F);%0A
-%0A
 %09%7D%0A
-%0A
 %09@Override%0A%09prot
@@ -1167,142 +1167,11 @@
 ) %7B%0A
-%0A//%09%09worldIn.playSound((EntityPlayer) null, pos, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_OFF, SoundCategory.BLOCKS,0.3F, 0.5F);%0A%0A
 %09%7D%0A
-%0A
 %09@Ov
@@ -1254,33 +1254,32 @@
 %0A%09%09return 0;%0A%09%7D%0A
-%0A
 %09@Override%0A%09prot
@@ -1344,17 +1344,16 @@
 n 0;%0A%09%7D%0A
-%0A
 %09@Overri
@@ -1451,18 +1451,16 @@
 ull;%0A%09%7D%0A
-%0A%0A
 %09@Overri
@@ -1566,17 +1566,16 @@
 tity) %7B%0A
-%0A
 %09%09if (en
@@ -1607,16 +1607,17 @@
 ingBase)
+ 
 %7B%0A%09%09%09Uti
@@ -1662,13 +1662,13 @@
 ty, 
-angle
+ANGLE
 , po
@@ -1677,12 +1677,8 @@
 r);%0A
-%09%09%09%0A
 %09%09%09t
@@ -1721,10 +1721,9 @@
 %09%09%7D%0A
+
 %09%7D%0A
-%0A
 %7D%0A

update slime pad sounds and mapcolor to match block