• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CyclopsMC / IntegratedDynamics / 22038914515

15 Feb 2026 04:15PM UTC coverage: 45.252% (+0.1%) from 45.155%
22038914515

push

github

web-flow
Add configurable pulse length property to Redstone Writer, Closes #724 (#1602)

2652 of 8642 branches covered (30.69%)

Branch coverage included in aggregate %.

11996 of 23728 relevant lines covered (50.56%)

2.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.6
/src/main/java/org/cyclops/integrateddynamics/part/aspect/write/AspectWriteBuilders.java
1
package org.cyclops.integrateddynamics.part.aspect.write;
2

3
import com.google.common.collect.ImmutableList;
4
import com.google.common.collect.Sets;
5
import net.minecraft.core.BlockPos;
6
import net.minecraft.nbt.Tag;
7
import net.minecraft.sounds.SoundSource;
8
import net.minecraft.world.item.ItemStack;
9
import net.minecraft.world.level.Level;
10
import net.minecraft.world.level.block.state.BlockState;
11
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
12
import net.neoforged.neoforge.event.level.NoteBlockEvent;
13
import net.neoforged.neoforge.fluids.FluidStack;
14
import org.apache.commons.lang3.tuple.Pair;
15
import org.apache.commons.lang3.tuple.Triple;
16
import org.cyclops.commoncapabilities.api.capability.recipehandler.IRecipeDefinition;
17
import org.cyclops.integrateddynamics.api.evaluate.variable.IValue;
18
import org.cyclops.integrateddynamics.api.evaluate.variable.IValueType;
19
import org.cyclops.integrateddynamics.api.evaluate.variable.IVariable;
20
import org.cyclops.integrateddynamics.api.part.PartTarget;
21
import org.cyclops.integrateddynamics.api.part.aspect.property.IAspectProperties;
22
import org.cyclops.integrateddynamics.api.part.aspect.property.IAspectPropertyTypeInstance;
23
import org.cyclops.integrateddynamics.api.part.write.IPartStateWriter;
24
import org.cyclops.integrateddynamics.api.part.write.IPartTypeWriter;
25
import org.cyclops.integrateddynamics.core.evaluate.variable.*;
26
import org.cyclops.integrateddynamics.core.part.aspect.build.AspectBuilder;
27
import org.cyclops.integrateddynamics.core.part.aspect.build.IAspectValuePropagator;
28
import org.cyclops.integrateddynamics.core.part.aspect.build.IAspectWriteDeactivator;
29
import org.cyclops.integrateddynamics.core.part.aspect.property.AspectProperties;
30
import org.cyclops.integrateddynamics.core.part.aspect.property.AspectPropertyTypeInstance;
31
import org.cyclops.integrateddynamics.part.aspect.read.AspectReadBuilders;
32
import org.cyclops.integrateddynamics.part.aspect.write.redstone.IWriteRedstoneComponent;
33
import org.cyclops.integrateddynamics.part.aspect.write.redstone.WriteRedstoneComponent;
34

35
import java.util.Optional;
36

37
/**
38
 * Collection of aspect write builders and value propagators.
39
 * @author rubensworks
40
 */
