ReactorCraft! Radiation is bad?

  • FTB will be shutting down this forum by the end of July. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
An easy, but impractical way to fix this, would be to call a function, to check if the container it is being pumped into is on a list (which would list all voiding blocks that you know about), and if return equals true, then it won't pump into it. The dropping it onto the ground and waiting for it to despawn, as well as voiding it. An easy fix for the first one is that players can't throw it, and do something similar to the list idea for it, so people can't just use turtles to drop it. As for the voiding thing, maybe it can't pump into a tesseract, ender tank etc. Also, maybe make it so it cant spill onto the ground unless there are x blocks nearby (the machines for your reactor thing). At the end of the day, you can only do so much. If players really want to, they are going to find a way to bypass it.
I cannot control this.
 
  • Like
Reactions: YX33A

ThatOneSlowking

New Member
Jul 29, 2019
3,520
0
0
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.
image.jpg

In all seriousness the parts I did understand are pretty intresting, specifically what would happen if two mods attempted to be last at the same time?
 

Colensocon1

New Member
Jul 29, 2019
331
0
0
You could just place the waste in say a chest and force wrench it or a hardened chest or something similar and then void that
 

Colensocon1

New Member
Jul 29, 2019
331
0
0
Damn...this is completely true.
I don't think there is a way to stop this one :/[DOUBLEPOST=1396049932][/DOUBLEPOST]Also I'm curious what would happen if a plugin like clearlagg tryed to remove the waste like a lot f servers have this plugin and most set it to clear all ground items every 5 minutes or so wouldn't this destroy the item or does your code prevent things like this?
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
I don't think there is a way to stop this one :/[DOUBLEPOST=1396049932][/DOUBLEPOST]Also I'm curious what would happen if a plugin like clearlagg tryed to remove the waste like a lot f servers have this plugin and most set it to clear all ground items every 5 minutes or so wouldn't this destroy the item or does your code prevent things like this?
It depends on how the plugin works.
 

immibis

New Member
Jul 29, 2019
884
0
0
An easy, but impractical way to fix this, would be to call a function, to check if the container it is being pumped into is on a list (which would list all voiding blocks that you know about), and if return equals true, then it won't pump into it.
What stops you from putting fuel into a hopper attached to an incinerator/trashcan/void pipe/nullifier?

Well, the entity never dies, so it falls forever. But you are right in that this functionally eliminates it.
Actually, entities do start taking damage once they reach a certain point, just like players.

Can't FML use corotines or do you not have those in java?
Not sure how this is relevant.
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
Can't FML use corotines or do you not have those in java?
What is a "Corotine"?

What stops you from putting fuel into a hopper attached to an incinerator/trashcan/void pipe/nullifier?
This is exactly the problem I am trying to get around.

Actually, entities do start taking damage once they reach a certain point, just like players.
I made the entity immune to all damage.
 

immibis

New Member
Jul 29, 2019
884
0
0
This is exactly the problem I am trying to get around.
I have no idea how Reactorcraft works, but what if fuel could only be handled by Reactorcraft blocks, and not by the player or machines from other mods?
 

Reika

RotaryCraft Dev
FTB Mod Dev
Sep 3, 2013
5,079
5,331
550
Toronto, Canada
sites.google.com
I have no idea how Reactorcraft works, but what if fuel could only be handled by Reactorcraft blocks, and not by the player or machines from other mods?
Fuel is not the issue; waste is. That said, it is probably my only solution. It is not possible with items, so I need to design some sort of other mechanic.
 

trajing

New Member
Jul 29, 2019
3,091
-14
1
What is a "Corotine"?


This is exactly the problem I am trying to get around.


I made the entity immune to all damage.
I may have misspelled it, but it allows you to run two different bits of code at the same time.