Merge branch 'master' into super_stoker

This commit is contained in:
boubou19 authored and GitHub committed 2025-05-25 21:54:37 +02:00
commit 1aba318d4c
11 files changed
+63 -42

No files matched your search

+11 -11
View File
@@ -34,30 +34,30 @@
* For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph
*/
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.7.40-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-597-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.7.45-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-615-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.8.4:dev')
api("com.github.GTNewHorizons:GTNHLib:0.6.21:dev")
api('com.github.GTNewHorizons:waila:1.8.6:dev')
api("com.github.GTNewHorizons:GTNHLib:0.6.24:dev")
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.0:dev") {
implementation("com.github.GTNewHorizons:WirelessCraftingTerminal:1.12.3:dev") {
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.1.7-GTNH:dev')
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.1.8-GTNH:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.35:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.7:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.8:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.266:dev') {
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.10:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.9.14:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.309:dev') {
exclude group: 'com.github.GTNewHorizons', module: 'AE2FluidCraft-Rework'
exclude group: 'com.github.GTNewHorizons', module: 'Applied-Energistics-2-Unofficial'
}
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.13-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.15-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.7.7-GTNH:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.46:dev") { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.6.64:dev") { transitive = false }
runtimeOnlyNonPublishable("com.github.GTNewHorizons:DuraDisplay:1.3.4:dev")
}
@@ -33,7 +33,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
modid = FluidCraft.MODID,
version = FluidCraft.VERSION,
name = FluidCraft.MODNAME,
dependencies = "required-after:appliedenergistics2@[rv3-beta-238,);required-after:CoFHCore;required-after:Baubles;after:waila;after:thaumicenergistics;after:ae2wct")
dependencies = "required-after:appliedenergistics2@[rv3-beta-238,);required-after:CoFHCore;after:waila;after:thaumicenergistics;after:ae2wct")
public class FluidCraft {
public static final String MODID = "ae2fc";
@@ -19,7 +19,7 @@ public class ContainerInterfaceWireless extends FCBaseContainer {
delegateContainer = new ContainerInterfaceTerminal(ip, monitorable);
this.bindPlayerInventory(ip, 14, 0);
this.bindPlayerInventory(ip, 14, 3);
}
@Override
@@ -13,6 +13,8 @@ import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import org.jetbrains.annotations.NotNull;
import com.glodblock.github.common.item.ItemBaseInfinityStorageCell;
import com.glodblock.github.common.item.ItemFluidVoidStorageCell;
import com.glodblock.github.crossmod.extracells.storage.ProxyFluidCellInventory;
@@ -226,12 +228,9 @@ public class FluidCellInventory implements IFluidCellInventory {
if (types == 0) types = this.getTotalFluidTypes();
if (l != null) {
if (restrictionLong > 0) {
remaining = Math.min((restrictionLong / types) - l.getStackSize(), this.getUnusedFluidCount());
remaining = Math.min((restrictionLong / types) - l.getStackSize(), getRemainingFluidCount());
} else {
remaining = (((this.getTotalBytes() / types)
- (int) Math.ceil((double) l.getStackSize() / singleByteAmount)
- getBytesPerType()) * singleByteAmount)
+ (singleByteAmount - l.getStackSize() % singleByteAmount);
remaining = (((getTotalBytes() / types) - getBytesPerType()) * singleByteAmount) - l.getStackSize();
}
} else {
if (restrictionLong > 0) {
@@ -479,7 +478,7 @@ public class FluidCellInventory implements IFluidCellInventory {
}
@Override
public List<IAEFluidStack> getContents() {
public @NotNull List<IAEFluidStack> getContents() {
List<IAEFluidStack> ret = new ArrayList<>();
for (IAEFluidStack fluid : this.getCellFluids()) {
ret.add(fluid);
@@ -1,11 +1,14 @@
package com.glodblock.github.common.storage;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import appeng.api.config.Actionable;
import appeng.api.exceptions.AppEngException;
import appeng.api.networking.security.BaseActionSource;
@@ -109,7 +112,7 @@ public class FluidVoidStorageCellInventory extends FluidCellInventory {
}
@Override
public List<IAEFluidStack> getContents() {
return null;
public @NotNull List<IAEFluidStack> getContents() {
return Collections.emptyList();
}
}
@@ -5,6 +5,8 @@ import java.util.List;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import appeng.api.storage.IMEInventory;
import appeng.api.storage.data.IAEFluidStack;
@@ -90,6 +92,7 @@ public interface IFluidCellInventory extends IMEInventory<IAEFluidStack> {
*/
long getTotalFluidTypes();
@NotNull
List<IAEFluidStack> getContents();
/**
@@ -20,9 +20,8 @@ public class SpeedWailaDataProvider extends BasePartWailaDataProvider {
@Override
public List<String> getWailaBody(final IPart part, final List<String> currentToolTip,
final IWailaDataAccessor accessor, final IWailaConfigHandler config) {
if (part instanceof FCSharedFluidBus) {
part.readFromNBT(accessor.getNBTData());
currentToolTip.add(Tooltip.partFluidBusFormat(((FCSharedFluidBus) part).calculateAmountToSend() / 5));
if (accessor.getNBTData().hasKey("BusSpeed")) {
currentToolTip.add(Tooltip.partFluidBusFormat(accessor.getNBTData().getInteger("BusSpeed")));
}
return currentToolTip;
}
@@ -30,8 +29,8 @@ public class SpeedWailaDataProvider extends BasePartWailaDataProvider {
@Override
public NBTTagCompound getNBTData(final EntityPlayerMP player, final IPart part, final TileEntity te,
final NBTTagCompound tag, final World world, final int x, final int y, final int z) {
if (part instanceof FCSharedFluidBus) {
part.writeToNBT(tag);
if (part instanceof FCSharedFluidBus bus) {
tag.setInteger("BusSpeed", bus.calculateAmountToSend() / 5);
}
return tag;
}
@@ -85,7 +85,6 @@ public class NEICellViewHandler implements IUsageHandler {
int count = 0;
for (IAEFluidStack aeFluid : sortedStacks) {
FluidStack fluid = aeFluid.getFluidStack();
long amount = fluid.amount;
ItemStack fluidItemStack = ItemFluidDrop.newStack(fluid);
if (fluidItemStack != null) {
fluidItemStack.stackSize = 1;
@@ -93,7 +92,7 @@ public class NEICellViewHandler implements IUsageHandler {
fluidItemStack,
OFFSET_X + count % ROW_ITEM_NUM * 18 + 1,
ITEMS_OFFSET_Y + count / ROW_ITEM_NUM * 18 + 1);
stacks.add(new ViewItemStack(positionedStack, amount, fluid.getFluid().getIcon(), fluid.getFluid().getColor()));
stacks.add(new ViewItemStack(positionedStack, aeFluid.getStackSize(), fluid.getFluid().getIcon(), fluid.getFluid().getColor()));
count++;
}
}
@@ -3,6 +3,7 @@ package com.glodblock.github.nei;
import java.util.regex.Pattern;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import com.glodblock.github.common.storage.IFluidCellInventory;
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
@@ -13,9 +14,10 @@ import appeng.api.storage.IMEInventoryHandler;
import appeng.api.storage.StorageChannel;
import appeng.api.storage.data.IAEFluidStack;
import codechicken.nei.SearchField;
import codechicken.nei.SearchTokenParser;
import codechicken.nei.api.ItemFilter;
public class NEIItemFilter implements SearchField.ISearchProvider {
public class NEISearchFilter implements SearchTokenParser.ISearchParserProvider {
@Override
public ItemFilter getFilter(String searchText) {
@@ -24,8 +26,18 @@ public class NEIItemFilter implements SearchField.ISearchProvider {
}
@Override
public boolean isPrimary() {
return false;
public char getPrefix() {
return 0;
}
@Override
public EnumChatFormatting getHighlightedColor() {
return null;
}
@Override
public SearchTokenParser.SearchMode getSearchMode() {
return SearchTokenParser.SearchMode.ALWAYS;
}
public static class Filter implements ItemFilter {
@@ -40,13 +52,13 @@ public class NEIItemFilter implements SearchField.ISearchProvider {
public boolean matches(ItemStack itemStack) {
if (itemStack.getItem() instanceof IStorageFluidCell) {
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
.getCellInventory(itemStack, null, StorageChannel.FLUIDS);
.getCellInventory(itemStack, null, StorageChannel.FLUIDS);
if (inventory instanceof final IFluidCellInventoryHandler handler) {
final IFluidCellInventory cellInventory = handler.getCellInv();
if (cellInventory != null) {
for (IAEFluidStack fluid : cellInventory.getContents()) {
boolean result = pattern.matcher(fluid.getFluidStack().getLocalizedName().toLowerCase())
.find();
.find();
if (result) return true;
}
@@ -57,5 +69,4 @@ public class NEIItemFilter implements SearchField.ISearchProvider {
}
}
}
@@ -18,7 +18,7 @@ public class NEI_FC_Config implements IConfigureNEI {
@Override
public void loadConfig() {
API.registerNEIGuiHandler(new AE2FC_NEIGuiHandler());
API.addSearchProvider(new NEIItemFilter());
API.addSearchProvider(new NEISearchFilter());
API.registerStackStringifyHandler(new FCStackStringifyHandler());
API.registerUsageHandler(new NEICellViewHandler());
@@ -61,12 +61,15 @@ import appeng.util.item.AEFluidStack;
import appeng.util.item.AEItemStack;
import baubles.api.BaublesApi;
import codechicken.nei.recipe.StackInfo;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.ModContainer;
import cpw.mods.fml.common.registry.GameData;
import io.netty.buffer.ByteBuf;
public final class Util {
public static boolean isBaublesLoaded = Loader.isModLoaded("Baubles");
public static int drainItemPower(AEBaseContainer c, InventoryPlayer ip, int slot, int ticks, double pm,
IFluidPortableCell wt) {
if (slot != -1) {
@@ -183,16 +186,20 @@ public final class Util {
return new ImmutablePair<>(i, is);
}
}
IInventory handler = BaublesApi.getBaubles(player);
if (handler != null) {
invSize = handler.getSizeInventory();
for (int i = 0; i < invSize; ++i) {
ItemStack is = handler.getStackInSlot(i);
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {
return new ImmutablePair<>(GuiHelper.encodeType(i, GuiHelper.InvType.PLAYER_BAUBLES), is);
if (isBaublesLoaded) {
IInventory handler = BaublesApi.getBaubles(player);
if (handler != null) {
invSize = handler.getSizeInventory();
for (int i = 0; i < invSize; ++i) {
ItemStack is = handler.getStackInSlot(i);
if (is != null && is.getItem() instanceof ItemWirelessUltraTerminal) {
return new ImmutablePair<>(GuiHelper.encodeType(i, GuiHelper.InvType.PLAYER_BAUBLES), is);
}
}
}
}
return null;
}