Skip to content

Commit

Permalink
Added frame motor and actuator
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed Jun 27, 2015
1 parent 7ae4e5b commit 98a41db
Show file tree
Hide file tree
Showing 26 changed files with 348 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -66,3 +66,5 @@ white-list.txt.converted
whitelist.json
world-20140811-075700.zip
.cache

gradle.properties
23 changes: 17 additions & 6 deletions build.gradle
Expand Up @@ -69,16 +69,17 @@ dependencies {
deployerJars "org.apache.maven.wagon:wagon-ftp:2.2"

compile "mrtjp:MrTJPCore:${config.mc.version}-${config.mrtjp.version}:dev"
compile "mrtjp:ForgeRelocation:${config.mc.version}-${config.fr.version}:dev"
compile "codechicken:CodeChickenLib:${config.mc.version}-${config.ccl.version}:dev"
compile "codechicken:ForgeMultipart:${config.mc.version}-${config.fmp.version}:dev"
compile "codechicken:NotEnoughItems:${config.mc.version}-${config.nei.version}:dev"
compile "tconstruct:TConstruct:${config.mc.version}-${config.tc.version}:deobf"
// compile group: 'thermalexpansion', name: 'ThermalExpansion', version: config.texpan.version, ext: 'jar'
compile group: 'cofh', name: 'CoFHCore', version: config.cofh.version, ext: 'jar'
}

def build_number = project.hasProperty("manualbuildnum") ? project.manualbuildnum : (Integer.parseInt(System.getenv("BUILD_NUMBER") ?: "1")+51).toString()
version = "${project.config.mod.version}."+build_number
println "Starting build for $archivesBaseName $version for MC $config.mc.version-$config.forge.version"

minecraft {
version = config.mc.version+"-"+config.forge.version
Expand Down Expand Up @@ -115,7 +116,9 @@ task updateVersion(type: Copy) {
'FORGE_VERSION': config.forge.version,
'FMP_VERSION' : config.fmp.version,
'CCL_VERSION' : config.ccl.version,
'MRTJP_VERSION': config.mrtjp.version
'MRTJP_VERSION': config.mrtjp.version,
'FR_VERSION': config.fr.version,
'FRFMP_VERSION': config.frfmp.version
])
}

Expand All @@ -126,6 +129,8 @@ processResources {
inputs.property "fmp.version", config.fmp.version
inputs.property "ccl.version", config.ccl.version
inputs.property "mrtjp.version", config.mrtjp.version
inputs.property "fr.version", config.fr.version
inputs.property "frfmp.version", config.frfmp.version

// Replace properties in all files
from(sourceSets.main.resources.srcDirs) {
Expand All @@ -137,7 +142,9 @@ processResources {
'FORGE_VERSION': config.forge.version,
'FMP_VERSION' : config.fmp.version,
'CCL_VERSION' : config.ccl.version,
'MRTJP_VERSION': config.mrtjp.version
'MRTJP_VERSION': config.mrtjp.version,
'FR_VERSION': config.fr.version,
'FRFMP_VERSION': config.frfmp.version
])
}
// Copy everything else
Expand Down Expand Up @@ -202,6 +209,9 @@ task mechanicalJar(type: Jar, dependsOn: reobf) {
include "mechanical_mod.info"
rename("mechanical_mod.info", 'mcmod.info')

include("mechanical_dependancies.info")
rename("mechanical_dependancies.info", "dependancies.info")

project.ext.baseExcludes.addAll(includes)
}
version = project.ext.jarVer
Expand Down Expand Up @@ -229,9 +239,6 @@ task compatJar(type: Jar, dependsOn: reobf) {
include "**/ProjectRedCompatibility*.class"
include "**/mrtjp/projectred/compatibility/**"

//APIs
//include "**/dan200/**"

include "**/assets/asm/**"
include "**/assets/projectred/textures/blocks/compat/**"

Expand All @@ -249,6 +256,7 @@ task baseJar(type: Jar, dependsOn: reobf) {
exclude project.ext.baseExcludes

rename("base_mod.info", 'mcmod.info')
rename("base_dependancies.info", "dependancies.info")
}
manifest {
attributes 'FMLCorePlugin': 'codechicken.core.launch.DepLoader'
Expand Down Expand Up @@ -426,6 +434,8 @@ if (project.hasProperty('curseapi'))
projectId = '229048'
artifact = mechanicalJar
relatedProject 'project-red-integration': 'requiredLibrary'
relatedProject 'forge-relocation': 'requiredLibrary'
relatedProject 'forge-relocation-fmp-plugin': 'requiredLibrary'
}

task curseWorld(dependsOn: 'curse', type: CurseUploadTask) {
Expand All @@ -442,6 +452,7 @@ if (project.hasProperty('curseapi'))
apiKey = project.curseapi
releaseType = 'release'
relatedProject 'mrtjpcore': 'requiredLibrary'
relatedProject 'forge-multi-part': 'requiredLibrary'
addGameVersion project.minecraft.version
}

Expand Down
9 changes: 6 additions & 3 deletions build.properties
Expand Up @@ -3,10 +3,13 @@ mod.version=4.7.0pre3
mc.version=1.7.10
forge.version=10.13.3.1399-1.7.10

mrtjp.version=1.0.9.19
ccl.version=1.1.3.136
fmp.version=1.2.0.344
mrtjp.version=1.0.10.23
fmp.version=1.2.0.345
fr.version = 0.0.1.2
frfmp.version = 0.0.1.2

#ccl not needed - is passed down from mrtjpcore
ccl.version=1.1.3.136
nei.version=1.0.4.106

tc.version=1.7.0.build734
Expand Down
2 changes: 2 additions & 0 deletions resources/Changelog
@@ -1,5 +1,7 @@
v4.7.0pre3
- ADDED: Teleposer
- ADDED: Frame Motor
- ADDED: Frame Linear Actuator
- FIX: Copper and tin harvest levels
- CHANGE: Rebalanced Jetpack

Expand Down
2 changes: 2 additions & 0 deletions resources/assets/projectred/lang/en_US.lang
Expand Up @@ -90,6 +90,8 @@ tile.projectred.expansion.machine2|4.name=Fire Starter
tile.projectred.expansion.machine2|5.name=Battery Box
tile.projectred.expansion.machine2|6.name=Charging Bench
tile.projectred.expansion.machine2|7.name=Teleposer
tile.projectred.expansion.machine2|8.name=Frame Motor
tile.projectred.expansion.machine2|9.name=Frame Linear Actuator
item.projectred.expansion.solar_panel.name=Solar Panel


Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
12 changes: 12 additions & 0 deletions resources/mechanical_dependancies.info
@@ -0,0 +1,12 @@
[{
"repo": "http://projectredwiki.com/maven/mrtjp/ForgeRelocation/@MC_VERSION@-@FR_VERSION@/",
"file": "ForgeRelocation-@MC_VERSION@-@FR_VERSION@-universal.jar",
"dev": "ForgeRelocation-@MC_VERSION@-@FR_VERSION@-dev.jar",
"class": "mrtjp.relocation.handler.RelocationMod"
},
{
"repo": "http://projectredwiki.com/maven/mrtjp/ForgeRelocationFMP/@MC_VERSION@-@FRFMP_VERSION@/",
"file": "ForgeRelocationFMP-@MC_VERSION@-@FRFMP_VERSION@-universal.jar",
"dev": "ForgeRelocationFMP-@MC_VERSION@-@FRFMP_VERSION@-dev.jar",
"class": "mrtjp.relocation.handler.RelocationMod"
}]
2 changes: 1 addition & 1 deletion src/mrtjp/projectred/ProjectRedExpansion.scala
Expand Up @@ -17,7 +17,7 @@ object ProjectRedExpansion
/** Items **/
var itemEmptybattery:ItemBatteryEmpty = null
var itemBattery:ItemBattery = null
var itemJetpack:ItemElectronicJetpack = null
var itemJetpack:ItemJetpack = null
var itemScrewdriver:ItemElectronicScrewdriver = null
var itemInfusedEnderPearl:ItemInfusedEnderPearl = null

Expand Down
2 changes: 2 additions & 0 deletions src/mrtjp/projectred/expansion/TileElectrotineGenerator.scala
Expand Up @@ -49,6 +49,8 @@ class TileElectrotineGenerator extends TPoweredMachine with TGuiMachine with TIn
burnTimeRemaining = tag.getShort("btime")
isBurning = burnTimeRemaining > 0
isCharged = cond.canWork
ib = isBurning
ic = isCharged
}

