Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fabric-1.14.4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

apply plugin: 'eclipse'
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.15.2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.16.4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.17.1/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.18.2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.19.4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.20.2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.20.4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.20.6/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion fabric-1.20/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6.11'
id 'fabric-loom' version '1.8.13'
}

archivesBaseName = "Dynmap"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 2 additions & 0 deletions neoforge-1.21.1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build/
/.gradle/
68 changes: 68 additions & 0 deletions neoforge-1.21.1/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
buildscript {
repositories {
jcenter()
mavenCentral()
}
}
plugins {
id 'eclipse'
id 'net.neoforged.gradle.userdev' version '7.1.20'
}

eclipse {
project {
name = "Dynmap(NeoForge-1.21.1)"
}
}

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

ext.buildNumber = System.getenv().BUILD_NUMBER ?: "Dev"

project.archivesBaseName = "${project.archivesBaseName}-neoforge-1.21.1"

minecraft {
accessTransformers {
file('src/main/resources/META-INF/accesstransformer.cfg')
}
}

dependencies {
implementation project(path: ":DynmapCore", configuration: "shadow")
implementation project(path: ':DynmapCoreAPI')
implementation "net.neoforged:neoforge:21.1.219"
}

processResources
{
filesMatching('META-INF/neoforge.mods.toml') {
expand(
version: project.version + '-' + project.ext.buildNumber,
mcversion: "1.21.1"
)
}
}

shadowJar {
dependencies {
include(dependency(':DynmapCore'))
include(dependency("commons-codec:commons-codec:"))
exclude("META-INF/maven/**")
exclude("META-INF/services/**")
}
relocate('org.apache.commons.codec', 'org.dynmap.neoforge_1_21_1.commons.codec')

archiveBaseName = "Dynmap"
archiveClassifier = "neoforge-1.21.1"
destinationDirectory = file '../target'
}

shadowJar.doLast {
task ->
ant.checksum file: task.archivePath
}

build.dependsOn(shadowJar)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.dynmap.neoforge_1_21_1;

public class ClientProxy extends Proxy {
public ClientProxy() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package org.dynmap.neoforge_1_21_1;

import java.io.File;

import org.dynmap.DynmapCommonAPI;
import org.dynmap.DynmapCommonAPIListener;
import org.dynmap.Log;
import org.dynmap.neoforge_1_21_1.DynmapPlugin.OurLog;

import net.minecraft.server.MinecraftServer;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.server.ServerAboutToStartEvent;
import net.neoforged.neoforge.event.server.ServerStartedEvent;
import net.neoforged.neoforge.event.server.ServerStoppingEvent;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.IExtensionPoint;
import net.neoforged.fml.ModList;
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent;

@Mod("dynmap")
public class DynmapMod
{
public static DynmapMod instance;
public static Proxy proxy = new Proxy();
public static DynmapPlugin plugin;
public static File jarfile;
public static String ver;
public static boolean useforcedchunks;

public class APICallback extends DynmapCommonAPIListener {
@Override
public void apiListenerAdded() {
if(plugin == null) {
plugin = proxy.startServer(server);
}
}
@Override
public void apiEnabled(DynmapCommonAPI api) {
}
}

public DynmapMod(IEventBus modEventBus) {
instance = this;
modEventBus.addListener(this::setup);
NeoForge.EVENT_BUS.addListener(this::onServerStarted);
NeoForge.EVENT_BUS.addListener(this::onServerStarting);
NeoForge.EVENT_BUS.addListener(this::onServerStopping);
Log.setLogger(new OurLog());
org.dynmap.modsupport.ModSupportImpl.init();
}

public void setup(final FMLCommonSetupEvent event) {
jarfile = ModList.get().getModFileById("dynmap").getFile().getFilePath().toFile();
ver = ModList.get().getModContainerById("dynmap").get().getModInfo().getVersion().toString();
}

private MinecraftServer server;

public void onServerStarting(ServerAboutToStartEvent event) {
server = event.getServer();
if(plugin == null)
plugin = proxy.startServer(server);
plugin.onStarting(server.getCommands().getDispatcher());
}

public void onServerStarted(ServerStartedEvent event) {
DynmapCommonAPIListener.register(new APICallback());
plugin.serverStarted();
}

public void onServerStopping(ServerStoppingEvent event) {
proxy.stopServer(plugin);
plugin = null;
}
}
Loading