From 1b4fe9de31568282eb0ba209b66605a1f0e1357a Mon Sep 17 00:00:00 2001 From: Slayer5934 Date: Sun, 21 Apr 2024 06:40:36 -0400 Subject: [PATCH 1/2] Update for Fabric 0.15.10, fixes server crash. --- build.gradle | 14 -------------- gradle.properties | 14 +++++++------- .../java/me/steven/indrev/WCustomTabPanel.java | 6 ------ .../armor/ReinforcedElytraFeatureRenderer.kt | 1 - .../indrev/blockentities/GlobalStateController.kt | 5 +---- .../gui/screenhandlers/IRGuiScreenHandler.kt | 3 +-- .../machines/ModularWorkbenchScreenHandler.kt | 3 +-- .../machines/RancherScreenHandler.kt | 3 +-- .../me/steven/indrev/registry/MachineRegistry.kt | 5 +---- 9 files changed, 12 insertions(+), 42 deletions(-) diff --git a/build.gradle b/build.gradle index 2910a7c8b..429a1a5cc 100644 --- a/build.gradle +++ b/build.gradle @@ -192,20 +192,6 @@ publishing { } } } - - // select the repositories you want to publish to - repositories { - maven { - url "https://maven.cafeteria.dev/releases" - credentials { - username = project.property("mcdUsername") - password = project.property("mcdPassword") - } - authentication { - basic(BasicAuthentication) - } - } - } } compileKotlin.kotlinOptions.jvmTarget = "17" diff --git a/gradle.properties b/gradle.properties index a229b3f7f..753f30aec 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,21 +1,21 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx3G # Fabric Properties -minecraft_version=1.19 -yarn_mappings=1.19+build.4 -loader_version=0.14.8 +minecraft_version=1.19.2 +yarn_mappings=1.19.2+build.28 +loader_version=0.15.10 #Fabric api -fabric_version=0.57.0+1.19 +fabric_version=0.77.0+1.19.2 loom_version=0.12-SNAPSHOT # Mod Properties -mod_version=1.15.2-BETA +mod_version=1.15.2-BETA-fab15hotfix maven_group=me.steven archives_base_name=indrev # Kotlin kotlin_version=1.7.0 fabric_kotlin_version=1.8.1+kotlin.1.7.0 # LibGui -libgui_version=6.0.0+1.19 +libgui_version=6.4.0+1.19 # Mod Menu modmenu_version=4.0.4 # Roughly Enough Items @@ -29,4 +29,4 @@ tr_energy_version=2.0.0-beta1 # Fake Player API fakeplayerapi_version=0.4.0 # ActiveJ -activej_version=4.3 \ No newline at end of file +activej_version=4.3 diff --git a/src/main/java/me/steven/indrev/WCustomTabPanel.java b/src/main/java/me/steven/indrev/WCustomTabPanel.java index f810e21c5..ebf9b14cf 100644 --- a/src/main/java/me/steven/indrev/WCustomTabPanel.java +++ b/src/main/java/me/steven/indrev/WCustomTabPanel.java @@ -122,7 +122,6 @@ public void setSize(int x, int y) { tabRibbon.setSize(x, TAB_HEIGHT); } - @Environment(EnvType.CLIENT) @Override public void addPainters() { super.addPainters(); @@ -278,7 +277,6 @@ public Tab build() { if (!this.tooltip.isEmpty()) { //noinspection Convert2Lambda tooltip = new Consumer() { - @Environment(EnvType.CLIENT) @Override public void accept(TooltipBuilder builder) { builder.add(WCustomTabPanel.Tab.Builder.this.tooltip.toArray(new Text[0])); @@ -304,7 +302,6 @@ public boolean canFocus() { return true; } - @Environment(EnvType.CLIENT) @Override public InputResult onClick(int x, int y, int button) { super.onClick(x, y, button); @@ -320,7 +317,6 @@ public InputResult onClick(int x, int y, int button) { return InputResult.PROCESSED; } - @Environment(EnvType.CLIENT) @Override public void onKeyPressed(int ch, int key, int modifiers) { if (isActivationKey(ch)) { @@ -328,7 +324,6 @@ public void onKeyPressed(int ch, int key, int modifiers) { } } - @Environment(EnvType.CLIENT) @Override public void paint(MatrixStack matrices, int x, int y, int mouseX, int mouseY) { TextRenderer renderer = MinecraftClient.getInstance().textRenderer; @@ -382,7 +377,6 @@ public void addTooltip(TooltipBuilder tooltip) { /** * Internal background painter instances for tabs. */ - @Environment(EnvType.CLIENT) final static class Painters { static final BackgroundPainter SELECTED_TAB = BackgroundPainter.createLightDarkVariants( BackgroundPainter.createNinePatch(new Identifier("indrev", "textures/gui/selected_light.png")).setTopPadding(2), diff --git a/src/main/kotlin/me/steven/indrev/armor/ReinforcedElytraFeatureRenderer.kt b/src/main/kotlin/me/steven/indrev/armor/ReinforcedElytraFeatureRenderer.kt index bde105670..07d12352b 100644 --- a/src/main/kotlin/me/steven/indrev/armor/ReinforcedElytraFeatureRenderer.kt +++ b/src/main/kotlin/me/steven/indrev/armor/ReinforcedElytraFeatureRenderer.kt @@ -20,7 +20,6 @@ import net.minecraft.client.util.math.MatrixStack import net.minecraft.entity.EquipmentSlot import net.minecraft.entity.LivingEntity -@Environment(EnvType.CLIENT) class ReinforcedElytraFeatureRenderer>( context: FeatureRendererContext, loader: EntityModelLoader diff --git a/src/main/kotlin/me/steven/indrev/blockentities/GlobalStateController.kt b/src/main/kotlin/me/steven/indrev/blockentities/GlobalStateController.kt index bfd5d8fe2..913cac9b6 100644 --- a/src/main/kotlin/me/steven/indrev/blockentities/GlobalStateController.kt +++ b/src/main/kotlin/me/steven/indrev/blockentities/GlobalStateController.kt @@ -19,12 +19,9 @@ import net.minecraft.world.World import java.util.function.LongFunction object GlobalStateController { - @Environment(EnvType.CLIENT) val chunksToUpdate: Long2ObjectMap> = Long2ObjectOpenHashMap() - @Environment(EnvType.CLIENT) val workingStateTracker = Long2BooleanOpenHashMap() - @Environment(EnvType.CLIENT) fun queueUpdate(pos: BlockPos) { val chunkPos = ChunkPos.toLong(pos.x shr 4, pos.z shr 4) if (MinecraftClient.getInstance().isOnThread) @@ -68,4 +65,4 @@ object GlobalStateController { } } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/me/steven/indrev/gui/screenhandlers/IRGuiScreenHandler.kt b/src/main/kotlin/me/steven/indrev/gui/screenhandlers/IRGuiScreenHandler.kt index 42a04e472..07b532b0a 100644 --- a/src/main/kotlin/me/steven/indrev/gui/screenhandlers/IRGuiScreenHandler.kt +++ b/src/main/kotlin/me/steven/indrev/gui/screenhandlers/IRGuiScreenHandler.kt @@ -39,7 +39,6 @@ open class IRGuiScreenHandler( } - @Environment(EnvType.CLIENT) override fun addPainters() { super.addPainters() val offset = 170 - rootPanel.width @@ -91,4 +90,4 @@ open class IRGuiScreenHandler( open fun onSyncedProperty(index: Int, property: SyncableProperty<*>) { } -} \ No newline at end of file +} diff --git a/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/ModularWorkbenchScreenHandler.kt b/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/ModularWorkbenchScreenHandler.kt index 38b259d50..ea82902e7 100644 --- a/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/ModularWorkbenchScreenHandler.kt +++ b/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/ModularWorkbenchScreenHandler.kt @@ -250,7 +250,6 @@ class ModularWorkbenchScreenHandler(syncId: Int, playerInventory: PlayerInventor panel.add(moduleToInstall, 3.0, 3.5) } - @Environment(EnvType.CLIENT) override fun addPainters() { val offset = 178 - rootPanel.width (rootPanel as WCustomTabPanel).setForceBackgroundPainter( @@ -390,4 +389,4 @@ class ModularWorkbenchScreenHandler(syncId: Int, playerInventory: PlayerInventor val MAX_LEVEL_TEXT = { translatable("gui.indrev.max_level").formatted(Formatting.RED) } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/RancherScreenHandler.kt b/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/RancherScreenHandler.kt index d42f23442..07d577574 100644 --- a/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/RancherScreenHandler.kt +++ b/src/main/kotlin/me/steven/indrev/gui/screenhandlers/machines/RancherScreenHandler.kt @@ -158,7 +158,6 @@ class RancherScreenHandler(syncId: Int, playerInventory: PlayerInventory, ctx: S } } - @Environment(EnvType.CLIENT) override fun addPainters() { val offset = 178 - rootPanel.width (rootPanel as WCustomTabPanel).setForceBackgroundPainter( @@ -193,4 +192,4 @@ class RancherScreenHandler(syncId: Int, playerInventory: PlayerInventory, ctx: S val SCREEN_ID = identifier("rancher_screen") val RANCHER_MK4 by lazy { MachineRegistry.RANCHER_REGISTRY.block(Tier.MK4) } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/me/steven/indrev/registry/MachineRegistry.kt b/src/main/kotlin/me/steven/indrev/registry/MachineRegistry.kt index 1f4e41540..dd99c3fdd 100644 --- a/src/main/kotlin/me/steven/indrev/registry/MachineRegistry.kt +++ b/src/main/kotlin/me/steven/indrev/registry/MachineRegistry.kt @@ -55,7 +55,6 @@ class MachineRegistry(private val key: String, val upgradeable: Boolean = true, private val blocks: MutableMap = EnumMap(Tier::class.java) val blockEntities: MutableMap> = EnumMap(Tier::class.java) - @Environment(EnvType.CLIENT) val modelProvider: MutableMap UnbakedModel?> = EnumMap(Tier::class.java) fun blockProvider(blockProvider: MachineRegistry.(Tier) -> Block): MachineRegistry { @@ -162,14 +161,12 @@ class MachineRegistry(private val key: String, val upgradeable: Boolean = true, } @Suppress("UNCHECKED_CAST") - @Environment(EnvType.CLIENT) fun registerBlockEntityRenderer(renderer: () -> BlockEntityRenderer) { blockEntities.forEach { (_, type) -> BlockEntityRendererRegistry.register(type as BlockEntityType) { _ -> renderer() } } } - @Environment(EnvType.CLIENT) fun setRenderLayer(layer: RenderLayer) { blocks.forEach { (_, block) -> BlockRenderLayerMap.INSTANCE.putBlock(block, layer) } } @@ -662,4 +659,4 @@ class MachineRegistry(private val key: String, val upgradeable: Boolean = true, .defaultFluidStorageProvider() .defaultModelProvider(true) } -} \ No newline at end of file +} From 86f7684c1c0ac92ef0f3f73121850d96cc845a84 Mon Sep 17 00:00:00 2001 From: Slayer5934 Date: Sat, 15 Jun 2024 08:15:01 -0400 Subject: [PATCH 2/2] Crappy fix for crashing modular bench & rancher. --- gradle.properties | 8 ++++---- src/main/java/me/steven/indrev/WCustomTabPanel.java | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 753f30aec..f60b9024f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,14 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx3G # Fabric Properties -minecraft_version=1.19.2 -yarn_mappings=1.19.2+build.28 +minecraft_version=1.19 +yarn_mappings=1.19+build.4 loader_version=0.15.10 #Fabric api -fabric_version=0.77.0+1.19.2 +fabric_version=0.58.0+1.19 loom_version=0.12-SNAPSHOT # Mod Properties -mod_version=1.15.2-BETA-fab15hotfix +mod_version=1.15.2-BETA-fab15hotfix2 maven_group=me.steven archives_base_name=indrev # Kotlin diff --git a/src/main/java/me/steven/indrev/WCustomTabPanel.java b/src/main/java/me/steven/indrev/WCustomTabPanel.java index ebf9b14cf..2073075c6 100644 --- a/src/main/java/me/steven/indrev/WCustomTabPanel.java +++ b/src/main/java/me/steven/indrev/WCustomTabPanel.java @@ -302,6 +302,7 @@ public boolean canFocus() { return true; } + @Environment(EnvType.CLIENT) @Override public InputResult onClick(int x, int y, int button) { super.onClick(x, y, button);