Skip to content

Commit

Permalink
update to latest ae2 (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari023 authored Jul 13, 2024
1 parent c778196 commit a2e1ab9
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 36 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- resize the scrollbar with the upgrade panel
- update ae2
9 changes: 8 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("net.neoforged.moddev") version "0.1.114"
id("net.neoforged.moddev") version "1.0.7"
id("com.diffplug.spotless") version "7.0.0.BETA1"
id("maven-publish")
java
Expand Down Expand Up @@ -71,6 +71,13 @@ dependencies {
repositories {
mavenLocal()
mavenCentral()
maven {
url = uri("https://prmaven.neoforged.net/NeoForge/pr1199")
content {
includeModule("net.neoforged", "testframework")
includeModule("net.neoforged", "neoforge")
}
}
maven {
url = uri("https://modmaven.dev/")
content {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
neoforgeVersion=21.0.30-beta
neoforgeVersion=21.0.126-beta-pr-1199-ui
neoForge.parchment.minecraftVersion=1.21
neoForge.parchment.mappingsVersion=2024.06.23

# Mod Properties
mavenGroup=de.mari_023
modID=ae2wtlib

ae2Version=19.0.7-alpha
ae2Version=19.0.10-alpha
curiosVersion=8.0.0-beta.4+1.20.6

reiVersion=16.0.729
architecturyVersion=13.0.1
architecturyVersion=13.0.4
jeiMinecraftVersion=1.21
jeiVersion=19.0.0.3
emiVersion=1.1.7
emiVersion=1.1.10
emiMinecraftVersion=1.21

runtimeItemlistMod=rei
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public AE2wtlibForge(IEventBus modEventBus) {
ModLoadingContext.get().getActiveContainer().registerConfig(ModConfig.Type.COMMON, AE2wtlibConfig.SPEC,
AE2wtlib.MOD_NAME + ".toml");
modEventBus.addListener((RegisterEvent e) -> {
if (!e.getRegistryKey().equals(Registries.BLOCK))
if (!e.getRegistryKey().equals(Registries.ITEM))
return;
AE2wtlibItems.init();
AE2wtlib.onAe2Initialized();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package de.mari_023.ae2wtlib.recipeviewer;

import net.minecraft.world.item.ItemStack;

import dev.emi.emi.api.EmiEntrypoint;
import dev.emi.emi.api.EmiPlugin;
import dev.emi.emi.api.EmiRegistry;
import dev.emi.emi.api.recipe.VanillaEmiRecipeCategories;
import dev.emi.emi.api.stack.EmiStack;

import appeng.api.config.Actionable;
import appeng.integration.modules.emi.EmiEncodePatternHandler;
import appeng.integration.modules.emi.EmiUseCraftingRecipeHandler;

import de.mari_023.ae2wtlib.AE2wtlibItems;
import de.mari_023.ae2wtlib.wct.WCTMenu;
import de.mari_023.ae2wtlib.wet.WETMenu;
import de.mari_023.ae2wtlib.wut.WTDefinitions;
Expand All @@ -21,7 +25,11 @@ public void register(EmiRegistry registry) {
new EmiEncodePatternHandler<>(WETMenu.class));
registry.addRecipeHandler(WCTMenu.TYPE, new EmiUseCraftingRecipeHandler<>(WCTMenu.class));

ItemStack wut = WTDefinitions.CRAFTING.universalTerminal();
AE2wtlibItems.UNIVERSAL_TERMINAL.injectAEPower(wut,
AE2wtlibItems.UNIVERSAL_TERMINAL.getAEMaxPower(wut), Actionable.MODULATE);

registry.addWorkstation(VanillaEmiRecipeCategories.CRAFTING,
EmiStack.of(WTDefinitions.CRAFTING.universalTerminal()));
EmiStack.of(wut));
}
}
10 changes: 9 additions & 1 deletion src/main/java/de/mari_023/ae2wtlib/recipeviewer/JEIPlugin.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package de.mari_023.ae2wtlib.recipeviewer;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;

import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.RecipeTypes;
import mezz.jei.api.registration.IRecipeCatalystRegistration;
import mezz.jei.api.registration.IRecipeTransferRegistration;

import appeng.api.config.Actionable;

import de.mari_023.ae2wtlib.AE2wtlib;
import de.mari_023.ae2wtlib.AE2wtlibItems;
import de.mari_023.ae2wtlib.wut.WTDefinitions;

@JeiPlugin
Expand All @@ -27,7 +31,11 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registrat

@Override
public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) {
registry.addRecipeCatalyst(WTDefinitions.CRAFTING.universalTerminal(),
ItemStack wut = WTDefinitions.CRAFTING.universalTerminal();
AE2wtlibItems.UNIVERSAL_TERMINAL.injectAEPower(wut,
AE2wtlibItems.UNIVERSAL_TERMINAL.getAEMaxPower(wut), Actionable.MODULATE);

registry.addRecipeCatalyst(wut,
RecipeTypes.CRAFTING);
}
}
11 changes: 10 additions & 1 deletion src/main/java/de/mari_023/ae2wtlib/recipeviewer/REIPlugin.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package de.mari_023.ae2wtlib.recipeviewer;

import net.minecraft.world.item.ItemStack;

import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
import me.shedaniel.rei.api.common.util.EntryStacks;
import me.shedaniel.rei.forge.REIPluginClient;
import me.shedaniel.rei.plugin.common.BuiltinPlugin;

import appeng.api.config.Actionable;

import de.mari_023.ae2wtlib.AE2wtlib;
import de.mari_023.ae2wtlib.AE2wtlibItems;
import de.mari_023.ae2wtlib.wut.WTDefinitions;

@REIPluginClient
Expand All @@ -18,7 +23,11 @@ public String getPluginProviderName() {

@Override
public void registerCategories(CategoryRegistry registry) {
ItemStack wut = WTDefinitions.CRAFTING.universalTerminal();
AE2wtlibItems.UNIVERSAL_TERMINAL.injectAEPower(wut,
AE2wtlibItems.UNIVERSAL_TERMINAL.getAEMaxPower(wut), Actionable.MODULATE);

registry.addWorkstations(BuiltinPlugin.CRAFTING,
EntryStacks.of(WTDefinitions.CRAFTING.universalTerminal()));
EntryStacks.of(wut));
}
}
5 changes: 0 additions & 5 deletions src/main/java/de/mari_023/ae2wtlib/wat/WATScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public void init() {
upgradesPanel.setMaxRows(Math.max(2, getVisibleRows()));
}

@Override
public int getVisibleRows() {
return 2;
}

@Override
public WTMenuHost getHost() {
return (WTMenuHost) getMenu().getHost();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/mari_023/ae2wtlib/wct/WCTMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public boolean mayPlace(ItemStack stack) {
}

@Override
public IGridNode getNetworkNode() {
public IGridNode getGridNode() {
return wctMenuHost.getActionableNode();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/mari_023/ae2wtlib/wet/WETMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public WETMenu(int id, final Inventory ip, final WETMenuHost gui) {
}

@Override
public IGridNode getNetworkNode() {
public IGridNode getGridNode() {
return wetMenuHost.getActionableNode();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.UnknownNullability;

import net.minecraft.client.gui.navigation.ScreenRectangle;
import net.neoforged.neoforge.network.PacketDistributor;

import appeng.client.Hotkeys;
import appeng.client.gui.WidgetContainer;
import appeng.client.gui.style.ScreenStyle;
import appeng.core.AEConfig;
import appeng.core.network.serverbound.HotkeyPacket;
import appeng.menu.AEBaseMenu;
import appeng.menu.SlotSemantics;
Expand Down Expand Up @@ -77,15 +72,4 @@ default ScrollingUpgradesPanel addUpgradePanel(WidgetContainer widgets, AEBaseMe
widgets.add("scrollingUpgrades", panel);
return panel;
}

default int getVisibleRows() {
int availableHeight = getRectangle().height() - 2 * AEConfig.instance().getTerminalMargin();
var style = Objects.requireNonNull(getStyle().getTerminalStyle());
return AEConfig.instance().getTerminalStyle().getRows(style.getPossibleRows(availableHeight));
}

@UnknownNullability
ScreenStyle getStyle();

ScreenRectangle getRectangle();
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.network.codec.NeoForgeStreamCodecs;

import appeng.api.config.Actionable;
import appeng.hotkeys.HotkeyActions;

import de.mari_023.ae2wtlib.AE2wtlibComponents;
Expand Down Expand Up @@ -64,8 +63,6 @@ public void addTerminal() {
ItemStack wut = new ItemStack(AE2wtlibItems.UNIVERSAL_TERMINAL);

wut.set(componentType, Unit.INSTANCE);
AE2wtlibItems.UNIVERSAL_TERMINAL.injectAEPower(wut,
AE2wtlibItems.UNIVERSAL_TERMINAL.getAEMaxPower(wut), Actionable.MODULATE);

WTDefinition wtDefinition = new WTDefinition(name, item::tryOpen, wTMenuHostFactory, menuType, item, wut,
TextConstants.formatTerminalName(translationKey), translationKey, hotkeyName, componentType,
Expand Down

0 comments on commit a2e1ab9

Please sign in to comment.