Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OptiGUI 2.1.4 #63

Merged
merged 2 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ internal fun initializePreprocessors(context: InitializerContext) {
context.registerPreprocessor<ShulkerBoxBlockEntity>(::processCommonComparable)

context.registerPreprocessor<LecternBlockEntity>(::processLectern)

context.registerPreprocessor<HangingSignBlockEntity>(::processHangingSign)
}

private val lookup: RegistryLookupService by lazy(::getService)
Expand Down Expand Up @@ -182,17 +180,6 @@ private fun processVillager(villager: VillagerEntity): Any? {
)
}

private fun processHangingSign(sign: HangingSignBlockEntity): Any? {
val world = sign.world ?: return null

return DefaultProperties(
container = lookup.lookupBlockId(world.getBlockState(sign.pos).block),
name = null,
biome = lookup.lookupBiomeId(world, sign.pos),
height = sign.pos.y
)
}

private fun processLectern(lectern: LecternBlockEntity): Any? {
val world = lectern.world ?: return null
// Workaround, because LecternBlockEntity doesn't sync
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package opekope2.optiglue_1_19_3

import net.fabricmc.fabric.api.resource.ResourceManagerHelper
import net.minecraft.block.entity.HangingSignBlockEntity
import net.minecraft.client.gui.screen.ingame.HangingSignEditScreen
import net.minecraft.entity.passive.CamelEntity
import net.minecraft.entity.vehicle.ChestBoatEntity
Expand All @@ -11,6 +12,7 @@ import opekope2.optigui.InitializerContext
import opekope2.optigui.internal.processCommon
import opekope2.optigui.internal.service.RetexturableScreensRegistryService
import opekope2.optigui.properties.ChestBoatProperties
import opekope2.optigui.properties.DefaultProperties
import opekope2.optigui.service.RegistryLookupService
import opekope2.optigui.service.ResourceAccessService
import opekope2.optigui.service.getService
Expand All @@ -33,6 +35,8 @@ object OptiGlueMod : EntryPoint {
context.registerPreprocessor<ChestBoatEntity>(::processChestBoat)
context.registerPreprocessor<CamelEntity>(::processCommon)

context.registerPreprocessor<HangingSignBlockEntity>(::processHangingSign)

ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(ResourceLoader)

logger.info("OptiGlue initialized.")
Expand All @@ -49,4 +53,16 @@ object OptiGlueMod : EntryPoint {
variant = chestBoat.variant.getName()
)
}


private fun processHangingSign(sign: HangingSignBlockEntity): Any? {
val world = sign.world ?: return null

return DefaultProperties(
container = lookup.lookupBlockId(world.getBlockState(sign.pos).block),
name = null,
biome = lookup.lookupBiomeId(world, sign.pos),
height = sign.pos.y
)
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ loom_version=1.2-SNAPSHOT
java_version=17
##########################################################################
# Mod Properties
mod_version=2.1.3
mod_version=2.1.4
maven_group=opekope2.optigui
##########################################################################
# Kotlin Dependencies
Expand Down