Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changed pipe's map colours.
  • Loading branch information
CalenXwX committed Mar 8, 2026
commit 49e2b3fe4d0b78cb8c894a21ab3ac1e4c9f01b9b
2 changes: 1 addition & 1 deletion api/buildcraft/api/properties/BuildCraftProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public final class BuildCraftProperties {
public static final Property<Integer> GENERIC_PIPE_DATA = IntegerProperty.create("pipe_data", 0, 15);
public static final Property<Integer> LED_POWER = IntegerProperty.create("led_power", 0, 3);

public static final Property<Boolean> JOINED_BELOW = BooleanProperty.create("joined_below"); // 这里的注册名就是model文件里的条件
public static final Property<Boolean> JOINED_BELOW = BooleanProperty.create("joined_below");
public static final Property<Boolean> MOVING = BooleanProperty.create("moving");
public static final Property<Boolean> LED_DONE = BooleanProperty.create("led_done");
// public static final Property<Boolean> ACTIVE = BooleanProperty.create("active"); // set but never used
Expand Down
12 changes: 12 additions & 0 deletions api/buildcraft/api/transport/pipe/PipeFlowType.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package buildcraft.api.transport.pipe;

import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.material.MapColor;

public final class PipeFlowType {
public final IFlowCreator creator;
Expand All @@ -9,6 +10,8 @@ public final class PipeFlowType {
/** The default colour type, if none is given in {@link PipeDefinition}. if this is also null then the final
* fallback type is {@link EnumPipeColourType#TRANSLUCENT}. */
public EnumPipeColourType fallbackColourType;
/** The default map colour. If the pipe is coloured, the map colour will be the pipe colour. */
private MapColor defaultMapColour = MapColor.METAL;

public PipeFlowType(IFlowCreator creator, IFlowLoader loader) {
this(creator, loader, null);
Expand All @@ -20,6 +23,15 @@ public PipeFlowType(IFlowCreator creator, IFlowLoader loader, EnumPipeColourType
this.fallbackColourType = colourType;
}

public PipeFlowType setDefaultMapColour(MapColor newColour) {
this.defaultMapColour = newColour;
return this;
}

public MapColor getDefaultMapColour() {
return this.defaultMapColour;
}

@FunctionalInterface
public interface IFlowCreator {
PipeFlow createFlow(IPipe t);
Expand Down