Skip to content

Commit e9c70de

Browse files
authored
Merge pull request #4172 from viloz1/1.21.4-fix
Add support for fabric 1.21.4
2 parents 58408bb + dc3bdd8 commit e9c70de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3976
-12
lines changed

fabric-1.14.4/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
apply plugin: 'eclipse'

fabric-1.15.2/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.16.4/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.17.1/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.18.2/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
plugins {
3-
id 'fabric-loom' version '1.6.11'
3+
id 'fabric-loom' version '1.9-SNAPSHOT'
44
}
55

66
archivesBaseName = "Dynmap"

fabric-1.19.4/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.20.2/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.20.4/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.20.6/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.20/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.11'
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
33
}
44

55
archivesBaseName = "Dynmap"

fabric-1.21.4/.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# gradle
2+
3+
.gradle/
4+
build/
5+
out/
6+
classes/
7+
8+
# eclipse
9+
10+
*.launch
11+
12+
# idea
13+
14+
.idea/
15+
*.iml
16+
*.ipr
17+
*.iws
18+
19+
# vscode
20+
21+
.settings/
22+
.vscode/
23+
bin/
24+
.classpath
25+
.project
26+
27+
# fabric
28+
29+
run/
30+
31+
# other
32+
*.log

fabric-1.21.4/build.gradle

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
plugins {
2+
id 'fabric-loom' version '1.9-SNAPSHOT'
3+
}
4+
5+
archivesBaseName = "Dynmap"
6+
version = parent.version
7+
group = parent.group
8+
9+
eclipse {
10+
project {
11+
name = "Dynmap(Fabric-1.21.4)"
12+
}
13+
}
14+
15+
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21) // Need this here so eclipse task generates correctly.
16+
17+
configurations {
18+
shadow
19+
implementation.extendsFrom(shadow)
20+
}
21+
22+
repositories {
23+
mavenCentral()
24+
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
25+
}
26+
27+
dependencies {
28+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
29+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
30+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
31+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
32+
33+
compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
34+
35+
shadow project(path: ':DynmapCore', configuration: 'shadow')
36+
37+
modCompileOnly "me.lucko:fabric-permissions-api:0.1-SNAPSHOT"
38+
compileOnly 'net.luckperms:api:5.4'
39+
}
40+
41+
loom {
42+
accessWidenerPath = file("src/main/resources/dynmap.accesswidener")
43+
}
44+
45+
processResources {
46+
filesMatching('fabric.mod.json') {
47+
expand "version": project.version
48+
}
49+
}
50+
51+
java {
52+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
53+
// if it is present.
54+
// If you remove this line, sources will not be generated.
55+
withSourcesJar()
56+
}
57+
58+
jar {
59+
from "LICENSE"
60+
from {
61+
configurations.shadow.collect { it.toString().contains("guava") ? null : it.isDirectory() ? it : zipTree(it) }
62+
}
63+
}
64+
65+
remapJar {
66+
archiveFileName = "${archivesBaseName}-${project.version}-fabric-${project.minecraft_version}.jar"
67+
destinationDirectory = file '../target'
68+
}
69+
70+
remapJar.doLast {
71+
task ->
72+
ant.checksum file: task.archivePath
73+
}

fabric-1.21.4/gradle.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
minecraft_version=1.21.4
2+
yarn_mappings=1.21.4+build.1
3+
loader_version=0.15.11
4+
fabric_version=0.110.5+1.21.4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package org.dynmap.fabric_1_21;
2+
3+
import net.fabricmc.api.ModInitializer;
4+
import net.fabricmc.loader.api.FabricLoader;
5+
import net.fabricmc.loader.api.ModContainer;
6+
import org.dynmap.DynmapCore;
7+
import org.dynmap.Log;
8+
9+
import java.io.File;
10+
import java.net.URISyntaxException;
11+
import java.nio.file.Path;
12+
import java.nio.file.Paths;
13+
14+
public class DynmapMod implements ModInitializer {
15+
private static final String MODID = "dynmap";
16+
private static final ModContainer MOD_CONTAINER = FabricLoader.getInstance().getModContainer(MODID)
17+
.orElseThrow(() -> new RuntimeException("Failed to get mod container: " + MODID));
18+
// The instance of your mod that Fabric uses.
19+
public static DynmapMod instance;
20+
21+
public static DynmapPlugin plugin;
22+
public static File jarfile;
23+
public static String ver;
24+
public static boolean useforcedchunks;
25+
26+
@Override
27+
public void onInitialize() {
28+
instance = this;
29+
30+
Path path = MOD_CONTAINER.getRootPath();
31+
try {
32+
jarfile = new File(DynmapCore.class.getProtectionDomain().getCodeSource().getLocation().toURI());
33+
} catch (URISyntaxException e) {
34+
Log.severe("Unable to get DynmapCore jar path", e);
35+
}
36+
37+
if (path.getFileSystem().provider().getScheme().equals("jar")) {
38+
path = Paths.get(path.getFileSystem().toString());
39+
jarfile = path.toFile();
40+
}
41+
42+
ver = MOD_CONTAINER.getMetadata().getVersion().getFriendlyString();
43+
44+
Log.setLogger(new FabricLogger());
45+
org.dynmap.modsupport.ModSupportImpl.init();
46+
47+
// Initialize the plugin, we will enable it fully when the server starts.
48+
plugin = new DynmapPlugin();
49+
}
50+
}

0 commit comments

Comments
 (0)