mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-25 06:24:54 +00:00
29 lines
1.0 KiB
Java
29 lines
1.0 KiB
Java
package magicbees.bees.allele.effect;
|
|
|
|
import net.minecraft.init.Blocks;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.world.World;
|
|
import net.minecraft.world.biome.BiomeGenBase;
|
|
import net.minecraftforge.common.BiomeDictionary;
|
|
import net.minecraftforge.oredict.OreDictionary;
|
|
|
|
import magicbees.api.bees.ITransmutationEffectLogic;
|
|
|
|
public class TransmutationEffectVanilla implements ITransmutationEffectLogic {
|
|
|
|
@Override
|
|
public boolean tryTransmutation(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
|
return trySpawnSandstone(world, biome, sourceBlock, x, y, z);
|
|
}
|
|
|
|
private boolean trySpawnSandstone(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
|
|
boolean flag = false;
|
|
if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.SANDY)
|
|
&& OreDictionary.itemMatches(new ItemStack(Blocks.sand), sourceBlock, false)) {
|
|
world.setBlock(x, y, z, Blocks.sandstone);
|
|
flag = true;
|
|
}
|
|
return flag;
|
|
}
|
|
}
|