Skip to content

Commit

Permalink
Updated:
Browse files Browse the repository at this point in the history
Examples
Configs
GHA

fixes #1
  • Loading branch information
Srdjan-V committed Oct 11, 2022
1 parent c5594f4 commit b19b374
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 73 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/curseforge_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,35 @@ jobs:
file: "${{ steps.get_mod_name.outputs.mod_name }}-${{ steps.get_version.outputs.version }}.jar"
token: ${{ secrets.GITHUB_TOKEN }}

- name: Retrieve Source from Latest Release
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "${{ github.repository }}"
version: "tags/v${{ steps.get_version.outputs.version }}"
file: "${{ steps.get_mod_name.outputs.mod_name }}-${{ steps.get_version.outputs.version }}-sources.jar"
token: ${{ secrets.GITHUB_TOKEN }}

#See https://github.com/itsmeow/curseforge-upload#usagearguments for more information
- name: Create CurseForge Release
id: "release-curseforge"
uses: itsmeow/curseforge-upload@v3
with:
game_versions: "Minecraft 1.12.2,Forge"
game_versions: "Minecraft 1.12:1.12.2,Forge"
game_endpoint: "minecraft"
release_type: "release"
changelog: "Changelog is available [here](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.get_version.outputs.version }})."
changelog_type: "markdown"
relations: ""
relations: "crafttweaker:requiredDependency,immersive-petroleum:requiredDependency,mixin-booter:requiredDependency,had-enough-items:optionalDependency"
file_path: "${{ steps.get_mod_name.outputs.mod_name }}-${{ steps.get_version.outputs.version }}.jar"
project_id: "${{ secrets.CURSEFORGE_PROJECT_ID }}"
token: "${{ secrets.CURSEFORGE_API_KEY }}"

- name: Create CurseForge Sources Release
uses: itsmeow/curseforge-upload@v3
with:
game_endpoint: "minecraft"
release_type: "release"
parent_file_id: "${{ steps.release-curseforge.outputs.id }}"
file_path: "${{ steps.get_mod_name.outputs.mod_name }}-${{ steps.get_version.outputs.version }}-sources.jar"
project_id: "${{ secrets.CURSEFORGE_PROJECT_ID }}"
token: "${{ secrets.CURSEFORGE_API_KEY }}"
54 changes: 0 additions & 54 deletions exampels/exampels.zs

This file was deleted.

50 changes: 50 additions & 0 deletions examples/examples.zs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import mods.TweakedLib.TweakedPowerTier;
import mods.TweakedExcavation.TweakedExcavator;
import mods.TweakedExcavation.TweakedMineral;

/*
TweakedExcavator.addMineral(String name, int mineralWeight, float failChance, String[] ores, float[] chances, int powerTier,
@Optional int[] dimBlacklist, @Optional int[] dimWhitelist)
ores Syntax:
"OreDict Item" - this will used the default IE method of searching
"ModID:OreDict Item" - This will search for a oredict item/block of a specific mod
"ModID:Mod Item" - this will search for items/blocks from a mod
"ModID:Mod Item:Metadata" this will search for items/blocks from a mod with metadata
"minecraft:oreIron" - will get minecraft's oredict version of iron
"minecraft:woolYellow" - will get minecraft's oredict version of yellow wool
"minecraft:wool:14" - will get minecraft's wool with metadata 13 (red wool)
TweakedExcavator.addMineralWithCustomYield(String name, int mineralWeight, float failChance, String[] ores, float[] chances, int powerTier, int oreYield,
@Optional int[] dimBlacklist, @Optional int[] dimWhitelist)
oreYield - is the size of the mineral vein
TweakedPowerTier.registerPowerTier(int capacity, int rft)
*/

var powerTier = TweakedPowerTier.registerPowerTier(64000, 4096);
TweakedExcavator.addMineral("Test1", 2000000, 0.0,["minecraft:oreIron", "minecraft:wool:14", "immersiveengineering:connector:0"] ,[1.0,1.0,1.0], powerTier);

var powerTier2 = TweakedPowerTier.registerPowerTier(640000, 40960);
TweakedExcavator.addMineralWithCustomYield("Test2", 2000000, 0.0,["minecraft:oreIron", "minecraft:woolYellow", "immersiveengineering:connector:0"] ,[1.0,1.0,1.0], powerTier2, 1000000);

/*
mods.TweakedExcavation.TweakedMineral is used for modifying default IE minerals and custom ones
available fields:
-powerTier
-yield
A TweakedMineral object can be obtained with this method:
TweakedExcavator.getTweakedMineral(String name);
*/

