Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
Commit of the base files and code.
  • Loading branch information
Mrbrutal committed Dec 29, 2015
1 parent fae8ae0 commit 83bbc87
Show file tree
Hide file tree
Showing 13 changed files with 214 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Thumbs.db
#################
*.war
*.ear
*.iml
*.ipr
*.iws

# Files #
#########
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
To get started, [sign the Contributor License Agreement](https://cla-assistant.io/Mrbrutal/Traincraft).
52 changes: 52 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Traincraft Mod License

## Usage
* The "*.cfg" files in the Traincraft config folder are not considered part of Traincraft and may be freely distributed.

* The Traincraft API is not considered part of Traincraft and may be freely distributed and/or used as you see fit, according to the MIT License.

* You may not use Traincraft to generate revenue for yourself except in the cases listed below.

* You may not distribute modified versions of Traincraft.

* You may install Traincraft on multiplayer servers and are **ALLOWED** to earn revenue as you desire from server usage fees, donations, sold services, or anything else you can come up with.
* If you wish to create a **public** client bundle including Traincraft for your users, you must follow the Public Mod Pack Restrictions below.
* **Private client bundles are permitted without requiring that you meet the restrictions on Public Mod Packs, but they must be protected via password or white-list in such a way that only server users are allowed to access it.**

## Derivatives
* You may create, publish, and earn revenue from a texture pack made for Traincraft so long as it contains no Traincraft code or original Traincraft art assets.

* You may create, publish, and earn revenue from an addon made for Traincraft using the Traincraft API (addon being defined as a mini-mod that requires Traincraft be installed to function), though Mrbrutal(or a contributor) reserves the right to implement similar features if desired. However, no addon code will ever be included in Traincraft without the addon makers permission.

* You may create, publish, and earn revenue from videos that display all or part of Traincraft. You should but are not required to provide a link to the [Traincraft Website](http://traincraft-mod.com/).

* You may create, publish, and earn revenue from maps that require Traincraft. You may distribute Traincraft with your map if you meet the Public Mod Pack requirements defined below. If you require your users to install Traincraft, provide a link to the [Traincraft Website](http://traincraft-mod.com/).

## Distribution
* Except in the case of Public Mod Packs, you may not publicly distribute Traincraft on another site without Mrbrutal's explicit permission. And if you have permission you must include a link to the [Traincraft Blog](http://traincraft-mod.com/) and [Blog](http://blog.meansoft.si/) and use the download links provided there unless you receive permission to do otherwise. Proper attribution must be provided regardless and you must post a link to this [License](https://github.com/Mrbrutal/Traincraft-164/blob/master/LICENSE.md).

## Public Mod Packs
* This section pertains **ONLY** to publicly available mod packs. The section does not apply to Private Server Packs as defined previously in the Usage Section.

* This is to be opened up after the Patreon goal is met. You can view the progres here: [Patreon](http://www.patreon.com/Mrbrutal)

* You are **REQUIRED** to **PUBLICLY** post a licensing page with entries for all the mods currently in your mod pack (links to licenses, images of PMs, posts by devs, etc...). This is the single most important requirement you must meet. If you cannot or will not do this, you cannot use Traincraft in your mod pack.
* You may not sell the mod pack.
* You are not allowed to use the latest series of Traincraft for at least a week after it's release, to protect against game-breaking problems or bugs.
* You must provide a link to the [Traincraft Blog](http://blog.meansoft.si/), [Traincraft Website](http://traincraft-mod.com) and [Traincraft License](https://github.com/Mrbrutal/Traincraft-164/blob/master/LICENSE.md) on your website.
* Beta builds are never to be packaged as part of a public mod pack. Only public versions of the mod can be used in Public mod packs.

## Source
* You may not create works using the Traincraft code (source or binary) without Mrbrutal's explicit permission except in the cases listed in this license.

* The source code is hosted on [GitHub](https://github.com/Mrbrutal/Traincraft)

* You may **NOT** create derivative Jars from Traincraft source to distribute to other users.

* You **MAY** use snippets of Traincraft Code posted on the Official Github in your own projects, but only if your project consists of less than 25% of Traincraft derived code. You must give credit to the Traincraft Project for the code used, including a link to the Github Project. Put this in your class file headers that contain Traincraft code, in your readme, and on the main download page.

* You may **NOT** use Traincraft Art Assets in other projects **unless** the project is intended to operate alongside Traincraft. Examples are Addons and InterMod Integration. Art assests include and are not limited to: Textures, Models(.obj or source code), Sounds, Any other art part of Traincraft.

* You **MAY** fork and edit the Github Project for the purpose of contributing to the Official Traincraft Project. You may **NOT** distribute any Jar created from a fork for any reason.

* All contributions to the Official Traincraft Project must be covered by a Contributor Licensing Agreement signed by the contributor. See the Github readme for more details.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Traincraft - A mod for Minecraft

Here you will find the source code for the **Official Traincraft Project**.


## What is Traincraft?

Traincraft is a mod written for [Minecraft](https://minecraft.net/). It is built on top of the [Minecraft Forge](https://github.com/MinecraftForge) API.

It adds new functionality and looks to the vanilla trains, and some other areas of the game. It adds over 80+ trains, wagons, and other vehicles. It also ads a completely new railway system with curved tracks and slopes. It was originaly started by **Spitfire4466**, then jointly developed with **Mrbrutal**, and now maintained by me, **Mrbrutal**. It has had well over 1,000,000 downloads and has been in development since 1.2.x versions of Minecraft.

## Why are you posting the Source Code?

> Since Spitfire4466 and me are exceedingly low on time to work on this project, open source was the only viable sollution. But since open source is something I've never done on this level or size, I'm a bit hessitant to do so. But in the hopes that I can still be a part of this and so that we can make Traincraft great again, I'm opening the source code for everyone to see. Furthermore, both versions of Traincraft will be open sourced, so that anyone willing to contribute will be able to contribute on both fronts.
## Official Links

* The main page with downloads: http://www.traincraft-mod.com
* The Blog and Forums page: http://blog.meansoft.si
* The Wiki: http://wiki.meansoft.si
* IRC: #Traincraft on Esper.net - Currently not used
* Patreon Page: http://www.patreon.com/Mrbrutal

<a href="http://www.patreon.com/Mrbrutal"> ![Patreon](http://blog.meansoft.si/blog/wp-content/uploads/2014/09/kaGh5_patreon_name_and_message.png)</a>

## Issues

An issue system or website will be provided in due time. Possibly, we might just use the GitHub's own system.

## Contributing

Traincraft Project welcomes contributions from anyone, provided they have signed the Contributor Licensing Agreement (CLA) found [here](https://cla-assistant.io/Mrbrutal/Traincraft).

Signing the CLA is simple, just follow the link, and hit the "I Agree" button and you are good to go.

Regarding new features/behavior changes, please submit a Suggestion Issue to the Tracker before you write a single line of code. Keeping everyone on the same page saves time and effort and reduces negative experiences all around when a change turns out to be controversial.

For now, the focus should be on updating the mod to the 1.7.x and 1.8.x branches, before adding any new features. Those will be added when the rewrite version is being done.

## Building

Traincraft will follow standard Forge conventions for setting up and building a project, with a couple additional details (details to come).

There will also be a jenkins build engine available for setting things up, and building releases quicker (details to come).

## License

Traincraft is licensed under a custom usage license tailored specifically for the project. It can be read [here](https://github.com/Mrbrutal/Traincraft-164/blob/master/LICENSE.md).

* Key things to keep in mind:
* You may **NOT** create works using the Traincraft code (source or binary) without Mrbrutal's explicit permission except in the cases listed in this license.
* You may **NOT** create derivative Jars from Traincraft source to distribute to other users.
* You **MAY** use snippets of Traincraft Code posted on the Official Github in your own projects, but only if your project consists of less than 25% of Traincraft derived code. You must give credit to the Traincraft Project for the code used, including a link to the Github Project. Put this in your class file headers that contain Traincraft code, in your readme, and on the main download page.
* You may **NOT** use Traincraft Art Assets in other projects **unless** the project is intended to operate alongside Traincraft. Examples are Addons and InterMod Integration. Art assests include and are not limited to: Textures, Models(.obj or source code), Sounds, Any other art part of Traincraft.
* You **MAY** fork and edit the Github Project for the purpose of contributing to the Official Traincraft Project. You may **NOT** distribute any Jar created from a fork for any reason.
* All contributions to the Official Traincraft Project must be covered by a Contributor Licensing Agreement signed by the contributor.
50 changes: 46 additions & 4 deletions Traincraft.iml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="si.meansoft.Traincraft" external.system.module.version="1.7.2-1.0.0_000" type="JAVA_MODULE" version="4">
<module external.linked.project.id=":Traincraft" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/../MeanCore" external.system.id="GRADLE" external.system.module.group="si.meansoft.Traincraft" external.system.module.version="1.7.2-1.0.0_000" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/api/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/api/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
Expand Down Expand Up @@ -53,6 +53,48 @@
<orderEntry type="library" exported="" name="Gradle: jinput-platform-2.0.5-natives-windows" level="project" />
<orderEntry type="library" exported="" name="Gradle: scala-reflect-2.10.2" level="project" />
<orderEntry type="library" exported="" name="Gradle: unresolved_dependency___si_meansoft_meancore_MeanCore_1_7_2_1_0_0_16" level="project" />
<orderEntry type="library" exported="" name="Gradle: :forgeSrc:1.7.2-10.12.2.1147" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.minecraft:launchwrapper:1.9" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.ow2.asm:asm-debug-all:4.1" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.scala-lang:scala-library:2.10.2" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.scala-lang:scala-compiler:2.10.2" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.sf.jopt-simple:jopt-simple:4.5" level="project" />
<orderEntry type="library" exported="" name="Gradle: java3d:vecmath:1.3.1" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.sf.trove4j:trove4j:3.0.3" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.ibm.icu:icu4j-core-mojang:51.2" level="project" />
<orderEntry type="library" exported="" name="Gradle: lzma:lzma:0.0.1" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.paulscode:codecjorbis:20101023" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.paulscode:codecwav:20101023" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.paulscode:libraryjavasound:20101123" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.paulscode:librarylwjglopenal:20100824" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.paulscode:soundsystem:20120107" level="project" />
<orderEntry type="library" exported="" name="Gradle: io.netty:netty-all:4.0.10.Final" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.google.guava:guava:15.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.apache.commons:commons-lang3:3.1" level="project" />
<orderEntry type="library" exported="" name="Gradle: commons-io:commons-io:2.4" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.java.jinput:jinput:2.0.5" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.java.jutils:jutils:1.0.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" exported="" name="Gradle: com.mojang:authlib:1.3" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.apache.logging.log4j:log4j-api:2.0-beta9" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.apache.logging.log4j:log4j-core:2.0-beta9" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.lwjgl.lwjgl:lwjgl:2.9.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.lwjgl.lwjgl:lwjgl_util:2.9.0" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:2.9.0:natives-linux" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:2.9.0:natives-osx" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.lwjgl.lwjgl:lwjgl-platform:2.9.0:natives-windows" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.java.jinput:jinput-platform:2.0.5:natives-linux" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.java.jinput:jinput-platform:2.0.5:natives-osx" level="project" />
<orderEntry type="library" exported="" name="Gradle: net.java.jinput:jinput-platform:2.0.5:natives-windows" level="project" />
<orderEntry type="library" exported="" name="Gradle: org.scala-lang:scala-reflect:2.10.2" level="project" />
<orderEntry type="module-library" exported="" scope="RUNTIME">
<library name="Gradle: C__Users_Jost__gradle_caches_minecraft_net_minecraftforge_forge_1_7_2_10_12_2_1147_start">
<CLASSES>
<root url="file://$USER_HOME$/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.2.1147/start" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

</module>
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
includeFlat '../MeanCore'
1 change: 1 addition & 0 deletions src/main/java/si/meansoft/traincraft/Traincraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void invalidFingerprint(FMLFingerprintViolationEvent evt) {

@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
System.out.println("TC-0: " + evt.getSuggestedConfigurationFile());
PreInitTC pi = new PreInitTC();
pi.init(evt);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright (c) 2014 Mrbrutal. All rights reserved.
* Do not modify or redistribute without written permission.
*
* @author Mrbrutal
*/

package si.meansoft.traincraft.common.config;

import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.common.config.Configuration;
import si.meansoft.meancore.common.library.InfoMC;

import java.io.File;

public class ConfigHandler {

public static Configuration config;
public static boolean updates;

public static void init(File file) {
if(config == null) {
config = new Configuration(file);
}
}

private static void loadConfiguration() {
updates = config.getBoolean(Configuration.CATEGORY_GENERAL, "Updates", true, "Bother for updates on launch?");

if (config.hasChanged()) {
config.save();
}
}

@SubscribeEvent
public void onConfigurationChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) {
if (event.modID.equalsIgnoreCase(InfoMC.MODID)) {
loadConfiguration();
}
}
}
29 changes: 0 additions & 29 deletions src/main/java/si/meansoft/traincraft/common/config/ConfigTC.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ public class InfoTC {
public static final String CLIENT_PROXY = "si.meansoft.traincraft.proxy.ClientProxy";
public static final String GUI_FACTORY = "si.meansoft.traincraft.client.core.GuiFactory";

//TODO change to hard dependency
public static final String DEPENDENCIES = InfoMC.DEPENDENCIES + "required-after:MeanCore@[" + InfoMC.VERSION + ");";
}
10 changes: 4 additions & 6 deletions src/main/java/si/meansoft/traincraft/event/PreInitTC.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import si.meansoft.meancore.common.config.ConfigHandler;
import si.meansoft.meancore.event.PreInit;
import si.meansoft.traincraft.common.config.ConfigTC;
import si.meansoft.traincraft.common.library.InfoTC;
import si.meansoft.traincraft.common.config.ConfigHandler;

public class PreInitTC extends PreInit {

public void init(FMLPreInitializationEvent evt) {

System.out.println("TC: " + evt.getModConfigurationDirectory());
System.out.println("TC: " + evt.getModConfigurationDirectory() + " : " + evt.getSuggestedConfigurationFile());

ConfigHandler.init(evt.getSuggestedConfigurationFile(), InfoTC.MODID);
FMLCommonHandler.instance().bus().register(new ConfigTC());
ConfigHandler.init(evt.getSuggestedConfigurationFile());
FMLCommonHandler.instance().bus().register(new ConfigHandler());
}
}
Binary file added src/main/resources/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 83bbc87

Please sign in to comment.