ReactorCraft! Radiation is bad?

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Pyure

Not Totally Useless
Aug 14, 2013
8,334
7,191
383
Waterloo, Ontario
Yes, an unloaded reactor will melt down.
Dick question, but is that actually specified anywhere?

That will not work forever.

I don't know how items are nulled in minecraft, but I half-expected a destructor method on the waste item to check its location prior to voiding and punish me for my cleverness. I haven't touched java in 15 years; do destructor methods even exist? :p (this would also punish for dropping in lava)

I'll make an effort to do the proper waste-disposal method when I need to.
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
Dick question, but is that actually specified anywhere?
No, because it is technically a bug, but not one I can do anything about.

I don't know how items are nulled in minecraft, but I half-expected a destructor method on the waste item to check its location prior to voiding and punish me for my cleverness. I haven't touched java in 15 years; do destructor methods even exist? :p
There is such a method ( finalize() ), but it calls on Java object destruction, so when you actually logged out of the game world, and not when the item died.
So far, the only thing I can think of would be for the developers of the other mods to add a special exception to nuclear waste, but my asking in the past was not at all productive, being met with responses like "this idea is stupid don't make items the player should have to get rid of a certain way".

(this would also punish for dropping in lava)
You already are. The items are invincible, so you are irradiating the area.
 
  • Like
Reactions: Pyure

YX33A

New Member
Jul 29, 2019
3,764
1
0
No, because it is technically a bug, but not one I can do anything about.


There is such a method ( finalize() ), but it calls on Java object destruction, so when you actually logged out of the game world, and not when the item died.
So far, the only thing I can think of would be for the developers of the other mods to add a special exception to nuclear waste, but my asking in the past was not at all productive, being met with responses like "this idea is stupid don't make items the player should have to get rid of a certain way".