var powerTier3 = TweakedPowerTier.registerPowerTier(6400000080000, 4096000);
var mineral1 = TweakedExcavator.getTweakedMineral("Test1");
mineral1.powerTier = powerTier3;

var mineral2 = TweakedExcavator.getTweakedMineral("Test2");
mineral2.yield = 180;
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.daemon = false

# Mod Information
tweaked_lib_version = 0.1.22
tweaked_lib_version = 1.0.0

mod_version = 1.0.0
maven_group = srki2k
Expand Down
28 changes: 18 additions & 10 deletions src/main/java/srki2k/tweakedexcavation/common/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,24 @@ public class Configs {
@Config(modid = TweakedExcavation.MODID)
public static class TPConfig {

@Config.Name("Default Power Tiers")
public static PowerTiers powerTiers;

public static class PowerTiers {
@Config.Comment({"This will set the power tier of the default IE Minerals, default=1"})
@Config.Name("Default Minerals PowerTier")
@Config.RangeInt(min = 0)
@Config.RequiresMcRestart
public static int defaultPowerTier = 1;
}
@Config.Name("Default Excavator Power Tiers")
public static DefaultExcavatorPowerTiers defaultExcavatorPowerTiers;

public static class DefaultExcavatorPowerTiers {

@Config.Comment({"This will set the capacity of the excavator, default=64000"})
@Config.Name("Default capacity")
@Config.RangeInt(min = 1)
@Config.RequiresMcRestart
public static int capacity = 64000;

@Config.Comment({"This will set the power consumption of the excavator, default=4096"})
@Config.Name("Default consumption")
@Config.RangeInt(min = 1)
@Config.RequiresMcRestart
public static int rft = 4096;

}

}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package srki2k.tweakedexcavation.common;

import srki2k.tweakedlib.api.powertier.PowerTierHandler;

public class DefaultMineralPower {

public static DefaultMineralPower instance;

public static DefaultMineralPower getInstance() {
if (instance == null) {
instance = new DefaultMineralPower();
}
return instance;
}
private DefaultMineralPower() {
powerTier = PowerTierHandler.registerPowerTier(
Configs.TPConfig.DefaultExcavatorPowerTiers.capacity,
Configs.TPConfig.DefaultExcavatorPowerTiers.rft
);
}

private final int powerTier;

public int getPowerTier() {
return powerTier;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import srki2k.tweakedexcavation.api.ihelpers.IMineralMix;
import srki2k.tweakedexcavation.api.ihelpers.IMineralWorldInfo;
import srki2k.tweakedexcavation.common.Configs;
import srki2k.tweakedexcavation.common.DefaultMineralPower;

import static blusunrize.immersiveengineering.api.tool.ExcavatorHandler.getMineralWorldInfo;
import static blusunrize.immersiveengineering.api.tool.ExcavatorHandler.mineralVeinCapacity;

@Mixin(value = ExcavatorHandler.class, remap = false)
public class MixinExcavatorHandler {
Expand Down Expand Up @@ -45,6 +44,6 @@ public static ExcavatorHandler.MineralMix getRandomMineral(World world, int chun

@Inject(method = "addMineral", at = @At("RETURN"))
private static void addMineral(String name, int mineralWeight, float failChance, String[] ores, float[] chances, CallbackInfoReturnable<ExcavatorHandler.MineralMix> cir) {
((IMineralMix) cir.getReturnValue()).setPowerTier(Configs.TPConfig.PowerTiers.defaultPowerTier);
((IMineralMix) cir.getReturnValue()).setPowerTier(DefaultMineralPower.getInstance().getPowerTier());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import java.util.List;

import static blusunrize.immersiveengineering.api.tool.ExcavatorHandler.mineralList;
import static srki2k.tweakedexcavation.common.Configs.TPConfig.PowerTiers.defaultPowerTier;
import static srki2k.tweakedexcavation.common.Configs.TPConfig.DefaultExcavatorPowerTiers.capacity;
import static srki2k.tweakedexcavation.common.Configs.TPConfig.DefaultExcavatorPowerTiers.rft;

public final class TweakedExcavationErrorLogging implements ICustomLogger {
public static void register() {
Expand Down Expand Up @@ -52,9 +53,11 @@ public Logger getModLogger() {

@Override
public String[] getConfigs() {
String[] strings = new String[1];
String[] strings = new String[3];

strings[0] = "Default Minerals PowerTier: " + defaultPowerTier;
strings[0] = "Default Excavator Power Tiers:";
strings[1] = "Default capacity: " + capacity;
strings[2] = "Default consumption: " + rft;

return strings;
}
Expand Down

0 comments on commit b19b374

Please sign in to comment.