-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add integration for EMI in storage actuator search
- Loading branch information
1 parent
a0f1872
commit c3e654e
Showing
17 changed files
with
158 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/com/klikli_dev/occultism/integration/emi/OccultismEmiIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022 klikli-dev | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
package com.klikli_dev.occultism.integration.emi; | ||
|
||
import com.klikli_dev.occultism.integration.emi.impl.OccultismEmiIntegrationImpl; | ||
|
||
public interface OccultismEmiIntegration { | ||
|
||
OccultismEmiIntegration instance = new OccultismEmiIntegrationImpl(); | ||
|
||
static OccultismEmiIntegration get() { | ||
return instance; | ||
} | ||
|
||
boolean isLoaded(); | ||
|
||
String getFilterText(); | ||
|
||
void setFilterText(String filter); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/klikli_dev/occultism/integration/emi/OccultismEmiIntegrationDummy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// SPDX-FileCopyrightText: 2024 klikli-dev | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
package com.klikli_dev.occultism.integration.emi; | ||
|
||
public class OccultismEmiIntegrationDummy implements OccultismEmiIntegration { | ||
|
||
@Override | ||
public boolean isLoaded() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String getFilterText() { | ||
return ""; | ||
} | ||
|
||
@Override | ||
public void setFilterText(String filter) { | ||
|
||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/klikli_dev/occultism/integration/emi/impl/OccultismEmiIntegrationImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// SPDX-FileCopyrightText: 2024 klikli-dev | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
package com.klikli_dev.occultism.integration.emi.impl; | ||
|
||
import com.klikli_dev.occultism.integration.emi.OccultismEmiIntegration; | ||
import com.klikli_dev.occultism.integration.jei.impl.JeiPlugin; | ||
import dev.emi.emi.api.EmiApi; | ||
import mezz.jei.api.runtime.IJeiRuntime; | ||
import net.neoforged.fml.ModList; | ||
|
||
public class OccultismEmiIntegrationImpl implements OccultismEmiIntegration { | ||
public boolean isLoaded() { | ||
return ModList.get().isLoaded("emi"); | ||
} | ||
|
||
@Override | ||
public String getFilterText() { | ||
if (!this.isLoaded()) | ||
return ""; | ||
|
||
return OccultismEmiHelper.getFilterText(); | ||
} | ||
|
||
@Override | ||
public void setFilterText(String filter) { | ||
if (!this.isLoaded()) | ||
return; | ||
|
||
OccultismEmiHelper.setFilterText(filter); | ||
} | ||
|
||
public static class OccultismEmiHelper { | ||
public static String getFilterText() { | ||
return EmiApi.getSearchText(); | ||
} | ||
|
||
public static void setFilterText(String filter) { | ||
EmiApi.setSearchText(filter); | ||
} | ||
} | ||
|
||
} |
12 changes: 6 additions & 6 deletions
12
...m/integration/emi/OccultismEmiPlugin.java → ...egration/emi/impl/OccultismEmiPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...tion/emi/recipes/MinerRecipeCategory.java → ...emi/impl/recipes/MinerRecipeCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...ion/emi/recipes/RitualRecipeCategory.java → ...mi/impl/recipes/RitualRecipeCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.