Skip to content

Commit

Permalink
fix cards
Browse files Browse the repository at this point in the history
  • Loading branch information
GlodBlock committed May 21, 2022
1 parent 7266759 commit 6061dc8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/com/glodblock/github/FluidCraft.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.glodblock.github;

import appeng.api.AEApi;
import appeng.api.config.Upgrades;
import com.glodblock.github.common.Config;
import com.glodblock.github.common.storage.FluidCellHandler;
import com.glodblock.github.inventory.InventoryHandler;
import com.glodblock.github.loader.*;
import com.glodblock.github.nei.recipes.DefaultExtractorLoader;
import com.glodblock.github.loader.ChannelLoader;
import com.glodblock.github.loader.ItemAndBlockHolder;
import com.glodblock.github.loader.RecipeLoader;
import com.glodblock.github.proxy.CommonProxy;
import com.glodblock.github.util.ModAndClassUtil;
import cpw.mods.fml.common.Mod;
Expand All @@ -15,6 +17,7 @@
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;

@Mod(modid = FluidCraft.MODID, version = FluidCraft.VERSION, name = FluidCraft.MODNAME)
Expand Down Expand Up @@ -49,6 +52,10 @@ public static void init(FMLInitializationEvent event) {
public static void postInit(FMLPostInitializationEvent event) {
NetworkRegistry.INSTANCE.registerGuiHandler(FluidCraft.INSTANCE, new InventoryHandler());
(new RecipeLoader()).run();
Upgrades.PATTERN_CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 3 );
Upgrades.CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_INTERFACE), 1 );
Upgrades.PATTERN_CAPACITY.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 3 );
Upgrades.CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.INTERFACE), 1 );
proxy.postInit(event);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.glodblock.github.common.parts;

import appeng.api.config.Actionable;
import appeng.api.config.Upgrades;
import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.MachineSource;
Expand Down Expand Up @@ -71,6 +72,12 @@ public void renderInventory( final IPartRenderHelper rh, final RenderBlocks rend
rh.renderInventoryBox( renderer );
}

@Override
public int getInstalledUpgrades( final Upgrades u )
{
return getInterfaceDuality().getInstalledUpgrades( u );
}

private IMEMonitor<IAEFluidStack> getFluidGrid() {
try {
return getProxy().getGrid().<IStorageGrid>getCache(IStorageGrid.class).getFluidInventory();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
package com.glodblock.github.common.tile;

import appeng.api.config.Actionable;
import appeng.api.config.Upgrades;
import appeng.api.networking.energy.IEnergyGrid;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.networking.security.MachineSource;
import appeng.api.networking.storage.IStorageGrid;
import appeng.api.storage.IMEMonitor;
import appeng.api.storage.data.IAEFluidStack;
import appeng.core.features.IStackSrc;
import appeng.me.GridAccessException;
import appeng.tile.misc.TileInterface;
import appeng.util.Platform;
import appeng.util.item.AEFluidStack;
import com.glodblock.github.loader.ItemAndBlockHolder;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;

import javax.annotation.Nullable;

public class TileFluidInterface extends TileInterface implements IFluidHandler
{

Expand All @@ -38,6 +44,21 @@ private IEnergyGrid getEnergyGrid() {
}
}

@Nullable
protected ItemStack getItemFromTile( final Object obj )
{
if (obj instanceof TileFluidInterface) {
return ItemAndBlockHolder.INTERFACE.stack();
}
return null;
}

@Override
public int getInstalledUpgrades( final Upgrades u )
{
return getInterfaceDuality().getInstalledUpgrades( u );
}

@Override
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
IMEMonitor<IAEFluidStack> fluidGrid = getFluidGrid();
Expand Down

0 comments on commit 6061dc8

Please sign in to comment.