Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
more work on activity sensor covers
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Aug 6, 2024
1 parent 50ea83f commit 4cd4c60
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AntimatterAPI
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package muramasa.gregtech.cover.redstone;

import muramasa.antimatter.capability.ICoverHandler;
import muramasa.antimatter.cover.CoverFactory;
import muramasa.antimatter.machine.Tier;
import muramasa.gregtech.cover.base.CoverBasicRedstoneOutput;
import net.minecraft.core.Direction;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class CoverActivityDetectorPossible extends CoverBasicRedstoneOutput {
public CoverActivityDetectorPossible(@NotNull ICoverHandler<?> source, @Nullable Tier tier, Direction side, CoverFactory factory) {
super(source, tier, side, factory);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package muramasa.gregtech.cover.redstone;

import muramasa.antimatter.blockentity.BlockEntityMachine;
import muramasa.antimatter.capability.ICoverHandler;
import muramasa.antimatter.cover.CoverFactory;
import muramasa.antimatter.machine.MachineFlag;
import muramasa.antimatter.machine.MachineState;
import muramasa.antimatter.machine.Tier;
import muramasa.gregtech.cover.base.CoverBasicRedstoneOutput;
import net.minecraft.core.Direction;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class CoverActivityDetectorProcessing extends CoverBasicRedstoneOutput {
public CoverActivityDetectorProcessing(@NotNull ICoverHandler<?> source, @Nullable Tier tier, Direction side, CoverFactory factory) {
super(source, tier, side, factory);
}

@Override
public void onUpdate() {
if (source().getTile() instanceof BlockEntityMachine<?> machine && machine.has(MachineFlag.RECIPE) && machine.isServerSide()){
if (machine.getMachineState() == MachineState.ACTIVE){
setOutputRedstone(inverted ? 0 : 15);
} else {
setOutputRedstone(inverted ? 15 : 0);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class CoverActivityDetectorRecipeFinish extends CoverBasicRedstoneOutput {
public class CoverActivityDetectorSuccessful extends CoverBasicRedstoneOutput {
boolean redstoneNextTick = false;

public CoverActivityDetectorRecipeFinish(@NotNull ICoverHandler<?> source, @Nullable Tier tier, Direction side, CoverFactory factory) {
public CoverActivityDetectorSuccessful(@NotNull ICoverHandler<?> source, @Nullable Tier tier, Direction side, CoverFactory factory) {
super(source, tier, side, factory);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ public class GregTechCovers {
public static final CoverFactory COVER_PROGRESS_SENSOR = CoverFactory.builder(CoverProgressSensor::new).item((a, b) -> {
return new ItemCover(GTIRef.ID, "progress_sensor");
}).addTextures(new Texture(GTIRef.ID, "block/cover/progress_sensor")).build(GTIRef.ID, "progress_sensor");
public static final CoverFactory COVER_ACTIVITY_DETECTOR_PROCESSING = CoverFactory.builder(CoverActivityDetectorProcessing::new).item((a,b) -> {
return new ItemCover(GTIRef.ID, "activity_detector_processing");
}).addTextures(new Texture(GTIRef.ID, "block/cover/activity_detector_processing")).build(GTIRef.ID, "activity_detector_processing");
public static final CoverFactory COVER_ACTIVITY_DETECTOR_SUCCESSFUL = CoverFactory.builder(CoverActivityDetectorSuccessful::new).item((a,b) -> {
return new ItemCover(GTIRef.ID, "activity_detector_successful");
}).addTextures(new Texture(GTIRef.ID, "block/cover/activity_detector_successful")).build(GTIRef.ID, "activity_detector_successful");
public static final CoverFactory COVER_ACTIVITY_DETECTOR_POSSIBLE = CoverFactory.builder(CoverActivityDetectorPossible::new).item((a,b) -> {
return new ItemCover(GTIRef.ID, "activity_detector_possible");
}).addTextures(new Texture(GTIRef.ID, "block/cover/activity_detector_possible")).build(GTIRef.ID, "activity_detector_possible");
public static final CoverFactory COVER_ENERGY_DETECTOR = CoverFactory.builder(CoverEnergyDetector::new).item((a, b) -> {
return new ItemCover(GTIRef.ID, "energy_detector");
}).addTextures(new Texture(GTIRef.ID, "block/cover/energy_detector")).build(GTIRef.ID, "energy_detector");
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4cd4c60

Please sign in to comment.