From 4cd4c60051854451e0c030775a071a40627590ac Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Tue, 6 Aug 2024 19:21:02 -0400 Subject: [PATCH] more work on activity sensor covers --- AntimatterAPI | 2 +- .../CoverActivityDetectorPossible.java | 15 +++++++++ .../CoverActivityDetectorProcessing.java | 29 ++++++++++++++++++ ...a => CoverActivityDetectorSuccessful.java} | 4 +-- .../gregtech/data/GregTechCovers.java | 9 ++++++ .../cover/activity_detector_possible.png | Bin 0 -> 303 bytes .../cover/activity_detector_processing.png | Bin 0 -> 300 bytes .../cover/activity_detector_successful.png | Bin 0 -> 302 bytes .../item/basic/activity_detector_possible.png | Bin 0 -> 273 bytes .../basic/activity_detector_processing.png | Bin 0 -> 260 bytes .../item/basic/activity_detector_success.png | Bin 0 -> 272 bytes 11 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorPossible.java create mode 100644 common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorProcessing.java rename common/src/main/java/muramasa/gregtech/cover/redstone/{CoverActivityDetectorRecipeFinish.java => CoverActivityDetectorSuccessful.java} (88%) create mode 100644 common/src/main/resources/assets/gti/textures/block/cover/activity_detector_possible.png create mode 100644 common/src/main/resources/assets/gti/textures/block/cover/activity_detector_processing.png create mode 100644 common/src/main/resources/assets/gti/textures/block/cover/activity_detector_successful.png create mode 100644 common/src/main/resources/assets/gti/textures/item/basic/activity_detector_possible.png create mode 100644 common/src/main/resources/assets/gti/textures/item/basic/activity_detector_processing.png create mode 100644 common/src/main/resources/assets/gti/textures/item/basic/activity_detector_success.png diff --git a/AntimatterAPI b/AntimatterAPI index 97adf6de6..330d4ef94 160000 --- a/AntimatterAPI +++ b/AntimatterAPI @@ -1 +1 @@ -Subproject commit 97adf6de61a404a460f0d45ac1bcbe896674d41d +Subproject commit 330d4ef945fa62fa219cd2581dfca87b464346e4 diff --git a/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorPossible.java b/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorPossible.java new file mode 100644 index 000000000..48a0afe7d --- /dev/null +++ b/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorPossible.java @@ -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); + } +} diff --git a/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorProcessing.java b/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorProcessing.java new file mode 100644 index 000000000..91a52e93b --- /dev/null +++ b/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorProcessing.java @@ -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); + } + } + } +} diff --git a/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorRecipeFinish.java b/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorSuccessful.java similarity index 88% rename from common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorRecipeFinish.java rename to common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorSuccessful.java index c8f9ead0a..9d686832d 100644 --- a/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorRecipeFinish.java +++ b/common/src/main/java/muramasa/gregtech/cover/redstone/CoverActivityDetectorSuccessful.java @@ -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); } diff --git a/common/src/main/java/muramasa/gregtech/data/GregTechCovers.java b/common/src/main/java/muramasa/gregtech/data/GregTechCovers.java index 57b2674c6..1a565b101 100644 --- a/common/src/main/java/muramasa/gregtech/data/GregTechCovers.java +++ b/common/src/main/java/muramasa/gregtech/data/GregTechCovers.java @@ -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"); diff --git a/common/src/main/resources/assets/gti/textures/block/cover/activity_detector_possible.png b/common/src/main/resources/assets/gti/textures/block/cover/activity_detector_possible.png new file mode 100644 index 0000000000000000000000000000000000000000..25a81e9a7f46916cb3135182b6cef82ed1726335 GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GGLLkg|>2BR0pdfpR zr>`sf11@GR75UGP@?QXj*pj^6T^Rm@;DWu&Cj&+Hc)B=-So9|EsQk~#ytCqAn=Mbm zv4zg<5@KiK4+KOy?!k|6jFg)&D{@l@!Mbxt*My|Ns9_cQ{y7RP^7m$YrO3kFVdQ&MBb@0REJ6WdHyG literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/gti/textures/block/cover/activity_detector_processing.png b/common/src/main/resources/assets/gti/textures/block/cover/activity_detector_processing.png new file mode 100644 index 0000000000000000000000000000000000000000..d40a2dc48a51809fe493d8295ff0e556667961d9 GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GGLLkg|>2BR0pdfpR zr>`sf11@GRRRc$j2BR0pdfpR zr>`sf11=U0Suv@X+Z2I9Y)RhkE)4%caKYZ?lYt_;JzX3_EP9i7RQ~5=-dXXm&6X$O z*h1%a39&Qr2Lhs_PZuapVAOHs$(y&2C+R>FE4PG%#6ROB$BqcBl|0(e)>hSaV@Cv= zw6t_vHe<>ThGm>C!b}mo4q{7YF}^q_+sPIn({VuKZ-1}v1qOk09{&I3MMb~fzkdDu z{^sVx^~%bN|F2rL>VKh{N{Zuz+)mC;2kHNd6D%!v{#USE6eA!h`SbqqVFHcC3i81bTzP)78&qol`;+0Q|#n6aWAK literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/gti/textures/item/basic/activity_detector_possible.png b/common/src/main/resources/assets/gti/textures/item/basic/activity_detector_possible.png new file mode 100644 index 0000000000000000000000000000000000000000..b9956f1d26a7f1a15b13cd07b44fa7ccdb42b840 GIT binary patch literal 273 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GGLLkg|>2BR0pdfpR zr>`sf11@GR4T*!sTit;|Y)RhkE)4%caKYZ?lYt`hJY5_^EP9g@5)yv+E2jOZ|NKvQ z(#J!*)d9Q=oD-U6FV|N-%aAhL(~Ke3*pn^ca?f>!6y6;s!X=DV8IwgjS`M`?V7$&G zv0+oEk%F@A-};b{EA{d5_y6G`*M)heNMh7;S4v>f^W|G)8q1WQXxk?9Xg z9aB=C)XU4i|6f*C_MexR_y6h@EB=TJ3oq7DeZ2BR0pdfpR zr>`sf11@GRO(BcFxe`Djwj^(N7l!{JxM1({$v}~bo-U3d7QM*{2?;;^71MsyfBq*t z>Ej{Z>HuB_&IwJkm+K$SW$5Y8k=`Y>hiyUj0X6?2BR0pdfpR zr>`sf11=U08FT;H)9rvlY)RhkE)4%caKYZ?lYt_0JzX3_EP9g@5)yv+E2jOZ|NKvQ z(#J!*)d9Q=oD-U6FV|N-%aAhL(~Ke3*pn^ca?f>!6y6;s!X=DV8IwgjS`M`?V7$&G zv0+oEk%F@A-};b{EA{d5_y6G`*M)heNMh7;S4w74udQZJ&TuHODgXpde; zPtTwCk01ZNf9~A7{Rzopr0K6DwN&o-= literal 0 HcmV?d00001