Skip to content

Commit

Permalink
add oredicts to ores
Browse files Browse the repository at this point in the history
  • Loading branch information
yor42 committed Nov 18, 2024
1 parent 47a29b7 commit ef7efbe
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ show_testing_output = false

# Mod Information
# HIGHLY RECOMMEND complying with SemVer for mod_version: https://semver.org/
mod_version = 1.1.5-UES
mod_version = 1.1.6-UES
root_package = cn
mod_id = academy
mod_name = AcademyCraft
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/cn/academy/ACOreDict.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@
public class ACOreDict {

public static void InitOredicts(){
OreDictionary.registerOre("oreImagCrystal", ACBlocks.crystal_ore);
OreDictionary.registerOre("oreResonantCrystal", ACBlocks.reso_ore);
OreDictionary.registerOre("oreConstraintMetal", ACBlocks.constraint_metal);
OreDictionary.registerOre("oreImagSilicon", ACBlocks.imagsil_ore);
OreDictionary.registerOre("oreSilicon", ACBlocks.imagsil_ore);

OreDictionary.registerOre("plateIron", ACItems.reinforced_iron_plate);

OreDictionary.registerOre("ingotSilicon", ACItems.imag_silicon_ingot);
OreDictionary.registerOre("nuggetSilicon", ACItems.imag_silicon_piece);
OreDictionary.registerOre("waferSilicon", ACItems.wafer);

OreDictionary.registerOre("ingotImagSilicon", ACItems.imag_silicon_ingot);
OreDictionary.registerOre("nuggetImagSilicon", ACItems.imag_silicon_piece);
OreDictionary.registerOre("waferImagSilicon", ACItems.wafer);

OreDictionary.registerOre("ingotConstraintMetal", ACItems.constraint_ingot);
OreDictionary.registerOre("plateConstraintMetal", ACItems.constraint_plate);

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/cn/academy/datapart/AbilityData.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.relauncher.Side;

import java.util.Arrays;
import java.util.BitSet;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -77,9 +78,7 @@ public void setCategory(Category c) {
level = 0;
}

for(int i = 0; i < skillExps.length; ++i) {
skillExps[i] = 0.0f;
}
Arrays.fill(skillExps, 0.0f);
learnedSkills.set(0, learnedSkills.size(), false);

sync();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/academy/datapart/CPData.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public interface IInterfSource {
boolean interfering();
}

private Map<String, IInterfSource> interfSources = new HashMap<>();
private final Map<String, IInterfSource> interfSources = new HashMap<>();

@SerializeIncluded
private boolean activated = false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/academy/datapart/CooldownData.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public SkillCooldown get(Controllable ctrl) {
*/
public SkillCooldown getSub(Controllable ctrl, int id) {
int sid = toID(ctrl, id);
return cooldownMap.containsKey(sid) ? cooldownMap.get(sid) : EMPTY_COOLDOWN;
return cooldownMap.getOrDefault(sid, EMPTY_COOLDOWN);
}

public void clear() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/academy/datapart/PresetData.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public Preset read(NBTBase tag_, Class<? extends Preset> type) {
NetworkS11n.addDirect(Preset.class, new NetS11nAdaptor<Preset>() {
@Override
public void write(ByteBuf buf, Preset obj) {
int count = (int) IntStream.range(0, MAX_KEYS).filter(idx -> obj.hasMapping(idx)).count();
int count = (int) IntStream.range(0, MAX_KEYS).filter(obj::hasMapping).count();
buf.writeByte(count);

IntStream.range(0, MAX_KEYS).forEach(idx -> {
Expand Down

0 comments on commit ef7efbe

Please sign in to comment.