Skip to content

Commit

Permalink
Remove some unused files, some notes about next steps as discussed on…
Browse files Browse the repository at this point in the history
… Discord
  • Loading branch information
quat1024 committed Oct 19, 2023
1 parent 9a10ecb commit d15a8fd
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 1,058 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Small things. Learn more at [the Mod's website](https://quarkmod.net).

This mod makes use of the [Java Universal Tween Engine](https://github.com/AurelienRibon/universal-tween-engine) by Aurelien Ribon, licensed under the Apache 2.0 License.

## Zeta?

*Project Zeta* is a planned rearchitecture of Quark to make it less tightly-integrated with Forge. Read the roadmap [in Vazkii's post on the Violet Moon forums](https://forum.violetmoon.org/d/78-project-zeta-aka-quark-on-fabric-real).

There is still lots to do! If you'd like to contribute, see `zeta-todo/README.md`

## Release Process
Quark's release process is mostly automated. Here's the steps:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
@Deprecated(forRemoval = true)
public interface IExternalCategory extends IConfigCategory {

void commit();
Expand Down
49 changes: 0 additions & 49 deletions src/main/java/vazkii/quark/api/config/IQuarkConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.event.config.ModConfigEvent;
import org.apache.commons.lang3.tuple.Pair;

import java.io.File;
import java.util.Map;
import java.util.function.Consumer;

@OnlyIn(Dist.CLIENT)
public interface IQuarkConfig {
Expand All @@ -20,47 +14,4 @@ class Holder {
public static IQuarkConfig instance = null;

}

/**
* Registers a category to be shown inside the q menu. Unless you have a really good reason, register only one per mod
* in the interest of keeping things somewhat clean.<br><br>
*
* @param modid Your mod ID. This will be used to map the configs per mod, and automatically handle refreshing the config
* whenever {@link ModConfigEvent} is fired. <b>Note:</b> If your config is loaded in any way where ModConfigEvent wouldn't
* fire for it, you must call {@link IConfigCategory#refresh()} manually.
* @param name The name of the category. This is a display only name and bears no internal significance.
* @param onChangedCallback The function to be called when this config changes. You can use {@link IQuarkConfig#writeToFileCallback(String)}
* to generate a callback that'll automatically regenerate the relevant config file. This function is called every time the player
* clicks the Save button in the quark config screen, even if the config didn't change.
* @return The top level category you can then add stuff onto.
*/
IExternalCategory registerExternalCategory(String modid, String name, Consumer<IExternalCategory> onChangedCallback);

/**
* Creates a callback to output the config contents to the given file.
* @see IQuarkConfig#writeToFileCallback(String) for a helper.
*/
Consumer<IExternalCategory> writeToFileCallback(File file);

/**
* {@link IQuarkConfig#writeToFileCallback(File)} helper. Passes in {@code new File("config", filename + ".toml")}.
*/
default Consumer<IExternalCategory> writeToFileCallback(String filename) {
return writeToFileCallback(new File("config", filename + ".toml"));
}

default Pair<IExternalCategory, IExternalCategory> registerClientCommonExternalCategory(String modid, String name, Consumer<IExternalCategory> commonCallback, Consumer<IExternalCategory> clientCallback) {
IExternalCategory main = registerExternalCategory(modid, name, (c) -> {
Map<String, IConfigCategory> topLevel = c.getTopLevelCategories();
((IExternalCategory) topLevel.get("common")).commit();
((IExternalCategory) topLevel.get("client")).commit();
c.updateDirty();
});

IExternalCategory common = main.addTopLevelCategory("common", commonCallback);
IExternalCategory client = main.addTopLevelCategory("client", clientCallback);

return Pair.of(common, client);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import vazkii.quark.api.config.IConfigCategory;
import vazkii.quark.api.config.IConfigElement;
import vazkii.quark.api.config.IConfigObject;
import vazkii.quark.base.client.config.external.ExternalCategory;
import vazkii.quark.base.client.config.screen.CategoryScreen;
import vazkii.quark.base.client.config.screen.WidgetWrapper;
import vazkii.quark.base.client.config.screen.inputtable.IInputtableConfigType;
Expand All @@ -38,7 +37,7 @@ public ConfigCategory(String name, String comment, IConfigCategory parent, Objec
super(name, comment, parent);

this.holderObject = holderObject;
if(parent == null || (parent instanceof ExternalCategory)) {
if(parent == null) {
path = name;
depth = 0;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import vazkii.quark.api.config.IConfigElement;
import vazkii.quark.api.config.IConfigObject;
import vazkii.quark.base.Quark;
import vazkii.quark.base.client.config.external.ExternalConfigHandler;
import vazkii.quark.base.module.config.IConfigCallback;
import vazkii.zeta.module.ZetaCategory;

Expand Down Expand Up @@ -68,7 +67,6 @@ public void commit() {
Quark.proxy.setConfigGuiSaving(true);
try {
commit(topLevelCategories);
ExternalConfigHandler.instance.commit();
Quark.proxy.handleQuarkConfigChange();
} finally {
Quark.proxy.setConfigGuiSaving(false);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import vazkii.quark.api.config.IConfigCategory;
import vazkii.quark.base.Quark;
import vazkii.quark.base.client.config.ConfigObject;
import vazkii.quark.base.client.config.external.ExternalCategory;
import vazkii.quark.base.client.config.screen.widgets.ConfigElementList;
import vazkii.quark.base.client.config.screen.widgets.ScrollableWidgetList;

Expand All @@ -33,7 +32,7 @@ protected void init() {

breadcrumbs = category.getName();
IConfigCategory currCategory = category.getParent();
while(currCategory != null && !(currCategory instanceof ExternalCategory)) {
while(currCategory != null) {
breadcrumbs = String.format("%s > %s", currCategory.getName(), breadcrumbs);
currCategory = currCategory.getParent();
}
Expand All @@ -49,7 +48,7 @@ public void render(@Nonnull PoseStack mstack, int mouseX, int mouseY, float part
// change name for externals
String modName = WordUtils.capitalizeFully(Quark.MOD_ID);
IConfigCategory currCategory = category;
while(currCategory != null && !(currCategory instanceof ExternalCategory))
while(currCategory != null)
currCategory = currCategory.getParent();

if(currCategory != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import vazkii.quark.api.config.IConfigCategory;
import vazkii.quark.base.Quark;
import vazkii.quark.base.client.config.IngameConfigHandler;
import vazkii.quark.base.client.config.external.ExternalConfigHandler;
import vazkii.quark.base.client.config.screen.widgets.CheckboxButton;
import vazkii.quark.base.client.config.screen.widgets.IconButton;
import vazkii.quark.base.client.config.screen.widgets.SocialButton;
Expand All @@ -45,7 +44,6 @@ protected void init() {
super.init();

final int perLine = 3;
boolean addExternal = ExternalConfigHandler.instance.hasAny();

int pad = 10;
int vpad = 23;
Expand All @@ -58,8 +56,6 @@ protected void init() {
List<ZetaCategory> categories = Quark.ZETA.modules.getInhabitedCategories();

int catCount = categories.size() + 1;
if(addExternal)
catCount++;

boolean shiftedLeft = false;
int useLeft = left;
Expand Down Expand Up @@ -94,11 +90,6 @@ protected void init() {
addRenderableWidget(new Button(useLeft + (bWidth + pad) * (i % perLine), vStart + (i / perLine) * vpad, bWidth, 20, componentFor(cat), categoryLink(cat)));
i++;

if(addExternal) {
cat = ExternalConfigHandler.instance.mockCategory;
addRenderableWidget(new Button(useLeft + (bWidth + pad) * (i % perLine), vStart + (i / perLine) * vpad, bWidth, 20, componentFor(cat), categoryLink(cat)));
}

bWidth = 200;
addRenderableWidget(new Button(width / 2 - bWidth / 2, height - 30, bWidth, 20, Component.translatable("quark.gui.config.save"), this::commit));

Expand Down
4 changes: 0 additions & 4 deletions src/main/java/vazkii/quark/base/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.ConfigScreenHandler.ConfigScreenFactory;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import vazkii.quark.base.Quark;
import vazkii.quark.base.QuarkClient;
import vazkii.quark.base.client.config.IngameConfigHandler;
import vazkii.quark.base.client.config.QButtonHandler;
import vazkii.quark.base.client.config.external.ExternalConfigHandler;
import vazkii.quark.base.client.config.screen.QuarkConfigHomeScreen;
import vazkii.quark.base.client.handler.InventoryButtonHandler;
import vazkii.quark.base.client.handler.ModelHandler;
Expand Down Expand Up @@ -83,8 +81,6 @@ public void start() {
ModLoadingContext.get().registerExtensionPoint(ConfigScreenFactory.class, () -> new ConfigScreenFactory((minecraft, screen) -> new QuarkConfigHomeScreen(screen)));

copyProgrammerArtIfMissing();

(new ExternalConfigHandler()).setAPIHandler();
}

@Override
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/vazkii/quark/base/proxy/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public class CommonProxy {

public void start() {
ForgeRegistries.RECIPE_SERIALIZERS.register(Quark.MOD_ID + ":exclusion", ExclusionRecipe.SERIALIZER);
ForgeRegistries.RECIPE_SERIALIZERS.register(Quark.MOD_ID + ":maintaining", DataMaintainingRecipe.SERIALIZER);
ForgeRegistries.RECIPE_SERIALIZERS.register(Quark.MOD_ID + ":maintaining_smelting", DataMaintainingSmeltingRecipe.SERIALIZER);
ForgeRegistries.RECIPE_SERIALIZERS.register(Quark.MOD_ID + ":maintaining_campfire", DataMaintainingCampfireRecipe.SERIALIZER);
ForgeRegistries.RECIPE_SERIALIZERS.register(Quark.MOD_ID + ":maintaining_smoking", DataMaintainingSmokingRecipe.SERIALIZER);

Quark.ZETA.loadBus
.subscribe(BrewingHandler.class)
Expand Down
Loading

0 comments on commit d15a8fd

Please sign in to comment.