use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.
the class BlockGemGlass method addRecipes.
@Override
public void addRecipes(RecipeMaker recipes) {
for (int i = 0; i < 16; ++i) {
EnumGem gem = getGem(i);
recipes.addSurroundOre(blockName + i, new ItemStack(this, 8, i), gem.getShardOreName(), "blockGlass");
}
}
use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.
the class BlockGemLamp method onBlockAdded.
@Override
public void onBlockAdded(World world, BlockPos pos, IBlockState state) {
if (!world.isRemote) {
boolean powered = world.isBlockPowered(pos);
EnumGem gem = EnumGem.values()[getMetaFromState(state)];
setState(world, pos, getLamp(inverted ? !powered : powered), gem);
}
}
use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.
the class BlockGemLamp method neighborChanged.
@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {
if (!world.isRemote) {
boolean powered = world.isBlockPowered(pos);
EnumGem gem = EnumGem.values()[getMetaFromState(state)];
BlockGemLamp newBlock = getLamp(inverted ? !powered : powered);
if (inverted) {
if (!lit && !powered) {
world.scheduleUpdate(pos, this, 4);
} else if (lit && powered) {
setState(world, pos, newBlock, gem);
}
} else {
if (lit && !powered) {
world.scheduleUpdate(pos, this, 4);
} else if (!lit && powered) {
setState(world, pos, newBlock, gem);
}
}
}
}
use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.
the class BlockGemLamp method updateTick.
@Override
public void updateTick(World world, BlockPos pos, IBlockState state, Random random) {
if (!world.isRemote) {
boolean powered = world.isBlockPowered(pos);
if (!powered) {
EnumGem gem = EnumGem.values()[getMetaFromState(state)];
setState(world, pos, getLamp(inverted ? !powered : powered), gem);
}
}
}
use of net.silentchaos512.gems.lib.EnumGem in project SilentGems by SilentChaos512.
the class BlockGemOre method addOreDict.
@Override
public void addOreDict() {
for (int i = 0; i < 16; ++i) {
EnumGem gem = getGem(i);
OreDictionary.registerOre(gem.getOreOreName(), gem.getOre());
}
}
Aggregations