41
public class AspectWriteBuilders {
×
42

43
    // --------------- Value type builders ---------------
44
    public static final AspectBuilder<ValueTypeBoolean.ValueBoolean, ValueTypeBoolean, Triple<PartTarget, IAspectProperties, ValueTypeBoolean.ValueBoolean>>
45
            BUILDER_BOOLEAN = getValue(AspectBuilder.forWriteType(ValueTypes.BOOLEAN));
4✔
46
    public static final AspectBuilder<ValueTypeInteger.ValueInteger, ValueTypeInteger, Triple<PartTarget, IAspectProperties, ValueTypeInteger.ValueInteger>>
47
            BUILDER_INTEGER = getValue(AspectBuilder.forWriteType(ValueTypes.INTEGER));
4✔
48
    public static final AspectBuilder<ValueTypeDouble.ValueDouble, ValueTypeDouble, Triple<PartTarget, IAspectProperties, ValueTypeDouble.ValueDouble>>
49
            BUILDER_DOUBLE = getValue(AspectBuilder.forWriteType(ValueTypes.DOUBLE));
4✔
50
    public static final AspectBuilder<ValueTypeString.ValueString, ValueTypeString, Triple<PartTarget, IAspectProperties, ValueTypeString.ValueString>>
51
            BUILDER_STRING = getValue(AspectBuilder.forWriteType(ValueTypes.STRING));
4✔
52
    public static final AspectBuilder<ValueTypeList.ValueList, ValueTypeList, Triple<PartTarget, IAspectProperties, ValueTypeList.ValueList>>
53
            BUILDER_LIST = getValue(AspectBuilder.forWriteType(ValueTypes.LIST));
4✔
54
    public static final AspectBuilder<ValueObjectTypeItemStack.ValueItemStack, ValueObjectTypeItemStack, Triple<PartTarget, IAspectProperties, ValueObjectTypeItemStack.ValueItemStack>>
55
            BUILDER_ITEMSTACK = getValue(AspectBuilder.forWriteType(ValueTypes.OBJECT_ITEMSTACK));
4✔
56
    public static final AspectBuilder<ValueObjectTypeFluidStack.ValueFluidStack, ValueObjectTypeFluidStack, Triple<PartTarget, IAspectProperties, ValueObjectTypeFluidStack.ValueFluidStack>>
57
            BUILDER_FLUIDSTACK = getValue(AspectBuilder.forWriteType(ValueTypes.OBJECT_FLUIDSTACK));
4✔
58
    public static final AspectBuilder<ValueTypeOperator.ValueOperator, ValueTypeOperator, Triple<PartTarget, IAspectProperties, ValueTypeOperator.ValueOperator>>
59
            BUILDER_OPERATOR = getValue(AspectBuilder.forWriteType(ValueTypes.OPERATOR));
4✔
60
    public static final AspectBuilder<ValueTypeNbt.ValueNbt, ValueTypeNbt, Triple<PartTarget, IAspectProperties, ValueTypeNbt.ValueNbt>>
61
            BUILDER_NBT = getValue(AspectBuilder.forWriteType(ValueTypes.NBT));
4✔
62
    public static final AspectBuilder<ValueObjectTypeRecipe.ValueRecipe, ValueObjectTypeRecipe, Triple<PartTarget, IAspectProperties, ValueObjectTypeRecipe.ValueRecipe>>
63
            BUILDER_RECIPE = getValue(AspectBuilder.forWriteType(ValueTypes.OBJECT_RECIPE));
4✔
64

65
    // --------------- Value type propagators ---------------
66
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueTypeBoolean.ValueBoolean>, Triple<PartTarget, IAspectProperties, Boolean>>
67
            PROP_GET_BOOLEAN = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
15✔
68

69
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties,ValueTypeInteger.ValueInteger>, Triple<PartTarget, IAspectProperties, Integer>>
70
            PROP_GET_INTEGER = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
15✔
71

72
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueTypeDouble.ValueDouble>, Triple<PartTarget, IAspectProperties, Double>>
73
            PROP_GET_DOUBLE = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
2✔
74

75
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueTypeLong.ValueLong>, Triple<PartTarget, IAspectProperties, Long>>
76
            PROP_GET_LONG = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
2✔
77

78
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueObjectTypeItemStack.ValueItemStack>, Triple<PartTarget, IAspectProperties, ItemStack>>
79
            PROP_GET_ITEMSTACK = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
2✔
80

81
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueTypeString.ValueString>, Triple<PartTarget, IAspectProperties, String>>
82
            PROP_GET_STRING = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
2✔
83

84
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueObjectTypeBlock.ValueBlock>, Triple<PartTarget, IAspectProperties, BlockState>>
85
            PROP_GET_BLOCK = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue().orElse(null));
