Odd molds behavior when using redstone mode

Odd molds behavior when using redstone mode
0

I know i’ve already discussed this in the main thread, but now it has bothered me enough to where i needed to check the source code…

So here goes:

Function OnServerTickPost()
...
if (
    (
        mInventoryChanged ||        // Seems to work fine with pinchers. Using a quick fire macro means i can rapid fire the mold.
        mTimer % 50 == 0 ||         // Have absolutely no idea why it's checking once every 2.5 seconds.
       (
            mBlockUpdated &&        // I assume mBlockUpdated is TRUE when redstone signal is sent to the mold. But for how long?
            mUseRedstone            // Of course only do this when redstone is enabled.
        )
    ) &&                            // AND
    (
        !mUseRedstone ||            // Not using redstone or...         Both seem to work fine to me
        hasRedstoneIncoming()       // Has RedstoneIncoming             Both seem to work fine to me
    ) &&                            // AND
    mContent == null &&             // AND      No issues here
    mAutoPullDirections != 0        //          No issues here
)

// All of this seems perfectly fine
for (byte tSide : ALL_SIDES_VALID)
    if (FACE_CONNECTED[tSide][mAutoPullDirections]) {
        DelegatorTileEntity<TileEntity> tDelegator = getAdjacentTileEntity(tSide);
        if (tDelegator.mTileEntity instanceof ITileEntityCrucible)
            ((ITileEntityCrucible)tDelegator.mTileEntity).fillMoldAtSide(this, tDelegator.mSideOfTileEntity, tSide);
    }

So, for a mold to automatically fill with molten stuff, four conditions HAVE to be true.

The first two are quite simple…

  1. The mold must have a direction to pull from set.
  2. The mold must be empty.

If those two aren’t true, then nothing will work. This is not one of my issues.

The third condition is so-so to me.

    • The mold MUST NOT use redstone mode, or…
    • The mold MUST have a redstone signal incoming.

This logic seems wonky to my own way of setting logical conditions.
Either way, it would work just fine with these three conditions so far.

But, the fourth is very complicated.

  1. Any of the following must be true
    • Block is updated AND block is using redstone mode.
    • The current tick is evenly divisible by 50. Or in other words, it will work one tick every 2.5 seconds.
    • Inventory has changed on the block. I don’t really know what this means. But i assume it means content changes from not null to null and back. Either way, it seems to work fine when i spam use a pincer on the mold.

My problem
The problem is that the mold, which is redstone enabled and has a direction, doesn’t automatically fill with molten material as soon as the redstone signal goes high. Of course the mold is empty as well.

It eventually fills after some delay, but at that point it’s too late because the crucible would have overheated (if i didn’t have a kill switch) and/or the crucible would have automatically been fed more materials for the alloying recipe i am doing. Which of course is why i want to use redstone mode and only pour when the temperature is right for the alloy i am making. Otherwise i would pour one of the ingredients rather than the alloy i am making.

Possible solution
Well, looking at the fourth condition. Inventory hasn’t changed at the time the redstone signal goes high. Not ever, so that’s not part of the problem.

It eventually fills, so i assume the tick (mTimer) is evenly divisible by 50 at that point. This isn’t a solution, this is just one way that the mold eventually does work because of.

The problem lies with the block being updated. I don’t think the block ever updates unless i change something nearby. This would work fine when the mold is next to the crucible i assume because the crucible causes a block update to happen when the material(s) in it melts or an alloy is formed.
But the molds are next to crucible crossings. Also, i have tried setting the redstone high at the exact temperature or slightly above the alloy temperature and nothing seems to work right.

My solution therefore would be to simplify the logic.

  1. Mold has a direction set.
  2. Mold is empty.
  3. Any of the following are true…
    • Mold doesn’t have redstone mode enabled
    • Mold uses redstone mode AND
      • Redstone signal is on
  4. Any of the following are true…
    • Inventory has changed
    • Block has been updated (Still not sure when this happens BTW)
    • Tick is % 50
    • Redstone is on AND the previous redstone signal was off. (pulse)

Additionally…

If tick is % 50, check if redstone signal is off. If so, reset last state of redstone signal.
That is, pulse only works every 2.5 seconds.
But the important part here is that as soon as redstone signal goes from low to high, a check does happen.

Could this be fixed and released please?
Pwetty please with cherries on top?

3 Likes

If it is Automatic it will attempt pouring every 2.5 seconds. This is to prevent Lag from checking every tick for no reason.

If it is Redstone based, a Block Update needs to happen and the Mold ends up checking for Redstone on each Block Update. Block Updates are like when you place or break a Block, or when Redstone Signals change PROPERLY (which certain Redstone Specialized Mods like Project Red do not do…). Yes Block Updates are used for literally everything, and it is annoying as fuck to deal with. Heck you never even know where the change came from, only that it happened.

