aether-legacy/src/main/java/com/gildedgames/the_aether/blocks/decorative/BlockAetherSlab.java
2023-03-13 19:53:26 +01:00

75 lines
2.3 KiB
Java

package com.gildedgames.the_aether.blocks.decorative;
import java.util.Random;
import com.gildedgames.the_aether.blocks.BlocksAether;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
import net.minecraft.world.World;
public class BlockAetherSlab extends BlockSlab {
private String name;
public BlockAetherSlab(String name, boolean double_slab, Material materialIn) {
super(double_slab, materialIn);
this.name = name;
this.setLightOpacity(0);
this.setStepSound(materialIn == Material.wood ? soundTypeWood : soundTypeStone);
}
@Override
public Item
getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) {
return Item.getItemFromBlock(this.getDroppedSlab());
}
public Block getDroppedSlab() {
if (this == BlocksAether.skyroot_double_slab) {
return BlocksAether.skyroot_slab;
} else if (this == BlocksAether.carved_double_slab) {
return BlocksAether.carved_slab;
} else if (this == BlocksAether.angelic_double_slab) {
return BlocksAether.angelic_slab;
} else if (this == BlocksAether.hellfire_double_slab) {
return BlocksAether.hellfire_slab;
} else if (this == BlocksAether.holystone_brick_double_slab) {
return BlocksAether.holystone_brick_slab;
} else if (this == BlocksAether.holystone_double_slab) {
return BlocksAether.holystone_slab;
} else if (this == BlocksAether.mossy_holystone_double_slab) {
return BlocksAether.mossy_holystone_slab;
} else {
return this;
}
}
@Override
public Item getItemDropped(int meta, Random rand, int fortune) {
return Item.getItemFromBlock(this.getDroppedSlab());
}
@Override
public int damageDropped(int meta) {
return 0;
}
@Override
public String func_150002_b(int meta) {
return this.name;
}
@Override
@SideOnly(Side.CLIENT)
public int getRenderBlockPass() {
return this == BlocksAether.aerogel_slab
|| this == BlocksAether.aerogel_double_slab
? 1
: 0;
}
}