mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 04:32:24 +00:00
More work on splitting ExtraBees
This commit is contained in:
1 parent
ac05f9013a
commit
b12d19c9ea
44 files changed
+327
-315
No files matched your search
@@ -1,8 +1,11 @@
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.blocks.BlockExtraBeeHive;
|
||||
import binnie.extrabees.blocks.type.EnumHiveType;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
@@ -12,6 +15,7 @@ import net.minecraftforge.common.BiomeDictionary;
|
||||
import java.util.Random;
|
||||
|
||||
public class WorldGenHiveNether extends WorldGenerator {
|
||||
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final BlockPos pos) {
|
||||
final Biome biome = world.getBiome(pos);
|
||||
@@ -25,6 +29,18 @@ public class WorldGenHiveNether extends WorldGenerator {
|
||||
}
|
||||
|
||||
public boolean embedInWall(final World world, final Block blockID, final BlockPos pos) {
|
||||
return world.getBlockState(pos).getBlock() == blockID && world.getBlockState(pos.up()).getBlock() == blockID && world.getBlockState(pos.down()).getBlock() == blockID && (world.isAirBlock(pos.add(1, 0, 0)) || world.isAirBlock(pos.add(-1, 0, 0)) || world.isAirBlock(pos.add(0, 0, 1)) || world.isAirBlock(pos.add(0, 0, -1)));
|
||||
if (world.getBlockState(pos).getBlock() != blockID){
|
||||
return false;
|
||||
}
|
||||
for (EnumFacing facing : EnumFacing.VALUES){
|
||||
if (facing.getAxis() == EnumFacing.Axis.Y && world.getBlockState(pos.up()).getBlock() != blockID){
|
||||
return false;
|
||||
}
|
||||
if (world.isAirBlock(pos.offset(facing))){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user