Skip to content

Commit

Permalink
Complete rewrite of the skyrising/skyblock fabric-carpet-1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorrell committed Jul 2, 2020
0 parents commit 9d39243
Show file tree
Hide file tree
Showing 27 changed files with 1,252 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Java CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# gradle

.gradle/
build/
out/
classes/

# idea

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

# vscode

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

# fabric

run/
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SkyBlock

SkyBlock is a module for [fabric-carpet](https://github.com/gnembon/fabric-carpet)

It is a fork of [skyrising/skyblock](https://github.com/skyrising/skyblock)

## Features
- Generator for empty worlds, keeping biomes, structure bounding boxes and end portals
- Generates a skyblock style spawn platform
- Additional wandering trader trades
- Dirt and sand generation from composters

## Installation
- Install [Fabric](https://fabricmc.net/use)
- Download [fabric-carpet](https://github.com/gnembon/fabric-carpet/releases)
- Download [SkyBlock](https://github.com/jsorrell/skyblock/releases)
- Place fabric-carpet and SkyBlock into `<minecraft-directory>/mods/`

## Usage (World Generation)
### Singleplayer
- `Create New World`
- `More World Options...`
- Choose `World Type: Skyblock`

### Multiplayer
- Open `server.properties`
- Change `level-type=default` to `level-type=skyblock`
- Make sure to delete or move the world folder in order to create a new world
153 changes: 153 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
import java.text.SimpleDateFormat

plugins {
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'maven-publish'
}

repositories {
maven {
url 'https://masa.dy.fi/maven'
}
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

def buildDate = new Date()
if (project.mod_version.endsWith('-dev')) {
def df = new SimpleDateFormat(".yyyyMMdd.HHmmss")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
project.mod_version += df.format(buildDate)
}


def branch = gitBranch()
if (branch != "master") {
project.mod_version += "+" + branch;
}

archivesBaseName = project.name
version = project.mod_version
group = project.maven_group

minecraft {
}

dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "carpet:fabric-carpet:${project.carpet_core_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"

// javax.annotation.Nullable/Nonnull
compileOnly "com.google.code.findbugs:jsr305:3.0.1"
}

static def gitCommit() {
def commit = ""
def proc = "git rev-parse HEAD".execute()
proc.in.eachLine { line -> commit = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
commit
}

static def gitBranch() {
def branch = ""
def proc = "git rev-parse --abbrev-ref HEAD".execute()
proc.in.eachLine { line -> branch = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
branch
}

static def gitStatus() {
def exitCode = "git diff --quiet".execute().waitFor() // not added
if (exitCode == 0) {
exitCode = "git diff --cached --quiet".execute().waitFor() // not committed
}
exitCode == 0
}

task generateJava(type: Copy) {
def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
def templateContext = [
version: project.version,
timestamp: df.format(buildDate),
branch: gitBranch(),
commit: gitCommit(),
working_dir_clean: gitStatus(),
minecraft_version: project.minecraft_version,
yarn_mappings: project.yarn_mappings
]
inputs.properties templateContext // for gradle up-to-date check
from 'src/template/java'
into "$buildDir/generated/java"
expand templateContext
}

sourceSets.main.java.srcDir "$buildDir/generated/java"
compileJava.dependsOn generateJava

processResources {
// this will ensure that this task is re-run when there's a change
inputs.property "version", project.version

// replace stuff in fabric.mod.json, nothing else
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"

// add mod metadata
expand "version": project.version
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}

// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}

// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}

jar {
from "LICENSE"
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(jar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}
17 changes: 17 additions & 0 deletions 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

# Mod Properties
mod_version = 2.0.0
maven_group = carpet-extension
archives_base_name = skyblock

# Fabric Properties
# see https://modmuss50.me/fabric.html
minecraft_version=1.16.1
yarn_mappings=1.16.1+build.19
loader_version=0.8.9+build.203
fabric_api_version=0.14.1+build.372-1.16

# see https://masa.dy.fi/maven/carpet/fabric-carpet/
carpet_core_version=1.16-1.4.0+v200623
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Jul 01 19:00:52 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
Loading

0 comments on commit 9d39243

Please sign in to comment.