Zelaux / AdvancedContentInfo

Java mod library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AdvancedContentInfo

AdvancedContentInfo is a Mindustry java mod library for making out stats and stats categories.

banner1

Usage/Examples

translations are written as for standard categories / stat / units:

  • AStatCat - category.lowercaseName
  • AStat - stat.lowercaseName
  • AStatUnit - unit.lowercaseName

You can initialize your stats and your categories in the setStats method of Block: YourBlock.java

package com.examplemod.blocks;

import acontent.world.meta.AStat;
import acontent.world.meta.AStats;
import mindustry.world.Block;

public class YourBlock extends Block {
    public AStats aStats=new AStats();
    public YourBlock(String name) {
        super(name);
        stats=aStats.copy(stats);
    }

    @Override
    public void setStats() {
        super.setStats();
        aStats.add(AStat.get("your_stat","your_category"),/*your statValue*/);
        aStats.add(AStat.get("your_stat1", AStatCat.get("your_category2")),/*your statValue*/);
        aStats.add(AStat.get("your_stat2", StatCat.function),/*your statValue*/);
        aStats.add(Stat.health,/*your statValue*/);
    }
}

Or make a separate class for this:

YourStats.java

package com.examplemod.blocks;

import acontent.world.meta.AStat;
import acontent.world.meta.AStatCat;
import mindustry.world.meta.StatCat;

public class YourStats {
    public static final AStatCat yourCategory2=AStatCat.get("your_category2");
    public static final AStat yourStat=AStat.get("your_stat","your_category");
    public static final AStat yourStat2=AStat.get("your_stat1", AStatCat.get("your_category2"));
    public static final AStat yourStat3=AStat.get("your_stat2", StatCat.function);
}

YourBlock.java

package com.examplemod.blocks;

import acontent.world.meta.AStats;
import mindustry.world.Block;

public class YourBlock extends Block {
    public AStats aStats=new AStats();
    public YourBlock(String name) {
        super(name);
        stats=aStats.copy(stats);
    }

    @Override
    public void setStats() {
        super.setStats();
        aStats.add(YourStats.yourStat,/*your statValue*/);
        aStats.add(YourStats.yourStat2,/*your statValue*/);
        aStats.add(YourStats.yourStat3,/*your statValue*/);
        aStats.add(Stat.health,/*your statValue*/);
    }
}

You can use index at the end of each .get method to change the position in the stat list or stat category. Stat category without index:

public class GasStats {
    public static AStat gasCapacity = AStat.get("gasCapacity", AStatCat.get("gasses"));
}

image

Stat category with index:

public class GasStats {
    public static AStat gasCapacity = AStat.get("gasCapacity", AStatCat.get("gasses", StatCat.liquids.ordinal()+1));
}

image

Stat without index:

public class BDStat {
    public static final AStat rotorsCount=AStat.get("rotorsCount", StatCat.general);
}

image

Stat with index:

public class BDStat {
    public static final AStat rotorsCount=AStat.get("rotorsCount", StatCat.general, Stat.size.ordinal()+1);
}

image

Also you can made custom StatUnits Example:

public void setStats(){
	aStats.add(GasStats.gasCapacity, gasCapacity, AStatUnit.get("gasUnits"));
}

Result:

image

Mindustry Mod By Zelaux

Resources

Authors

  • Zelaux(main-programmer)

Installation Guide

1.Via .jar File

  • 1.Go to releases.

  • 2.Download the latest .jar file.

  • 3.Launch Mindustry.

  • 4.Open "Mods".

  • 5."Import Mod".

  • 6."Impot File"

  • 7.Find file with name "AdvancedContentInfo.jar" and click "load".

  • 8.Play!

2.Via Mod Browser

  • 1.Go to in-game Mod Browser.

  • 2.Find "AdvancedContentInfo" in mod list.

  • 3.Download.

Build Guide

PC

  • 1.Download intelijIDEA.

  • 2.Clone this repository.

  • 3.When importing is end, go to Intelij console and type:

Windows MacOSX Linux
gradlew jar ./gradlew jar ./gradlew jar
  • 4.When compilation is end, your build will be in "build/libs" Download

Depend via Gradle(Replace COMMIT_HASH with text from this file):

dependencies {
        implementation 'com.github.Zelaux:AdvancedContentInfo:COMMIT_HASH'
}

About

Java mod library


Languages

Language:Java 100.0%