-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockSnow.java
More file actions
110 lines (96 loc) · 3.13 KB
/
BlockSnow.java
File metadata and controls
110 lines (96 loc) · 3.13 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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 BlockSnow extends Block
{
protected BlockSnow(int i, int j)
{
super(i, j, Material.snow);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
setTickOnLoad(true);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean canPlaceBlockAt(World world, int i, int j, int k)
{
int l = world.getBlockId(i, j - 1, k);
if(l == 0 || !Block.blocksList[l].isOpaqueCube())
{
return false;
} else
{
return world.getBlockMaterial(i, j - 1, k).getIsSolid();
}
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
func_314_h(world, i, j, k);
}
private boolean func_314_h(World world, int i, int j, int k)
{
if(!canPlaceBlockAt(world, i, j, k))
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
return false;
} else
{
return true;
}
}
public void harvestBlock(World world, int i, int j, int k, int l)
{
int i1 = Item.snowball.shiftedIndex;
float f = 0.7F;
double d = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(world, (double)i + d, (double)j + d1, (double)k + d2, new ItemStack(i1, 1, 0));
entityitem.delayBeforeCanPickup = 10;
world.entityJoinedWorld(entityitem);
world.setBlockWithNotify(i, j, k, 0);
}
public int idDropped(int i, Random random)
{
return Item.snowball.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 0;
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.getSavedLightValue(EnumSkyBlock.Block, i, j, k) > 11)
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
}
}
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
Material material = iblockaccess.getBlockMaterial(i, j, k);
if(l == 1)
{
return true;
}
if(material == blockMaterial)
{
return false;
} else
{
return super.shouldSideBeRendered(iblockaccess, i, j, k, l);
}
}
}