forked from dfu/MineColony
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlockChanger.java
76 lines (68 loc) · 1.85 KB
/
BlockChanger.java
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
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
import java.util.Random;
public class BlockChanger extends BlockContainer
{
protected BlockChanger(int blockID)
{
super(blockID, Material.wood);
blockIndexInTexture = 26;
}
public int getBlockTextureFromSide(int i)
{
if(i == 1)
{
return blockIndexInTexture - 1;
}
if(i == 0)
{
return blockIndexInTexture - 1;
}
if(i == 3)
{
return blockIndexInTexture + 1;
} else
{
return blockIndexInTexture;
}
}
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(world.multiplayerWorld)
{
return true;
} else
{
TileEntityChanger tileentitychanger = (TileEntityChanger)world.getBlockTileEntity(i, j, k);
ModLoader.OpenModGUI(entityplayer, tileentitychanger);
return true;
}
}
protected TileEntity getBlockEntity()
{
return new TileEntityChanger();
//return null;
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
if(l == 0)
{
world.setBlockMetadataWithNotify(i, j, k, 2);
}
if(l == 1)
{
world.setBlockMetadataWithNotify(i, j, k, 5);
}
if(l == 2)
{
world.setBlockMetadataWithNotify(i, j, k, 3);
}
if(l == 3)
{
world.setBlockMetadataWithNotify(i, j, k, 4);
}
}
}