Skip to content

Commit

Permalink
1.3.1 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpgr committed Nov 5, 2024
1 parent a16c49d commit 106c998
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
3 changes: 3 additions & 0 deletions changelogs/1.3.1-1.20.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Patch [1.3.1]

- Fixed a crash when opening the CraftingTableII screen
8 changes: 0 additions & 8 deletions changelogs/1.3.md

This file was deleted.

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ yarn_mappings=1.20.3+build.1
loader_version=0.14.23

# Mod Properties
mod_version=1.3-1.20.3
mod_version=1.3.1-1.20.3
maven_group=net.johnpgr.craftingtableiifabric
archives_base_name=craftingtable-ii-refabricated

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.johnpgr.craftingtableiifabric.inventory

import net.minecraft.item.ItemStack
import net.minecraft.recipe.Recipe
import net.minecraft.recipe.RecipeEntry
import net.minecraft.screen.slot.Slot

Expand All @@ -18,5 +17,5 @@ class CraftingTableIISlot(
}

val recipe
get(): RecipeEntry<*> = (inventory as CraftingTableIIInventory).recipes[index]
get(): RecipeEntry<*>? = (inventory as CraftingTableIIInventory).recipes.getOrNull(index)
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class CraftingTableIIScreen(
//check if the mouse is in our inventory bounds
if ((aX >= 0 && aY >= 0 && aX < 176) && aY < backgroundHeight - 100) {
val i = ((craftableRecipesSize + 8 - 1) / 8 - 5).toDouble()
val j = MathHelper.clamp(amount, -1.0, 1.0)
val j = MathHelper.clamp(verticalAmount, -1.0, 1.0)

scrollPosition -= (j / i).toFloat()
scrollPosition = MathHelper.clamp(scrollPosition, 0f, 1f)
Expand Down Expand Up @@ -198,7 +198,7 @@ class CraftingTableIIScreen(
//draw description overlay
ctx.drawTexture(descriptionTexture, x - 124, y, 0, 0, 121, 162)

val recipe = slot.recipe
val recipe = slot.recipe ?: continue
val ingredientStacks = arrayListOf<ItemStack>()

//TODO: Find a way to draw all matching stacks. Maybe a timer that loops through the list of matching stacks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class CraftingTableIIScreenHandler(

val quickCraft = actionType == SlotActionType.QUICK_MOVE
val itemStack = slot.stack
val recipe = slot.recipe
val recipe = slot.recipe ?: return

CraftingTableIIPacket(recipe.id, syncId, quickCraft).send()

Expand Down

0 comments on commit 106c998

Please sign in to comment.