This commit is contained in:
kuba6000 committed 2022-10-12 21:09:45 +02:00
1 parent d993c90c3e
commit 14a712260b
156 files changed
+14896 -13422

No files matched your search

@@ -1,47 +1,40 @@
package magicbees.world.feature;
import forestry.api.apiculture.hives.IHiveGen;
import magicbees.main.utils.BlockUtil;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import forestry.api.apiculture.hives.IHiveGen;
public class HiveGenUnderground implements IHiveGen {
protected final int minLevel;
protected final int range;
protected final Block replace;
private final int surroundCount;
import magicbees.main.utils.BlockUtil;
public HiveGenUnderground(int minLevel, int range, int surroundCount) {
this(minLevel, range, Blocks.stone, surroundCount);
}
public class HiveGenUnderground implements IHiveGen
{
protected final int minLevel;
protected final int range;
protected final Block replace;
private final int surroundCount;
public HiveGenUnderground(int minLevel, int range, Block replace, int surroundCount) {
this.minLevel = minLevel;
this.range = range;
this.replace = replace;
this.surroundCount = surroundCount;
}
public HiveGenUnderground(int minLevel, int range, int surroundCount) {
this(minLevel, range, Blocks.stone, surroundCount);
}
@Override
public int getYForHive(World world, int x, int z) {
return minLevel + world.rand.nextInt(range);
}
public HiveGenUnderground(int minLevel, int range, Block replace, int surroundCount)
{
this.minLevel = minLevel;
this.range = range;
this.replace = replace;
this.surroundCount = surroundCount;
}
@Override
public boolean isValidLocation(World world, int x, int y, int z) {
return BlockUtil.getSurroundCount(world, x, y, z, replace) >= surroundCount;
}
@Override
public int getYForHive(World world, int x, int z)
{
return minLevel + world.rand.nextInt(range);
}
@Override
public boolean isValidLocation(World world, int x, int y, int z)
{
return BlockUtil.getSurroundCount(world, x, y, z, replace) >= surroundCount;
}
@Override
public boolean canReplace(World world, int x, int y, int z)
{
return !world.isAirBlock(x, y, z) && BlockUtil.canBlockReplaceAt(world, x, y, z, replace);
}
@Override
public boolean canReplace(World world, int x, int y, int z) {
return !world.isAirBlock(x, y, z) && BlockUtil.canBlockReplaceAt(world, x, y, z, replace);
}
}