Skip to content
Merged

Dev #38

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ org.gradle.caching=true
org.gradle.configuration-cache=true
minecraft_version=26.1.2
minecraft_version_range=[26.1,26.2]
neo_version=26.1.2.44-beta
neo_version=26.1.2.75

## Mod Properties

Expand All @@ -15,14 +15,14 @@ jei_version=29.5.0.28
mod_id=justdynathings
mod_name=Just Dyna Things
mod_license=Ora Et Labora License
mod_version=2.0-alpha-build6
mod_version=2.0-alpha-build7
mod_group_id=com.devdyna.justdynathings
mod_authors=DevDyna
mod_description=Just Dire Things addon to add more stuff and qol things

## lib
cakesticklib_version=[1.10,)
cakesticklib=8103279
cakesticklib=8279313

justdirethings_version=[1.6.8,)
justdirethings=8042519
49 changes: 26 additions & 23 deletions src/main/java/com/devdyna/justdynathings/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Config {
private static final ModConfigSpec.Builder qCOMMON = new ModConfigSpec.Builder();

public static BooleanValue ENABLE_ALL_JEI_FUELS;
public static BooleanValue DISABLE_FUEL_JEI;

public static ConfigValue<List<? extends String>> UNSTABLE_TIME_CRYSTAL_TOOLTIPS;

Expand Down Expand Up @@ -185,29 +186,31 @@ private static void misc() {
.comment("Include any fuel item to Generator JEI category")
.define("include_any_jei_fuels", true);

UNSTABLE_TIME_CRYSTAL_TOOLTIPS = qCOMMON
.comment("Define the pool of strings that will show as tooltip below Void Crystal")
.defineList(
List.of("void_crystal_tooltips"),
() -> List.of(
"Unstable Stability",
"This is time",
"Fragment of reality",
"The paradox must grow",
"Is the time a lie?",
"There is a paradox on your timeline",
"Time to collapse",
"Time is relative",
"Its time to collapse",
"You collapse me round",
"Press T to collapse",
"Paradox mentioned",
"Never gone collapse up",
"Better with Time"
),
() -> "",
o -> o instanceof String
);
DISABLE_FUEL_JEI = qCOMMON
.comment("Disable Fuel JEI categories when Just Tiered Generators is installed")
.define("disable_jei_fuels", true);

UNSTABLE_TIME_CRYSTAL_TOOLTIPS = qCOMMON
.comment("Define the pool of strings that will show as tooltip below Void Crystal")
.defineList(
List.of("void_crystal_tooltips"),
() -> List.of(
"Unstable Stability",
"This is time",
"Fragment of reality",
"The paradox must grow",
"Is the time a lie?",
"There is a paradox on your timeline",
"Time to collapse",
"Time is relative",
"Its time to collapse",
"You collapse me round",
"Press T to collapse",
"Paradox mentioned",
"Never gone collapse up",
"Better with Time"),
() -> "",
o -> o instanceof String);

qCOMMON.pop();
}
Expand Down
49 changes: 27 additions & 22 deletions src/main/java/com/devdyna/justdynathings/compat/jei/JEIPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.*;
import java.util.stream.Collectors;

import com.devdyna.cakesticklib.api.utils.ModAddonUtil;
import com.devdyna.cakesticklib.api.utils.x;
import com.devdyna.justdynathings.Client;
import com.devdyna.justdynathings.Config;
Expand Down Expand Up @@ -92,34 +93,38 @@ public void registerCategories(IRecipeCategoryRegistration r) {
@Override
public void registerRecipes(IRecipeRegistration r) {

Map<Integer, List<ItemStack>> fuels = new HashMap<>();
if (!(ModAddonUtil.checkMod("justtieredgens") && Config.DISABLE_FUEL_JEI.get())) {

// Process fuels
for (ItemStack stack : FuelUtils.getAllSolidFuels()) {
int burnTime = stack.getBurnTime(null, Minecraft.getInstance().level.fuelValues());
Map<Integer, List<ItemStack>> fuels = new HashMap<>();

// Add JDT fuels before
if (stack.getItem() instanceof Coal_T1 ||
(stack.getItem() instanceof BlockItem bi
&& bi.getBlock() instanceof CoalBlock_T1)) {
r.addRecipes(FuelRecipeCategory.TYPE,
List.of(new FuelRecords.Items(List.of(stack))));
continue;
}
// Process fuels
for (ItemStack stack : FuelUtils.getAllSolidFuels()) {
int burnTime = stack.getBurnTime(null, Minecraft.getInstance().level.fuelValues());

if (burnTime > 0)
fuels.computeIfAbsent(burnTime, k -> new ArrayList<>()).add(stack);
// Add JDT fuels before
if (stack.getItem() instanceof Coal_T1 ||
(stack.getItem() instanceof BlockItem bi
&& bi.getBlock() instanceof CoalBlock_T1)) {
r.addRecipes(FuelRecipeCategory.TYPE,
List.of(new FuelRecords.Items(List.of(stack))));
continue;
}

}
if (burnTime > 0)
fuels.computeIfAbsent(burnTime, k -> new ArrayList<>()).add(stack);

// Add remaining fuels
if (Config.ENABLE_ALL_JEI_FUELS.get()) {
fuels.entrySet().stream()
.sorted(Map.Entry.<Integer, List<ItemStack>>comparingByKey().reversed())
.forEach(entry -> r.addRecipes(FuelRecipeCategory.TYPE,
List.of(new FuelRecords.Items(entry.getValue()))));
}
}

// Add remaining fuels
if (Config.ENABLE_ALL_JEI_FUELS.get()) {
fuels.entrySet().stream()
.sorted(Map.Entry.<Integer, List<ItemStack>>comparingByKey().reversed())
.forEach(entry -> r.addRecipes(FuelRecipeCategory.TYPE,
List.of(new FuelRecords.Items(entry.getValue()))));
}

}
// TODO COMPAT : include fluid
FuelUtils.getAllRefinedFuels().stream()
.collect(Collectors.groupingBy(f -> ((RefinedFuel) f.getFluid()).fePerMb()))
.entrySet().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ else if (recipe.getFuels().getFirst().getItem() instanceof BlockItem bi
: maxburn + " ticks",
46, 4,
0xFFFFFFFF);
guiGraphics.text(Minecraft.getInstance().font, rate + " FE/tick", 46, 18, 0xFFFFFFFF);
guiGraphics.text(Minecraft.getInstance().font,
(hasShiftDown() ? MagicHelpers.withSuffix(total) : total + " FE"), 46,
(hasShiftDown() ? MagicHelpers.withSuffix(rate) : rate) + " FE/tick", 46, 18, 0xFFFFFFFF);
guiGraphics.text(Minecraft.getInstance().font,
(hasShiftDown() ? MagicHelpers.withSuffix(total) : total) + " FE", 46,
32,
0xFFFFFFFF);
stack.popMatrix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ protected void addTranslations() {
// misc
add(MODULE_ID + ".configuration.answer", "A questionable question");
add(MODULE_ID + ".configuration.include_any_jei_fuels", "Include Any Fuel to JEI fuel category");
add(MODULE_ID + ".configuration.disable_jei_fuels", "Disable Fuel JEI categories when Just Tiered Generators is installed");

add(MODULE_ID + ".configuration.void_crystal_tooltips",
"All possible strings rendered below Void Crystal");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public void inventoryTick(ItemStack itemStack, ServerLevel level, Entity entity,

@Override
public Component getName(ItemStack stack) {
//TODO ColorUtils.pulse milli -> seconds
return Component.translatable(getDescriptionId())
.withColor(ColorUtils.pulse(Color.BLUE, Color.MAGENTA, 4).getRGB());
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading