mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 05:02:37 +00:00
1.7.10 Files
Files added
This commit is contained in:
1 parent
393ea9b463
commit
a31efb2dc3
1768 files changed
+84831
No files matched your search
@@ -0,0 +1,42 @@
|
||||
package noppes.npcs.items;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomItems;
|
||||
|
||||
public class ItemMusic extends ItemNpcInterface{
|
||||
|
||||
private boolean shouldRotate = false;
|
||||
|
||||
public ItemMusic() {
|
||||
setCreativeTab(CustomItems.tabMisc);
|
||||
}
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player)
|
||||
{
|
||||
if(par2World.isRemote)
|
||||
return par1ItemStack;
|
||||
|
||||
int note = par2World.rand.nextInt(24);
|
||||
float var7 = (float)Math.pow(2.0D, (double)(note - 12) / 12.0D);
|
||||
|
||||
String var8 = "harp";
|
||||
|
||||
par2World.playSoundEffect(player.posX, player.posY, player.posZ, "note." + var8, 3.0F, var7);
|
||||
par2World.spawnParticle("note", player.posY, player.posY + 1.2D, player.posY, (double)note / 24.0D, 0.0D, 0.0D);
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public Item setRotated(){
|
||||
shouldRotate = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean shouldRotateAroundWhenRendering()
|
||||
{
|
||||
return shouldRotate;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user