This repository has been archived by the owner on Jul 20, 2024. It is now read-only.
generated from TomJuri/ExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Osama
committed
Apr 9, 2024
1 parent
13585aa
commit a98cbf1
Showing
33 changed files
with
1,411 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,100 @@ | ||
plugins { | ||
kotlin("jvm") version "1.9.0" | ||
id("cc.polyfrost.loom") version "0.10.0.5" | ||
id("dev.architectury.architectury-pack200") version "0.1.3" | ||
id("com.github.johnrengelman.shadow") version "8.1.1" | ||
id("net.kyori.blossom") version "1.3.1" | ||
kotlin("jvm") version "1.9.0" | ||
id("cc.polyfrost.loom") version "0.10.0.5" | ||
id("dev.architectury.architectury-pack200") version "0.1.3" | ||
id("com.github.johnrengelman.shadow") version "8.1.1" | ||
id("net.kyori.blossom") version "1.3.1" | ||
} | ||
|
||
group = "dev.macrohq" | ||
version = "1.0.0" | ||
|
||
repositories { | ||
maven("https://repo.polyfrost.cc/releases") | ||
maven("https://repo.spongepowered.org/repository/maven-public") | ||
maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") | ||
maven("https://repo.polyfrost.cc/releases") | ||
maven("https://repo.spongepowered.org/repository/maven-public") | ||
maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") | ||
} | ||
|
||
val embed: Configuration by configurations.creating | ||
configurations.implementation.get().extendsFrom(embed) | ||
|
||
dependencies { | ||
minecraft("com.mojang:minecraft:1.8.9") | ||
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") | ||
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") | ||
compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.0-alpha+") | ||
embed("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") | ||
compileOnly("org.spongepowered:mixin:0.8.5-SNAPSHOT") | ||
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor") | ||
modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.2") | ||
embed("com.squareup.okhttp3:okhttp:3.14.9") | ||
minecraft("com.mojang:minecraft:1.8.9") | ||
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") | ||
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") | ||
compileOnly("cc.polyfrost:oneconfig-1.8.9-forge:0.2.0-alpha+") | ||
embed("cc.polyfrost:oneconfig-wrapper-launchwrapper:1.0.0-beta+") | ||
compileOnly("org.spongepowered:mixin:0.8.5-SNAPSHOT") | ||
annotationProcessor("org.spongepowered:mixin:0.8.5-SNAPSHOT:processor") | ||
modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.2") | ||
embed("com.squareup.okhttp3:okhttp:3.14.9") | ||
implementation("it.unimi.dsi:fastutil:8.2.1") | ||
} | ||
|
||
blossom { | ||
replaceToken("%%VERSION%%", version) | ||
replaceToken("%%VERSION%%", version) | ||
} | ||
|
||
loom { | ||
runConfigs { | ||
named("client") { | ||
ideConfigGenerated(true) | ||
} | ||
runConfigs { | ||
named("client") { | ||
ideConfigGenerated(true) | ||
} | ||
} | ||
|
||
launchConfigs { | ||
getByName("client") { | ||
arg("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker") | ||
property("devauth.enabled", "false") | ||
} | ||
launchConfigs { | ||
getByName("client") { | ||
arg("--tweakClass", "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker") | ||
property("devauth.enabled", "false") | ||
} | ||
} | ||
|
||
forge { | ||
pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) | ||
mixinConfig("mixins.swiftslayer.json") | ||
} | ||
forge { | ||
pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) | ||
mixinConfig("mixins.swiftslayer.json") | ||
} | ||
} | ||
|
||
tasks { | ||
jar { | ||
manifest.attributes( | ||
mapOf( | ||
"ModSide" to "CLIENT", | ||
"TweakOrder" to "0", | ||
"ForceLoadAsMod" to true, | ||
"TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker", | ||
"MixinConfigs" to "mixins.swiftslayer.json" | ||
) | ||
) | ||
dependsOn(shadowJar) | ||
} | ||
jar { | ||
manifest.attributes( | ||
mapOf( | ||
"ModSide" to "CLIENT", | ||
"TweakOrder" to "0", | ||
"ForceLoadAsMod" to true, | ||
"TweakClass" to "cc.polyfrost.oneconfig.loader.stage0.LaunchWrapperTweaker", | ||
"MixinConfigs" to "mixins.swiftslayer.json" | ||
) | ||
) | ||
dependsOn(shadowJar) | ||
} | ||
|
||
remapJar { | ||
input.set(shadowJar.get().archiveFile) | ||
archiveClassifier.set("") | ||
} | ||
remapJar { | ||
input.set(shadowJar.get().archiveFile) | ||
archiveClassifier.set("") | ||
} | ||
|
||
shadowJar { | ||
isEnableRelocation = true | ||
relocationPrefix = "dev.macrohq.swiftslayer.relocate" | ||
relocate("cc.polyfrost", "cc.polyfrost") // this is so oneconfig doesn't get relocated, causing the tweaker to not be found | ||
configurations = listOf(embed) | ||
} | ||
shadowJar { | ||
isEnableRelocation = true | ||
relocationPrefix = "dev.macrohq.swiftslayer.relocate" | ||
relocate( | ||
"cc.polyfrost", | ||
"cc.polyfrost" | ||
) // this is so oneconfig doesn't get relocated, causing the tweaker to not be found | ||
configurations = listOf(embed) | ||
} | ||
|
||
processResources { | ||
inputs.property("version", version) | ||
filesMatching(listOf("mcmod.info")) { | ||
expand(mapOf("version" to version)) | ||
} | ||
processResources { | ||
inputs.property("version", version) | ||
filesMatching(listOf("mcmod.info")) { | ||
expand(mapOf("version" to version)) | ||
} | ||
} | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
java.toolchain.languageVersion = JavaLanguageVersion.of(8) |
31 changes: 31 additions & 0 deletions
31
src/main/java/dev/macrohq/swiftslayer/mixin/world/MixinChunkProviderClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package dev.macrohq.swiftslayer.mixin.world; | ||
|
||
import dev.macrohq.swiftslayer.util.accessor.IChunkProviderClient; | ||
import net.minecraft.client.multiplayer.ChunkProviderClient; | ||
import net.minecraft.util.LongHashMap; | ||
import net.minecraft.world.chunk.Chunk; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(ChunkProviderClient.class) | ||
public class MixinChunkProviderClient implements IChunkProviderClient { | ||
|
||
@Shadow | ||
private LongHashMap<Chunk> chunkMapping; | ||
|
||
@Shadow | ||
private List<Chunk> chunkListing; | ||
|
||
@Override | ||
public LongHashMap<Chunk> chunkMapping() { | ||
return this.chunkMapping; | ||
} | ||
|
||
@Override | ||
public List<Chunk> chunkListing() { | ||
return this.chunkListing; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.