Advanced Generators

Advanced Generators

40M Downloads

1.8.9 IEnergyProvider Change

pauljoda opened this issue ยท 10 comments

commented

It seems your mod is using IEnergyHandler as the base for the RF output of the generator. This is not how the API is used now as they have moved the IEnergyReciever and IEnergyProvider functions to seperate child classes. For other mods attempting to see if they can recieve/provide energy to your mod, they will be unable to interact. For example, our NeoTech mod can not connect to your generator because it is not marked as an IEnergyReceiver or IEnergyProvider. I do not know if you have a particular reason to not use the proper child classes but it breaks interaction with others mods.

commented

Technically NEOTech (and other pipe mods) should be looking for IEnergyConnection to determine if they can connect IMHO. IEnergyHandler is a subinterface of that.

The problem is that the generators are meant to push energy out (via IEnergyReceiver on the pipe), they can't really provide energy via IEnergyProvider.extractEnergy

I'll can try switching to IEnergyProvider and just have extractEnergy return 0, not sure if this will fix anything.

commented

Ok i've added a workaround. Right clicking a face of a flux generator with a wrench will set that side to forced output mode, allowing it to connect with pipes that don't implement RF interfaces.

I've also implemented IEnergyProvider with a working extractEnergy.

Combined this should allow the mod to work with FR and NeoTech pipes.

This is somewhat experimental, please report any bugs.

commented

I've changed my TE to implement IEnergyProvider and it changes nothing.

I've looked at it deeper and neotech pipes don't implement any kind of RF interface at all. Same thing as Fluxed Redstone.

My generators need to detect the pipe somehow, to assign an output color to it. This isn't going to work unless those mods change their implementation.

If you want a non-broken power system in 1.8.9 - use buildcraft for now.

commented

tested and works wonders... everything is in it's place!! great job.

commented

Just wanted to give a little input as to why our pipes don't use RF interfaces, we don't use them because they don't store things. We move things from one point to another. Glad you were able to work with us as it is subtly different from how most mods in 1.7 did things. This prevents a lot of extra ticking and storage that we don't really care to use.

I can see your points about pushing energy out. That is generally true for most cases. However, allowing the interface to extract energy is also something I feel should be provided. Without that, there would be no point for the IEnergyProvider if the assumption is that it will handle pushing energy out and not allowing interface with itself.

Anyway thanks for working with us. I only added more input because if we are doing something totally wrong I would like to fix that. I don't think either of us is wrong, just different interpretations.

commented

going into my test lab map, first thing I noticed after the update, is that Neotech cables are detected, and attached to your generators, before it wasn't even attached. Forcing the output to either FR or Neo cables works wonders, huston.. we got power.

I did got a crash trying to expand one of the generators by adding a TurbineController

