-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WoodType compat * moved StringRepresentable into IWoodType and more
- Loading branch information
1 parent
7caa63d
commit 42c5a56
Showing
6 changed files
with
37 additions
and
24 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
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,11 @@ | ||
package org.valkyrienskies.eureka.block | ||
|
||
import net.minecraft.util.StringRepresentable | ||
import net.minecraft.world.level.block.Block | ||
|
||
public interface IWoodType : StringRepresentable { | ||
|
||
fun getWood(): Block | ||
|
||
fun getPlanks(): Block | ||
} |
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
29 changes: 14 additions & 15 deletions
29
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,21 @@ | ||
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) : IWoodType { | ||
ACACIA(Blocks.ACACIA_LOG, Blocks.ACACIA_PLANKS), | ||
BIRCH(Blocks.BIRCH_LOG, Blocks.BIRCH_PLANKS), | ||
CRIMSON(Blocks.CRIMSON_STEM, Blocks.CRIMSON_PLANKS), | ||
DARK_OAK(Blocks.DARK_OAK_LOG, Blocks.DARK_OAK_PLANKS), | ||
JUNGLE(Blocks.JUNGLE_LOG, Blocks.JUNGLE_PLANKS), | ||
OAK(Blocks.OAK_LOG, Blocks.OAK_PLANKS), | ||
SPRUCE(Blocks.SPRUCE_LOG, Blocks.SPRUCE_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