-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for 1.21 & migrate to NeoForge
- Loading branch information
1 parent
aa147a6
commit d5f507b
Showing
40 changed files
with
1,068 additions
and
8 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
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
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
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
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
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
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
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
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
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
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
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,64 @@ | ||
plugins { | ||
id "architectury-plugin" version "3.4-SNAPSHOT" | ||
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false | ||
} | ||
|
||
architectury { | ||
minecraft = minecraft_version | ||
} | ||
|
||
subprojects { | ||
apply plugin: "dev.architectury.loom" | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
// clientOnlyMinecraftJar() | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${minecraft_version}" | ||
mappings loom.officialMojangMappings() | ||
|
||
// implementation project(path: ":crossversion:common", configuration: "namedElements") | ||
} | ||
} | ||
|
||
allprojects { | ||
apply plugin: "java" | ||
apply plugin: "architectury-plugin" | ||
apply plugin: "maven-publish" | ||
|
||
archivesBaseName = archives_base_name | ||
version = mod_version | ||
group = maven_group | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
options.release = 21 | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
} | ||
} | ||
|
||
task buildAll { | ||
dependsOn subprojects.collect { it.tasks.matching { it.name == 'build' } } | ||
|
||
doLast { | ||
subprojects.forEach { | ||
def platproj = it | ||
if(platproj.name.matches("fabric|forge|quilt")) { | ||
copy { | ||
from platproj.file("build/libs/${archives_base_name}-${mod_version}.jar") | ||
into "${buildDir}/" | ||
rename(".+", "${archives_base_name}-${project.name.substring(2)}-${mod_version}-${platproj.name.capitalize()}.jar") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
task publishAllToMavenLocal { | ||
dependsOn subprojects.collect { it.tasks.matching { it.name == 'publishToMavenLocal' } } | ||
} |
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,42 @@ | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDir "${project(":crossversion:common").projectDir}/src/main/java" | ||
} | ||
resources { | ||
srcDir "${project(":crossversion:common").projectDir}/src/main/resources" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" | ||
|
||
modApi("me.shedaniel.cloth:cloth-config:${cloth_version}"){ | ||
exclude(group: "net.fabricmc") | ||
exclude(group: "net.fabricmc.fabric-api") | ||
} | ||
} | ||
|
||
architectury { | ||
common(enabled_platforms.split(",")) | ||
} | ||
|
||
loom { | ||
accessWidenerPath = project(":crossversion:common").file("src/main/resources/invmove.accesswidener") | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenCommon(MavenPublication) { | ||
artifactId = maven_artifact_id | ||
from components.java | ||
} | ||
} | ||
|
||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. | ||
repositories { | ||
// Add repositories to publish to here. | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
mc1.21/common/src/main/java/me/pieking1215/invmove/InvMove21.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,57 @@ | ||
package me.pieking1215.invmove; | ||
|
||
import com.mojang.blaze3d.vertex.ByteBufferBuilder; | ||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import me.pieking1215.invmove.module.Module; | ||
import me.pieking1215.invmove.module.VanillaModule21; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.Font; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.network.chat.MutableComponent; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public abstract class InvMove21 extends InvMove { | ||
|
||
public InvMove21() { | ||
|
||
super(); | ||
} | ||
|
||
@Override | ||
public Module getVanillaModule() { | ||
return new VanillaModule21(); | ||
} | ||
|
||
@Override | ||
public MutableComponent translatableComponent(String key) { | ||
return Component.translatable(key); | ||
} | ||
|
||
@Override | ||
public MutableComponent literalComponent(String text) { | ||
return Component.literal(text); | ||
} | ||
|
||
@Override | ||
public boolean optionToggleCrouch() { | ||
return Minecraft.getInstance().options.toggleCrouch().get(); | ||
} | ||
|
||
@Override | ||
public void setOptionToggleCrouch(boolean toggleCrouch) { | ||
Minecraft.getInstance().options.toggleCrouch().set(toggleCrouch); | ||
} | ||
|
||
@Override | ||
protected void drawShadow(Font font, PoseStack poseStack, String string, float x, float y, int col){ | ||
MultiBufferSource.BufferSource buffer = MultiBufferSource.immediate(new ByteBufferBuilder(786432)); | ||
font.drawInBatch(string, x, y, col, true, poseStack.last().pose(), buffer, Font.DisplayMode.NORMAL, 0, 15728880); | ||
buffer.endBatch(); | ||
} | ||
|
||
@Override | ||
public ResourceLocation parseResource(String path){ | ||
return ResourceLocation.parse(path); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
mc1.21/common/src/main/java/me/pieking1215/invmove/module/VanillaModule21.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,5 @@ | ||
package me.pieking1215.invmove.module; | ||
|
||
public class VanillaModule21 extends VanillaModule16 { | ||
// any 1.21+ stuff could be done here | ||
} |
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,19 @@ | ||
architectury { | ||
common(enabled_platforms.split(",")) | ||
} | ||
|
||
loom { | ||
accessWidenerPath = project("${parent.path}:common").loom.accessWidenerPath | ||
} | ||
|
||
dependencies { | ||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" | ||
modApi "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}" | ||
|
||
modImplementation("com.terraformersmc:modmenu:${modmenu_version}") { | ||
exclude(group: "net.fabricmc") | ||
exclude(group: "net.fabricmc.fabric-api") | ||
} | ||
|
||
compileOnly(project(path: "${parent.path}:common", configuration: "namedElements")) { transitive false } | ||
} |
7 changes: 7 additions & 0 deletions
7
mc1.21/fabric-like/src/main/java/me/pieking1215/invmove/fabric_like/InvMoveInitializer.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,7 @@ | ||
package me.pieking1215.invmove.fabric_like; | ||
|
||
public interface InvMoveInitializer { | ||
|
||
void init(); | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...bric-like/src/main/java/me/pieking1215/invmove/fabric_like/InvMoveModMenuIntegration.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,12 @@ | ||
package me.pieking1215.invmove.fabric_like; | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import me.pieking1215.invmove.InvMoveConfig; | ||
|
||
public class InvMoveModMenuIntegration implements ModMenuApi { | ||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
return InvMoveConfig::setupCloth; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...bric-like/src/main/java/me/pieking1215/invmove/fabric_like/mixin/client/OverlayMixin.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,16 @@ | ||
package me.pieking1215.invmove.fabric_like.mixin.client; | ||
|
||
import me.pieking1215.invmove.InvMove; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(Screen.class) | ||
public class OverlayMixin { | ||
@Inject(method = "render", at = @At("TAIL")) | ||
public void render(CallbackInfo callbackInfo) { | ||
InvMove.instance().drawDebugOverlay(); | ||
} | ||
} |
Oops, something went wrong.