-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockNote.java
More file actions
92 lines (83 loc) · 2.66 KB
/
BlockNote.java
File metadata and controls
92 lines (83 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package net.minecraft.src;
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
public class BlockNote extends BlockContainer
{
public BlockNote(int i)
{
super(i, 74, Material.wood);
}
public int getBlockTextureFromSide(int i)
{
return blockIndexInTexture;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
if(l > 0 && Block.blocksList[l].canProvidePower())
{
boolean flag = world.isBlockGettingPowered(i, j, k);
TileEntityNote tileentitynote = (TileEntityNote)world.getBlockTileEntity(i, j, k);
if(tileentitynote.previousRedstoneState != flag)
{
if(flag)
{
tileentitynote.triggerNote(world, i, j, k);
}
tileentitynote.previousRedstoneState = flag;
}
}
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(world.multiplayerWorld)
{
return true;
} else
{
TileEntityNote tileentitynote = (TileEntityNote)world.getBlockTileEntity(i, j, k);
tileentitynote.changePitch();
tileentitynote.triggerNote(world, i, j, k);
return true;
}
}
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(world.multiplayerWorld)
{
return;
} else
{
TileEntityNote tileentitynote = (TileEntityNote)world.getBlockTileEntity(i, j, k);
tileentitynote.triggerNote(world, i, j, k);
return;
}
}
protected TileEntity getBlockEntity()
{
return new TileEntityNote();
}
public void playBlock(World world, int i, int j, int k, int l, int i1)
{
float f = (float)Math.pow(2D, (double)(i1 - 12) / 12D);
String s = "harp";
if(l == 1)
{
s = "bd";
}
if(l == 2)
{
s = "snare";
}
if(l == 3)
{
s = "hat";
}
if(l == 4)
{
s = "bassattack";
}
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, (new StringBuilder()).append("note.").append(s).toString(), 3F, f);
world.spawnParticle("note", (double)i + 0.5D, (double)j + 1.2D, (double)k + 0.5D, (double)i1 / 24D, 0.0D, 0.0D);
}
}