Repository navigation
Expand file tree
/
Copy pathDecoBlockIce.java
More file actions
55 lines (45 loc) · 1.54 KB
/
Copy pathDecoBlockIce.java
File metadata and controls
55 lines (45 loc) · 1.54 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
package net.minecraft.src;
import java.util.Random;
public class DecoBlockIce extends BlockIce
{
public DecoBlockIce(int id)
{
super(id);
this.setUnlocalizedName("ice");
this.setHardness(0.5F);
this.setLightOpacity(3);
this.setStepSound(Block.soundGlassFootstep);
ItemPickaxe.SetAllPicksToBeEffectiveVsBlock(this);
}
public void onBlockAdded(World world, int x, int y, int z)
{
if (world.provider.isHellWorld)
{
world.setBlockWithNotify(x, y, z, 0);
world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
for (int i = 0; i < 8; ++i)
{
world.spawnParticle("largesmoke", (double)x + Math.random(), (double)y + Math.random(), (double)z + Math.random(), 0.0D, 0.0D, 0.0D);
}
}
else
checkMelting(world, x, y, z);
}
public void onNeighborBlockChange(World world, int x, int y, int z, int id)
{
world.scheduleBlockUpdate(x, y, z, this.blockID, this.tickRate(world));
}
public void updateTick(World world, int x, int y, int z, Random random)
{
checkMelting(world, x, y, z);
}
private void checkMelting(World world, int x, int y, int z)
{
int aboveBlockID = world.getBlockId(x, y + 1, z);
if (!FCUtilsMisc.IsIKInColdBiome(world, x, z) && (world.canBlockSeeTheSky(x, y + 1, z) || world.getBlockLightValue(x, y, z) > 7) && aboveBlockID != this.blockID)
{
world.setBlockWithNotify(x, y, z, 0);
FCUtilsMisc.PlaceNonPersistantWater(world, x, y, z);
}
}
}