`ava.util.IllegalFormatConversionException: d != net.minecraft.util.BlockPos
at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302)
at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2793)
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2747)
at java.util.Formatter.format(Formatter.java:2520)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2927)
at scala.collection.immutable.StringLike$class.format(StringLike.scala:287)
at scala.collection.immutable.StringOps.format(StringOps.scala:30)
at net.bdew.lib.BdLib$.logWarn(BdLib.scala:26)
at net.bdew.lib.multiblock.tile.TileController$$anonfun$validateModules$2.apply(TileController.scala:70)
at net.bdew.lib.multiblock.tile.TileController$$anonfun$validateModules$2.apply(TileController.scala:69)
at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
at net.bdew.lib.multiblock.tile.TileController$class.validateModules(TileController.scala:69)
at net.bdew.lib.multiblock.tile.TileControllerGui.validateModules(TileControllerGui.scala:14)
at net.bdew.lib.multiblock.tile.TileController$$anonfun$1.apply$mcV$sp(TileController.scala:89)
at net.bdew.lib.Event0$$anonfun$trigger$1.apply(Event.scala:19)
at net.bdew.lib.Event0$$anonfun$trigger$1.apply(Event.scala:19)
at scala.collection.immutable.List.foreach(List.scala:383)
at net.bdew.lib.Event0.trigger(Event.scala:19)
at net.bdew.lib.tile.TileTicking$class.update(TileTicking.scala:24)
at net.bdew.lib.multiblock.tile.TileControllerGui.func_73660_a(TileControllerGui.scala:14)
at net.minecraft.world.World.func_72939_s(World.java:1718)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:545)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:701)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:605)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:250)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:481)
at java.lang.Thread.run(Thread.java:745)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head --
Stacktrace:
at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302)
at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2793)
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2747)
at java.util.Formatter.format(Formatter.java:2520)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2927)
at scala.collection.immutable.StringLike$class.format(StringLike.scala:287)
at scala.collection.immutable.StringOps.format(StringOps.scala:30)
at net.bdew.lib.BdLib$.logWarn(BdLib.scala:26)
at net.bdew.lib.multiblock.tile.TileController$$anonfun$validateModules$2.apply(TileController.scala:70)
at net.bdew.lib.multiblock.tile.TileController$$anonfun$validateModules$2.apply(TileController.scala:69)
at scala.collection.mutable.HashSet.foreach(HashSet.scala:78)
at net.bdew.lib.multiblock.tile.TileController$class.validateModules(TileController.scala:69)
at net.bdew.lib.multiblock.tile.TileControllerGui.validateModules(TileControllerGui.scala:14)
at net.bdew.lib.multiblock.tile.TileController$$anonfun$1.apply$mcV$sp(TileController.scala:89)
at net.bdew.lib.Event0$$anonfun$trigger$1.apply(Event.scala:19)
at net.bdew.lib.Event0$$anonfun$trigger$1.apply(Event.scala:19)
at scala.collection.immutable.List.foreach(List.scala:383)
at net.bdew.lib.Event0.trigger(Event.scala:19)
at net.bdew.lib.tile.TileTicking$class.update(TileTicking.scala:24)
at net.bdew.lib.multiblock.tile.TileControllerGui.func_73660_a(TileControllerGui.scala:14)

-- Block entity being ticked --
Details:
Name: advgenerators.TurbineController // net.bdew.generators.controllers.turbine.TileTurbineController
Block type: ID #484 (tile.advgenerators.TurbineController // net.bdew.generators.controllers.turbine.BlockTurbineController$)
Block data value: 0 / 0x0 / 0b0000
Block location: World: (1056,4,583), Chunk: (at 0,0,7 in 66,36; contains blocks 1056,0,576 to 1071,255,591), Region: (2,1; contains chunks 64,32 to 95,63, blocks 1024,0,512 to 1535,255,1023)
Actual block type: ID #484 (tile.advgenerators.TurbineController // net.bdew.generators.controllers.turbine.BlockTurbineController$)
Actual block data value: 0 / 0x0 / 0b0000
Stacktrace:
at net.minecraft.world.World.func_72939_s(World.java:1718)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:545)

-- Affected level --
Details:
Level name: Mod Test Lab
All players: 0 total; []
Chunk stats: ServerChunkCache: 625 Drop: 0
Level seed: -6353641628453592419
Level generator: ID 01 - flat, ver 0. Features enabled: true
Level generator options:
Level spawn location: 898.00,4.00,520.00 - World: (898,4,520), Chunk: (at 2,0,8 in 56,32; contains blocks 896,0,512 to 911,255,527), Region: (1,1; contains chunks 32,32 to 63,63, blocks 512,0,512 to 1023,255,1023)
Level time: 141491 game time, 6147 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 96606 (now: false), thunder time: 68271 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:701)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:605)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:250)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:481)
at java.lang.Thread.run(Thread.java:745)`

commented

Fixed the crash in this build: http://minecraft.curseforge.com/projects/bdlib/files/2286264

It crashed when trying to output a warning about something being wrong with the internal list of modules in that generator. After updating please try again and see if you get any warnings in your log.

commented

Also in the future please open a new issue for things like that, so it's easier to keep track.

commented

cool, sorry about that.

commented

I see your point about push vs pull modes. And i think with my latest version pull should work better.

It would be nice if you at least implemented IEnergyConnection on the pipes so that my generators could detect that there's something that understands RF in that tile - that would remove the need for the users to force it to output mode with a wrench.