-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for fabric-1.21.1 #4148
Open
petersv5
wants to merge
1
commit into
webbukkit:v3.0
Choose a base branch
from
petersv5:1.21.1-fabric-port
base: v3.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# gradle | ||
|
||
.gradle/ | ||
build/ | ||
out/ | ||
classes/ | ||
|
||
# eclipse | ||
|
||
*.launch | ||
|
||
# idea | ||
|
||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# vscode | ||
|
||
.settings/ | ||
.vscode/ | ||
bin/ | ||
.classpath | ||
.project | ||
|
||
# fabric | ||
|
||
run/ | ||
|
||
# other | ||
*.log |
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,76 @@ | ||
plugins { | ||
id 'fabric-loom' version '1.6.11' | ||
} | ||
|
||
archivesBaseName = "Dynmap" | ||
version = parent.version | ||
group = parent.group | ||
|
||
eclipse { | ||
project { | ||
name = "Dynmap(Fabric-1.21.1)" | ||
} | ||
} | ||
|
||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21) // Need this here so eclipse task generates correctly. | ||
|
||
configurations { | ||
shadow | ||
implementation.extendsFrom(shadow) | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
|
||
compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' | ||
|
||
shadow project(path: ':DynmapCore', configuration: 'shadow') | ||
|
||
modCompileOnly "me.lucko:fabric-permissions-api:0.1-SNAPSHOT" | ||
compileOnly 'net.luckperms:api:5.4' | ||
|
||
//implementation 'org.xerial:sqlite-jdbc:3.30.1' | ||
shadow group: 'org.xerial', name: 'sqlite-jdbc', version: '3.30.1' | ||
} | ||
|
||
loom { | ||
accessWidenerPath = file("src/main/resources/dynmap.accesswidener") | ||
} | ||
|
||
processResources { | ||
filesMatching('fabric.mod.json') { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
java { | ||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task | ||
// if it is present. | ||
// If you remove this line, sources will not be generated. | ||
withSourcesJar() | ||
} | ||
|
||
jar { | ||
from "LICENSE" | ||
from { | ||
configurations.shadow.collect { it.toString().contains("guava") ? null : it.isDirectory() ? it : zipTree(it) } | ||
} | ||
} | ||
|
||
remapJar { | ||
archiveFileName = "${archivesBaseName}-${project.version}-fabric-${project.minecraft_version}.jar" | ||
destinationDirectory = file '../target' | ||
} | ||
|
||
remapJar.doLast { | ||
task -> | ||
ant.checksum file: task.archivePath | ||
} |
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,4 @@ | ||
minecraft_version=1.21.1 | ||
yarn_mappings=1.21.1+build.3 | ||
loader_version=0.15.11 | ||
fabric_version=0.102.1+1.21.1 |
50 changes: 50 additions & 0 deletions
50
fabric-1.21.1/src/main/java/org/dynmap/fabric_1_21_1/DynmapMod.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,50 @@ | ||
package org.dynmap.fabric_1_21_1; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.loader.api.FabricLoader; | ||
import net.fabricmc.loader.api.ModContainer; | ||
import org.dynmap.DynmapCore; | ||
import org.dynmap.Log; | ||
|
||
import java.io.File; | ||
import java.net.URISyntaxException; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
public class DynmapMod implements ModInitializer { | ||
private static final String MODID = "dynmap"; | ||
private static final ModContainer MOD_CONTAINER = FabricLoader.getInstance().getModContainer(MODID) | ||
.orElseThrow(() -> new RuntimeException("Failed to get mod container: " + MODID)); | ||
// The instance of your mod that Fabric uses. | ||
public static DynmapMod instance; | ||
|
||
public static DynmapPlugin plugin; | ||
public static File jarfile; | ||
public static String ver; | ||
public static boolean useforcedchunks; | ||
|
||
@Override | ||
public void onInitialize() { | ||
instance = this; | ||
|
||
Path path = MOD_CONTAINER.getRootPath(); | ||
try { | ||
jarfile = new File(DynmapCore.class.getProtectionDomain().getCodeSource().getLocation().toURI()); | ||
} catch (URISyntaxException e) { | ||
Log.severe("Unable to get DynmapCore jar path", e); | ||
} | ||
|
||
if (path.getFileSystem().provider().getScheme().equals("jar")) { | ||
path = Paths.get(path.getFileSystem().toString()); | ||
jarfile = path.toFile(); | ||
} | ||
|
||
ver = MOD_CONTAINER.getMetadata().getVersion().getFriendlyString(); | ||
|
||
Log.setLogger(new FabricLogger()); | ||
org.dynmap.modsupport.ModSupportImpl.init(); | ||
|
||
// Initialize the plugin, we will enable it fully when the server starts. | ||
plugin = new DynmapPlugin(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain why you changed this to shadow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a mistake on my part. It is a local modification to include sqlite support on fabirc for some of our local servers. I forgot to remove that when preparing the PR.