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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.dynmapblockscan.core.statehandlers.StateContainer.WellKnownBlockClasses;
import org.dynmapblockscan.core.util.Matrix3D;
import org.dynmapblockscan.core.util.Vector3D;
import org.dynmapblockscan.core.PathElement;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
Expand Down Expand Up @@ -150,24 +151,14 @@ public static class BlockRecord {
public int lightAttenuation;
}

protected static class PathElement {
String[] modids;
PathElement(String mid) {
modids = new String[] { mid };
}
void addModId(String mid) {
modids = Arrays.copyOf(modids, modids.length + 1);
modids[modids.length-1] = mid;
}
}
protected static class PathDirectory extends PathElement {
Map<String,PathElement> entries = new HashMap<String, PathElement>();
PathDirectory(String mid) {
super(mid);
}

}
protected static Map<String, PathElement> assetmap; // Map of asset paths and mods containing them
protected Map<String, PathElement> assetmap = new HashMap<>(); // Map of asset paths and mods containing them

protected void addElement(String modid, String n) {
String[] tok = n.split("/");
Expand Down
16 changes: 16 additions & 0 deletions core/src/main/java/org/dynmapblockscan/core/PathElement.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.dynmapblockscan.core;

import java.util.Arrays;

public class PathElement {
public String[] modids;

public PathElement(String mid) {
modids = new String[]{ mid };
}

public void addModId(String mid) {
modids = Arrays.copyOf(modids, modids.length + 1);
modids[modids.length - 1] = mid;
}
}
3 changes: 3 additions & 0 deletions fabric-1.21.6-1.21.8/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.gradle/
/build/
/bin/
73 changes: 73 additions & 0 deletions fabric-1.21.6-1.21.8/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
plugins {
id 'fabric-loom' version '1.11-SNAPSHOT'
}

project.archivesBaseName = "${parent.name}-fabric-1.21.6-1.21.8"
version = project.mod_version
group = project.maven_group

eclipse {
project {
name = "${parent.name}-fabric-1.21.6-1.21.8"
}
}

configurations {
shadow
implementation.extendsFrom(shadow)
}

sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21) // Need this here so eclipse task generates correctly.

repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://cursemaven.com' }
}

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 "us.dynmap:DynmapCoreAPI:${parent.version}"

shadow project(path: ":core", configuration: 'shadow')

compileOnly 'net.luckperms:api:5.4'
compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2'
// modCompileOnly "me.lucko:fabric-permissions-api:0.1-SNAPSHOT"
modCompileOnly files("../libs/fabric-permissions-api-0.1.jar")
}

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 = "${parent.name}-${parent.version}-fabric-1.21.6-1.21.8.jar"
destinationDirectory = file '../target'
}

remapJar.doLast {
task ->
ant.checksum file: task.archivePath
}
17 changes: 17 additions & 0 deletions fabric-1.21.6-1.21.8/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.6
yarn_mappings=1.21.6+build.1
loader_version=0.17.2

# Mod Properties
mod_version = 1.0.0
maven_group = com.example
archives_base_name = fabric-example-mod

# Dependencies
fabric_version=0.128.2+1.21.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.dynmapblockscan.fabric_1_21_6_1_21_8;

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

import net.fabricmc.api.EnvType;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.ModContainer;
import net.minecraft.server.MinecraftServer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.loader.api.FabricLoader;

import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;

public class DynmapBlockScanMod implements ModInitializer
{
public static DynmapBlockScanPlugin.OurLog logger = new DynmapBlockScanPlugin.OurLog();
private static final ModContainer MOD_CONTAINER = FabricLoader.getInstance().getModContainer("dynmapblockscan")
.orElseThrow(() -> new RuntimeException("Failed to get mod container: dynmapblockscan"));

// The instance of your mod that Forge uses.
public static DynmapBlockScanMod instance;

// Says where the client and server 'proxy' code is loaded.
public static Proxy proxy = null;

public static DynmapBlockScanPlugin plugin;
public static File jarfile;

public DynmapBlockScanMod(){
if(FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT){
proxy = new ClientProxy();
}else{
proxy = new Proxy();
}
}
@Override
public void onInitialize(){
instance = this;

logger.info("setup");

jarfile = MOD_CONTAINER.getOrigin().getPaths().get(0).toFile();

ServerLifecycleEvents.SERVER_STARTING.register(this::onServerStarting);
ServerLifecycleEvents.SERVER_STARTED.register(this::onServerStarted);
ServerLifecycleEvents.SERVER_STOPPED.register(this::onServerStopped);

//FileUtils.getOrCreateDirectory(FabricLoader.getInstance().getConfigDir().resolve("dynmapblockscan"), "dynmapblockscan");
//ModLoadingContext.registerConfig("dynmapblockscan", ModConfig.Type.COMMON, SettingsConfig.SPEC, "dynmapblockscan/settings.toml");

}

public static class SettingsConfig
{
// public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
// public static final ForgeConfigSpec SPEC;
//
// public static final ForgeConfigSpec.ConfigValue<List<? extends String>> excludeModules;
// public static final ForgeConfigSpec.ConfigValue<List<? extends String>> excludeBlockNames;
public static List<String> excludedModules = Arrays.asList("minecraft"); // <--- Remove "minecraft" to generate vanilla blocks
public static List<String> excludedBlockNames = Arrays.asList();

static
{
// BUILDER.comment("DynmapBlockScan settings");
// BUILDER.push("settings");
// excludeModules = BUILDER.comment("Which modules to exclude").defineList("exclude_modules", Arrays.asList("minecraft"), entry -> true);
// excludeBlockNames = BUILDER.comment("Which block names to exclude").defineList("exclude_blocknames", Arrays.asList(), entry -> true);
// BUILDER.pop();
//
// SPEC = BUILDER.build();
}
}

private MinecraftServer server;

public void onServerStarting(MinecraftServer server_) {
server = server_;
if(plugin == null)
plugin = proxy.startServer(server);
// plugin.setDisabledModules((List<String>) SettingsConfig.excludeModules.get());
// plugin.setDisabledBlockNames((List<String>) SettingsConfig.excludeBlockNames.get());
plugin.setDisabledModules((List<String>) SettingsConfig.excludedModules);
plugin.setDisabledBlockNames((List<String>) SettingsConfig.excludedBlockNames);
plugin.serverStarting();
}

public void onServerStarted(MinecraftServer server_) {
plugin.serverStarted();
}

public void onServerStopped(MinecraftServer server_) {
proxy.stopServer(plugin);
plugin = null;
}

// @NetworkCheckHandler
// public boolean netCheckHandler(Map<String, String> mods, Side side) {
// return true;
// }
}
Loading