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

Update for Fabric 0.15.10, fixes server crash for 1.19.2. #586

Open
wants to merge 2 commits into
base: 1.19
Choose a base branch
from
Open
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
14 changes: 0 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 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.19
yarn_mappings=1.19+build.4
loader_version=0.14.8
loader_version=0.15.10
#Fabric api
fabric_version=0.57.0+1.19
fabric_version=0.58.0+1.19
loom_version=0.12-SNAPSHOT
# Mod Properties
mod_version=1.15.2-BETA
mod_version=1.15.2-BETA-fab15hotfix2
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
Expand All @@ -29,4 +29,4 @@ tr_energy_version=2.0.0-beta1
# Fake Player API
fakeplayerapi_version=0.4.0
# ActiveJ
activej_version=4.3
activej_version=4.3
5 changes: 0 additions & 5 deletions src/main/java/me/steven/indrev/WCustomTabPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -278,7 +277,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 Down Expand Up @@ -320,15 +318,13 @@ 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)) {
onClick(0, 0, 0);
}
}

@Environment(EnvType.CLIENT)
@Override
public void paint(MatrixStack matrices, int x, int y, int mouseX, int mouseY) {
TextRenderer renderer = MinecraftClient.getInstance().textRenderer;
Expand Down Expand Up @@ -382,7 +378,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
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 Expand Up @@ -68,4 +65,4 @@ object GlobalStateController {
}
}
}
}
}
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 Expand Up @@ -91,4 +90,4 @@ open class IRGuiScreenHandler(
open fun onSyncedProperty(index: Int, property: SyncableProperty<*>) {

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -390,4 +389,4 @@ class ModularWorkbenchScreenHandler(syncId: Int, playerInventory: PlayerInventor
val MAX_LEVEL_TEXT = { translatable("gui.indrev.max_level").formatted(Formatting.RED) }
}

}
}
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 Expand Up @@ -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) }
}
}
}
5 changes: 1 addition & 4 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) ->
BlockEntityRendererRegistry.register(type as BlockEntityType<T>) { _ -> renderer() }
}
}

@Environment(EnvType.CLIENT)
fun setRenderLayer(layer: RenderLayer) {
blocks.forEach { (_, block) -> BlockRenderLayerMap.INSTANCE.putBlock(block, layer) }
}
Expand Down Expand Up @@ -662,4 +659,4 @@ class MachineRegistry(private val key: String, val upgradeable: Boolean = true,
.defaultFluidStorageProvider()
.defaultModelProvider(true)
}
}
}