Skip to content

Commit

Permalink
Merge pull request #327 from GrowthcraftCE/bugfix/Inventory-Merge-Nul…
Browse files Browse the repository at this point in the history
…lPointer

Bugfix/inventory merge null pointer
  • Loading branch information
Alatyami authored Mar 27, 2020
2 parents 4c216a7 + 5cb810b commit 26ae294
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
// deobfCompile "com.pam.harvestcraft:harvestcraft:1.12a"
deobfCompile "mcjty.theoneprobe:TheOneProbe-1.12:" + project.property('theoneprobe_version')
compile "mcjty.theoneprobe:TheOneProbe-1.12:" + project.property('theoneprobe_version')

deobfProvided "mezz.jei:jei_" + project.property('minecraft_version') + ":" + project.property('jei_version') + ":api"

Expand Down
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Thu Mar 26 14:34:11 EDT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,21 @@ public boolean mergeWithSlotsOfKind(ItemStack stack, Class<? extends Slot> slotC
}

private boolean mergeWithComparativeSlot(int startSlotID, int endSlotID, ItemStack stack, @Nullable ItemStack matchStack) {
// Try and merge with a slot that has the same item.
for (int i = startSlotID; i <= endSlotID; ++i) {
if (stack.isEmpty()) break;
final Slot subSlot = inventorySlots.get(i);
if ( (matchStack == null && subSlot.isItemValid(stack))
|| (ItemStack.areItemsEqual(subSlot.getStack(), matchStack) ) ) {

// if match stack is not null then we need to compare the ItemStacks in the slots.
if (matchStack != null && ItemStack.areItemsEqual(subSlot.getStack(), matchStack)) {
return mergeWithSlot(subSlot, stack);
}
// if match stack is null, then just find the nearest empty stack.
if ( matchStack == null && subSlot.isItemValid(stack)
&& canAddItemToSlot(subSlot, stack, false)) {
return mergeWithSlot(subSlot, stack);
}

}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/growthcraft_bees/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ item.bee.name=Bee
item.bees_wax.white.name=White Beeswax
item.bees_wax.orange.name=Orange Beeswax
item.bees_wax.magenta.name=Magenta Beeswax
item.bees_wax.light_blue.name=Light Blue Beeswax
item.bees_wax.lightBlue.name=Light Blue Beeswax
item.bees_wax.normal.name=Yellow Beeswax
item.bees_wax.lime.name=Lime Beeswax
item.bees_wax.pink.name=Pink Beeswax
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/assets/growthcraft_grapes/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ tile.grape_vine_fruit.name=Grape Vine
# Fluids
fluid.fluid_booze_purple_juice=Purple Grape Juice
fluid.fluid_booze_purple_wine=Purple Grape Wine
fluid.fluid_booze_purple_wine_potent=Purple Grape Wine
fluid.fluid_booze_purple_wine_extended=Purple Grape Wine
fluid.fluid_booze_purple_wine_potent=Purple Grape Wine Potent
fluid.fluid_booze_purple_wine_extended=Purple Grape Wine Extended
fluid.fluid_booze_purple_ambrosia=Purple Ambrosia
fluid.fluid_booze_purple_portwine=Purple Port Wine
fluid.fluid_booze_purple_wine_intoxicated=Purple Grape Wine
fluid.fluid_booze_purple_wine_poisoned=Purple Grape Wine

fluid.fluid_booze_red_juice=Red Grape Juice
fluid.fluid_booze_red_wine=Red Grape Wine
fluid.fluid_booze_red_wine_potent=Red Grape Wine
fluid.fluid_booze_red_wine_extended=Red Grape Wine
fluid.fluid_booze_red_wine_potent=Red Grape Wine Potent
fluid.fluid_booze_red_wine_extended=Red Grape Wine Extended
fluid.fluid_booze_red_ambrosia=Red Ambrosia
fluid.fluid_booze_red_portwine=Red Port Wine
fluid.fluid_booze_red_wine_intoxicated=Red Grape Wine
fluid.fluid_booze_red_wine_poisoned=Red Grape Wine

fluid.fluid_booze_green_juice=Green Grape Juice
fluid.fluid_booze_green_wine=Green Grape Wine
fluid.fluid_booze_green_wine_potent=Green Grape Wine
fluid.fluid_booze_green_wine_extended=Green Grape Wine
fluid.fluid_booze_green_wine_potent=Green Grape Wine Potent
fluid.fluid_booze_green_wine_extended=Green Grape Wine Extended
fluid.fluid_booze_green_ambrosia=Green Ambrosia
fluid.fluid_booze_green_portwine=Green Port Wine
fluid.fluid_booze_green_wine_intoxicated=Green Grape Wine
Expand Down

0 comments on commit 26ae294

Please sign in to comment.