Skip to content

Add configurable pulse length property to Redstone Writer#1602

Merged
rubensworks merged 6 commits intomaster-1.21-ltsfrom
copilot/add-pulse-length-option
Feb 15, 2026
Merged

Add configurable pulse length property to Redstone Writer#1602
rubensworks merged 6 commits intomaster-1.21-ltsfrom
copilot/add-pulse-length-option

Conversation

Copy link
Contributor

Copilot AI commented Feb 15, 2026

Adds a "Pulse Length" AspectProperty to configure redstone pulse duration in ticks. Previously, pulses lasted until the next aspect evaluation (timing-dependent). Now pulses have deterministic tick-based duration.

Changes

  • New AspectProperty: PROP_PULSE_LENGTH (integer, ≥1 tick, default 1)

    • Added to PROPERTIES_REDSTONE_PULSE
    • Localized in en_us.json
  • Pulse scheduling infrastructure:

    • Extended IDynamicRedstone with setScheduledPulseRemaining(int) / getScheduledPulseRemaining()
    • Added scheduledPulseRemaining map to BlockEntityMultipartTicking
    • Implemented tick-based countdown in updateScheduledPulses()
  • Updated pulse logic in PROP_SET_PULSE:

    • On value change: emit pulse, schedule reset after N ticks
    • On same value + active pulse: no-op (let pulse continue)
    • On same value + no pulse: set to 0
  • Game tests: Added two tests to verify configurable pulse length functionality:

    • testAspectsWriteRedstoneBooleanPulseLengthLong: Tests 10-tick boolean pulse duration
    • testAspectsWriteRedstoneIntegerPulseLengthLong: Tests 10-tick integer pulse duration
// Before: pulse lasted until next evaluation (unpredictable)
if (lastPulseValue != pulseValue) {
    setRedstoneLevel(target, emitLevel, strongPower);
} else {
    setRedstoneLevel(target, 0, strongPower);
}

// After: pulse lasts for configured tick duration
if (lastPulseValue != pulseValue) {
    setRedstoneLevel(target, emitLevel, strongPower);
    setScheduledPulseRemaining(target, pulseLength);
} else if (getScheduledPulseRemaining(target) == 0) {
    setRedstoneLevel(target, 0, strongPower);
}

Default of 1 tick maintains original behavior. Users can configure longer pulse durations as needed.

Original prompt

This section details on the original issue you should resolve

<issue_title>Addition of a Pulse Length Option on Redstone Writer</issue_title>
<issue_description>

Issue type:

  • ➕ Feature request

Short description:

An option in the same place as where you set strong power to true or false to chose the length of the pulse in ticks. I can’t currently find this option, but sorry if there is one and I didn’t find it. </issue_description>

<agent_instructions>Could you implement this as a new AspectProperty with the name Pulse Length Option?
Don't forget to also add localization for it in en_us!</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@rubensworks It looks like that's not possible yet indeed, will add it in the future.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 15, 2026 15:18
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Pulse Length Option to Redstone Writer Add configurable pulse length property to Redstone Writer Feb 15, 2026
Copilot AI requested a review from rubensworks February 15, 2026 15:44
@coveralls
Copy link

coveralls commented Feb 15, 2026

Coverage Status

coverage: 45.369% (+0.2%) from 45.155%
when pulling 95078a8 on copilot/add-pulse-length-option
into ff98784 on master-1.21-lts.

Copy link
Member

@rubensworks rubensworks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add some game tests for this new feature?

Also, logs/latest.log‎ should not be pushed.


PROPERTIES_REDSTONE_PULSE.setValue(PROP_STRONG_POWER, ValueTypeBoolean.ValueBoolean.of(false));
PROPERTIES_REDSTONE_PULSE.setValue(PROP_PULSE_EMIT_VALUE, ValueTypeInteger.ValueInteger.of(15));
PROPERTIES_REDSTONE_PULSE.setValue(PROP_PULSE_LENGTH, ValueTypeInteger.ValueInteger.of(2));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default pulse value should be 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 95078a8. Changed the default pulse length from 2 to 1 tick to maintain original behavior.

Co-authored-by: rubensworks <440384+rubensworks@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 15, 2026

Could you also add some game tests for this new feature?

Also, logs/latest.log‎ should not be pushed.

Done in commit 95078a8. Added two game tests:

  • testAspectsWriteRedstoneBooleanPulseLengthLong: Tests boolean pulse with 10-tick duration
  • testAspectsWriteRedstoneIntegerPulseLengthLong: Tests integer pulse with 10-tick duration

Also removed logs/latest.log from the repository and added logs/ to .gitignore. All 800 game tests now pass.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.minecraftservices.com
    • Triggering command: /opt/hostedtoolcache/Java_Microsoft_jdk/21.0.2/x64/bin/java /opt/hostedtoolcache/Java_Microsoft_jdk/21.0.2/x64/bin/java -Dfml.gameLayerLibraries -Dfml.pluginLayerLibraries -Dforge.logging.console.level=debug -Dforge.logging.markers=REGISTRIES -DignoreList=securejarhandler-3.0.8.jar,asm-9.7.jar,asm-commons-9.7.jar,asm-tree-9.7.jar,asm-util-9.7.jar,asm-analysis-9.7.jar,bootstraplauncher-2.0.2.jar,JarJarFileSystems-0.4.1.jar,mixinextras-neoforge-0.4.1.jar,client-extra,neoforge- -Djava.net.preferIPv6Addresses=system -DlegacyClassPath.file=/home/REDACTED/work/IntegratedDynamics/IntegratedDynamics/.gradle/configuration/neoForm/neoFormJoined1.21.1-20240808.144430/steps/writeMinecraftClasspathGameTestServer/classpath.txt -DmergeModules=jna-5.10.0.jar,jna-platform-5.10.0.jar -Dneoforge.enableGameTest=true -Dneoforge.enabledGameTestNamespaces=cyclopscore,integrateddynamics -Dneoforge.gameTestServer=true -p /home/REDACTED/.gradle/caches/modules-2/files-2.1/cpw.mods/bootstraplauncher/2.0.2/1a2d076cbc33b0520cbacd591224427b2a20047d/bootstraplauncher-2.0.2.jar:/home/REDACTED/.gradle/caches/modules-2/files-2.1/cpw.mods/securejarhandler/3.0.8/c0ef95cecd8699a0449053ac7 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from rubensworks February 15, 2026 16:06
@rubensworks rubensworks marked this pull request as ready for review February 15, 2026 16:14
@rubensworks rubensworks merged commit a8c181f into master-1.21-lts Feb 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Addition of a Pulse Length Option on Redstone Writer

3 participants