Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
Initial Mod Commit
Browse files Browse the repository at this point in the history
* Basic infrastructure
* Twilight Forest
  - added support for versions later than 3.8.689
  - Transformation Trees now change the biome they're in to Enchanted Forest as expected
* AbyssalCraft
  - Support for versions of AbyssalCraft later than 1.9.6
  - AbyssalCraft is able to change biomes through ritual or corruption
* Bookshelf
  - Added support for mods that use DarkHax's Bookshelf mod
  - WorldUtils#setBiomes correctly alters the biome in worlds with JEID installed
  - This fixes Moss being unable to alter the biome in the Hunting Dimension
  • Loading branch information
sam-kirby committed Apr 1, 2019
1 parent 049ee31 commit efff5d6
Show file tree
Hide file tree
Showing 24 changed files with 759 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# IntelliJ project files
.idea
*.iml
out

# Gradle files
.gradle

# Minecraft files
run

# Project Build files
build

# Compiled jars
*.jar
!gradle/wrapper/gradle-wrapper.jar

# System files
*.DS_Store
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
language: java
jdk: oraclejdk8

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
- rm -f $HOME/.gradle/caches/minecraft/ForgeVersion.json
- rm -f $HOME/.gradle/caches/minecraft/ForgeVersion.json.etag
- rm -rf $HOME/.gradle/caches/minecraft/deobfedDeps
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.bin
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.lock

cache:
directories:
- "$HOME/.gradle/caches"
- "$HOME/.gradle/wrapper"
- "$HOME/.m2/repository"

install: "./gradlew setupCIWorkspace"
script: "./gradlew clean build"

deploy:
provider: releases
skip_cleanup: true
api_key:
secure: w7hJ6+wtexnkItn4rJUinxTSTFhzINv62kcl4I+oLId27P6YVnoB3QV6eutQlYT1hmHNJFcSeG8F4K2Q7I/K6LIzwQHvrZaMU170tV+3BKzlYHa9DUU0AqZtfJjP89jtdWFkxODfakaWJgJBswwwMcwp9Uq2WGJVSAE4aI+TOiwUqxjkXjm6j14Kl9Q8f2blxXlHWfPT/DE3fmSguuT961JE33DwloCaAi5nNHkq+LJLycvG3wI29urCzePdgsIhbweL7+cDUTT0POyorCT/XjrTQT8DGAmnNNzyyV9qnyg5tHFbezhqRm4Yu/vcXHN/8GSYFQwyKREI3r+603ngnziCmgCooRShyZqLKKa2c21P2eOeE9y5W3iCOmmB+jGcGjrPkImSXdb/PymqWfrvq9PNmP7IJy88TjQYBt8ftaZXBF4XC2vVTls4XLJJ3e1CNzj6fpmgRdJ2jb065K2YJ714I9H6w2a4GirzIXq+9EzYNlDV9lcux9E/7GvP16ow7S+n5ZFiwwk6ChBvHu5HIYsAO/30qao3984+EAmXvyeKfN4fVbX4oJsK523aFQOkV+E9qNkH/57LgwKVmrgrWqDLwXfUiiV89V7JBeDCaYlBZviVumT34w2Ndncp4Q00mMMvLxHS26swuNZBwpaimGWqD57OOrY41QhBivWYU0E=
file_glob: true
file: $TRAVIS_BUILD_DIR/build/libs/*
on:
tags: true
92 changes: 92 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
buildscript {
repositories {
jcenter()
maven { url 'https://files.minecraftforge.net/maven' }
maven { url 'http://repo.spongepowered.org/maven' }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'org.spongepowered.mixin'

def buildnumber = System.getenv('TRAVIS_BUILD_NUMBER')
def suffix = buildnumber != null ? ".$buildnumber" : "-SNAPSHOT"
version = "1.0.0$suffix"
group = "uk.bobbytables.jeidsi" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "jeidsi"

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}

minecraft {
version "1.12.2-14.23.5.2815"
runDir "run"
mappings "stable_39"
makeObfSourceJar false // an Srg named sources jar is made by default. uncomment this to disable.

def args = [
'-Dfml.coreMods.load=uk.bobbytables.jeidsi.JEIDsILoadingPlugin',
'-Dmixin.hotSwap=true',
'-Dmixin.checks.interfaces=true'
]
clientJvmArgs.addAll(args)
serverJvmArgs.addAll(args)
}

repositories {
mavenLocal()

maven { url 'https://www.dimdev.org/maven'}

ivy {
url 'https://google.com/404'
ivyPattern('https://google.com/404')
artifactPattern("https://media.forgecdn.net/files/[organisation]/[module]/[revision].[ext]")
}
}

dependencies {
compileOnly 'org.dimdev:mixin:0.7.11-SNAPSHOT'
compileOnly '2626:479:JustEnoughIDs-1.0.2-26@jar'

compileOnly '2691:339:AbyssalCraft-1.12.2-1.9.6@jar'
compileOnly '2683:823:Bookshelf-1.12.2-2.3.577@jar'
compileOnly "2686:476:twilightforest-1.12.2-3.9.888-universal@jar"
}

mixin {
add sourceSets.main, "mixins.jeidsi.refmap.json"
}

jar {
manifest.attributes(
"FMLCorePluginContainsFMLMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"FMLCorePlugin": "uk.bobbytables.jeidsi.JEIDsILoadingPlugin",
"ForceLoadAsMod": "true"
)
}

processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else except the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
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 @@
#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
164 changes: 164 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
#!/usr/bin/env bash

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
echo "$*"
}

die ( ) {
echo
echo "$*"
echo
exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
14 changes: 14 additions & 0 deletions src/main/java/uk/bobbytables/jeidsi/JEIDsI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package uk.bobbytables.jeidsi;

import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@Mod(modid = JEIDsI.MODID, name = JEIDsI.NAME, version = JEIDsI.VERSION, dependencies = "required-after:jeid")
public class JEIDsI {
public static final String MODID = "jeidsi";
public static final String NAME = "JustEnoughIDs Integration";
public static final String VERSION = "1.0.0";

public static final Logger LOGGER = LogManager.getLogger("JEIDsI");
}
49 changes: 49 additions & 0 deletions src/main/java/uk/bobbytables/jeidsi/JEIDsILoadingPlugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package uk.bobbytables.jeidsi;

import net.minecraftforge.common.ForgeVersion;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.Mixins;

import javax.annotation.Nullable;
import java.util.Map;

@IFMLLoadingPlugin.MCVersion(ForgeVersion.mcVersion)
@IFMLLoadingPlugin.SortingIndex(-8000)
public class JEIDsILoadingPlugin implements IFMLLoadingPlugin {
public static final Logger LOGGER = LogManager.getLogger("jeidsi");

public JEIDsILoadingPlugin() {
MixinBootstrap.init();
Mixins.addConfiguration("mixins.jeidsi.init.json");
Mixins.addConfiguration("mixins.jeid.server.init.json"); // We NEED JEID's loader plugin on the server too
}

@Override
public String[] getASMTransformerClass() {
return new String[0];
}

@Override
public String getModContainerClass() {
return null;
}

@Nullable
@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {

}

@Override
public String getAccessTransformerClass() {
return null;
}
}
Loading

0 comments on commit efff5d6

Please sign in to comment.