Skip to content

Commit

Permalink
Added geolyzer function to get underground oil info
Browse files Browse the repository at this point in the history
updated GT and EIO references
  • Loading branch information
repo-alt committed Jan 1, 2021
1 parent 8d81073 commit 4797485
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 8 deletions.
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'com.matthewprenger.cursegradle'

tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ["-deprecation:false"]
}

file "build.properties" withReader {
def prop = new Properties()
prop.load(it)
Expand Down Expand Up @@ -103,6 +107,14 @@ repositories {
name = "gt"
url = "http://gregtech.overminddl1.com/"
}
ivy {
name 'gtnh_download_source'
artifactPattern "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]"
}
maven { // GalacticGreg, YAMCore,..
name 'UsrvDE'
url "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/"
}
}

configurations {
Expand All @@ -121,7 +133,7 @@ dependencies {
compileOnly "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev"
compileOnly "codechicken:WR-CBE:${config.minecraft.version}-${config.wrcbe.version}:dev"
compileOnly "com.bluepowermod:BluePower:${config.bluepower.version}:deobf"
compileOnly "com.gregoriust.gregtech:gregtech_${config.minecraft.version}:${config.gt.version}:dev"
compileOnly "com.gregoriust.gregtech:gregtech:${config.gt.version}:dev"
compileOnly "igwmod:IGW-Mod-1.7.10:${config.igwmod.version}:userdev"
compileOnly "li.cil.tis3d:TIS-3D:${config.tis3d.version}:dev"
compileOnly "mcp.mobius.waila:Waila:${config.waila.version}_${config.minecraft.version}:dev"
Expand Down
6 changes: 3 additions & 3 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minecraft.version=1.7.10
forge.version=10.13.4.1614-1.7.10

oc.version=1.7.5.6
oc.version=1.7.5.7-GTNH

ae2.version=rv2-beta-26
bc.version=7.0.9
Expand All @@ -18,13 +18,13 @@ coloredlights.build=35
ec.cf=2242/839
ec.version=deobf-1.7.10-2.2.73b129
eio.cf=2219/296
eio.version=1.7.10-2.2.1.276
eio.version=1.7.10-2.3.0.429_beta
es.version=1.4.5.24
fmp.version=1.1.0.308
forestry.version=4.1.0.44
gc.build=3
gc.version=3.0.7
gt.version=5.04.06
gt.version=5.09.33.52
ic2.version=2.2.828-experimental
igwmod.version=1.1.3-18
mekanism.build=5
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package li.cil.oc.integration.enderio

import crazypants.enderio.tool.ITool
import crazypants.enderio.api.tool.ITool
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.item.ItemStack

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import li.cil.tis3d.api.serial.SerialInterface
import li.cil.tis3d.api.serial.SerialInterfaceProvider
import li.cil.tis3d.api.serial.SerialProtocolDocumentationReference
import net.minecraft.nbt.NBTTagCompound
import net.minecraft.tileentity.TileEntity
import net.minecraft.util.EnumFacing
import net.minecraft.world.World

Expand All @@ -36,7 +37,7 @@ object SerialInterfaceProviderAdapter extends SerialInterfaceProvider {
override def interfaceFor(world: World, x: Int, y: Int, z: Int, side: EnumFacing): SerialInterface = new SerialInterfaceAdapter(world.getTileEntity(x, y, z).asInstanceOf[Adapter])

override def isValid(world: World, x: Int, y: Int, z: Int, side: EnumFacing, serialInterface: SerialInterface): Boolean = serialInterface match {
case adapter: SerialInterfaceAdapter => adapter.tileEntity == world.getTileEntity(x, y, z)
case adapter: SerialInterfaceAdapter => adapter.tileEntity.asInstanceOf[TileEntity] == world.getTileEntity(x, y, z)
case _ => false
}

Expand All @@ -48,7 +49,7 @@ object SerialInterfaceProviderAdapter extends SerialInterfaceProvider {

// ----------------------------------------------------------------------- //

val node = api.Network.newNode(this, Visibility.Network).withComponent("serial_port").create()
val node: Node = api.Network.newNode(this, Visibility.Network).withComponent("serial_port").create()

override def onMessage(message: Message): Unit = {}

Expand Down
9 changes: 8 additions & 1 deletion src/main/scala/li/cil/oc/server/component/Geolyzer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import li.cil.oc.api.machine.Context
import li.cil.oc.api.network.Message
import li.cil.oc.api.network.Visibility
import li.cil.oc.api.prefab
import li.cil.oc.common.tileentity.{Robot => EntityRobot, Microcontroller}
import li.cil.oc.common.tileentity.{Microcontroller, Robot => EntityRobot}
import li.cil.oc.common.entity.{Drone => EntityDrone}
import li.cil.oc.common.item.TabletWrapper
import li.cil.oc.util.BlockPosition
Expand All @@ -30,6 +30,7 @@ import net.minecraft.item.Item
import net.minecraft.item.ItemStack
import net.minecraft.nbt.NBTTagCompound
import net.minecraft.world.biome.BiomeGenDesert
import net.minecraft.world.chunk.Chunk
import net.minecraftforge.common.MinecraftForge
import net.minecraftforge.common.util.ForgeDirection

Expand Down Expand Up @@ -183,6 +184,12 @@ class Geolyzer(val host: EnvironmentHost) extends prefab.ManagedEnvironment with
})
}
}
@Callback(doc = """function():table -- Returns GregTech underground fluids information""")
def scanUndergroundFluids(computer: Context, args: Arguments): Array[AnyRef] = {
val blockPos = BlockPosition(host)
val fluid = gregtech.common.GT_UndergroundOil.undergroundOilReadInformation(new Chunk(host.world, blockPos.x>>4, blockPos.z>>4))
result(Map("type" -> fluid.getLocalizedName, "quantity" -> fluid.amount))
}

override def onMessage(message: Message): Unit = {
super.onMessage(message)
Expand Down

0 comments on commit 4797485

Please sign in to comment.