-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockPumpkin.java
More file actions
91 lines (82 loc) · 2.19 KB
/
BlockPumpkin.java
File metadata and controls
91 lines (82 loc) · 2.19 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
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 BlockPumpkin extends Block
{
protected BlockPumpkin(int i, int j, boolean flag)
{
super(i, Material.pumpkin);
blockIndexInTexture = j;
setTickOnLoad(true);
blockType = flag;
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if(i == 1)
{
return blockIndexInTexture;
}
if(i == 0)
{
return blockIndexInTexture;
}
int k = blockIndexInTexture + 1 + 16;
if(blockType)
{
k++;
}
if(j == 0 && i == 2)
{
return k;
}
if(j == 1 && i == 5)
{
return k;
}
if(j == 2 && i == 3)
{
return k;
}
if(j == 3 && i == 4)
{
return k;
} else
{
return blockIndexInTexture + 16;
}
}
public int getBlockTextureFromSide(int i)
{
if(i == 1)
{
return blockIndexInTexture;
}
if(i == 0)
{
return blockIndexInTexture;
}
if(i == 3)
{
return blockIndexInTexture + 1 + 16;
} else
{
return blockIndexInTexture + 16;
}
}
public void onBlockAdded(World world, int i, int j, int k)
{
super.onBlockAdded(world, i, j, k);
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
int l = world.getBlockId(i, j, k);
return (l == 0 || Block.blocksList[l].blockMaterial.getIsLiquid()) && world.isBlockOpaqueCube(i, j - 1, k);
}
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;
world.setBlockMetadataWithNotify(i, j, k, l);
}
private boolean blockType;
}