forked from SteamWar/SteamWar
Remove anything powered and Bamboo from generation
This commit is contained in:
+5
@@ -31,7 +31,9 @@ import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.block.data.AnaloguePowerable;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Powerable;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
import org.bukkit.block.data.type.Bed;
|
||||
import org.bukkit.block.data.type.Door;
|
||||
@@ -63,6 +65,7 @@ public class BlockBoundingBox {
|
||||
if (!material.isItem()) return;
|
||||
if (!material.isBlock()) return;
|
||||
if (material == Material.WATER) return;
|
||||
if (material == Material.BAMBOO) return;
|
||||
if (material.getBlastResistance() <= 0.0) return;
|
||||
if (material.getBlastResistance() > 9.0) return;
|
||||
|
||||
@@ -91,6 +94,8 @@ public class BlockBoundingBox {
|
||||
if (maxX - minX == 1 && maxY - minY == 1 && maxZ - minZ == 1) return;
|
||||
|
||||
BlockData blockData = CraftBlockData.createData(blockState);
|
||||
if (blockData instanceof Powerable powerable && powerable.isPowered()) return; // No powered blocks!
|
||||
if (blockData instanceof AnaloguePowerable analoguePowerable && analoguePowerable.getPower() > 0) return; // No powered blocks!
|
||||
if (blockData instanceof Door) return; // Doors dont seem to be 2 blocks tall?
|
||||
if (blockData instanceof Bed) return; // Beds dont seem to be 2 blocks tall?
|
||||
if (blockData instanceof Waterlogged waterlogged && waterlogged.isWaterlogged()) return;
|
||||
|
||||
Reference in New Issue
Block a user