Inventory change means that a Hopper has pulled out the Ingot from the Mold or something along the lines. The Mold does have an Inventory Slot. This Update however does not happen when the Ingot solidifies, since I handle Internal Slot changes differently from Hoppers interacting with it.

Incorrect, the Crucible doesn’t send Block Updates at all, unless when it vaporizes/explodes.

The Sensor you likely have on the Crucible is capable of sending a Block Update, BUT only when its Output Signal changes.

The Project Red Wires are NOT capable of sending proper Block Updates at all, resulting in the Mold not reacting to the Redstone Signal, since no Block Update happened to make it aware of the Redstone change. This Issue is why Pistons can sometimes be “BUD-powered” but dont react at all.

This is why your Setup doesn’t work.

3 Likes

I am using GT wires. Not Project Red wires.

2 Likes

Screenshot of the Setup please (I will look at the one on the main thread in the meantime.)

Edit: Well that was the Project Red Screenshot. So not the one I need. XD

2 Likes

As you can see, GT 6 wires goes from the sensor to the molds. The GT 6 wire lights up.
Molds still pour after UP to 2.5 seconds. Not when the signal on the GT 6 wire changes.

In this setup i am smelting black sand and charcoal to make iron. So in this particular one i don’t really need the redstone mode. I will turn off redstone mode on the molds and see if they pour. I assume they will.

2 Likes

Here is the Issue, the Mold doesn’t know that, this is what Block Updates are for and they are not sent somehow.

Can you try using Redstone Repeaters as Covers on the GT6 Redwire? Preferrably pointing towards the Molds. :wink:

3 Likes

First thing first, i turned off redstone mode and the molds still pour wonky… Hmm…
It’s not even related to redstone at all then?

EDIT: I used a pickaxe to pick one mold up and place it again, it pours now without redstone immediately.

2 Likes

Regular Automatic Mode pours all 2.5 seconds, remember? And it goes with the internal clock of the Molds, which I might change to the Serverwide Clock soon.

3 Likes

Ah right, yeah the molds pour with the same delay between them as i placed them without redstone mode on.
I will try repeaters next.
EDIT: No, same delay with redstone repeater covers.

They pour in the same order i placed them and at the exact same speed that i placed them. It’s as if a recording of the time and interval of how i placed them down.

2 Likes

I said TOWARDS the Molds#

Edit I see a different Issue, that Redwire is OFF not ON, the thing at the tip of the Repeater needs to glow.

3 Likes

Like so?

It’s off because the temperature is below 1820

2 Likes

Yes and the Wire is still OFF btw

You are pointing a PROJECT RED repeater into my Wire, do you think that the Wire will receive a Block Update after I told you what was wrong with the Molds earlier?

Edit: and you did turn Redstone Mode back ON right?

3 Likes

I can’t do everything at the same time here but the wire does light up at the right temperature.

PR repeater DELETED, also, it’s in side was from your wire, not going to wire.
Still pouring oddly.

Yes, redstone mode is back on.

2 Likes

Okay something must be wrong with my Red Alloy wires for this to happen. I will check that later. ^^

3 Likes

Thank you!

Didn’t know one could slap repeaters on your wires. Other than that, this isn’t really my first rodeo. :wink:

So you can’t check if redstone is on or off to a certain block without a block update?

2 Likes

So what is wrong with this setup then?
Still doing the same thing.

Are minecraft repeaters not sending block updates either then?

EDIT: Two more screenshots.

EDIT: I mean, the temporary solution (somewhat) is to try and place all molds as quickly as i can so at least they all have a chance to pour when the conditions are right. Because if i place them slowly enough, only two will pour and thus missing their chance on that cycle.

2 Likes

Wait you are sending a Redstone Pulse, right? As in the Wire is OFF for most of the time and only ON the moment it pours, right?

2 Likes

if (mTemperature > 1820K)
RedstoneOn();
else
RedstoneOff();

The only thing i pulse is the hoppers above which feeds a set amount of ingredients to the crucible after delay to allow the pour to happen.

Before i started doing your biddings to show that the setup is sound, the repeater that i deleted was set to 32 ticks. Meaning i got about a 1.6 second window to pour before new ingredients were dropped by the hoppers.

2 Likes

So it is permanently ON, the Redstone Update only happens when it goes from OFF to ON and vice versa. When it is permanently ON it will do the Timer thing.

And the Repeaters are only doing a Redstone ONE-WAY they actually dont serve a purpose in your Setup except for testing. But they can be useful in some cases.

2 Likes

It’s permanently on as long as the temperature is above 1820 yes.
Currently smelting iron so the mold has molten iron in it before the redstone signal turns on.

You mean i should make a pulse happen when temperature is over 1820 instead?
It’s easy, i have Red Power. I just don’t like having clocks for no good reason but i can test that.

2 Likes