Skip to content

Commit 6a8f7eb

Browse files
Fixed blacklist not working
1 parent fc37c5e commit 6a8f7eb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import net.minecraft.commands.arguments.EntityAnchorArgument
44
import net.minecraft.core.BlockPos
55
import net.minecraft.core.Direction.Axis
66
import net.minecraft.core.registries.BuiltInRegistries
7+
import net.minecraft.core.registries.Registries
78
import net.minecraft.network.chat.Component
89
import net.minecraft.resources.ResourceLocation
910
import net.minecraft.server.level.ServerLevel
@@ -37,8 +38,8 @@ import org.valkyrienskies.mod.common.util.toDoubles
3738
import org.valkyrienskies.mod.common.util.toJOMLD
3839
import org.valkyrienskies.mod.util.logger
3940

40-
// var ASSEMBLE_BLACKLIST: TagKey<Block> =
41-
// TagKey.create(Registry.BLOCK_REGISTRY, ResourceLocation(EurekaMod.MOD_ID, "assemble_blacklist"))
41+
var ASSEMBLE_BLACKLIST: TagKey<Block> =
42+
TagKey.create(Registries.BLOCK, ResourceLocation(EurekaMod.MOD_ID, "assemble_blacklist"))
4243

4344
class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) :
4445
BlockEntity(EurekaBlockEntities.SHIP_HELM.get(), pos, state), MenuProvider {
@@ -131,7 +132,9 @@ class ShipHelmBlockEntity(pos: BlockPos, state: BlockState) :
131132
level,
132133
blockPos
133134
) {
134-
val allowed = !it.isAir && !EurekaConfig.SERVER.blockBlacklist.contains(BuiltInRegistries.BLOCK.getKey(it.block).toString())
135+
val allowed = !it.isAir && !it.`is`(ASSEMBLE_BLACKLIST) &&
136+
// TODO: Remove blockBlacklist
137+
!(EurekaConfig.SERVER.blockBlacklist.isNotEmpty() && EurekaConfig.SERVER.blockBlacklist.contains(BuiltInRegistries.BLOCK.getKey(it.block).toString()))
135138
// This isn't the best way to count helms, but it'll work I promise!
136139
if (allowed && it.block is ShipHelmBlock) {
137140
helmCount++

0 commit comments

Comments
 (0)