2✔
86

87
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueObjectTypeFluidStack.ValueFluidStack>, Triple<PartTarget, IAspectProperties, FluidStack>>
88
            PROP_GET_FLUIDSTACK = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
2✔
89

90
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueTypeNbt.ValueNbt>, Triple<PartTarget, IAspectProperties, Optional<Tag>>>
91
            PROP_GET_NBT = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue());
2✔
92

93
    public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, ValueObjectTypeRecipe.ValueRecipe>, Triple<PartTarget, IAspectProperties, IRecipeDefinition>>
94
            PROP_GET_RECIPE = input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getRawValue().orElse(null));
3✔
95

96
    public static final class Audio {
×
97

98
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_VOLUME =
7✔
99
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.volume", AspectReadBuilders.VALIDATOR_DOUBLE_POSITIVE);
100
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_FREQUENCY =
7✔
101
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.frequency", AspectReadBuilders.VALIDATOR_DOUBLE_POSITIVE);
102
        public static final IAspectPropertyTypeInstance<ValueTypeInteger, ValueTypeInteger.ValueInteger> PROP_RANGE =
7✔
103
                new AspectPropertyTypeInstance<>(ValueTypes.INTEGER, "aspect.aspecttypes.integrateddynamics.integer.range", AspectReadBuilders.VALIDATOR_INTEGER_POSITIVE);
104
        public static final IAspectProperties PROPERTIES_NOTE = new AspectProperties(Sets.<IAspectPropertyTypeInstance>newHashSet(
11✔
105
                PROP_VOLUME
106
        ));
107
        public static final IAspectProperties PROPERTIES_SOUND = new AspectProperties(ImmutableList.<IAspectPropertyTypeInstance>of(
7✔
108
                PROP_VOLUME,
109
                PROP_FREQUENCY
110
        ));
111
        public static final IAspectProperties PROPERTIES_TEXT = new AspectProperties(ImmutableList.<IAspectPropertyTypeInstance>of(
6✔
112
                PROP_RANGE
113
        ));
114
        static {
115
            PROPERTIES_NOTE.setValue(PROP_VOLUME, ValueTypeDouble.ValueDouble.of(3D));
5✔
116
            PROPERTIES_SOUND.setValue(PROP_VOLUME, ValueTypeDouble.ValueDouble.of(3D));
5✔
117
            PROPERTIES_SOUND.setValue(PROP_FREQUENCY, ValueTypeDouble.ValueDouble.of(1D));
5✔
118
            PROPERTIES_TEXT.setValue(PROP_RANGE, ValueTypeInteger.ValueInteger.of(32));
5✔
119
        }
120

121
        public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, Pair<NoteBlockInstrument, Integer>>, Void> PROP_SET = input -> {
2✔
122
            IAspectProperties properties = input.getMiddle();
×
123
            BlockPos pos = input.getLeft().getTarget().getPos().getBlockPos();
×
124

125
            NoteBlockInstrument instrument = input.getRight().getLeft();
×
126
            int eventParam = input.getRight().getRight();
×
127
            if(eventParam >= 0 && eventParam <= 24) {
×
128
                Level world = input.getLeft().getTarget().getPos().getLevel(false);
×
129
                if (world != null) { // If a block falls in a world when there's no one around, does it make any sound?
×
130
                    NoteBlockEvent.Play e = new NoteBlockEvent.Play(world, pos, world.getBlockState(pos), eventParam, instrument);
×
131
                    if (!net.neoforged.neoforge.common.NeoForge.EVENT_BUS.post(e).isCanceled()) {
×
132
                        float f = (float) Math.pow(2.0D, (double) (eventParam - 12) / 12.0D);
×
133
                        float volume = (float) properties.getValue(PROP_VOLUME).getRawValue();
×
134
                        world.playSound(null, pos, e.getInstrument().getSoundEvent().value(), SoundSource.RECORDS, volume, f);
×
135
                    }
136
                }
137
            }
138
            return null;
×
139
        };
140

141
        public static IAspectValuePropagator<Triple<PartTarget, IAspectProperties, Integer>, Triple<PartTarget, IAspectProperties, Pair<NoteBlockInstrument, Integer>>>
142
            propWithInstrument(final NoteBlockInstrument instrument) {
143
            return input -> Triple.of(input.getLeft(), input.getMiddle(), Pair.of(instrument, input.getRight()));
3✔
144
        }
145

146
        public static final AspectBuilder<ValueTypeInteger.ValueInteger, ValueTypeInteger, Triple<PartTarget, IAspectProperties, Integer>>
147
                BUILDER_INTEGER = AspectWriteBuilders.BUILDER_INTEGER.appendKind("audio").handle(PROP_GET_INTEGER);
6✔
148
        public static final AspectBuilder<ValueTypeInteger.ValueInteger, ValueTypeInteger, Triple<PartTarget, IAspectProperties, Integer>>
149
                BUILDER_INTEGER_INSTRUMENT = BUILDER_INTEGER.appendKind("instrument").withProperties(PROPERTIES_NOTE);
6✔
150
        public static final AspectBuilder<ValueTypeString.ValueString, ValueTypeString, Triple<PartTarget, IAspectProperties, String>>
151
                BUILDER_STRING = AspectWriteBuilders.BUILDER_STRING.appendKind("audio").handle(PROP_GET_STRING);
7✔
152

153
    }
