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…
- The mold must have a direction to pull from set.
- 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.
- 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.
- Mold has a direction set.
- Mold is empty.
- Any of the following are true…
- Mold doesn’t have redstone mode enabled
- Mold uses redstone mode AND
- Redstone signal is on
- 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?