-
Notifications
You must be signed in to change notification settings - Fork 36
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
998d17d
commit 0344006
Showing
6 changed files
with
37 additions
and
22 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
common/src/main/kotlin/org/valkyrienskies/eureka/block/IWoodType.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.valkyrienskies.eureka.block | ||
|
||
import net.minecraft.world.level.block.Block | ||
|
||
public interface IWoodType { | ||
|
||
fun getWood(): Block | ||
|
||
fun getPlanks(): Block | ||
|
||
fun getSerializedName(): String | ||
|
||
} |
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
28 changes: 14 additions & 14 deletions
28
common/src/main/kotlin/org/valkyrienskies/eureka/block/WoodType.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 org.valkyrienskies.eureka.block | ||
|
||
import net.minecraft.resources.ResourceLocation | ||
import net.minecraft.util.StringRepresentable | ||
import net.minecraft.world.level.block.Block | ||
import net.minecraft.world.level.block.Blocks | ||
|
||
// TODO mod compat | ||
public enum class WoodType(final val logBlock: Block, final val plankBlock: Block) : StringRepresentable, IWoodType { | ||
OAK(Blocks.OAK_LOG, Blocks.OAK_PLANKS), | ||
SPRUCE(Blocks.SPRUCE_LOG, Blocks.SPRUCE_PLANKS), | ||
BIRCH(Blocks.BIRCH_LOG, Blocks.BIRCH_PLANKS), | ||
JUNGLE(Blocks.JUNGLE_LOG, Blocks.JUNGLE_PLANKS), | ||
ACACIA(Blocks.ACACIA_LOG, Blocks.ACACIA_PLANKS), | ||
DARK_OAK(Blocks.DARK_OAK_LOG, Blocks.DARK_OAK_PLANKS), | ||
CRIMSON(Blocks.CRIMSON_STEM, Blocks.CRIMSON_PLANKS), | ||
WARPED(Blocks.WARPED_STEM, Blocks.WARPED_PLANKS); | ||
|
||
enum class WoodType(val resourceName: String) : StringRepresentable { | ||
OAK("oak"), | ||
SPRUCE("spruce"), | ||
BIRCH("birch"), | ||
JUNGLE("jungle"), | ||
ACACIA("acacia"), | ||
DARK_OAK("dark_oak"), | ||
WARPED("warped"), | ||
CRIMSON("crimson"); | ||
override fun getSerializedName(): String = name.lowercase() | ||
|
||
val textureLocationPlanks get() = ResourceLocation("minecraft:block/${resourceName}_planks") | ||
val textureLocationLog get() = ResourceLocation("minecraft:block/${resourceName}_log") | ||
override fun getWood(): Block = logBlock | ||
|
||
override fun getSerializedName(): String = resourceName | ||
override fun getPlanks(): Block = plankBlock | ||
} |
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