Skip to content

Commit

Permalink
Merge pull request #1 from Team-RTG/1.10.2-dev
Browse files Browse the repository at this point in the history
Merged dev into master (1.1.0.0)
  • Loading branch information
whichonespink44 authored May 20, 2017
2 parents e350aed + fd5b683 commit 6d34576
Show file tree
Hide file tree
Showing 24 changed files with 1,031 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
77 changes: 77 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
### Team-RTG Contribution Guidelines
===
##### So you wanna contribute to this Team RTG mod? Great, you are very welcome to do so! Just a few things before you do: We would really apreciate it if you conformed to our coding standards, as it would really easen our jobs.

If you have any questions, you can hop on over to our [discord server](https://discord.gg/0wIG7mz3g6RSfyq5).

Happy coding!

Braces:
----
No newlines in front of opening braces
``` java
public static void sendCoffeeToPink(WhichOnesPink pink) {
pink.send(new Coffee());
}
```

Spaces:
----
Just to be clear. This is java, not php. Please dont put spaces after, before or on top of any kinds of brackets.
``` java
pink.give(new Coffee(coffees[]));
```
That is the *only* correct way to do that line!

Also, indents are 4 spaces, not tabs! (throwinyavotes!)

Other spacing rules are:
- required in between parameters `(a, b)`,
- required in between opperators and opperants (`a + b`, `a == b`)
- required in front of parentesis in `if`, `for` and `catch` statements
- required in front of opening braces for statements and methods
- not permitted between variable and `!` or `++`/`--`
``` java
public static void sendCoffeeToPink(WhichOnesPink pink, Coffee coffee) {
pink.send(coffee);
pink.setCoffees(pink.getCoffees() + 1);
if (!pink.wantsCoffee()) {
pink.doctor.call();
}
}
```

Switch statements
----
- `case` statements are indented and on new lines
- `case` statements always end with `break;`
- always ends with `default;`, even if unused
``` java
switch (drink) {
case COFFEE:
drink.giveTo(pink);
break;
case TEA:
system.crash("Are you trying to poison me?");
break;
default:
break;
}
```

Other Characters
----
- Strings are with double quotes (`"`), unless `'` is needed for escaping reasons.

Naming
----
- If a similar class or function to what you are adding already exists, name it with the same template.
- If you are overriding a method all the parameters should have the same names as the overridden methods.

### Coordinates ###
Minecraft has 3 types of coordinates, that we need to use in diffferent cases. Block coordinates, chunk coordinates,
and coordinates to a block relative to the chunk. For example, the block at block coordinates `x = 0, y = 64, z = 20` is in the chunk at `x = 0, z = 1`, and it has the chunk-local coordinate `x = 0, y = 64, z = 4`. To make matters worse, the chunk coordinates are sometimes refered to as `x` and `y` instead of `x` and `z`. So we have a few rules about coordinate naming. These are some of the rules we consider most important, since they can really create confusion:
- Block coordinates should be referenced as `bx, by, bz` or simply `x, y, z`.
- Chunk coordinates should be referenced as `cx, cz`, _never_ `x, z`, `x, y` or even `cx, cy`.
- Chunk-local block coordinates should be referenced as `lx, ly, lz`, never anything else.
- Avoid using other names for any kind of coordinates, like `i, j, k` even in loops. If its a coordinate, give it the correct `x`, `y` or `z` and optionally some describing prefex.
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# eclipse
*.launch
.settings
.metadata
.classpath
.project
bin
eclipse

# idea
*.ipr
*.iws
*.iml
.idea
out

# gradle
build
.gradle
run

libs/*.jar
gradlew-*.bat

.DS_Store
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 {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'

sourceCompatibility = targetCompatibility = 1.8

static def parseprops(File cfg) {
cfg.withReader {
def prop = new Properties()
prop.load(it)
return (new ConfigSlurper().parse(prop))
}
}

ext.ref = parseprops(file('build.properties'))

group = ref.package_base + '.' + ref.mod_id
archivesBaseName = 'PassableLeaves' + '-' + (ref.mc_version as String)
version = ref.mod_version

dependencies {
provided fileTree(dir: 'libs', include: '*.jar')
}

minecraft {
version = (ref.mcf_suffix!='') ? ref.mcf_version + '-' + ref.mcf_suffix : ref.mcf_version
mappings = ref.mcp_mappings
runDir = ref.run_dir
makeObfSourceJar = false
replace '@MOD_VERSION@', project.version
replace '0.0-MCF+MINVER', ref.mcf_minver
replace '9001.0-MCF+MAXVER', ref.mcf_maxver
replaceIn 'ModInfo.java'
}

processResources {
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand ([
'modid':ref.mod_id,
'name':ref.mod_name,
'description':ref.mod_desc,
'version':ref.mod_version,
'mcversion':ref.mc_version,
'url':ref.mod_url,
'authorList':ref.mod_author,
'credits':ref.mod_creds,
'logoFile':ref.mod_logo,
])
}
from(sourceSets.main.resources.srcDirs) {exclude 'mcmod.info'}
}

sourceJar {classifier = 'src'}

// For a debugging session used 'gradle -DEBUG [runClient|runServer]'
allprojects {
tasks.withType(JavaExec) {
// disabled to possibly alleviate testing issues on cumputers with low memory
// jvmArgs '-Xms2G', '-Xmx4G'
if (System.getProperty("EBUG")!=null)
jvmArgs '-agentlib:jdwp=transport=dt_socket,address=localhost:5005,server=y,suspend=y'
}
}

//Adds the LoadingPlugin description to the manifest so forge finds it.
jar {
manifest {
attributes 'FMLCorePlugin': 'passableleaves.core.PLCore',
'FMLCorePluginContainsFMLMod': 'true'
}
}


// use -Dwarn|-Dwarnall CLI arguement for verbose compiler warnings
// -Dwarn covers the 3 most common warnings only
tasks.withType(JavaCompile) {
if (System.getProperty("warn") != null)
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:rawtypes" << "-Xlint:deprecation"
if (System.getProperty("warnall") != null)
options.compilerArgs << "-Xlint:all"
}
20 changes: 20 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# TODO: should maybe find a way to update mod_version automatically in the future (perhaps from git), but not neccessary.
# mod_author has to be in ""'s (and comma-separated, ie: "","",""), because array[]
mod_id=passableleaves
mod_name=Passable Leaves
mod_desc=Minecraft core mod that makes leaves passable.
mod_version=1.1.0.0
mc_version=1.10.2
mod_url=https://github.com/Team-RTG/PassableLeaves
mod_author="Team RTG"
mod_creds="Based on code donated by HellFirePvP for the Appalachia mod."
mod_logo=assets/passableleaves/logo.png
mcf_version=12.18.2.2099
mcf_minver=12.18.1.2011
mcf_maxver=
# mcf_suffix is the branch suffix (without '-') on the Forge version when it's not the default branch in the Forge repo
# This may be the same as mc_version, eg Non-default: 1.9.4-12.18.2.2099-1.9.4, Default: 1.9.4-12.18.2.2099
mcf_suffix=
mcp_mappings=snapshot_nodoc_20161027
run_dir=run
package_base=org.teamrtg
28 changes: 28 additions & 0 deletions etc/config/PassableLeaves/passableleaves.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Configuration file

debugging {
# WARNING: This should only be enabled if you know what you're doing.
# [default: false]
B:"Enable Debugging"=false
}


leaves {
# fallDistance
# [default: 0]
S:fallDistance=0

# motionX
# [default: 0.75]
S:motionX=0.75

# motionY
# [default: 0.75]
S:motionY=0.75

# motionZ
# [default: 0.75]
S:motionZ=0.75
}


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 Nov 14 20:36:39 EST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
Loading

0 comments on commit 6d34576

Please sign in to comment.