Skip to content

Commit

Permalink
Merge pull request #73 from Mesabrook-Development-Team/1.0.0.10
Browse files Browse the repository at this point in the history
1.0.0.10
  • Loading branch information
RavenholmZombie authored Feb 10, 2024
2 parents f9f9fc7 + 7636d5f commit 6f3b456
Show file tree
Hide file tree
Showing 1,704 changed files with 61,263 additions and 2,534 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ build
# other
eclipse
run
*.jar
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<img src="https://i.imgur.com/feeEoWr.png" width=200>
<img src="https://i.imgur.com/3Hn6bk1.png" width=200>

<b>Now part of the Mesabrook Development Team</b>
35 changes: 13 additions & 22 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,26 @@ http://mcforge.readthedocs.io/en/latest/gettingstarted/

Step 1: Open your command-line and browse to the folder where you extracted the zip file.

Step 2: Once you have a command window up in the folder that the downloaded material was placed, type:

Windows: "gradlew setupDecompWorkspace"
Linux/Mac OS: "./gradlew setupDecompWorkspace"

Step 3: After all that finished, you're left with a choice.
For eclipse, run "gradlew eclipse" (./gradlew eclipse if you are on Mac/Linux)

If you prefer to use IntelliJ, steps are a little different.
Step 2: You're left with a choice.
If you prefer to use Eclipse:
1. Run the following command: "gradlew genEclipseRuns" (./gradlew genEclipseRuns if you are on Mac/Linux)
2. Open Eclipse, Import > Existing Gradle Project > Select Folder
or run "gradlew eclipse" to generate the project.
(Current Issue)
4. Open Project > Run/Debug Settings > Edit runClient and runServer > Environment
5. Edit MOD_CLASSES to show [modid]%%[Path]; 2 times rather then the generated 4.

If you prefer to use IntelliJ:
1. Open IDEA, and import project.
2. Select your build.gradle file and have it import.
3. Once it's finished you must close IntelliJ and run the following command:

"gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)

Step 4: The final step is to open Eclipse and switch your workspace to /eclipse/ (if you use IDEA, it should automatically start on your project)
3. Run the following command: "gradlew genIntellijRuns" (./gradlew genIntellijRuns if you are on Mac/Linux)
4. Refresh the Gradle Project in IDEA if required.

If at any point you are missing libraries in your IDE, or you've run into problems you can run "gradlew --refresh-dependencies" to refresh the local cache. "gradlew clean" to reset everything {this does not affect your code} and then start the processs again.

Should it still not work,
Refer to #ForgeGradle on EsperNet for more information about the gradle environment.

Tip:
If you do not care about seeing Minecraft's source code you can replace "setupDecompWorkspace" with one of the following:
"setupDevWorkspace": Will patch, deobfuscate, and gather required assets to run minecraft, but will not generate human readable source code.
"setupCIWorkspace": Same as Dev but will not download any assets. This is useful in build servers as it is the fastest because it does the least work.

Tip:
When using Decomp workspace, the Minecraft source code is NOT added to your workspace in a editable way. Minecraft is treated like a normal Library. Sources are there for documentation and research purposes and usually can be accessed under the 'referenced libraries' section of your IDE.
or the Forge Project Discord discord.gg/UvedJ9m

Forge source installation
=========================
Expand Down
47 changes: 42 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,26 @@ buildscript {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}

plugins {
id 'org.ajoberstar.grgit' version '1.7.2'
id 'com.github.johnrengelman.shadow' version '1.2.4'
}

apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.

final commitId

version = "1.0"
group = "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "modid"
if (hasProperty("grgit")) { // If there's a valid Git repository, get the latest commit ID
commitId = "${grgit.head().abbreviatedId}"
} else { // Else fall back to NOGIT
commitId = "NOGIT"
}

version = "1.0.0.10"
group = "com.mesabrook.ib" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "wbtc"

sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
Expand All @@ -38,7 +51,7 @@ dependencies {
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"

// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
Expand All @@ -55,6 +68,28 @@ dependencies {
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

compile "org.apache.httpcomponents:httpclient:4.3.3"
compile "org.apache.httpcomponents:httpcore:4.3.2"
compile "commons-logging:commons-logging:1.1.3"
provided fileTree(dir:'deps',include:'*.jar')
}

shadowJar {
dependencies {
include(dependency('org.apache.httpcomponents:httpclient:4.3.3'))
include(dependency('org.apache.httpcomponents:httpcore:4.3.2'))
include(dependency('commons-logging:commons-logging:1.1.3'))
}

// Relocate http to prevent conflicts with other mods that include it
relocate 'org.apache.http', 'com.mesabrook.ib.repack.org.apache.http'
relocate 'org.apache.commons.logging', 'com.mesabrook.ib.repack.org.apache.commons.logging'

classifier '' // Replace the default JAR
}

reobf {
shadowJar {} // Reobfuscate the shadowed JAR
}

processResources {
Expand All @@ -76,4 +111,6 @@ processResources {
}
}

sourceSets { main { output.resourcesDir = output.classesDir } }
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
2 changes: 1 addition & 1 deletion changelogs/PR3/changes.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Immersibrook 1.0.0 - The Technology Update - Pre-Release 3
Immersibrook 1.0.0 - The Technology Update - Pre-Release 3a
Binary file added deps/Dynmap-3.4-forge-1.12.2.jar
Binary file not shown.
Binary file added deps/Hwyla-1.8.26-B41_1.12.2.jar
Binary file not shown.
Binary file added deps/ImmersiveEngineering-0.12-98.jar
Binary file not shown.
Binary file added deps/JABCM-1.12.2-0.0.6_A.jar
Binary file not shown.
Binary file added deps/Pam's+HarvestCraft+1.12.2zg.jar
Binary file not shown.
Binary file added deps/device-api-0.3.0-1.12.2.jar
Binary file not shown.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 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
org.gradle.daemon=false
78 changes: 43 additions & 35 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
## 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=""
# 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\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

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

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

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

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -40,31 +59,11 @@ case "`uname`" in
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=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.
Expand All @@ -90,7 +89,7 @@ location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
Expand All @@ -114,6 +113,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
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=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
53 changes: 52 additions & 1 deletion src/main/java/com/mesabrook/ib/Main.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
package com.mesabrook.ib;

import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import org.apache.logging.log4j.Logger;

import com.mesabrook.ib.proxy.CommonProxy;
import com.mesabrook.ib.tab.TabImmersibrook;
import com.mesabrook.ib.telecom.CallManager;
import com.mesabrook.ib.telecom.WirelessEmergencyAlertManager;
import com.mesabrook.ib.util.IndependentTimer;
import com.mesabrook.ib.util.Reference;
import com.mesabrook.ib.util.apiaccess.DataAccess;
import com.mesabrook.ib.util.config.ModConfig;
import com.mesabrook.ib.util.handlers.RegistryHandler;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
Expand All @@ -24,7 +33,7 @@
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;

@Mod(modid = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION, dependencies = "required-after:harvestcraft;required-after:immersiveengineering;required-after:jabcm", updateJSON = Reference.UPDATE_URL)
@Mod(modid = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION, dependencies = "required-after:harvestcraft;required-after:immersiveengineering;required-after:jabcm;required-after:cdm", updateJSON = Reference.UPDATE_URL)
public class Main
{

Expand All @@ -38,30 +47,70 @@ public class Main
public static boolean THERCMOD = false;
public static boolean DYNMAP = false;
public static final Random rand = new Random();
public IndependentTimer timer;

// Config
public static File config;

// Creative Tab
public static final CreativeTabs IMMERSIBROOK_MAIN = new TabImmersibrook("tab_immersibrook");

// New motto system
private List<String> mottos;

private List<String> loadMottos()
{
List<String> mottos = new ArrayList<>();

try
{
InputStream inputStream = getClass().getResourceAsStream("/assets/wbtc/mottos.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
String line;

while ((line = reader.readLine()) != null)
{
mottos.add(line);
}

reader.close();
}
catch (Exception e)
{
e.printStackTrace();
}

return mottos;
}

public String getRandomMotto()
{
int index = rand.nextInt(mottos.size());
return mottos.get(index);
}

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
logger = event.getModLog();
mottos = loadMottos();
Reference.MOTTO = getRandomMotto();
RegistryHandler.preInitRegistries(event);
}

@EventHandler
public void init(FMLInitializationEvent event)
{
Reference.MOTTO = getRandomMotto();
timer = new IndependentTimer();
RegistryHandler.initRegistries();
proxy.init(event);
}

@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
Reference.MOTTO = getRandomMotto();
RegistryHandler.postInitRegistries(event);
}

Expand All @@ -87,5 +136,7 @@ public static void serverStopping(FMLServerStoppingEvent event)
{
WirelessEmergencyAlertManager.instance().stop();
}
CallManager.instance().onServerStop();
DataAccess.shutdown(FMLCommonHandler.instance().getMinecraftServerInstance().getWorld(0));
}
}
Loading

0 comments on commit 6f3b456

Please sign in to comment.