Skip to content

Commit

Permalink
Update for AE2 19.0.11-alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
ramidzkh committed Jul 14, 2024
1 parent 794907e commit 0886dd5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 35 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
minecraft_version=1.21
neoforge_version=21.0.63-beta
ae2_version=19.0.8-alpha
mekanism_version=10.6.4.50
neoforge_version=21.0.87-beta
ae2_version=19.0.11-alpha
mekanism_version=10.6.5.52
emi_version=1.1.10
jade_id=5493270

loader_version_range=[1,)
neo_version_range=[21.0,)
ae2_version_range=[19.0.0,20.0.0)
mekanism_version_range=[10.6.0,11-)
ae2_version_range=[19.0.11-alpha,20.0.0)
mekanism_version_range=[10.6.5,11-)

org.gradle.caching=true
org.gradle.configuration-cache=true
Expand Down
25 changes: 0 additions & 25 deletions src/main/java/me/ramidzkh/mekae2/AppliedMekanistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.IEventBus;
Expand All @@ -33,20 +30,12 @@
import appeng.api.behaviors.GenericSlotCapacities;
import appeng.api.client.StorageCellModels;
import appeng.api.features.P2PTunnelAttunement;
import appeng.api.implementations.blockentities.IChestOrDrive;
import appeng.api.parts.RegisterPartCapabilitiesEvent;
import appeng.api.stacks.AEKeyType;
import appeng.api.stacks.AEKeyTypes;
import appeng.api.storage.StorageCells;
import appeng.api.storage.cells.IBasicCellItem;
import appeng.api.storage.cells.ICellGuiHandler;
import appeng.api.storage.cells.ICellHandler;
import appeng.api.upgrades.Upgrades;
import appeng.core.definitions.AEItems;
import appeng.core.localization.GuiText;
import appeng.menu.MenuOpener;
import appeng.menu.locator.MenuLocators;
import appeng.menu.me.common.MEStorageMenu;
import appeng.parts.automation.StackWorldBehaviors;

@Mod(AppliedMekanistics.ID)
Expand Down Expand Up @@ -122,20 +111,6 @@ private void registerGenericAdapters(RegisterCapabilitiesEvent event) {
}

private void initializeModels() {
StorageCells.addCellGuiHandler(new ICellGuiHandler() {
@Override
public boolean isSpecializedFor(ItemStack cell) {
return cell.getItem() instanceof IBasicCellItem basicCellItem
&& basicCellItem.getKeyType() == MekanismKeyType.TYPE;
}

@Override
public void openChestGui(Player player, IChestOrDrive chest, ICellHandler cellHandler, ItemStack cell) {
MenuOpener.open(MEStorageMenu.TYPE, player,
MenuLocators.forBlockEntity((BlockEntity) chest));
}
});

for (var tier : AMItems.Tier.values()) {
var cell = AMItems.get(tier);
var portable = AMItems.getPortableCell(tier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import mekanism.api.chemical.slurry.Slurry;
import mekanism.api.chemical.slurry.SlurryStack;

import appeng.api.config.PowerUnits;
import appeng.api.config.PowerUnit;
import appeng.api.parts.IPartItem;
import appeng.api.parts.IPartModel;
import appeng.items.parts.PartModels;
Expand Down Expand Up @@ -140,7 +140,7 @@ public S insertChemical(int tank, S stack, Action action) {
}

if (action == Action.EXECUTE) {
part.queueTunnelDrain(PowerUnits.AE, (double) total / MekanismKeyType.TYPE.getAmountPerOperation());
part.queueTunnelDrain(PowerUnit.AE, (double) total / MekanismKeyType.TYPE.getAmountPerOperation());
}

return ChemicalBridge.withAmount(stack, stack.getAmount() - total);
Expand Down Expand Up @@ -234,7 +234,7 @@ public S extractChemical(int tank, long maxAmount, Action action) {
var result = input.get().extractChemical(tank, maxAmount, action);

if (action.execute()) {
part.queueTunnelDrain(PowerUnits.AE,
part.queueTunnelDrain(PowerUnit.AE,
(float) result.getAmount() / MekanismKeyType.TYPE.getAmountPerOperation());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public long getTankCapacity(int tank) {
@Override
public boolean isValid(int tank, S stack) {
var what = MekanismKey.of(stack);
return what == null || inv.isAllowed(what);
return what == null || inv.isAllowedIn(tank, what);
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/me/ramidzkh/mekae2/data/RecipeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ protected void buildRecipes(RecipeOutput output) {
.requires(housing)
.requires(cellComponent)
.unlockedBy("has_cell_component" + tierName, has(cellComponent))
.unlockedBy("has_chemical_housing", has(housing))
.save(output);
ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, AMItems.getPortableCell(tier)::get)
.requires(AEBlocks.CHEST)
.requires(AEBlocks.ME_CHEST)
.requires(cellComponent)
.requires(AEBlocks.ENERGY_CELL)
.requires(housing)
Expand Down

0 comments on commit 0886dd5

Please sign in to comment.