Skip to content

Commit

Permalink
chore: prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
SirEdvin committed Feb 3, 2024
1 parent ce17697 commit 783a48e
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 32 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.6] - 2024-02-03

### Changed

- Update code to new CC:T

### Fixed

- Crash when turtle mimic is beacon [#19]

## [1.2.5] - 2023-11-03

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("site.siredvin.root") version "0.4.12"
id("site.siredvin.release") version "0.4.12"
id("site.siredvin.root") version "0.6.1"
id("site.siredvin.release") version "0.6.1"
}

subprojectShaking {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx4G
org.gradle.warning.mode = all
minecraftVersion = 1.20.1
# Mod Properties
modVersion = 1.2.5
modVersion = 1.2.6
mavenGroup = site.siredvin
modBaseName = turtlematic
archivesBaseName = turtlematic
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ loom = "1.2.+"
mixinGradle = "0.8.+"
forgegradle = "6.+"
# Core mod dependencies
cc-tweaked = "1.108.1"
peripheralium = "0.6.13"
cc-tweaked = "1.109.5"
peripheralium = "0.6.15"
mixin = "0.8.5"
# Fabric dependencies
fabric-api = "0.87.0+1.20.1"
Expand All @@ -31,7 +31,7 @@ rei = "12.0.625"

[libraries]
# Core mod dependencies
cc-tweaked-common = {module = "cc.tweaked:common", version.ref = "cc-tweaked"}
cc-tweaked-common = {module = "cc.tweaked:cc-tweaked-1.20.1-common", version.ref = "cc-tweaked"}
cc-tweaked-common-api = {module = "cc.tweaked:cc-tweaked-1.20.1-common-api", version.ref = "cc-tweaked"}
cc-tweaked-core = {module = "cc.tweaked:cc-tweaked-1.20.1-core", version.ref = "cc-tweaked"}
common-config = {module = "fuzs.forgeconfigapiport:forgeconfigapiport-common", version.ref = "forgeconfigapirt-fabric"}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package site.siredvin.turtlematic

import dan200.computercraft.api.client.ComputerCraftAPIClient
import dan200.computercraft.api.client.turtle.TurtleUpgradeModeller
import dan200.computercraft.api.turtle.ITurtleUpgrade
import dan200.computercraft.api.turtle.TurtleUpgradeSerialiser
Expand All @@ -18,6 +17,7 @@ import site.siredvin.turtlematic.computercraft.peripheral.misc.ChunkVialPeripher
import site.siredvin.turtlematic.computercraft.peripheral.misc.CreativeChestPeripheral
import site.siredvin.turtlematic.computercraft.peripheral.misc.MimicPeripheral
import site.siredvin.turtlematic.computercraft.peripheral.misc.TurtleChatterPeripheral
import java.util.function.BiConsumer
import java.util.function.Consumer
import java.util.function.Supplier

Expand All @@ -33,6 +33,7 @@ object TurtlematicCoreClient {
"turtle/creative_chest_left",
"turtle/creative_chest_right",
)
val EXTRA_TURTLE_MODEL_PROVIDERS: MutableList<Supplier<Pair<TurtleUpgradeSerialiser<ITurtleUpgrade>, TurtleUpgradeModeller<ITurtleUpgrade>>>> = mutableListOf()

@Suppress("UNCHECKED_CAST")
val EXTRA_ENTITY_RENDERERS: Array<Supplier<EntityType<Entity>>> = arrayOf(
Expand All @@ -52,78 +53,84 @@ object TurtlematicCoreClient {
}

fun <T : ITurtleUpgrade> asClockwise(serializer: Supplier<TurtleUpgradeSerialiser<T>>) {
ComputerCraftAPIClient.registerTurtleUpgradeModeller(
serializer.get(),
ClockwiseTurtleModeller(),
)
EXTRA_TURTLE_MODEL_PROVIDERS.add {
@Suppress("UNCHECKED_CAST")
Pair(serializer.get() as TurtleUpgradeSerialiser<ITurtleUpgrade>, ClockwiseTurtleModeller())
}
}

fun onInit() {
ComputerCraftAPIClient.registerTurtleUpgradeModeller(
fun onModelRegister(consumer: BiConsumer<TurtleUpgradeSerialiser<*>, TurtleUpgradeModeller<ITurtleUpgrade>>) {
consumer.accept(
TurtleUpgradeSerializers.TURTLE_CHATTER.get(),
TurtleUpgradeModeller.sided(
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${TurtleChatterPeripheral.UPGRADE_ID.path}_left"),
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${TurtleChatterPeripheral.UPGRADE_ID.path}_right"),
),
)

TurtleRenderTrickRegistry.registerTrick(
TurtleUpgradeSerializers.TURTLE_CHATTER.get(),
ChattingTurtleRenderTrick,
)

ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.MIMIC.get(),
TurtleUpgradeModeller.sided(
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${MimicPeripheral.UPGRADE_ID.path}_left"),
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${MimicPeripheral.UPGRADE_ID.path}_right"),
),
)

TurtleRenderTrickRegistry.registerTrick(
TurtleUpgradeSerializers.MIMIC.get(),
MimicTurtleRenderTrick,
)

ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.CREATIVE_CHEST.get(),
TurtleUpgradeModeller.sided(
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${CreativeChestPeripheral.UPGRADE_ID.path}_left"),
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${CreativeChestPeripheral.UPGRADE_ID.path}_right"),
),
)
ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.CHUNK_VIAL.get(),
TurtleUpgradeModeller.sided(
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${ChunkVialPeripheral.UPGRADE_ID.path}_left"),
ResourceLocation(TurtlematicCore.MOD_ID, "turtle/${ChunkVialPeripheral.UPGRADE_ID.path}_right"),
),
)

ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.SOUL_SCRAPPER.get(),
TurtleUpgradeModeller.flatItem(),
)

ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.LAVA_BUCKET.get(),
TurtleUpgradeModeller.flatItem(),
)

ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.BOW.get(),
AngleItemTurtleModeller(),
)

ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.PISTON.get(),
FacingBlockTurtleModeller(),
)

