Compare commits

..
Author SHA1 Message Date
miozune 14853a2481 Fix NPE with FCStackStringifyHandler (#129) 2023-05-13 19:03:22 +02:00
miozune 2cd049d40e ForgeDirection fix & update dependencies (#128) 2023-05-09 07:39:00 +02:00
6 changed files with 28 additions and 20 deletions

No files matched your search

+4 -2
View File
@@ -1,4 +1,4 @@
//version: 1683373797
//version: 1683563728
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -1266,7 +1266,9 @@ tasks.register('faq') {
print("If your build fails to fetch dependencies, they might have been deleted and replaced by newer " +
"versions.\nCheck if the versions you try to fetch are still on the distributing sites.\n" +
"The links can be found in repositories.gradle and build.gradle:repositories, " +
"not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.")
"not build.gradle:buildscript.repositories - this one is for gradle plugin metadata.\n\n" +
"If your build fails to recognize the syntax of new Java versions, enable Jabel in your " +
"gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties.")
}
}
+11 -17
View File
@@ -1,28 +1,22 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-203-GTNH:dev')
api('com.github.GTNewHorizons:NotEnoughItems:2.3.50-GTNH:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-208-GTNH:dev')
api('curse.maven:cofh-core-69162:2388751')
api('com.github.GTNewHorizons:waila:1.5.24:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.33:dev') { transitive = false }
api('com.github.GTNewHorizons:waila:1.6.0:dev')
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.34:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.9.0:dev")
compileOnly('com.github.GTNewHorizons:ForestryMC:4.5.6:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.4.11:dev')
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.13:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.42.82:dev')
compileOnly('com.github.GTNewHorizons:StructureLib:1.2.6:dev')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly('com.github.GTNewHorizons:ForestryMC:4.6.7:dev')
compileOnly('com.github.GTNewHorizons:EnderIO:2.4.14:dev')
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.21:dev')
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:AppleCore:3.2.10:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.33:dev') { transitive = false }
compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.1-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.5-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.4.1-GTNH:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:GTplusplus:1.8.42:dev') { transitive = false }
compileOnly('com.github.GTNewHorizons:GTplusplus:1.9.4:dev') { transitive = false }
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.2.10:dev") { transitive = false }
compileOnly('com.github.GTNewHorizons:KekzTech:0.7.8:dev')
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
}
@@ -86,6 +86,7 @@ public class ItemFluidDrop extends FCBaseItem {
shape = aIconRegister.registerIcon(NameConst.RES_KEY + NameConst.ITEM_FLUID_DROP);
}
@Nullable
public static ItemStack newStack(@Nullable FluidStack fluid) {
if (fluid == null || fluid.amount <= 0) {
return null;
@@ -97,6 +98,7 @@ public class ItemFluidDrop extends FCBaseItem {
return stack;
}
@Nullable
public static ItemStack newDisplayStack(FluidStack fluid) {
if (fluid == null) {
return null;
@@ -120,6 +122,7 @@ public class ItemFluidDrop extends FCBaseItem {
return getFluidStack(stack.getItemStack()) != null;
}
@Nullable
public static FluidStack getFluidStack(ItemStack stack) {
if (stack == null || stack.getItem() != ItemAndBlockHolder.DROP || !stack.hasTagCompound()) {
return null;
@@ -139,6 +142,7 @@ public class ItemFluidDrop extends FCBaseItem {
return fluidStack;
}
@Nullable
public static IAEFluidStack getAeFluidStack(@Nullable IAEItemStack stack) {
if (stack == null) {
return null;
@@ -151,6 +155,7 @@ public class ItemFluidDrop extends FCBaseItem {
return fluidStack;
}
@Nullable
public static IAEItemStack newAeStack(@Nullable FluidStack fluid) {
if (fluid == null || fluid.amount <= 0) {
return null;
@@ -163,6 +168,7 @@ public class ItemFluidDrop extends FCBaseItem {
return stack;
}
@Nullable
public static IAEItemStack newAeStack(@Nullable IAEFluidStack fluid) {
if (fluid == null || fluid.getStackSize() <= 0) {
return null;
@@ -34,6 +34,7 @@ public class ItemFluidPacket extends FCBaseItem {
setMaxStackSize(1);
}
@Nullable
public static FluidStack getFluidStack(ItemStack stack) {
if (stack == null || !stack.hasTagCompound()) {
return null;
@@ -82,10 +83,12 @@ public class ItemFluidPacket extends FCBaseItem {
}
}
@Nullable
public static FluidStack getFluidStack(@Nullable IAEItemStack stack) {
return stack != null ? getFluidStack(stack.getItemStack()) : null;
}
@Nullable
public static ItemStack newStack(@Nullable FluidStack fluid) {
if (fluid == null || fluid.amount == 0) {
return null;
@@ -99,6 +102,7 @@ public class ItemFluidPacket extends FCBaseItem {
return stack;
}
@Nullable
public static ItemStack newStack(@Nullable IAEFluidStack fluid) {
if (fluid == null || fluid.getStackSize() == 0) {
return null;
@@ -106,6 +110,7 @@ public class ItemFluidPacket extends FCBaseItem {
return newStack(fluid.getFluidStack());
}
@Nullable
public static ItemStack newDisplayStack(@Nullable FluidStack fluid) {
if (fluid == null) {
return null;
@@ -430,7 +430,7 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
if (te instanceof IGregTechTileEntity) {
IMetaTileEntity mte = ((IGregTechTileEntity) te).getMetaTileEntity();
if (mte instanceof MetaPipeEntity) {
return ((MetaPipeEntity) mte).isConnectedAtSide(direction.ordinal());
return ((MetaPipeEntity) mte).isConnectedAtSide(direction);
}
}
return true;
@@ -25,6 +25,7 @@ public class FCStackStringifyHandler implements IStackStringifyHandler {
public FluidStack getFluid(ItemStack item) {
if (item.getItem() instanceof ItemFluidDrop) {
FluidStack fluid = ItemFluidDrop.getFluidStack(item);
if (fluid == null) return null;
fluid.amount /= Math.max(item.stackSize, 1);
return fluid;
} else if (item.getItem() instanceof ItemFluidPacket) {