Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8.9 update #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# default
* text eol=auto

# git
.gitattributes text eol=lf
.gitignore text eol=lf

# sources
*.java text eol=lf

# resources
*.lang text eol=lf
*.cfg text eol=lf
*.info text eol=lf
*.mcmeta text eol=lf
*.md text eol=lf
*.xml text eol=lf

# scripts
*.bat text eol=crlf
*.gradle text eol=lf
*.properties text eol=lf

# binaries
*.png binary
*.jar binary
31 changes: 23 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
/.settings/
/bin/
/release/
/build/
/.gradle/
/run/
.project
.classpath
## gradle
/.gradle
/build

## ForgeGradle
/run

## eclipse
/.settings
/.metadata
/.classpath
/.project
/bin

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

## custom
/release
96 changes: 50 additions & 46 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,56 +1,51 @@
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
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'
classpath 'com.matthewprenger:CurseGradle:1.0-SNAPSHOT'
}
}

apply plugin: "forge"
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'com.matthewprenger.cursegradle'

// define the properties file
ext.configFile = file "build.properties"

configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
compileJava.options.encoding = 'UTF-8'

repositories {
ivy {
url "http://bspk.rs/MC"
layout "pattern", {
artifact "[module]/deobf/%5B${config.minecraft_version}%5D[module]-deobf-[revision].[ext]"
artifact "[module]/deobf/[${config.minecraft_version}][module]-deobf-[revision].[ext]"
url 'http://bspk.rs/MC'
layout 'pattern', {
artifact "[module]/%5B${project.minecraft_version}%5D[module]-universal-[revision].[ext]"
artifact "[module]/[${project.minecraft_version}][module]-universal-[revision].[ext]"
}
}
}

dependencies {
compile name: 'bspkrsCore', version: "${config.bscore_version}", ext: 'jar'
deobfCompile name: 'bspkrsCore', version: project.bscore_version, ext: 'jar'
}

group = config.group_name
version = config.mod_version
archivesBaseName = "[${config.minecraft_version}]${config.mod_id}"
group = project.group_name
version = project.mod_version
archivesBaseName = "[${project.minecraft_version}]${project.mod_id}"

minecraft {
version = config.minecraft_version + "-" + config.forge_version // grab latest forge
mappings = config.mappings_version
runDir = "run"
replace '@MOD_VERSION@', version
replace '@BSCORE_VERSION@', config.bscore_version
version = project.minecraft_version + '-' + project.forge_version // grab latest forge
mappings = project.mappings_version
runDir = 'run'
replace '@MOD_VERSION@', project.mod_version
replace '@BSCORE_VERSION@', project.bscore_version
}

processResources {
Expand All @@ -62,15 +57,13 @@ processResources {
// replaces
expand ([
'mod_version': version,
'bscore_version': config.bscore_version,
'bscore_jar': "[${config.minecraft_version}]bspkrsCore-universal-${config.bscore_version}.jar",
'pattern': "\\\\[.+?\\\\](\\\\w+).*?([\\\\d\\\\.]+)[-\\\\w]*\\\\.[^\\\\d]+",
'forge_version': config.forge_version,
'minecraft_version': config.minecraft_version
'bscore_version': project.bscore_version,
'forge_version': project.forge_version,
'minecraft_version': project.minecraft_version
])
}

// copy everything else, thats we didnt do before
// copy everything else that we didnt do before
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.info'
exclude '**/*.properties'
Expand All @@ -79,22 +72,33 @@ processResources {

// change the name of my obfuscated jar
jar {
appendix = config.appendix
appendix = project.appendix
}

// add a source jar
task sourceJar(type: Jar) {
from sourceSets.main.allSource
sourceJar {
appendix = 'src'
}

// because the normal output has been made to be obfuscated
task deobfJar(type: Jar) {
from sourceSets.main.output
appendix = 'deobf'
classifier = ''
}

artifacts {
archives sourceJar
archives deobfJar
}
}

if (project.hasProperty('api_key_curse') && project.hasProperty('extra_curse_id')) {
tasks.curseforge.dependsOn signJars
curseforge {
apiKey = project.api_key_curse

project {
id = project.extra_curse_id
changelog = ''
releaseType = project.hasProperty('extra_curse_releasetype') ? project.extra_curse_releasetype : 'release'

addArtifact sourceJar

relations {
requiredLibrary 'bspkrscore'
}
}
}
}
8 changes: 0 additions & 8 deletions build.properties

This file was deleted.

11 changes: 11 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
minecraft_version=1.8.9
forge_version=11.15.0.1719
mappings_version=snapshot_20160125
mod_version=1.8.9.1
bscore_version=1.8.9.1
mod_id=Treecapitator
group_name=treecapitator
appendix=universal

# extra_curse_id=-1
# extra_curse_releasetype=release
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 Jul 02 15:54:47 CDT 2014
#Tue Feb 02 20:59:49 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-bin.zip
10 changes: 3 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ case "`uname`" in
;;
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"
Expand All @@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null

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

Expand Down Expand Up @@ -114,6 +109,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
1 change: 0 additions & 1 deletion src/main/java/bspkrs/treecapitator/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public class ClientProxy extends CommonProxy
public void init(FMLInitializationEvent event)
{
super.init(event);
new TCClientTicker();
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/bspkrs/treecapitator/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import bspkrs.treecapitator.network.TCPacketConfig;
import bspkrs.treecapitator.network.TCPacketLogin;
import bspkrs.treecapitator.util.TCLog;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
Expand All @@ -28,7 +28,7 @@ public void init(FMLInitializationEvent event)
networkChannel = NetworkRegistry.INSTANCE.newChannel(TreecapitatorMod.metadata.modId, new TCMessageToMessageCodec(),
new LoginPacketHandler(), new ConfigPacketHandler());

FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);
}

public boolean isEnabled()
Expand Down
41 changes: 0 additions & 41 deletions src/main/java/bspkrs/treecapitator/TCClientTicker.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/bspkrs/treecapitator/Treecapitator.java
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ private boolean damageShearsAndContinue(World world, Block block, BlockPos pos)
currentShearsDamage -= Math.floor(currentShearsDamage);

if ((shears != null) && (shears.stackSize < 1) && (shearsIndex != -1))
player.inventory.setInventorySlotContents(shearsIndex, (ItemStack) null);
player.inventory.setInventorySlotContents(shearsIndex, null);
}
return TCSettings.allowMoreBlocksThanDamage || hasShearsInHotbar(player);
}
Expand Down
Loading