Skip to content

Commit

Permalink
WhyMap 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wefhy committed Aug 8, 2022
1 parent bf3d270 commit b737482
Show file tree
Hide file tree
Showing 866 changed files with 3,793 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on: [pull_request, push]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# gradle

.gradle/
build/
out/
classes/

# eclipse

*.launch

# idea

.idea/
*.iml
*.ipr
*.iws

# vscode

.settings/
.vscode/
bin/
.classpath
.project

# macos

*.DS_Store

# fabric

run/
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# I DO NOT currently accept contributions
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Reloading single tile: https://stackoverflow.com/questions/72015263/update-reload-specific-tile-in-leaflet-dynamicly

mogrify -format png32 -path ../experimental32 *.png

https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames

// assets/minecraft/textures/block/acacia_door_top.png

https://github.com/leonbloy/pngj

25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# WhyMap

High performance minecraft world map with web-based interface and infinite zoom.
Your map will be presented at http://localhost:7542

## Setup

You need yarn installed in order to compile the project (for building the frontend)

To run the mod:

`gradle runClient`

To compile `jar` file:

`gradle build`

## License

[GPL-v3](LICENSE)

## Contributions
**I DO NOT accept contributions to this repository at this moment. Pull requests will be rejected.**

If you wish to help with frontend development, [frontend repository](https://github.com/wefhy/WhyMap-frontend) is open for contributions
178 changes: 178 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// Copyright (c) 2022 wefhy

object Constants {
const val modid = "WhyMap"
const val group = "dev.wefhy"
const val name = modid
const val version = "1.0.0"
const val minecraftVersion="1.18.2"
const val yarnMappings="1.18.2+build.1"
const val loaderVersion="0.13.3"
const val fabricVersion="0.47.8+1.18.2"
}

plugins {
id ("fabric-loom") version "0.11-SNAPSHOT"
id ("maven-publish")
id ("org.jetbrains.kotlin.jvm") version "1.7.10"
id ("org.jetbrains.kotlin.plugin.serialization") version "1.7.10"
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
}
base {
archivesBaseName = Constants.name
}
version = Constants.version
group = Constants.group

repositories {
mavenCentral()
maven(url = "https://repo.maven.apache.org/maven2/")
}

//configurations {
// // configuration that holds jars to include in the jar
// extraLibs
//}

val extraLibs: Configuration by configurations.creating



dependencies {
minecraft ("com.mojang:minecraft:${Constants.minecraftVersion}")
mappings ("net.fabricmc:yarn:${Constants.yarnMappings}:v2")
modImplementation ("net.fabricmc:fabric-loader:${Constants.loaderVersion}")
modImplementation ("net.fabricmc.fabric-api:fabric-api:${Constants.fabricVersion}")
modImplementation("net.fabricmc:fabric-language-kotlin:1.8.2+kotlin.1.7.10")

implementation ("io.ktor:ktor-server-core:2.0.3")
implementation ("io.ktor:ktor-server-cio:2.0.3")
implementation ("io.ktor:ktor-server-content-negotiation:2.0.3")
implementation ("io.ktor:ktor-serialization-kotlinx-json:2.0.3")
implementation ("io.ktor:ktor-server-html-builder:2.0.3")
implementation ("io.ktor:ktor-server-cors:2.0.3")
implementation (group = "org.tukaani", name = "xz", version = "1.9")

extraLibs ("io.ktor:ktor-server-core:2.0.3")
extraLibs ("io.ktor:ktor-server-cio:2.0.3")
extraLibs ("io.ktor:ktor-server-content-negotiation:2.0.3")
extraLibs ("io.ktor:ktor-serialization-kotlinx-json:2.0.3")
extraLibs ("io.ktor:ktor-server-html-builder:2.0.3")
extraLibs ("io.ktor:ktor-server-cors:2.0.3")
extraLibs (group = "org.tukaani", name = "xz", version = "1.9")


}

tasks.getByName<ProcessResources>("processResources") {
filesMatching("fabric.mod.json") {
expand(
mutableMapOf("version" to project.version)
)
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
kotlinOptions.freeCompilerArgs += "-Xcontext-receivers"
}

//kotlin {
// targets.all {
// compilatons.all {
// kotlinOptions {
// freeCompilerArgs = freeCompilerArgs + "-Xcontext-receivers"
// }
// }
// }
//}

tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from("LICENSE") {
rename { "${it}_${Constants.name}"}
}
from(extraLibs.resolve().map { if (it.isDirectory) it else zipTree(it) })
// from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
// from(configurations.runtime.map({ if (it.isDirectory) it else zipTree(it) }))
// from(configurations.implementation.map({ if (it.isDirectory()) it else zipTree(it) }))
// from {
// configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
// }
}

val yarnBuild = task<Exec>("yarnBuild") {
workingDir = file("src-vue")
commandLine("yarn", "build")
}

val copyDistFolder = tasks.register<Copy>("copyDistFolder") {
from(file("src-vue/dist"))
into(file("src/main/resources/web"))
exclude("*.js.map")
}

val deleteOldWeb = tasks.register<Delete>("deleteOldWeb") {
delete(files("src/main/resources/web/css"))
delete(files("src/main/resources/web/js"))
}

//abstract class YarnServeTask : DefaultTask() {
// @TaskAction
// fun serve() {
//
// }
//}
//
//tasks.register<YarnServeTask>("yarnServe") {
//
//}

tasks.register<Exec>("serve") {
workingDir = file("src-vue")
commandLine("yarn", "serve")
}



tasks {
"runClient" {
dependsOn(copyDistFolder)
}
"build" {
dependsOn(copyDistFolder)
}
"processResources" {
dependsOn(copyDistFolder)
}
"sourcesJar" {
dependsOn(copyDistFolder)
}
"copyDistFolder" {
dependsOn(deleteOldWeb)
dependsOn(yarnBuild)
}
}


//val fatJar = task("fatJar", type = Jar::class) {
// baseName = "${project.name}-fat"
// manifest {
// attributes["Implementation-Title"] = "Gradle Jar File Example"
// attributes["Implementation-Version"] = version
// attributes["Main-Class"] = "com.mkyong.DateUtils"
// }
//// from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
// from(extraLibs.resolve().map { if (it.isDirectory) it else zipTree(it) })
// with(tasks.jar.get() as CopySpec)
//}
//
//tasks {
// "build" {
// dependsOn(fatJar)
// }
//}
16 changes: 16 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G

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

# Mod Properties
mod_version = 1.0.0
maven_group = dev.wefhy
archives_base_name = whymap

# Dependencies
fabric_version=0.47.8+1.18.2
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit b737482

Please sign in to comment.