-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6dfe2d0
commit 4146367
Showing
41 changed files
with
275 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
api/src/main/kotlin/com/possible_triangle/skygrid/api/world/Generator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.possible_triangle.skygrid.api.world | ||
|
||
import kotlin.random.Random | ||
import net.minecraft.util.RandomSource | ||
|
||
fun interface Generator<B : IBlockAccess> { | ||
fun generate(random: Random, access: B): Boolean | ||
fun generate(random: RandomSource, access: B): Boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
api/src/main/kotlin/com/possible_triangle/skygrid/api/xml/elements/PropertyTransformer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
package com.possible_triangle.skygrid.api.xml.elements | ||
|
||
import net.minecraft.util.RandomSource | ||
import net.minecraft.world.level.block.state.BlockState | ||
import net.minecraft.world.level.block.state.properties.Property | ||
import kotlin.random.Random | ||
|
||
abstract class PropertyTransformer : Transformer() { | ||
|
||
abstract val key: String | ||
|
||
final override fun apply(state: BlockState, random: Random): BlockState { | ||
final override fun apply(state: BlockState, random: RandomSource): BlockState { | ||
val property = state.properties.find { it.name == key } ?: return state | ||
return transform(state, property, random) | ||
} | ||
|
||
protected abstract fun <T : Comparable<T>> transform( | ||
state: BlockState, | ||
property: Property<T>, | ||
random: Random, | ||
random: RandomSource, | ||
): BlockState | ||
|
||
} |
8 changes: 4 additions & 4 deletions
8
api/src/main/kotlin/com/possible_triangle/skygrid/api/xml/elements/ProxyProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
api/src/main/kotlin/com/possible_triangle/skygrid/api/xml/elements/Transformer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package com.possible_triangle.skygrid.api.xml.elements | ||
|
||
import kotlinx.serialization.Serializable | ||
import net.minecraft.util.RandomSource | ||
import net.minecraft.world.level.block.state.BlockState | ||
import kotlin.random.Random | ||
|
||
@Serializable | ||
abstract class Transformer { | ||
|
||
abstract fun apply(state: BlockState, random: Random): BlockState | ||
abstract fun apply(state: BlockState, random: RandomSource): BlockState | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.