ZeroNoRyouki / ExtremeReactors2

19 stars 17 forks source link

Emit a pulse signal will trigger twice #38

Closed beiai closed 3 years ago

beiai commented 3 years ago

Minecraft Version: 1.16.5 forge: 36.0.42 ExtremeReactors-1.16.4-2.0.22 ZeroCore2-1.16.4-2.0.20

When I use [Increase on pulse/Decrease on pulse] in the redstone port, the value in the Reactor/Turbine changes twice It seems that all pulse have the same problem?

ZeroNoRyouki commented 3 years ago

I've checked it and I've got only one change per pulse. Keep in mind that a "pulse" is a change in redstone state. So if you are, for example, turning a lever on and the off (or viceversa) you are sending two pulses.

beiai commented 3 years ago

Ok, I get it now, thanks!

ZeroNoRyouki commented 3 years ago

You are welcome

RogueLogix commented 3 years ago

a "pulse" is a change in redstone state. ... turning a lever on and the off (or viceversa) you are sending two pulses.

The minecraft wiki for what a redstone pulse is would like to disagree, a pulse is a signal state change then reversion to its original state. For a lever, turning it on then back off is a single pulse with the length of however long it was on, assuming initial state was off. Opposite (off then on) is also a pulse, though rarely used.

https://minecraft.gamepedia.com/Mechanics/Redstone/Pulse_circuit#Pulses

The behavior you describe is also inconsistent with the behavior of the BR redstone port where pulses worked off the rising edge. One of two correct behaviors with a pulse (other being activation on falling edge).

https://github.com/erogenousbeef-zz/BigReactors/blob/master/src/main/java/erogenousbeef/bigreactors/common/multiblock/tileentity/TileEntityReactorRedstonePort.java#L121-L166