ComputerCraftAPIClient.registerTurtleUpgradeModeller(
consumer.accept(
TurtleUpgradeSerializers.STICKY_PISTON.get(),
FacingBlockTurtleModeller(),
)
EXTRA_TURTLE_MODEL_PROVIDERS.forEach {
val pair = it.get()
consumer.accept(pair.first, pair.second)
}
}

fun onInit() {
TurtleRenderTrickRegistry.registerTrick(
TurtleUpgradeSerializers.TURTLE_CHATTER.get(),
ChattingTurtleRenderTrick,
)

TurtleRenderTrickRegistry.registerTrick(
TurtleUpgradeSerializers.MIMIC.get(),
MimicTurtleRenderTrick,
)

asClockwise(TurtleUpgradeSerializers.AUTOMATA_CORE)
asClockwise(TurtleUpgradeSerializers.HUSBANDRY_AUTOMATA)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package site.siredvin.turtlematic

import dan200.computercraft.api.client.FabricComputerCraftAPIClient
import dan200.computercraft.api.turtle.ITurtleUpgrade
import dan200.computercraft.api.turtle.TurtleUpgradeSerialiser
import net.fabricmc.api.ClientModInitializer
import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry
Expand All @@ -14,5 +17,9 @@ object FabricTurtlematicClient : ClientModInitializer {
TurtlematicCoreClient.EXTRA_ENTITY_RENDERERS.forEach {
EntityRendererRegistry.register(it.get(), TurtlematicCoreClient.getEntityRendererProvider(it.get()))
}
TurtlematicCoreClient.onModelRegister { serializer, modeller ->
@Suppress("UNCHECKED_CAST")
FabricComputerCraftAPIClient.registerTurtleUpgradeModeller(serializer as TurtleUpgradeSerialiser<ITurtleUpgrade>, modeller)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package site.siredvin.turtlematic

import dan200.computercraft.api.client.turtle.RegisterTurtleModellersEvent
import dan200.computercraft.api.turtle.ITurtleUpgrade
import dan200.computercraft.api.turtle.TurtleUpgradeSerialiser
import net.minecraft.resources.ResourceLocation
import net.minecraftforge.api.distmarker.Dist
import net.minecraftforge.client.event.EntityRenderersEvent.RegisterRenderers
Expand Down Expand Up @@ -30,4 +33,12 @@ object ForgeTurtlematicClient {
event.register(model)
}
}

@SubscribeEvent
fun registerTurtleModels(event: RegisterTurtleModellersEvent) {
TurtlematicCoreClient.onModelRegister { serializer, model ->
@Suppress("UNCHECKED_CAST")
event.register(serializer as TurtleUpgradeSerialiser<ITurtleUpgrade>, model)
}
}
}

0 comments on commit 783a48e

Please sign in to comment.