View Issue Details

IDProjectCategoryView StatusLast Update
0000068Industrial-Craft²nuclear reactor and anything associatedpublic2012-11-17 15:07
ReporterShedar Assigned ToRichardG  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Summary0000068: Invalid return value of the IReactor.getOutput() method
DescriptionWith single uranium cell IReactor.getOutput() returns 1 instead of 5.
Bug occurs with industrialcraft-2_1.108.71-lf.jar.
industrialcraft-2_1.108.52-lf.jar returns 5 as it should
Steps To Reproduce1. Create a reactor
2. turn on reactor
3. add an uranium cell to the reactor
4. Use Debug Item to check reactor's output

Nuclear Control Information Panel also can be used

TagsNo tags attached.
Minecraft Version

Activities

RawCode

2012-11-13 03:22

reporter   ~0000189

Nuclear Control Information Panel

not belong to IC2

Shedar

2012-11-13 09:21

updater   ~0000190

@RawCode, I forgot about Debug Item.

RawCode

2012-11-13 11:17

reporter   ~0000192

public int sendEnergy(int var1)
    {
        return EnergyNet.getForWorld(this.worldObj).emitEnergyFrom(this, var1 * IC2.energyGeneratorNuclear);
    }
by design, output (1 per cell) + production rate (5 by default).

you shoud not use outdated addons as source of information

Shedar

2012-11-13 11:23

updater   ~0000193

1. my addon is not outdated =)
2. it uses official API, which should return correct value
3. Debug Item (part of ic2) reports 1eu/t

RawCode

2012-11-13 11:55

reporter   ~0000195

you addon is outdated
it use API incorrectly
devs forgot to update debug tool

Shedar

2012-11-13 12:02

updater   ~0000197

You are either troll or don't understand difference between internal code and API.
In both cases I have nothing to say for you.

RawCode

2012-11-13 13:48

reporter   ~0000199

then decompile youself and check what class implement IReactor and how, i wont repeat myself.

TheBard

2012-11-13 15:30

reporter   ~0000202

Like I mentioned on the IC2 thread for Nuclear Control Information... My hunch is that the change to IReactor.getOutput() was done in relation to the change for the experimental steam changes. There's a config option to enable steam reactor output.

So my assumption is that the value IReactor.getOutput() returns needs to be multiplied by either a value of 5 if the reactor is outputting EU, or multiplied by some different value if outputting steam. That way IReactor.getOutput() doesn't need to know if steam is enabled or not, the output value will always be the same regardless of whether EU or steam is enabled... but later on, energy/steam checks can multiply that value by whatever factor based upon if energy or steam is switched on.

So Nuclear Control Information should multiply the result from IReactor.getOutput() by 5 to correctly display EU output. I don't know if you can read the steam output enabled config option inside IC2... but if you can, then you could also possibly display Steam/t instead of EU/t by multiplying by whatever factor the steam output is valued at.

Shedar

2012-11-13 15:57

updater   ~0000204

Public API is designed to allow to interact with component without information about it's implementation. If you will check the latest version of the API, you will see
    /**
     * Get the reactor's energy output.
     *
     * @return Energy output in EU/t
     */
    public int getOutput();
I see nothing about multiplication. It is a latest version of the API.
If API will be changed - I will update my addon. Otherwise it is a bug.
Yes, I can get information via reflection again. But I wouldn't, it is a step backward.

TheBard

2012-11-13 19:29

reporter   ~0000206

RichardG is the one who made the change I believe... possibly he failed to update the comment? What do other sections of the IC2 code do after they call getOutput()? I'm guessing they multiply by either the EU factor or the Steam factor?

RawCode

2012-11-14 09:40

reporter   ~0000209

@Shedar blablabla mr freeman

Download: http://dl.dropbox.com/u/861751/IC2/1.108…1.108.71-lf.jar
API: http://dl.dropbox.com/u/861751/IC2/1.108…1.108.52-lf.zip

Read this lines carefully, multiple times if needed, latest version of API is not for latest version of beta.

Since you not able to change API, you shoud change your code, how to change your code listed in my second reply.

And for reflections !!!!YOU WILL GET SAME OUTPUT!!!!

Shedar

2012-11-14 10:30

updater   ~0000210

> Since you not able to change API
Okay, you finally understand, that something wrong with API *applause*
But your logic is weird, "If something wrong there - change something here, to be as wrong as other side".
My logic: "if something wrong there - report the problem, so it can be fixed".

RawCode

2012-11-14 12:48

reporter   ~0000211

If something changed there - change something here, to be same as other side.

you try to report reactor update as bug...

RichardG

2012-11-16 14:34

administrator   ~0000219

The debug item doesn't read EU/t.

Care to read the changelog?

Shedar

2012-11-16 14:52

updater   ~0000220

Last edited: 2012-11-16 15:21

> Care to read the changelog?
What do you mean? Did I miss something about API update?

RichardG

2012-11-17 14:55

administrator   ~0000223

You did miss something, unless I forgot to add it.

Issue History

Date Modified Username Field Change
2012-11-12 17:49 Shedar New Issue
2012-11-13 03:22 RawCode Note Added: 0000189
2012-11-13 09:20 Shedar Steps to Reproduce Updated
2012-11-13 09:21 Shedar Note Added: 0000190
2012-11-13 11:17 RawCode Note Added: 0000192
2012-11-13 11:23 Shedar Note Added: 0000193
2012-11-13 11:55 RawCode Note Added: 0000195
2012-11-13 12:02 Shedar Note Added: 0000197
2012-11-13 13:48 RawCode Note Added: 0000199
2012-11-13 15:30 TheBard Note Added: 0000202
2012-11-13 15:57 Shedar Note Added: 0000204
2012-11-13 19:29 TheBard Note Added: 0000206
2012-11-14 09:40 RawCode Note Added: 0000209
2012-11-14 10:30 Shedar Note Added: 0000210
2012-11-14 12:48 RawCode Note Added: 0000211
2012-11-14 23:34 Alblaka Status new => acknowledged
2012-11-16 14:34 RichardG Note Added: 0000219
2012-11-16 14:52 Shedar Note Added: 0000220
2012-11-16 15:21 Shedar Note Edited: 0000220
2012-11-17 14:55 RichardG Note Added: 0000223
2012-11-17 14:55 RichardG Status acknowledged => closed
2012-11-17 14:55 RichardG Assigned To => RichardG
2012-11-17 14:55 RichardG Resolution open => no change required
2012-11-17 14:55 RichardG Fixed in Version => 1.108
2012-11-17 15:07 RichardG Status closed => resolved