Skip to content

Commit

Permalink
1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
ImUrX committed Mar 18, 2022
1 parent 6b9f71b commit 8e07ec7
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "0.10.0-SNAPSHOT" apply false
id "dev.architectury.loom" version "0.11.0-SNAPSHOT" apply false
}

architectury {
Expand All @@ -19,7 +19,7 @@ subprojects {
// The following line declares the mojmap mappings, you may use other mappings as well
// mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
mappings "net.fabricmc:yarn:1.18+build.1:v2"
mappings "net.fabricmc:yarn:1.17.1+build.65:v2"

implementation "io.github.imurx:arboard:${rootProject.arboard_version}"
}
Expand Down Expand Up @@ -54,12 +54,10 @@ allprojects {

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
options.release = 16
}

java {
withSourcesJar()
}
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ private void initFabrishot() {
FramebufferCaptureCallback.EVENT.register((dimension, byteBuffer) -> {
byte[] array = new byte[dimension.height * dimension.width * 4];
//im sure there is a better way but no idea
for (int i = 0; i < byteBuffer.capacity(); i+=3) {
for(int j = 0; j < 3; j++) array[i+j] = byteBuffer.get(j+i);
array[i+3] = -1;
int offset = 0;
for (int i = 0; i < byteBuffer.capacity(); i++) {
if(i % 3 == 0 && i != 0) {
array[i+offset] = -1;
offset++;
}
array[offset+i] = byteBuffer.get(i);
}
ScreenshotCopy.copyScreenshot(dimension.width, dimension.height, array);
});
Expand Down
4 changes: 2 additions & 2 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"mixins": ["screencopy.mixins.json"],
"depends": {
"fabricloader": ">=0.9.0",
"minecraft": ">=1.18",
"cloth-config": ">=6.1.48",
"minecraft": ">=1.17",
"cloth-config2": ">=5.3.58",
"fabric-lifecycle-events-v1": "*",
"fabric-resource-loader-v0": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/screencopy.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"package": "io.github.imurx.screenshotcopy.fabric.mixins",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_16",
"client": [
"MixinScreenshotRecorder"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.ConfigGuiHandler;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.IExtensionPoint;
import net.minecraftforge.fmlclient.ConfigGuiHandler;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.network.NetworkConstants;

@Mod(ScreenshotCopy.MOD_ID)
public class ScreenshotCopyForge {
public ScreenshotCopyForge() {
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (a, b) -> true));
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> "Client-side mod", (a, b) -> b));
DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> this::client);
}

Expand Down
8 changes: 4 additions & 4 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader = "javafml"
loaderVersion = "[38,)"
loaderVersion = "[37,)"
issueTrackerURL = "https://github.com/ImUrX/screencopy/issues"
license = "MIT OR Apache-2.0"

Expand All @@ -18,20 +18,20 @@ logoFile = "icon.png"
[[dependencies.screencopy]]
modId = "forge"
mandatory = true
versionRange = "[38,)"
versionRange = "[37,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.screencopy]]
modId = "minecraft"
mandatory = true
versionRange = "[1.18,)"
versionRange = "[1.17,)"
ordering = "NONE"
side = "BOTH"

[[dependencies.screencopy]]
modId = "cloth_config"
mandatory = true
versionRange = "[6.1.48,)"
versionRange = "[5.3.58,)"
ordering = "NONE"
side = "CLIENT"
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
org.gradle.jvmargs=-Xmx2048M

minecraft_version=1.18
minecraft_version=1.17.1

archives_base_name=screenshotcopy
mod_version=1.0.0
mod_version=0.9.0
maven_group=io.github.imurx

cloth_config_version=6.1.48
cloth_config_version=5.3.58
arboard_version=1.0.2

fabric_loader_version=0.12.12
fabric_api_version=0.46.1+1.18
mod_menu_version=3.0.1
fabrishot_version=1.6.0
fabric_loader_version=0.13.3
fabric_api_version=0.46.1+1.17
mod_menu_version=2.0.14
fabrishot_version=1.5.1

forge_version=1.18-38.0.17
forge_version=1.17.1-37.1.1

0 comments on commit 8e07ec7

Please sign in to comment.