Skip to content

Commit

Permalink
Actually fixed the incompatibility with Fabric Loader 0.15.x this tim…
Browse files Browse the repository at this point in the history
…e. Mod has been confirmed to work server-side and not cause crashes. I had to update LibGUI as well, silly me. Also fixed an internal string which showed "indrev.indrev_group" in the Creative Tab Menu.
  • Loading branch information
LokeYourC3PH committed Jan 14, 2024
1 parent 724e6f7 commit fcd54a7
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center"><img src="https://i.imgur.com/1ZwHaAt.png"></p>
<h3 align="center">Industrial Revolution</h3>
<h3 align="center">Industrial ReZolution</h3>
<p align="center">An Industrial mod made for Fabric.</p>
<p align="center">
<a title="Fabric API" href="https://github.com/FabricMC/fabric">
Expand Down
14 changes: 0 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,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"
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ org.gradle.jvmargs=-Xmx3G
# Fabric Properties
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.8
loader_version=0.14.21
loader_version=0.15.0
#Fabric api
fabric_version=0.84.0+1.20.1
loom_version=1.2-SNAPSHOT
# Mod Properties
mod_version=1.16.5-BETA
mod_version=1.16.5-BETA-Hotfix
maven_group=me.steven
archives_base_name=indrev
archives_base_name=indrez
# Kotlin
kotlin_version=1.8.22
fabric_kotlin_version=1.9.5+kotlin.1.8.22
# LibGui
libgui_version=8.0.0+1.20
libgui_version=8.1.1+1.20.1
# Mod Menu
modmenu_version=7.0.1
# Roughly Enough Items
Expand Down
6 changes: 0 additions & 6 deletions src/main/java/me/steven/indrev/WCustomTabPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ public void setSize(int x, int y) {
tabRibbon.setSize(x, TAB_HEIGHT);
}

@Environment(EnvType.CLIENT)
@Override
public void addPainters() {
super.addPainters();
Expand Down Expand Up @@ -279,7 +278,6 @@ public Tab build() {
if (!this.tooltip.isEmpty()) {
//noinspection Convert2Lambda
tooltip = new Consumer<TooltipBuilder>() {
@Environment(EnvType.CLIENT)
@Override
public void accept(TooltipBuilder builder) {
builder.add(WCustomTabPanel.Tab.Builder.this.tooltip.toArray(new Text[0]));
Expand All @@ -305,7 +303,6 @@ public boolean canFocus() {
return true;
}

@Environment(EnvType.CLIENT)
@Override
public InputResult onClick(int x, int y, int button) {
super.onClick(x, y, button);
Expand All @@ -322,7 +319,6 @@ public InputResult onClick(int x, int y, int button) {
}


@Environment(EnvType.CLIENT)
@Override
public InputResult onKeyPressed(int ch, int key, int modifiers) {
if (isActivationKey(ch)) {
Expand All @@ -332,7 +328,6 @@ public InputResult onKeyPressed(int ch, int key, int modifiers) {
return InputResult.IGNORED;
}

@Environment(EnvType.CLIENT)
@Override
public void paint(DrawContext ctx, int x, int y, int mouseX, int mouseY) {
MatrixStack matrices = ctx.getMatrices();
Expand Down Expand Up @@ -387,7 +382,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),
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/me/steven/indrev/IndustrialRevolution.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ object IndustrialRevolution : ModInitializer {
val MOD_GROUP_KEY = RegistryKey.of(RegistryKeys.ITEM_GROUP, identifier("mod_group"))

val MOD_GROUP: ItemGroup =
FabricItemGroup.builder().icon { ItemStack { MachineRegistry.PULVERIZER_REGISTRY.block(Tier.MK4).asItem() } }.displayName(Text.literal("indrev.indrev_group")).build()
FabricItemGroup.builder().icon { ItemStack { MachineRegistry.PULVERIZER_REGISTRY.block(Tier.MK4).asItem() } }.displayName(Text.literal("Industrial ReZolution")).build()

val COOLERS_TAG: TagKey<Item> = TagKey.of(RegistryKeys.ITEM, identifier("coolers"))
val WRENCH_TAG: TagKey<Item> = TagKey.of(RegistryKeys.ITEM, Identifier("c:wrenches"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<T : LivingEntity, M : EntityModel<T>>(
context: FeatureRendererContext<T, M>,
loader: EntityModelLoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ import net.minecraft.world.World
import java.util.function.LongFunction

object GlobalStateController {
@Environment(EnvType.CLIENT)
val chunksToUpdate: Long2ObjectMap<MutableSet<BlockPos>> = 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ open class IRGuiScreenHandler(

}

@Environment(EnvType.CLIENT)
override fun addPainters() {
super.addPainters()
val offset = 170 - rootPanel.width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 0 additions & 3 deletions src/main/kotlin/me/steven/indrev/registry/MachineRegistry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class MachineRegistry(private val key: String, val upgradeable: Boolean = true,
private val blocks: MutableMap<Tier, Block> = EnumMap(Tier::class.java)
val blockEntities: MutableMap<Tier, BlockEntityType<*>> = EnumMap(Tier::class.java)

@Environment(EnvType.CLIENT)
val modelProvider: MutableMap<Tier, (String) -> UnbakedModel?> = EnumMap(Tier::class.java)

fun blockProvider(blockProvider: MachineRegistry.(Tier) -> Block): MachineRegistry {
Expand Down Expand Up @@ -162,14 +161,12 @@ class MachineRegistry(private val key: String, val upgradeable: Boolean = true,
}

@Suppress("UNCHECKED_CAST")
@Environment(EnvType.CLIENT)
fun <T : BlockEntity> registerBlockEntityRenderer(renderer: () -> BlockEntityRenderer<T>) {
blockEntities.forEach { (_, type) ->
BlockEntityRendererFactories.register(type as BlockEntityType<T>) { _ -> renderer() }
}
}

@Environment(EnvType.CLIENT)
fun setRenderLayer(layer: RenderLayer) {
blocks.forEach { (_, block) -> BlockRenderLayerMap.INSTANCE.putBlock(block, layer) }
}
Expand Down

0 comments on commit fcd54a7

Please sign in to comment.