You already are. The items are invincible, so you are irradiating the area.
Honestly I only know of three mods with "trash can" systems. Er, sorry, 4, TE3 has one, yes?(five if I could a mod by immibis that I'm not sure is still being worked on)
Extra Utilities, GregTech, and Ancient Warfare. One of those is somewhat unused, and one is made by a person who you could actually get some serious help on this with, since he's a master of editing other mods using reflection based purely on how he assumes it works. Greg is actually a great coder in that regard.
 
  • Like
Reactions: abculatter_2

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
Honestly I only know of three mods with "trash can" systems. Er, sorry, 4, TE3 has one, yes?(five if I could a mod by immibis that I'm not sure is still being worked on)
Extra Utilities, GregTech, and Ancient Warfare. One of those is somewhat unused, and one is made by a person who you could actually get some serious help on this with, since he's a master of editing other mods using reflection based purely on how he assumes it works. Greg is actually a great coder in that regard.
TE3 has one (and the most commonly used one at that), and the new dev really hates my mods, so there is no help there. GT is unlikely to help, too, given that his community hates me even more for making, in one person's words, "mods that are so OP they should be illegal to make".
 

YX33A

New Member
Jul 29, 2019
3,764
1
0
TE3 has one (and the most commonly used one at that), and the new dev really hates my mods, so there is no help there. GT is unlikely to help, too, given that his community hates me even more for making, in one person's words, "mods that are so OP they should be illegal to make".
His Community is filled with people that are more fanatical then Greg himself. I'd suggest asking Greg regardless of his insane his fans are; fans tend to be insane as a rule.
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
His Community is filled with people that are more fanatical then Greg himself. I'd suggest asking Greg regardless of his insane his fans are; fans tend to be insane as a rule.
Arguably true. How would I best contact him?

And what about TE? I have asked similar questions in the past, and it always went the same. For example, because of the bedrock pickaxe's ability to harvest spawners, spawning about 40 mobs in the process, some people made autofarms with the autonomous activator. KingLemming said he was going to blacklist the pickaxe, but then he left, and when skyboy was asked, he refused to do anything, instead insisting that the bedrock pickaxe should not be able to harvest spawners.
 

YX33A

New Member
Jul 29, 2019
3,764
1
0
Arguably true. How would I best contact him?

And what about TE? I have asked similar questions in the past, and it always went the same. For example, because of the bedrock pickaxe's ability to harvest spawners, spawning about 40 mobs in the process, some people made autofarms with the autonomous activator. KingLemming said he was going to blacklist the pickaxe, but then he left, and when skyboy was asked, he refused to do anything, instead insisting that the bedrock pickaxe should not be able to harvest spawners.
I'd suggest PMing him over on the IC2 forums. Just remember; the help he'd be offering would be related to using reflection to add a blacklist to "trash cans" based on if items are immortal or not, and he's gotten some serious flak over his use of such techniques before(well, actually, it was flak about him apparently decompiling RP2 to edit some recipes when in fact he "merely" coded in such reflection based on how he assumed it would work and succeeded), and while I have no doubts that he would be somewhat approving of the idea(it is after all a balancing feature that is actually been long coming for these sorts of devices), it's still technically a dark path to tread.
You'd be using code(likely partially coded by Greg or coded yourself using techniques provided by Greg) to usurp functionality from other mods. I'd approve, but you'll still get a ton of flak for it regardless of how needed it is.
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
I'd suggest PMing him over on the IC2 forums. Just remember; the help he'd be offering would be related to using reflection to add a blacklist to "trash cans" based on if items are immortal or not, and he's gotten some serious flak over his use of such techniques before(well, actually, it was flak about him apparently decompiling RP2 to edit some recipes when in fact he "merely" coded in such reflection based on how he assumed it would work and succeeded), and while I have no doubts that he would be somewhat approving of the idea(it is after all a balancing feature that is actually been long coming for these sorts of devices), it's still technically a dark path to tread.
You'd be using code(likely partially coded by Greg or coded yourself using techniques provided by Greg) to usurp functionality from other mods. I'd approve, but you'll still get a ton of flak for it regardless of how needed it is.
There is a way to do this entirely on his end. Basically (without going into the java) allow an item to require it be queried before deletion; if it returns false, deletion fails.
 

YX33A

New Member
Jul 29, 2019
3,764
1
0
There is a way to do this entirely on his end. Basically (without going into the java) allow an item to require it be queried before deletion; if it returns false, deletion fails.
That works? Then this is even easier then I'd have thought! The catch is you have to add this code to all mods with "Trash Cans", which is why I think you'd need Greg's help; I can think of no one better at adding code to mods using reflection, seeing as he can do it without looking at the code for the mod he's adding it to.
 
  • Like
Reactions: abculatter_2

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
That works? Then this is even easier then I'd have thought! The catch is you have to add this code to all mods with "Trash Cans", which is why I think you'd need Greg's help; I can think of no one better at adding code to mods using reflection, seeing as he can do it without looking at the code for the mod he's adding it to.
No, that would not be reflection, it would be asm/bytecode edit, and I would not be willing to touch it. I asked about Greg because you said IC2/GT has a trashcan too.

I contacted the maker of ExtraUtils.
 

YX33A

New Member
Jul 29, 2019
3,764
1
0
No, that would not be reflection, it would be asm/bytecode edit, and I would not be willing to touch it. I asked about Greg because you said IC2/GT has a trashcan too.

I contacted the maker of ExtraUtils.
Honestly I'm no coder; all I know is Greg is able to add edits to mods without touching their code, and without looking it up either. And that sounds pretty awesome to someone who can't code, y'know?
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
Honestly I'm no coder; all I know is Greg is able to add edits to mods without touching their code, and without looking it up either. And that sounds pretty awesome to someone who can't code, y'know?
Reflection can be used to edit fields (variables); this can be used to change values of things, from power outputs to recipes to all sorts of data. It cannot, however, change the "logic" of a program and add "if" statements, extra methods, or stop the execution of various branches.
 
  • Like
Reactions: Pokefenn

YX33A

New Member
Jul 29, 2019
3,764
1
0
Reflection can be used to edit fields (variables); this can be used to change values of things, from power outputs to recipes to all sorts of data. It cannot, however, change the "logic" of a program and add "if" statements, extra methods, or stop the execution of various branches.
Still seems like something up Greg's alley, though. Again, I can't code and barely understand the difference.
 

portablejim

New Member
Jul 29, 2019
267
0
1
Reflection
(really it's introspection because I am not changing anything, and it actually requires a core mod as well)

As an example, here is how to get (as an Item) a Buildcraft gold power pipe.
Code:
Class.forName("buildcraft.BuildCraftTransport").getField("pipePowerGold").get(null)

Coremods (asm code)

The code above is compiled down to bytecode. Here is the result (well, turned into a readable format - it's usually unreadable)
Code:
  L0
    LINENUMBER 54 L0
    NEW net/minecraft/item/ItemStack
    DUP
    LDC "buildcraft.BuildCraftTransport"
    INVOKESTATIC java/lang/Class.forName (Ljava/lang/String;)Ljava/lang/Class;
    LDC "pipePowerGold"
    INVOKEVIRTUAL java/lang/Class.getField (Ljava/lang/String;)Ljava/lang/reflect/Field;
    ACONST_NULL
    INVOKEVIRTUAL java/lang/reflect/Field.get (Ljava/lang/Object;)Ljava/lang/Object;
    CHECKCAST net/minecraft/item/Item
    ICONST_1
    ICONST_0
    INVOKESPECIAL net/minecraft/item/ItemStack.<init> (Lnet/minecraft/item/Item;II)V
    ASTORE 1

An example of modifying this code is here. This code turns
Code:
Block.blocksList[l].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, i1);
into
Code:
boolean x = Block.blocksList[l].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, i1);
Veinminer.instance.blockMined(this.theWorld, this.thisPlayerMP, par1, par2, par3, x, i1);
Yes, it is difficult.

As for Greg doing ASM, he doesn't do any (as far as the version in TPPI, anyway). He does all his changes by being last (if you can be last to edit recipes, for example, you can just change the recipes without having to worry about other mods changing them.
 
  • Like
Reactions: YX33A

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
An example of modifying this code is here. This code turns
Code:
Block.blocksList[l].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, i1);
into
Code:
boolean x = Block.blocksList[l].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, i1);
Veinminer.instance.blockMined(this.theWorld, this.thisPlayerMP, par1, par2, par3, x, i1);
Yes, it is difficult.
:eek:
Would you be willing to show me how to do that (add a function call into vanilla code)? It would allow me to easily fix several bugs and allow a few features I have wanted.
I do not need the "x = " part, just the chance to insert the function call.
 

