Skip to content

Commit

Permalink
Updated to Minecraft 1.9.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
delvr committed May 31, 2016
1 parent 71ac2ad commit 0064c57
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
1 change: 1 addition & 0 deletions .idea/runConfigurations/Release.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/Update.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion build.gradle
Expand Up @@ -5,7 +5,8 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT"
classpath "net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT"
classpath "co.riiid:gradle-github-plugin:0.4.2"
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.0.7"
}
}
Expand Down
2 changes: 1 addition & 1 deletion changelog.md
@@ -1,2 +1,2 @@
- Updated to Minecraft 1.9.
- Updated to Minecraft 1.9.4.

11 changes: 4 additions & 7 deletions gradle.properties
@@ -1,11 +1,8 @@
org.gradle.jvmargs=-Xmx2G
modVersion=0.2
modDependencies=Farseek@[1.9.4,1.9.4-2)

modClass=streams.StreamsMod
coreModClass=streams.core.StreamsCoreMod
accessTransformer=streams_at.cfg

modVersion=1.9-0.2
modDependencies=Farseek@[1.9,1.9-2)
forgeRevision=1936
mcpMappings=snapshot_20160530

curseForgeId=229769
curseForgeReleaseType=beta
1 change: 0 additions & 1 deletion src/main/resources/META-INF/streams_at.cfg
@@ -1,3 +1,2 @@
public-f net.minecraft.block.Block field_176227_L # blockState
public net.minecraft.block.BlockLiquid func_180687_h(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/Vec3d; # getFlowVector
public net.minecraft.world.World field_72999_e # scheduledUpdatesAreImmediate
8 changes: 4 additions & 4 deletions src/main/scala/streams/block/BlockRiver.scala
Expand Up @@ -49,13 +49,13 @@ class BlockRiver(liquid: MaterialLiquid, val dx: Int, val dz: Int) extends Block
getFlowingBlock(liquid).onBlockAdded(w, pos, state) // Checks for hardening & schedules update
}

override def onNeighborBlockChange(w: World, pos: BlockPos, state: IBlockState, formerNeighbor: Block) {
override def neighborChanged(state: IBlockState, w: World, pos: BlockPos, formerNeighbor: Block) {
if(formerNeighbor.isSolidOrLiquid) {
implicit val world = w
if(populating)
shoreUp(pos)
else {
getFlowingBlock(liquid).onNeighborBlockChange(w, pos, state, formerNeighbor) // Checks for hardening
getFlowingBlock(liquid).neighborChanged(state, w, pos, formerNeighbor) // Checks for hardening
if(blockAt(pos) == this && (!blockBelow(pos).isSolidOrLiquid || neighbors(pos).map(blockAt(_)).exists(!_.isSolidOrLiquid)))
w.scheduleUpdate(pos, this, tickRate(w))
}
Expand All @@ -81,14 +81,14 @@ class BlockRiver(liquid: MaterialLiquid, val dx: Int, val dz: Int) extends Block
}
}

override def getFlowVector(w: IBlockAccess, pos: BlockPos): Vec3d = { // Normalized in World.handleMaterialAcceleration()
override def getFlow(w: IBlockAccess, pos: BlockPos, state: IBlockState): Vec3d = { // Normalized in World.handleMaterialAcceleration()
implicit val world = w
if(dataAt(pos) == 0)
baseFlowVector
else {
val fallingNeighborDirections = CompassDirections.filter(d => blockAt(pos.add(d.x, 1, d.z)).material == liquid)
if(fallingNeighborDirections.isEmpty)
baseFlowVector + super.getFlowVector(w, pos)
baseFlowVector + super.getFlow(w, pos, state)
else { // Avoid water rising up counter-flow to meet waterfall
val combinedDirection = fallingNeighborDirections.reduce(_ + _)
val dMax = abs_max(combinedDirection.x.toDouble, combinedDirection.z.toDouble)
Expand Down
10 changes: 5 additions & 5 deletions src/main/scala/streams/block/FixedFlowBlockExtensions.scala
Expand Up @@ -19,17 +19,17 @@ import net.minecraftforge.client.model.ModelLoader
/** @author delvr */
object FixedFlowBlockExtensions {

def getFlowDirection(w: IBlockAccess, pos: BlockPos, material: Material,
super_getFlowDirection: ReplacedMethod[BlockLiquid]): Float = {
def getSlopeAngle(w: IBlockAccess, pos: BlockPos, material: Material, state: IBlockState,
super_getSlopeAngle: ReplacedMethod[BlockLiquid]): Float = {
if(w.isInstanceOf[World] || w.isInstanceOf[ChunkCache] || w.isInstanceOf[BlockAccess]) {
blockAt(pos)(w) match {
case block: BlockRiver => // Fixed flow
val flowVector = block.getFlowVector(w, pos)
val flowVector = block.getFlow(w, pos, state)
if(flowVector.xCoord == 0D && flowVector.zCoord == 0D) -1000F
else (atan2(flowVector.zCoord, flowVector.xCoord) - PI / 2D).toFloat
case _ => super_getFlowDirection(w, pos, material)
case _ => super_getSlopeAngle(w, pos, material, state)
}
} else super_getFlowDirection(w, pos, material)
} else super_getSlopeAngle(w, pos, material, state)
}

def onRegisterAllBlocks(shapes: BlockModelShapes, super_onRegisterAllBlocks: ReplacedMethod[ModelLoader]): Unit = {
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/streams/core/StreamsCoreMod.scala
Expand Up @@ -15,9 +15,9 @@ class StreamsClassTransformer extends MethodReplacementTransformer {
implicit private val transformer = this

protected val methodReplacements = Seq(
MethodReplacement("net/minecraft/block/BlockLiquid", "getFlowDirection", "func_185697_a",
"(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/material/Material;)F",
"streams/block/FixedFlowBlockExtensions/getFlowDirection"),
MethodReplacement("net/minecraft/block/BlockLiquid", "getSlopeAngle", "func_189544_a",
"(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/material/Material;Lnet/minecraft/block/state/IBlockState;)F",
"streams/block/FixedFlowBlockExtensions/getSlopeAngle"),
MethodReplacement("net/minecraft/entity/item/EntityBoat", "getUnderwaterStatus", "func_184444_v",
"()Lnet/minecraft/entity/item/EntityBoat$Status;",
"streams/entity/item/EntityBoatExtensions/getUnderwaterStatus"),
Expand Down

0 comments on commit 0064c57

Please sign in to comment.