-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This also fixes recipes that didn't appear in the recipe book, such as module upgrades. There's still a few small hiccups (for example if you have all the requirements for a laser, it won't automatically move the book into the recipe slot), but most of the recipes are working now.
- Loading branch information
Showing
68 changed files
with
725 additions
and
1,093 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
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 |
---|---|---|
|
@@ -33,4 +33,4 @@ configurateVersion = 4.1.2 | |
|
||
trinketsVersion = 3.4.0 | ||
|
||
scLibraryVersion = 1.0.12 | ||
scLibraryVersion = 1.0.17 |
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,8 @@ | ||
package pw.switchcraft.plethora | ||
|
||
import net.minecraft.util.Identifier | ||
|
||
object PlethoraKt { | ||
internal const val modId = Plethora.MOD_ID | ||
internal fun ModId(value: String) = Identifier(modId, value) | ||
} |
67 changes: 67 additions & 0 deletions
67
src/main/java/pw/switchcraft/plethora/gameplay/data/BlockModelProvider.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,67 @@ | ||
package pw.switchcraft.plethora.gameplay.data | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider | ||
import net.minecraft.block.Block | ||
import net.minecraft.data.client.* | ||
import net.minecraft.data.client.TextureKey.* | ||
import net.minecraft.state.property.Properties.FACING | ||
import net.minecraft.util.math.Direction | ||
import pw.switchcraft.plethora.PlethoraKt.ModId | ||
import pw.switchcraft.plethora.gameplay.registry.Registration.ModBlocks.* | ||
import java.util.* | ||
|
||
class BlockModelProvider(generator: FabricDataGenerator) : FabricModelProvider(generator) { | ||
override fun generateBlockStateModels(gen: BlockStateModelGenerator) { | ||
gen.registerSimpleCubeAll(REDSTONE_INTEGRATOR) | ||
|
||
registerManipulator(gen, MANIPULATOR_MARK_1, 1) | ||
registerManipulator(gen, MANIPULATOR_MARK_2, 2) | ||
} | ||
|
||
override fun generateItemModels(gen: ItemModelGenerator) { | ||
} | ||
|
||
private fun registerManipulator(gen: BlockStateModelGenerator, block: Block, mark: Int) { | ||
val modelId = manipulatorModel.upload( | ||
block, | ||
TextureMap() | ||
.put(PARTICLE, ModId("block/manipulator_side")) | ||
.put(BOTTOM, ModId("block/manipulator_bottom")) | ||
.put(TOP, ModId("block/manipulator_top$mark")) | ||
.put(SIDE, ModId("block/manipulator_side")), | ||
gen.modelCollector | ||
) | ||
|
||
val variants = createDownDefaultFacingVariantMap() | ||
|
||
gen.blockStateCollector.accept(VariantsBlockStateSupplier.create( | ||
block, | ||
BlockStateVariant.create().put(VariantSettings.MODEL, modelId) | ||
).coordinate(variants)) | ||
} | ||
|
||
private fun createDownDefaultFacingVariantMap(): BlockStateVariantMap.SingleProperty<Direction> = | ||
BlockStateVariantMap.create(FACING) | ||
.register(Direction.DOWN, BlockStateVariant.create()) | ||
.register(Direction.UP, BlockStateVariant.create() | ||
.put(VariantSettings.X, VariantSettings.Rotation.R180)) | ||
.register(Direction.NORTH, BlockStateVariant.create() | ||
.put(VariantSettings.X, VariantSettings.Rotation.R90) | ||
.put(VariantSettings.Y, VariantSettings.Rotation.R180)) | ||
.register(Direction.SOUTH, BlockStateVariant.create() | ||
.put(VariantSettings.X, VariantSettings.Rotation.R90)) | ||
.register(Direction.EAST, BlockStateVariant.create() | ||
.put(VariantSettings.X, VariantSettings.Rotation.R90) | ||
.put(VariantSettings.Y, VariantSettings.Rotation.R270)) | ||
.register(Direction.WEST, BlockStateVariant.create() | ||
.put(VariantSettings.X, VariantSettings.Rotation.R90) | ||
.put(VariantSettings.Y, VariantSettings.Rotation.R90)) | ||
|
||
companion object { | ||
val manipulatorModel = Model( | ||
Optional.of(ModId("block/manipulator_base")), Optional.empty(), | ||
PARTICLE, BOTTOM, TOP, SIDE | ||
) | ||
} | ||
} |
11 changes: 0 additions & 11 deletions
11
src/main/java/pw/switchcraft/plethora/gameplay/data/Generators.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/main/java/pw/switchcraft/plethora/gameplay/data/ItemModelProvider.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,25 @@ | ||
package pw.switchcraft.plethora.gameplay.data | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider | ||
import net.minecraft.data.client.BlockStateModelGenerator | ||
import net.minecraft.data.client.ItemModelGenerator | ||
import net.minecraft.data.client.Models.GENERATED | ||
import pw.switchcraft.plethora.gameplay.registry.Registration.ModItems | ||
|
||
class ItemModelProvider(generator: FabricDataGenerator) : FabricModelProvider(generator) { | ||
override fun generateBlockStateModels(gen: BlockStateModelGenerator) { | ||
} | ||
|
||
override fun generateItemModels(gen: ItemModelGenerator) { | ||
gen.register(ModItems.GLASSES_MODULE, GENERATED) | ||
gen.register(ModItems.INTROSPECTION_MODULE, GENERATED) | ||
gen.register(ModItems.KEYBOARD_MODULE, GENERATED) | ||
gen.register(ModItems.KINETIC_MODULE, GENERATED) | ||
// Laser provided in JSON for custom rotations | ||
gen.register(ModItems.SCANNER_MODULE, GENERATED) | ||
gen.register(ModItems.SENSOR_MODULE, GENERATED) | ||
gen.register(ModItems.NEURAL_CONNECTOR, GENERATED) | ||
gen.register(ModItems.NEURAL_INTERFACE, GENERATED) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pw/switchcraft/plethora/gameplay/data/PlethoraDatagen.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,18 @@ | ||
package pw.switchcraft.plethora.gameplay.data | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator | ||
import org.slf4j.LoggerFactory | ||
import pw.switchcraft.plethora.gameplay.data.recipes.RecipeGenerator | ||
|
||
object PlethoraDatagen : DataGeneratorEntrypoint { | ||
val log = LoggerFactory.getLogger("Plethora/PlethoraDatagen")!! | ||
|
||
override fun onInitializeDataGenerator(generator: FabricDataGenerator) { | ||
log.info("Plethora datagen initializing") | ||
|
||
generator.addProvider(BlockModelProvider(generator)) | ||
generator.addProvider(ItemModelProvider(generator)) | ||
generator.addProvider(RecipeGenerator(generator)) | ||
} | ||
} |
107 changes: 0 additions & 107 deletions
107
src/main/java/pw/switchcraft/plethora/gameplay/data/RecipeGenerator.java
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
src/main/java/pw/switchcraft/plethora/gameplay/data/RecipeRegistry.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/main/java/pw/switchcraft/plethora/gameplay/data/recipes/KineticRecipe.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,34 @@ | ||
package pw.switchcraft.plethora.gameplay.data.recipes | ||
|
||
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags.GOLD_INGOTS | ||
import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags.REDSTONE_DUSTS | ||
import net.minecraft.entity.effect.StatusEffects | ||
import net.minecraft.item.ItemStack | ||
import net.minecraft.item.Items.PISTON | ||
import net.minecraft.potion.Potions | ||
import net.minecraft.recipe.Ingredient.fromTag | ||
import net.minecraft.recipe.Ingredient.ofItems | ||
import net.minecraft.recipe.SpecialRecipeSerializer | ||
import net.minecraft.util.Identifier | ||
import pw.switchcraft.library.recipe.BetterSpecialRecipe | ||
import pw.switchcraft.library.recipe.IngredientBrew | ||
import pw.switchcraft.plethora.gameplay.registry.Registration.ModItems.KINETIC_MODULE | ||
|
||
class KineticRecipe(id: Identifier) : BetterSpecialRecipe(id) { | ||
private val brew = IngredientBrew(StatusEffects.JUMP_BOOST, Potions.LEAPING) | ||
|
||
override val ingredients = listOf( | ||
fromTag(REDSTONE_DUSTS), fromTag(GOLD_INGOTS), fromTag(REDSTONE_DUSTS), | ||
ofItems(PISTON), brew, ofItems(PISTON), | ||
fromTag(REDSTONE_DUSTS), fromTag(GOLD_INGOTS), fromTag(REDSTONE_DUSTS), | ||
) | ||
|
||
override val outputItem = ItemStack(KINETIC_MODULE) | ||
|
||
override fun isIgnoredInRecipeBook() = false | ||
override fun getSerializer() = recipeSerializer | ||
|
||
companion object { | ||
val recipeSerializer = SpecialRecipeSerializer { KineticRecipe(it) } | ||
} | ||
} |
Oops, something went wrong.