Pyure

Not Totally Useless
Aug 14, 2013
8,334
7,191
383
Waterloo, Ontario
Some hard-ish numbers if anyone's interested.

9 uranium fuel pellets in a 3x3 grid surrounded by boilers produced approximately 5.85TJ of power, by which time enough of the pellets had depleted to be unable to sustain a consistent reaction*. You could get a bit more out if you were constantly feeding pellets. Right now 4 or 5 pellets are kicking around at 85% depleted accomplishing nothing, so there's definitely room for a lot more juice to squeeze out.

It ran, on average, at 940MW (believe its /T).

I don't have hard numbers on how much I spent on the fuel unfortunately. Definitely a good investment however.

*Its a sign of Reika's good design that we can even say that sentence. You can't get away with that in IC2 nukes.
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
Some hard-ish numbers if anyone's interested.

9 uranium fuel pellets in a 3x3 grid surrounded by boilers produced approximately 5.85TJ of power, by which time enough of the pellets had depleted to be unable to sustain a consistent reaction*. You could get a bit more out if you were constantly feeding pellets. Right now 4 or 5 pellets are kicking around at 85% depleted accomplishing nothing, so there's definitely room for a lot more juice to squeeze out.

It ran, on average, at 940MW (believe its /T).

I don't have hard numbers on how much I spent on the fuel unfortunately. Definitely a good investment however.

*Its a sign of Reika's good design that we can even say that sentence. You can't get away with that in IC2 nukes.
Nuclear fuel is not all that expensive, but given how long it lasts, it is well worth the effort.