Added charged versions of all Energy items to JEI

This commit is contained in:
Flanks255 2024-03-13 17:42:12 -05:00
parent 99ea93ebad
commit f0184f4d1a
3 changed files with 14 additions and 7 deletions

View file

@ -163,10 +163,8 @@ public class ActuallyAdditions {
new UpdateChecker(); new UpdateChecker();
InitEntities.init(); // todo: [port] replace InitEntities.init(); // todo: [port] replace
//AAWorldGen gen = new AAWorldGen();
ItemCoffee.initIngredients(); ItemCoffee.initIngredients();
CrusherCrafting.init(); CrusherCrafting.init();
//LensMining.init();
} }
private void onConfigReload(ModConfigEvent event) { private void onConfigReload(ModConfigEvent event) {

View file

@ -19,7 +19,7 @@ import java.util.stream.Collectors;
public class ActuallyTabs { public class ActuallyTabs {
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, ActuallyAdditions.MODID); public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, ActuallyAdditions.MODID);
public static final Supplier<CreativeModeTab> GROUP = CREATIVE_MODE_TABS.register("tab", () -> CreativeModeTab.builder() public static final Supplier<CreativeModeTab> GROUP = CREATIVE_MODE_TABS.register("tab", () -> CreativeModeTab.builder() // TODO coherently order them :P
.icon(() -> ActuallyItems.ITEM_BOOKLET.get().getDefaultInstance()) .icon(() -> ActuallyItems.ITEM_BOOKLET.get().getDefaultInstance())
.withTabsBefore(CreativeModeTabs.SPAWN_EGGS) .withTabsBefore(CreativeModeTabs.SPAWN_EGGS)
.title(Component.translatable("itemGroup.actuallyadditions")) .title(Component.translatable("itemGroup.actuallyadditions"))
@ -34,6 +34,7 @@ public class ActuallyTabs {
CustomEnergyStorage storage = new CustomEnergyStorage(itemEnergy.maxPower, itemEnergy.transfer, itemEnergy.transfer); CustomEnergyStorage storage = new CustomEnergyStorage(itemEnergy.maxPower, itemEnergy.transfer, itemEnergy.transfer);
storage.setEnergyStored(itemEnergy.maxPower); storage.setEnergyStored(itemEnergy.maxPower);
stack.setData(ActuallyAttachments.ENERGY_STORAGE.get(), storage); stack.setData(ActuallyAttachments.ENERGY_STORAGE.get(), storage);
stack.getOrCreateTag().putBoolean("Charged", true);
} }
}); });
stacks.addAll(charged); stacks.addAll(charged);

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.inventory.gui.CrusherScreen;
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble; import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.base.ItemEnergy;
import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineCategory; import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineCategory;
import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherCategory; import de.ellpeck.actuallyadditions.mod.jei.crusher.CrusherCategory;
import de.ellpeck.actuallyadditions.mod.jei.empowerer.EmpowererRecipeCategory; import de.ellpeck.actuallyadditions.mod.jei.empowerer.EmpowererRecipeCategory;
@ -29,16 +30,15 @@ import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.RecipeTypes; import mezz.jei.api.constants.RecipeTypes;
import mezz.jei.api.helpers.IJeiHelpers; import mezz.jei.api.helpers.IJeiHelpers;
import mezz.jei.api.recipe.RecipeType; import mezz.jei.api.recipe.RecipeType;
import mezz.jei.api.registration.IGuiHandlerRegistration; import mezz.jei.api.registration.*;
import mezz.jei.api.registration.IRecipeCatalystRegistration;
import mezz.jei.api.registration.IRecipeCategoryRegistration;
import mezz.jei.api.registration.IRecipeRegistration;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import javax.annotation.Nonnull;
@JeiPlugin @JeiPlugin
public class JEIActuallyAdditionsPlugin implements IModPlugin { public class JEIActuallyAdditionsPlugin implements IModPlugin {
public static final ResourceLocation ID = new ResourceLocation(ActuallyAdditions.MODID, "jei_plugin"); public static final ResourceLocation ID = new ResourceLocation(ActuallyAdditions.MODID, "jei_plugin");
@ -55,6 +55,14 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
public static final RecipeType<CrushingRecipe> CRUSHING = RecipeType.create(ActuallyAdditions.MODID, "crushing", CrushingRecipe.class); public static final RecipeType<CrushingRecipe> CRUSHING = RecipeType.create(ActuallyAdditions.MODID, "crushing", CrushingRecipe.class);
public static final RecipeType<MiningLensRecipe> MINING_LENS = RecipeType.create(ActuallyAdditions.MODID, "mining_lens", MiningLensRecipe.class); public static final RecipeType<MiningLensRecipe> MINING_LENS = RecipeType.create(ActuallyAdditions.MODID, "mining_lens", MiningLensRecipe.class);
@Override
public void registerItemSubtypes(@Nonnull ISubtypeRegistration reg) {
ActuallyItems.ITEMS.getEntries().forEach(entry -> {
if (entry.get() instanceof ItemEnergy)
reg.useNbtForSubtypes(entry.get());
});
}
@Override @Override
public void registerCategories(IRecipeCategoryRegistration registry) { public void registerCategories(IRecipeCategoryRegistration registry) {
IJeiHelpers helpers = registry.getJeiHelpers(); IJeiHelpers helpers = registry.getJeiHelpers();