AdvancedContentInfo
is a Mindustry java mod library for making out stats and stats categories.
translations are written as for standard categories / stat / units:
AStatCat
- category.lowercaseNameAStat
- stat.lowercaseNameAStatUnit
- 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"));
}
Stat category with index:
public class GasStats {
public static AStat gasCapacity = AStat.get("gasCapacity", AStatCat.get("gasses", StatCat.liquids.ordinal()+1));
}
Stat without index:
public class BDStat {
public static final AStat rotorsCount=AStat.get("rotorsCount", StatCat.general);
}
Stat with index:
public class BDStat {
public static final AStat rotorsCount=AStat.get("rotorsCount", StatCat.general, Stat.size.ordinal()+1);
}
Also you can made custom StatUnits Example:
public void setStats(){
aStats.add(GasStats.gasCapacity, gasCapacity, AStatUnit.get("gasUnits"));
}
Result:
- Zelaux(main-programmer)
-
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!
-
1.Go to in-game Mod Browser.
-
2.Find "AdvancedContentInfo" in mod list.
-
3.Download.
-
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:
repositories{
maven{ url 'https://raw.githubusercontent.com/Zelaux/Repo/master/repository' }
maven{ url 'https://raw.githubusercontent.com/Anuken/MindustryMaven/master/repository' }
}
dependencies {
implementation 'com.github.Zelaux.AdvancedContentInfo:core:v1.5.0'
}