Skip to content

Commit d4cd224

Browse files
re-added blockBlacklist config
1 parent 5a9a4c0 commit d4cd224

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,10 @@ object EurekaConfig {
165165

166166
@JsonSchema(description = "Maximum number of blocks allowed in a ship. Set to 0 for no limit")
167167
val maxShipBlocks = 32 * 32 * 32
168+
169+
// TODO: Remove blockBlacklist
170+
// Blacklist of blocks that don't get added for ship building
171+
@JsonSchema(description = "Blacklist of blocks that don't get assembled (Use Block Tag instead)")
172+
var blockBlacklist : Set<String> = emptySet()
168173
}
169174
}

common/src/main/kotlin/org/valkyrienskies/eureka/blockentity/ShipHelmBlockEntity.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) :
132132
val builtShip = ShipAssembler.collectBlocks(
133133
level,
134134
blockPos
135-
) { !it.isAir && !it.`is`(ASSEMBLE_BLACKLIST) }
135+
) { !it.isAir && !it.`is`(ASSEMBLE_BLACKLIST) &&
136+
// TODO: Remove blockBlacklist
137+
(EurekaConfig.SERVER.blockBlacklist.isNotEmpty() && !EurekaConfig.SERVER.blockBlacklist.contains(Registry.BLOCK.getKey(it.block).toString()))
138+
}
136139

137140
if (builtShip == null) {
138141
player.sendMessage(TextComponent("Ship is too big! Max size is ${EurekaConfig.SERVER.maxShipBlocks} blocks (changeable in the config)"), Util.NIL_UUID)

0 commit comments

Comments
 (0)