154

155
    public static final class Effect {
×
156

157
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_OFFSET_X =
6✔
158
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.offset_x");
159
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_OFFSET_Y =
6✔
160
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.offset_y");
161
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_OFFSET_Z =
6✔
162
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.offset_z");
163
        public static final IAspectPropertyTypeInstance<ValueTypeInteger, ValueTypeInteger.ValueInteger> PROP_PARTICLES =
7✔
164
                new AspectPropertyTypeInstance<>(ValueTypes.INTEGER, "aspect.aspecttypes.integrateddynamics.integer.particles", AspectReadBuilders.VALIDATOR_INTEGER_POSITIVE);
165
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_SPREAD_X =
7✔
166
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.spread_x", AspectReadBuilders.VALIDATOR_DOUBLE_POSITIVE);
167
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_SPREAD_Y =
7✔
168
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.spread_y", AspectReadBuilders.VALIDATOR_DOUBLE_POSITIVE);
169
        public static final IAspectPropertyTypeInstance<ValueTypeDouble, ValueTypeDouble.ValueDouble> PROP_SPREAD_Z =
7✔
170
                new AspectPropertyTypeInstance<>(ValueTypes.DOUBLE, "aspect.aspecttypes.integrateddynamics.double.spread_z", AspectReadBuilders.VALIDATOR_DOUBLE_POSITIVE);
171
        public static final IAspectPropertyTypeInstance<ValueTypeBoolean, ValueTypeBoolean.ValueBoolean> PROP_FORCE =
6✔
172
                new AspectPropertyTypeInstance<>(ValueTypes.BOOLEAN, "aspect.aspecttypes.integrateddynamics.boolean.force_particle");
173
        public static final IAspectProperties PROPERTIES_PARTICLE = new AspectProperties(ImmutableList.<IAspectPropertyTypeInstance>of(
12✔
174
                PROP_OFFSET_X,
175
                PROP_OFFSET_Y,
176
                PROP_OFFSET_Z,
177
                PROP_PARTICLES,
178
                PROP_SPREAD_X,
179
                PROP_SPREAD_Y,
180
                PROP_SPREAD_Z
181
        ));
182

183
        static {
184
            PROPERTIES_PARTICLE.setValue(PROP_OFFSET_X, ValueTypeDouble.ValueDouble.of(0.5D));
5✔
185
            PROPERTIES_PARTICLE.setValue(PROP_OFFSET_Z, ValueTypeDouble.ValueDouble.of(0.5D));
5✔
186
            PROPERTIES_PARTICLE.setValue(PROP_OFFSET_Y, ValueTypeDouble.ValueDouble.of(0.5D));
5✔
187
            PROPERTIES_PARTICLE.setValue(PROP_PARTICLES, ValueTypeInteger.ValueInteger.of(1));
5✔
188
            PROPERTIES_PARTICLE.setValue(PROP_SPREAD_X, ValueTypeDouble.ValueDouble.of(0.0D));
5✔
189
            PROPERTIES_PARTICLE.setValue(PROP_SPREAD_Y, ValueTypeDouble.ValueDouble.of(0.0D));
5✔
190
            PROPERTIES_PARTICLE.setValue(PROP_SPREAD_Z, ValueTypeDouble.ValueDouble.of(0.0D));
5✔
191
        }
192

193
        public static final AspectBuilder<ValueTypeDouble.ValueDouble, ValueTypeDouble, Triple<PartTarget, IAspectProperties, Double>>
194
                BUILDER_DOUBLE = AspectWriteBuilders.BUILDER_DOUBLE.appendKind("effect").handle(PROP_GET_DOUBLE);
6✔
195
        public static final AspectBuilder<ValueTypeDouble.ValueDouble, ValueTypeDouble, Triple<PartTarget, IAspectProperties, Double>>
196
                BUILDER_DOUBLE_PARTICLE = BUILDER_DOUBLE.withProperties(PROPERTIES_PARTICLE);
5✔
197

198
    }
