Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MUKSC committed Dec 3, 2024
0 parents commit 4325c5a
Show file tree
Hide file tree
Showing 11 changed files with 323 additions and 0 deletions.
119 changes: 119 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# User-specific stuff
.idea/

*.iml
*.ipr
*.iws

# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Cache of project
.gradletasknamecache

**/build/

# Common working directory
run/
runs/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
2 changes: 2 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Copyright (c) 2024
All rights reserved.
79 changes: 79 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
plugins {
alias(libs.plugins.fabric.loom)
}

version = project.property("mod_version") as String
group = project.property("maven_group") as String

base {
archivesName.set(project.property("archives_base_name") as String)
}

val targetJavaVersion = 17
java {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}

loom {
// accessWidenerPath = file("src/main/resources/darkdaysahead.accesswidener")

mods {
register("mcssc") {
sourceSet("main")
}
}
}

repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
}
}
filter {
includeGroup("maven.modrinth")
}
}
maven("https://maven.bawnorton.com/releases")
maven("https://maven.shedaniel.me")
maven("https://maven.terraformersmc.com/releases")
}

dependencies {
minecraft(libs.com.mojang.minecraft)
mappings(variantOf(libs.net.fabricmc.yarn) { classifier("v2") })
modImplementation(libs.net.fabricmc.fabric.loader)
libs.com.github.bawnorton.mixinsquared.fabric.run {
annotationProcessor(this)
implementation(this)
include(this)
}

modCompileOnly(libs.modrinth.sereneseasons)
}

tasks.processResources {
val properties = mapOf(
"id" to project.property("mod_id") as String,
"version" to project.version,
"name" to project.property("mod_name") as String,
"minecraft_version" to libs.versions.minecraft.get(),
"loader_version" to libs.versions.fabric.loader.get()
)
filteringCharset = "UTF-8"
inputs.properties(properties)
filesMatching("fabric.mod.json") { expand(properties) }
}

tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(targetJavaVersion)
}

tasks.jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName}" }
}
}
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

# Mod Properties
mod_id=moreculling-sereneseasons-compat
mod_version=1.0.0
mod_name=MoreCulling-Serene Seasons Compat
maven_group=me.muksc.mcssc
archives_base_name=moreculling-sereneseasons-compat
19 changes: 19 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[versions]
loom = "1.8-SNAPSHOT"
minecraft = "1.20.1"
yarn = "1.20.1+build.10"
fabric-loader = "0.16.9"
mixinsquared = "0.2.0"

sereneseasons = "4RgDk9NB"

[libraries]
com-mojang-minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
net-fabricmc-yarn = { module = "net.fabricmc:yarn", version.ref = "yarn" }
net-fabricmc-fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-loader" }
com-github-bawnorton-mixinsquared-fabric = { module = "com.github.bawnorton.mixinsquared:mixinsquared-fabric", version.ref = "mixinsquared" }

modrinth-sereneseasons = { module = "maven.modrinth:serene-seasons", version.ref = "sereneseasons" }

[plugins]
fabric-loom = { id = "fabric-loom", version.ref = "loom" }
1 change: 1 addition & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
8 changes: 8 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pluginManagement {
repositories {
maven("https://maven.fabricmc.net/") {
name = "Fabric"
}
gradlePluginPortal()
}
}
12 changes: 12 additions & 0 deletions src/main/java/me/muksc/mcssc/MCSSCMixinCanceller.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package me.muksc.mcssc;

import com.bawnorton.mixinsquared.api.MixinCanceller;

import java.util.List;

public class MCSSCMixinCanceller implements MixinCanceller {
@Override
public boolean shouldCancel(List<String> targetClassNames, String mixinClassName) {
return mixinClassName.equals("sereneseasons.mixin.client.MixinLevelRenderer");
}
}
38 changes: 38 additions & 0 deletions src/main/java/me/muksc/mcssc/mixin/WorldRendererMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package me.muksc.mcssc.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.render.WorldRenderer;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import sereneseasons.season.SeasonHooks;

@Debug(export = true)
@Mixin(value = WorldRenderer.class, priority = 1500)
public abstract class WorldRendererMixin {
@Unique
private World world;
@Unique
private RegistryEntry<Biome> biome;

@WrapOperation(method = "renderWeather", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;getBiome(Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/registry/entry/RegistryEntry;"))
private RegistryEntry<Biome> storeBiome(World instance, BlockPos blockPos, Operation<RegistryEntry<Biome>> original) {
RegistryEntry<Biome> result = original.call(instance, blockPos);
world = instance;
biome = result;
return result;
}

@ModifyExpressionValue(method = "renderWeather", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/biome/Biome;hasPrecipitation()Z"))
private boolean hasPrecipitation(boolean original) {
return SeasonHooks.hasPrecipitationSeasonal(world, biome);
}
}
24 changes: 24 additions & 0 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"schemaVersion": 1,
"id": "${id}",
"version": "${version}",
"name": "${name}",
"description": "",
"authors": [],
"contact": {},
"license": "All-Rights-Reserved",
"environment": "client",
"entrypoints": {
"mixinsquared": [
"me.muksc.mcssc.MCSSCMixinCanceller"
]
},
"mixins": [
"mcssc.mixins.json"
],
"depends": {
"fabricloader": ">=${loader_version}",
"minecraft": "${minecraft_version}",
"sereneseasons": "*"
}
}
12 changes: 12 additions & 0 deletions src/main/resources/mcssc.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"required": true,
"minVersion": "0.8",
"package": "me.muksc.mcssc.mixin",
"compatibilityLevel": "JAVA_17",
"client": [
"WorldRendererMixin"
],
"injectors": {
"defaultRequire": 1
}
}

0 comments on commit 4325c5a

Please sign in to comment.