Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
eclipse/
build/
*.iml
*.iws
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# idea
out
*.ipr
.gradle/
libs/
out/
*.iws
*.iml
.idea

# gradle
build

# other
eclipse
run
libs
classes
25 changes: 7 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,14 @@ Setup Workspace
git clone [git-repo-url]
```

Download [CodeChickenCore-1.7.2-1.0.0-dev][1], [NotEnoughItems-1.7.2-1.0.1-dev][1] & [Waila-1.5.2a_1.7.2][2]
If you don't have [Gradle][1] installed on your computer you can use `gradlew` or `gradlew.bat` instead

Add a folder called `libs`, in the folder put the three downloaded `.jar` files.
For help setting up a ForgeGradle workspace, go to this [forum page][2].

If you don't have [Gradle][3] installed on your computer you can use `gradlew` or `gradlew.bat` instead
How to install it is a bit different depending on what IDE you are using.

For help setting up a ForgeGradle workspace, go to this [forum page][4].
Instructions on how to install is in [README.txt][3]

##### Installing for Intellij IDEA
```sh
gradle setupDecompWorkspace idea
```

##### Installing for Eclipse
```sh
gradle setupDecompWorkspace eclipse
```

[1]:http://www.chickenbones.craftsaddle.org/Files/New_Versions/links.php
[2]:http://www.minecraftforum.net/topic/1846244-172-
[3]:http://www.gradle.org/
[4]:http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
[1]:http://www.gradle.org/
[2]:http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
[3]:README.txt
59 changes: 59 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
-------------------------------------------
Source installation information for modders
-------------------------------------------
This code follows the Minecraft Forge installation methodology. It will apply
some small patches to the vanilla MCP source code, giving you and it access
to some of the data and functions you need to build a successful mod.

Note also that the patches are built against "unrenamed" MCP source code (aka
srgnames) - this means that you will not be able to read them directly against
normal code.

Source pack installation information:

Standalone source installation
==============================

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 preffer to use IntelliJ, steps are a little different.
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)

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 effect 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, deobfusicated, and gather required assets to run minecraft, but will not generated 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.

Forge source installation
=========================
MinecraftForge ships with this code and installs it as part of the forge
installation process, no further action is required on your part.

LexManos' Install Video
=======================
https://www.youtube.com/watch?v=8VEdtQLuLO0&feature=youtu.be

For more details update more often refer to the Forge Forums:
http://www.minecraftforge.net/forum/index.php/topic,14048.0.html
72 changes: 59 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,75 @@

// For those who want the bleeding edge
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'

apply plugin: 'forge'
/*
// for people who want stable - not yet functional for MC 1.8.9 - we require the forgegradle 2.1 snapshot
plugins {
id "net.minecraftforge.gradle.forge" version "2.0.1"
}
*/

version = "A92"
repositories {
maven { // WAILA
name 'Prof. Mobius'
url 'http://mobiusstrip.eu/maven'
}
maven { // NEI and friends
name 'Chickenbones'
url 'http://chickenbones.net/maven/'
}
}

version = "A94"
group= "vswe.stevesfactory" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "StevesFactoryManager"

minecraft {
version = "1.7.10-10.13.0.1188"
assetDir = "eclipse/assets"
version = "1.8.9-11.15.1.1722"
runDir = "run"

// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = "stable_20"
}

dependencies {
// you may put jars on which you depend on in ./libs
// 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

// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
// except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'

// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
compile 'mcp.mobius.waila:Waila:1.6.0-B3_1.8.8:dev'
}

processResources
Expand All @@ -35,13 +81,13 @@ processResources
// 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, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Jun 11 01:18:37 CEST 2014
#Mon Sep 14 12:28:28 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
Empty file removed logs/latest.log
Empty file.
2 changes: 1 addition & 1 deletion src/main/java/vswe/stevesfactory/GeneratedInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@


public class GeneratedInfo {
public static final String version = /*@v*/"A92";
public static final String version = /*@v*/"A94";
public static final boolean inDev = /*@d*/false;
}
7 changes: 4 additions & 3 deletions src/main/java/vswe/stevesfactory/GuiHandler.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package vswe.stevesfactory;

import cpw.mods.fml.common.network.IGuiHandler;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.network.IGuiHandler;
import vswe.stevesfactory.blocks.ITileEntityInterface;


Expand All @@ -14,7 +15,7 @@ public GuiHandler() {

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
TileEntity te = world.getTileEntity(new BlockPos(x, y, z));

if (te != null && te instanceof ITileEntityInterface) {
return ((ITileEntityInterface)te).getContainer(te, player.inventory);
Expand All @@ -25,7 +26,7 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity te = world.getTileEntity(x, y, z);
TileEntity te = world.getTileEntity(new BlockPos(x, y, z));

if (te != null && te instanceof ITileEntityInterface) {
return ((ITileEntityInterface)te).getGui(te, player.inventory);
Expand Down
33 changes: 17 additions & 16 deletions src/main/java/vswe/stevesfactory/Localization.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package vswe.stevesfactory;


import net.minecraft.util.EnumFacing;
import net.minecraft.util.StatCollector;

public enum Localization {
Expand All @@ -14,12 +15,12 @@ public enum Localization {
CONDITION_LONG,
FLOW_CONTROL_SHORT,
FLOW_CONTROL_LONG,
LIQUID_INPUT_SHORT,
LIQUID_INPUT_LONG,
LIQUID_OUTPUT_SHORT,
LIQUID_OUTPUT_LONG,
LIQUID_CONDITION_SHORT,
LIQUID_CONDITION_LONG,
FLUID_INPUT_SHORT,
FLUID_INPUT_LONG,
FLUID_OUTPUT_SHORT,
FLUID_OUTPUT_LONG,
FLUID_CONDITION_SHORT,
FLUID_CONDITION_LONG,
REDSTONE_EMITTER_SHORT,
REDSTONE_EMITTER_LONG,
REDSTONE_CONDITION_SHORT,
Expand Down Expand Up @@ -105,7 +106,7 @@ public enum Localization {
NO_CONDITION_ERROR,
BUCKETS,
MILLI_BUCKETS,
LIQUIDS_MENU,
FLUIDS_MENU,
USE_ALL,
REVERSED,
LOOP_ORDER_MENU,
Expand Down Expand Up @@ -191,8 +192,8 @@ public enum Localization {
VARIABLE_GREEN,
VARIABLE_RED,
VARIABLE_BLACK,
NO_LIQUID_SELECTED,
CHANGE_LIQUID,
NO_FLUID_SELECTED,
CHANGE_FLUID,
EDIT_SETTING,
NO_ITEM_SELECTED,
CHANGE_ITEM,
Expand Down Expand Up @@ -378,17 +379,17 @@ public String toString() {
return StatCollector.translateToLocal("gui." + StevesFactoryManager.UNLOCALIZED_START + name);
}

public static Localization getForgeDirectionLocalization(int id) {
switch (id) {
case 0:
public static Localization getDirectionLocalization(EnumFacing facing) {
switch (facing) {
case DOWN:
return DOWN;
case 1:
case UP:
return UP;
case 2:
case NORTH:
return NORTH;
case 3:
case SOUTH:
return SOUTH;
case 4:
case WEST:
return WEST;
default:
return EAST;
Expand Down
Loading