199

200
    public static final class Redstone {
×
201

202
        private static final IWriteRedstoneComponent WRITE_REDSTONE_COMPONENT = new WriteRedstoneComponent();
4✔
203

204
        public static final IAspectPropertyTypeInstance<ValueTypeBoolean, ValueTypeBoolean.ValueBoolean> PROP_STRONG_POWER =
6✔
205
                new AspectPropertyTypeInstance<>(ValueTypes.BOOLEAN, "aspect.aspecttypes.integrateddynamics.boolean.strong_power");
206
        public static final IAspectPropertyTypeInstance<ValueTypeInteger, ValueTypeInteger.ValueInteger> PROP_PULSE_EMIT_VALUE =
7✔
207
                new AspectPropertyTypeInstance<>(ValueTypes.INTEGER, "aspect.aspecttypes.integrateddynamics.integer.pulse_emit_value",
208
                        (v) -> v.getRawValue() >= 0 && v.getRawValue() <= 15);
×
209
        public static final IAspectPropertyTypeInstance<ValueTypeInteger, ValueTypeInteger.ValueInteger> PROP_PULSE_LENGTH =
7✔
210
                new AspectPropertyTypeInstance<>(ValueTypes.INTEGER, "aspect.aspecttypes.integrateddynamics.integer.pulse_length",
211
                        (v) -> v.getRawValue() >= 1);
×
212
        public static final IAspectProperties PROPERTIES_REDSTONE = new AspectProperties(ImmutableList.<IAspectPropertyTypeInstance>of(
6✔
213
                PROP_STRONG_POWER
214
        ));
215
        public static final IAspectProperties PROPERTIES_REDSTONE_PULSE = new AspectProperties(ImmutableList.<IAspectPropertyTypeInstance>of(
8✔
216
                PROP_STRONG_POWER,
217
                PROP_PULSE_EMIT_VALUE,
218
                PROP_PULSE_LENGTH
219
        ));
220

221
        static {
222
            PROPERTIES_REDSTONE.setValue(PROP_STRONG_POWER, ValueTypeBoolean.ValueBoolean.of(false));
5✔
223

224
            PROPERTIES_REDSTONE_PULSE.setValue(PROP_STRONG_POWER, ValueTypeBoolean.ValueBoolean.of(false));
5✔
225
            PROPERTIES_REDSTONE_PULSE.setValue(PROP_PULSE_EMIT_VALUE, ValueTypeInteger.ValueInteger.of(15));
5✔
226
            PROPERTIES_REDSTONE_PULSE.setValue(PROP_PULSE_LENGTH, ValueTypeInteger.ValueInteger.of(1));
5✔
227
        }
228

229
        public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, Integer>, Void> PROP_SET = input -> {
2✔
230
            boolean strongPower = input.getMiddle().getValue(PROP_STRONG_POWER).getRawValue();
8✔
231
            WRITE_REDSTONE_COMPONENT.setRedstoneLevel(input.getLeft(), input.getRight(), strongPower);
10✔
232
            return null;
2✔
233
        };
234
        public static final IAspectValuePropagator<Triple<PartTarget, IAspectProperties, Integer>, Void> PROP_SET_PULSE = input -> {
2✔
235
            PartTarget target = input.getLeft();
4✔
236
            boolean strongPower = input.getMiddle().getValue(PROP_STRONG_POWER).getRawValue();
8✔
237
            int pulseValue = input.getRight();
5✔
238
            int emitLevel = input.getMiddle().getValue(PROP_PULSE_EMIT_VALUE).getRawValue();
8✔
239
            int pulseLength = input.getMiddle().getValue(PROP_PULSE_LENGTH).getRawValue();
8✔
240
            int lastPulseValue = WRITE_REDSTONE_COMPONENT.getLastPulseValue(target);
4✔
241
            int scheduledPulseRemaining = WRITE_REDSTONE_COMPONENT.getScheduledPulseRemaining(target);
4✔
242
            if (lastPulseValue != pulseValue) {
3✔
243
                // New pulse triggered
244
                WRITE_REDSTONE_COMPONENT.setLastPulseValue(target, pulseValue);
4✔
245
                WRITE_REDSTONE_COMPONENT.setRedstoneLevel(target, emitLevel, strongPower);
5✔
246
                WRITE_REDSTONE_COMPONENT.setScheduledPulseRemaining(target, pulseLength);
5✔
247
            } else if (scheduledPulseRemaining == 0) {
2✔
248
                // No pulse is active, set to 0
249
                WRITE_REDSTONE_COMPONENT.setRedstoneLevel(target, 0, strongPower);
5✔
250
            }
251
            // If scheduledPulseRemaining > 0, the pulse is still active, don't change anything
252
            return null;
2✔
253
        };
254

255
        public static final IAspectWriteDeactivator DEACTIVATOR = new IAspectWriteDeactivator() {
7✔
256
            @Override
257
            public <P extends IPartTypeWriter<P, S>, S extends IPartStateWriter<P>> void onDeactivate(P partType, PartTarget target, S state) {
258
                WRITE_REDSTONE_COMPONENT.deactivate(target);
3✔
259
            }
1✔
260
        };
261

262
        public static final AspectBuilder<ValueTypeBoolean.ValueBoolean, ValueTypeBoolean, Triple<PartTarget, IAspectProperties, Boolean>>
263
                BUILDER_BOOLEAN = AspectWriteBuilders.BUILDER_BOOLEAN.appendKind("redstone").handle(PROP_GET_BOOLEAN).appendDeactivator(DEACTIVATOR).withProperties(PROPERTIES_REDSTONE);
10✔
264
        public static final AspectBuilder<ValueTypeInteger.ValueInteger, ValueTypeInteger, Triple<PartTarget, IAspectProperties, Integer>>
265
                BUILDER_INTEGER = AspectWriteBuilders.BUILDER_INTEGER.appendKind("redstone").handle(PROP_GET_INTEGER).appendDeactivator(DEACTIVATOR).withProperties(PROPERTIES_REDSTONE);
11✔
266

267
    }
268

269
    public static <V extends IValue, T extends IValueType<V>> AspectBuilder<V, T, Triple<PartTarget, IAspectProperties, V>> getValue(AspectBuilder<V, T, Triple<PartTarget, IAspectProperties, IVariable<V>>> builder) {
270
        return builder.handle(input -> Triple.of(input.getLeft(), input.getMiddle(), input.getRight().getValue()));
16✔
271
    }
272

273
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc