Skip to content

Commit

Permalink
fix(tags): Update usages of Tags with new names.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayfri committed Aug 15, 2024
1 parent cf439d1 commit 9f52707
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ data class GeodeBlocks(
var middleLayer: BlockStateProvider = simpleStateProvider(),
var outerLayer: BlockStateProvider = simpleStateProvider(),
var innerPlacements: List<BlockState> = emptyList(),
var cannotReplace: BlockTagArgument = Tags.Blocks.FEATURES_CANNOT_REPLACE,
var invalidBlocks: BlockTagArgument = Tags.Blocks.GEODE_INVALID_BLOCKS,
var cannotReplace: BlockTagArgument = Tags.Block.FEATURES_CANNOT_REPLACE,
var invalidBlocks: BlockTagArgument = Tags.Block.GEODE_INVALID_BLOCKS,
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ data class DimensionType(
@OptIn(ExperimentalSerializationApi::class)
fun getJsonEncoder(dataPack: DataPack) = when {
::jsonEncoder.isInitialized -> jsonEncoder

else -> {
jsonEncoder = Json {
prettyPrint = dataPack.jsonEncoder.configuration.prettyPrint
Expand All @@ -67,6 +68,6 @@ data class DimensionType(
* Values are the minimal values for a dimension type, booleans have the same values as overworld.
*/
fun DataPack.dimensionType(fileName: String = "dimension_type", dimensionType: DimensionType.() -> Unit = {}): DimensionTypeArgument {
dimensionTypes += DimensionType(fileName, infiniburn = Tags.Blocks.INFINIBURN_OVERWORLD).apply(dimensionType)
dimensionTypes += DimensionType(fileName, infiniburn = Tags.Block.INFINIBURN_OVERWORLD).apply(dimensionType)
return DimensionTypeArgument(fileName, name)
}
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ fun componentsTests() {
rule(
speed = 0.5f,
correctForDrops = true,
Tags.Blocks.BASE_STONE_OVERWORLD,
Tags.Blocks.OVERWORLD_CARVER_REPLACEABLES,
Tags.Block.BASE_STONE_OVERWORLD,
Tags.Block.OVERWORLD_CARVER_REPLACEABLES,
Blocks.HAY_BLOCK
)
defaultMiningSpeed = 2.0f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import io.github.ayfri.kore.arguments.maths.vec3
import io.github.ayfri.kore.arguments.numbers.relativePos
import io.github.ayfri.kore.assertions.assertsMatches
import io.github.ayfri.kore.functions.Function
import io.github.ayfri.kore.generated.Tags
import kotlin.random.Random

private fun randomPos(from: Int = 0, to: Int = 100) = Random.nextInt(from, to).relativePos
Expand Down Expand Up @@ -34,6 +35,6 @@ fun Function.cloneTests() {

clone {
randomZoneAndDestination()
filter(io.github.ayfri.kore.generated.Tags.Blocks.BASE_STONE_OVERWORLD, CloneMode.FORCE)
filter(Tags.Block.BASE_STONE_OVERWORLD, CloneMode.FORCE)
} assertsMatches Regex("clone ~\\d* ~\\d* ~\\d* ~\\d* ~\\d* ~\\d* ~\\d* ~\\d* ~\\d* filtered #minecraft:base_stone_overworld force")
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fun DataPack.enchantmentTests() {
description("This is a test enchantment.")
exclusiveSet(Tags.Enchantment.IN_ENCHANTING_TABLE)
supportedItems(Items.DIAMOND_SWORD, Items.DIAMOND_AXE)
primaryItems(Tags.Items.AXES)
primaryItems(Tags.Item.AXES)
slots(EquipmentSlot.MAINHAND, EquipmentSlot.OFFHAND)
}

Expand Down Expand Up @@ -565,7 +565,8 @@ fun DataPack.enchantmentTests() {
5,
5,
5
]
],
"trigger_game_event": "minecraft:block_place"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fun DataPack.recipeTest() {
recipes {
blasting("test_blasting") {
ingredient {
tag = Tags.Items.STONE_CRAFTING_MATERIALS
tag = Tags.Item.STONE_CRAFTING_MATERIALS
}

result = itemStack(Items.DIAMOND) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fun DataPack.placedFeatureTests() {
rarityFilter(5)

blockPredicateFilter(allOf {
matchingBlockTag(tag = Tags.Blocks.DIRT)
matchingBlockTag(tag = Tags.Block.DIRT)
trueBlockPredicate()
})
}
Expand Down

0 comments on commit 9f52707

Please sign in to comment.