aether-legacy/src/main/java/com/legacy/aether/blocks/BlockIcestone.java

37 lines
998 B
Java
Raw Normal View History

2018-12-07 05:33:43 +01:00
package com.legacy.aether.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
2018-12-07 06:32:48 +01:00
public class BlockIcestone extends Block {
2018-12-07 05:33:43 +01:00
2018-12-07 06:32:48 +01:00
public BlockIcestone() {
2018-12-07 05:33:43 +01:00
super(Material.ice);
this.setHardness(3F);
this.setTickRandomly(true);
this.setStepSound(soundTypeGlass);
this.setHarvestLevel("pickaxe", 1);
this.setBlockTextureName("aether_legacy:icestone");
}
@Override
2018-12-07 06:32:48 +01:00
public void onBlockAdded(World worldIn, int xIn, int yIn, int zIn) {
for (int x = xIn - 3; x <= (xIn + 3); ++x) {
for (int y = yIn - 3; y <= (yIn + 3); ++y) {
for (int z = zIn - 3; z <= (zIn + 3); ++z) {
2018-12-07 05:33:43 +01:00
Block block = worldIn.getBlock(x, y, z);
2018-12-07 06:32:48 +01:00
if (block == Blocks.water || block == Blocks.flowing_water) {
2018-12-07 05:33:43 +01:00
worldIn.setBlock(x, y, z, Blocks.ice);
2018-12-07 06:32:48 +01:00
} else if (block == Blocks.lava || block == Blocks.flowing_lava) {
2018-12-07 05:33:43 +01:00
worldIn.setBlock(x, y, z, Blocks.obsidian);
}
}
}
}
}
}