Skip to content

Commit

Permalink
tweak tags and remove unifiedPublishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew6rant committed Jun 22, 2022
1 parent 9424547 commit 4843753
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 89 deletions.
43 changes: 0 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,46 +101,3 @@ publishing {
}
}

unifiedPublishing {
project {
changelog = "Added Config! \nTesting, this file was uploaded automatically by the unifiedPublishing plugin."
releaseType = "release"
gameVersions = ["1.18.2"]
gameLoaders = ["fabric"]

mainPublication tasks.remapJar // Declares the publicated jar

relations {
depends { // Mark as a required dependency
curseforge = "fabric-api" // Optional, project slug
modrinth = "fabric-api" // Optional, project slug or id
curseforge = "cloth-config"
modrinth = "cloth-config"
}
includes { // Mark as an included dependency
curseforge = "stacc"
// Stacc API isn't on Modrinth
}
optional { // Mark as an optional dependency
curseforge = "modmenu"
modrinth = "modmenu"
}
}

var cfToken = System.getenv("CF_TOKEN")
if (cfToken != null) {
curseforge {
token = cfToken
id = "515415" // Required, must be a string, ID of CurseForge project
}
}

var mrToken = System.getenv("MODRINTH_TOKEN")
if (mrToken != null) {
modrinth {
token = mrToken
id = "7pbXPVrB" // Required, must be a string, ID of Modrinth project
}
}
}
}
24 changes: 12 additions & 12 deletions src/main/java/io/github/Andrew6rant/stacker/Stacker.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import net.minecraft.util.ActionResult;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.HashSet;
import java.util.List;
Expand All @@ -20,6 +22,7 @@
import static net.minecraft.util.registry.Registry.ITEM_KEY;

public class Stacker implements ModInitializer {
private static final Logger LOGGER = LogManager.getLogger("Stacker");
private static Stacker stacker;
static ConfigHolder<StackerConfig> stackerConfig;

Expand All @@ -31,15 +34,11 @@ public void onInitialize() {
loadStacker("save");
return ActionResult.success(true);
});
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
loadStacker("load");
});
ServerLifecycleEvents.END_DATA_PACK_RELOAD.register((server, resourceManager, success) -> {
loadStacker("reload");
});
ServerLifecycleEvents.SERVER_STARTED.register(server -> loadStacker("load"));
ServerLifecycleEvents.END_DATA_PACK_RELOAD.register((server, resourceManager, success) -> loadStacker("reload"));
}
public static void loadStacker(String configMsg) {
System.out.println("Stacker: Attempting to "+configMsg+" config...");
LOGGER.info("Stacker: Attempting to "+configMsg+" config...");
Set<String> invalidSet = new HashSet<>();
for (Item item : Registry.ITEM) {
if (!item.isDamageable()) {
Expand All @@ -48,14 +47,15 @@ public static void loadStacker(String configMsg) {
Stacker.setMax(item, Stacker.overrideItem(item, stackerConfig.getConfig().itemOverride, invalidSet));
}
if (invalidSet.size() > 0) {
System.err.println("Stacker: Invalid override entries!");
System.err.println("Stacker: The following entries were invalid:");
LOGGER.error("Stacker: Invalid override entries!");
LOGGER.warn("Stacker: The following entries were invalid:");
for (String invalid : invalidSet) {
System.err.println("Stacker: \""+invalid+"\"");
LOGGER.warn("Stacker: \""+invalid+"\"");
}
System.err.println("Stacker: Make sure to use the format, \"mod:item:max_stack\", or \"#tag:item:max_stack\".");
LOGGER.warn("Stacker: Make sure to use the format, \"mod:item:max_stack\", or \"#tag:item:max_stack\".");
}
System.out.println(configMsg.equals("save") ? "Stacker: Config saved!": "Stacker: Config "+configMsg+"ed!");

LOGGER.info(configMsg.equals("save") ? "Stacker: Config saved!": "Stacker: Config "+configMsg+"ed!");
}
public static void setMax(Item item, int max) {
if (max >0) {
Expand Down
18 changes: 9 additions & 9 deletions src/main/resources/data/inmis/tags/items/backpacks.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"replace": false,
"values": [
"inmis:ender_pouch",
"inmis:baby_backpack",
"inmis:frayed_backpack",
"inmis:plated_backpack",
"inmis:gilded_backpack",
"inmis:bejeweled_backpack",
"inmis:blazing_backpack",
"inmis:withered_backpack",
"inmis:endless_backpack"
{"id": "inmis:ender_pouch", "required": false},
{"id": "inmis:baby_backpack", "required": false},
{"id": "inmis:frayed_backpack", "required": false},
{"id": "inmis:plated_backpack", "required": false},
{"id": "inmis:gilded_backpack", "required": false},
{"id": "inmis:bejeweled_backpack", "required": false},
{"id": "inmis:blazing_backpack", "required": false},
{"id": "inmis:withered_backpack", "required": false},
{"id": "inmis:endless_backpack", "required": false}
]
}
50 changes: 25 additions & 25 deletions src/main/resources/data/techreborn/tags/items/not_stackable.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"replace": false,
"values": [
"techreborn:quantum_helmet",
"techreborn:quantum_chestplate",
"techreborn:quantum_leggings",
"techreborn:quantum_boots",
"techreborn:red_cell_battery",
"techreborn:lithium_ion_battery",
"techreborn:lithium_ion_batpack",
"techreborn:energy_crystal",
"techreborn:lapotron_crystal",
"techreborn:lapotronic_orb",
"techreborn:lapotronic_orbpack",
"techreborn:basic_drill",
"techreborn:basic_chainsaw",
"techreborn:basic_jackhammer",
"techreborn:electric_treetap",
"techreborn:advanced_drill",
"techreborn:advanced_chainsaw",
"techreborn:advanced_jackhammer",
"techreborn:rock_cutter",
"techreborn:industrial_drill",
"techreborn:industrial_chainsaw",
"techreborn:industrial_jackhammer",
"techreborn:nanosaber",
"techreborn:omni_tool",
"techreborn:cloaking_device"
{"id": "techreborn:quantum_helmet", "required": false},
{"id": "techreborn:quantum_chestplate", "required": false},
{"id": "techreborn:quantum_leggings", "required": false},
{"id": "techreborn:quantum_boots", "required": false},
{"id": "techreborn:red_cell_battery", "required": false},
{"id": "techreborn:lithium_ion_battery", "required": false},
{"id": "techreborn:lithium_ion_batpack", "required": false},
{"id": "techreborn:energy_crystal", "required": false},
{"id": "techreborn:lapotron_crystal", "required": false},
{"id": "techreborn:lapotronic_orb", "required": false},
{"id": "techreborn:lapotronic_orbpack", "required": false},
{"id": "techreborn:basic_drill", "required": false},
{"id": "techreborn:basic_chainsaw", "required": false},
{"id": "techreborn:basic_jackhammer", "required": false},
{"id": "techreborn:electric_treetap", "required": false},
{"id": "techreborn:advanced_drill", "required": false},
{"id": "techreborn:advanced_chainsaw", "required": false},
{"id": "techreborn:advanced_jackhammer", "required": false},
{"id": "techreborn:rock_cutter", "required": false},
{"id": "techreborn:industrial_drill", "required": false},
{"id": "techreborn:industrial_chainsaw", "required": false},
{"id": "techreborn:industrial_jackhammer", "required": false},
{"id": "techreborn:nanosaber", "required": false},
{"id": "techreborn:omni_tool", "required": false},
{"id": "techreborn:cloaking_device", "required": false}
]
}

0 comments on commit 4843753

Please sign in to comment.