Initial Commit

Initial Commit
This commit is contained in:
JAWolfe04 2016-01-22 15:14:58 -06:00
parent 9d775ca575
commit 5c137164b3
13 changed files with 263 additions and 0 deletions

19
.gitignore vendored Normal file
View File

@ -0,0 +1,19 @@
## gradle
/.gradle
/build
/gradle
/gradlew
/gradlew.bat
## ForgeGradle
/runClient
/runServer
## eclipse
/eclipse
/.settings
/.metadata
/.classpath
/.project
/bin
/libs

1
Setup.bat Normal file
View File

@ -0,0 +1 @@
gradlew.bat setupdecompworkspace eclipse

14
build.bat Normal file
View File

@ -0,0 +1,14 @@
@echo off
set WORKDIR=%CD%
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
cd /d "%DIRNAME%"
call gradlew.bat build
cd /d "%WORKDIR%"
pause

104
build.gradle Normal file
View File

@ -0,0 +1,104 @@
buildscript
{
repositories
{
mavenCentral()
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'
}
}
// define the properties file
ext.configFile = file "build.prop"
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
}
allprojects
{
apply plugin: 'java'
apply plugin: 'forge'
apply plugin: 'maven'
group = config.group_name
version = config.mod_version
archivesBaseName = "[${config.minecraft_version}]${config.mod_id}"
minecraft
{
version = config.minecraft_version + "-" + config.forge_version
replaceIn "References.java"
replace "@MOD_VERSION@", config.mod_version
if(file('../run').exists())
{
runDir = "../run"
}
else
{
runDir = ""
}
}
}
dependencies {
}
//Creates a compiled de-obfuscated jar
task deobfJar(type: Jar){
from sourceSets.main.output
appendix = 'deobf'
}
//creates a jar containing only the src
task sourceJar(type: Jar){
from sourceSets.main.allSource
appendix = 'src'
}
tasks.build.dependsOn('sourceJar', 'deobfJar')
processResources
{
// First we just copy in the mcmod.info file
from(sourceSets.main.resources.srcDirs)
{
include '**/*.info'
include '**/*.prop'
// replaces
expand ([
'mod_version': project.config.mod_version,
'tfc_version': project.config.tfc_version,
'minecraft_version': project.config.minecraft_version,
])
}
// copy everything else, that we didn't copy before
from(sourceSets.main.resources.srcDirs)
{
exclude '**/*.info'
exclude '**/*.prop'
}
}
task wrapper(type: Wrapper){
gradleVersion = '2.2.1'
}

6
build.prop Normal file
View File

@ -0,0 +1,6 @@
minecraft_version=1.7.10
forge_version=10.13.4.1558-1.7.10
tfc_version=0.79.27
mod_version=1.00
mod_id=TerraFirmaPunkTweaks
group_name=com.onewolfe.tfptweaks

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,28 @@
package com.onewolfe.tfptweaks;
import cpw.mods.fml.common.FMLLog;
import org.apache.logging.log4j.Level;
public class LogHelper
{
public static void log(Level logLevel, Object object)
{
FMLLog.log(References.ModName, logLevel, String.valueOf(object));
}
public static void all(Object object){ log(Level.ALL, object); }
public static void debug(Object object){ log(Level.DEBUG, object); }
public static void error(Object object){ log(Level.ERROR, object); }
public static void fatal(Object object){ log(Level.FATAL, object); }
public static void info(Object object){ log(Level.INFO, object); }
public static void off(Object object){ log(Level.OFF, object); }
public static void trace(Object object){ log(Level.TRACE, object); }
public static void warn(Object object){ log(Level.WARN, object); }
}

View File

@ -0,0 +1,36 @@
package com.onewolfe.tfptweaks;
import java.util.Random;
import com.bioxx.tfc.api.TFCBlocks;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
public class PlayerHandler
{
@SubscribeEvent
public void onItemPickup(EntityItemPickupEvent event)
{
EntityItem item = event.item;
ItemStack is = item.getEntityItem();
EntityPlayer player = event.entityPlayer;
Item droppedItem = is.getItem();
if(droppedItem.equals(Item.getItemFromBlock(Blocks.chest)))
{
item.delayBeforeCanPickup = 100;
item.setDead();
item.setInvisible(true);
Random rand = player.worldObj.rand;
player.worldObj.playSoundAtEntity(player, "random.pop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
player.inventory.addItemStackToInventory(new ItemStack(TFCBlocks.chest, 1, 0));
}
}
}

View File

@ -0,0 +1,13 @@
package com.onewolfe.tfptweaks;
public class References
{
public static final String ModID = "terrafirmapunktweaks";
public static final String ModName = "TerraFirmaPunk Tweaks";
public static final String MODID_TFC = "terrafirmacraft";
public static final String MODNAME_TFC = "TerraFirmaCraft";
public static final String ModVersion = "@MOD_VERSION@";
public static final String ModDependencies = "required-after:" + MODID_TFC;
}

View File

@ -0,0 +1,21 @@
package com.onewolfe.tfptweaks;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.MinecraftForge;
@Mod(modid = References.ModID, name = References.ModName, version = References.ModVersion, dependencies = References.ModDependencies)
public class TerraFirmaPunkTweaks
{
@EventHandler
public void init(FMLInitializationEvent event)
{
}
@EventHandler
public void initialize(FMLInitializationEvent event)
{
MinecraftForge.EVENT_BUS.register(new PlayerHandler());
}
}

View File

@ -0,0 +1,21 @@
{
"modListVersion": 2,
"modList": [{
"modid": "terrafirmapunktweaks",
"name": "TerraFirmaPunk Tweaks",
"description": "Various tweaks for TerraFirmaPunk.",
"version": "${mod_version}",
"mcversion": "${minecraft_version}",
"url": "",
"updateUrl": "",
"authorList": [""],
"credits": "",
"logoFile": "",
"screenshots": [],
"parent": "",
"requiredMods": [],
"dependencies": ["terrafirmacraft"],
"dependants": [ ],
"useDependencyInformation": "true"
}]
}