override def writeDesc(out:MCDataOutput)
Expand Down
73 changes: 73 additions & 0 deletions src/mrtjp/projectred/expansion/TileFrameActuator.scala
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2015.
* Created by MrTJP.
* All rights reserved.
*/
package mrtjp.projectred.expansion

import codechicken.lib.render.uv.{MultiIconTransformation, UVTransformation}
import mrtjp.core.render.TCubeMapRender
import mrtjp.core.world.WorldLib
import mrtjp.projectred.ProjectRedExpansion
import net.minecraft.client.renderer.texture.IIconRegister
import net.minecraft.util.IIcon
import net.minecraft.world.{IBlockAccess, World}

class TileFrameActuator extends TileMachine with TMotorTile
{
override def getBlock = ProjectRedExpansion.machine2
override def doesRotate = false
override def doesOrient = true

override def stickOut(w:World, x:Int, y:Int, z:Int, side:Int) = side == (this.side^1)
override def stickIn(w:World, x:Int, y:Int, z:Int, side:Int) = side != (this.side^1)

override def getMoveDir = side^1

override def drawPower(size:Int) = cond.drawPower(200+10*size)
}

object RenderFrameActuator extends TCubeMapRender
{
var bottom:IIcon = _
var top:IIcon = _
var sidea:IIcon = _
var sideb:IIcon = _
var sidec:IIcon = _

var iconT1:UVTransformation = null
var iconT2:UVTransformation = null
var iconT3:UVTransformation = null

override def getData(w:IBlockAccess, x:Int, y:Int, z:Int) =
{
val te = WorldLib.getTileEntity(w, x, y, z, classOf[TileFrameActuator])
if (te != null) (te.side, te.rotation,
if (te.isCharged && te.isPowered) iconT3
else if (te.isCharged) iconT2
else iconT1)
else getInvData
}

override def getInvData = (0, 0, iconT1)

override def getIcon(s:Int, meta:Int) = s match
{
case 0 => bottom
case 1 => top
case _ => sidea
}

override def registerIcons(reg:IIconRegister)
{
bottom = reg.registerIcon("projectred:machines/actuator/bottom")
top = reg.registerIcon("projectred:machines/actuator/top")
sidea = reg.registerIcon("projectred:machines/actuator/sidea")
sideb = reg.registerIcon("projectred:machines/actuator/sideb")
sidec = reg.registerIcon("projectred:machines/actuator/sidec")

iconT1 = new MultiIconTransformation(bottom, top, sidea, sidea, sidea, sidea)
iconT2 = new MultiIconTransformation(bottom, top, sideb, sideb, sideb, sideb)
iconT3 = new MultiIconTransformation(bottom, top, sidec, sidec, sidec, sidec)
}
}

0 comments on commit 98a41db

Please sign in to comment.