Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa1ce34cbc | ||
|
|
47772c3ff7 |
@@ -49,15 +49,13 @@ class ShapedRecipeListener : Listener {
|
||||
}
|
||||
isStackedRecipe = true
|
||||
} else if (inMatrix != null) {
|
||||
val max = Math.floorDiv(inMatrix.amount, inRecipe.item.amount)
|
||||
val max = inMatrix.amount
|
||||
if (max < upperBound) {
|
||||
upperBound = max
|
||||
}
|
||||
isStackedRecipe = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!isStackedRecipe) {
|
||||
return
|
||||
}
|
||||
@@ -68,10 +66,8 @@ class ShapedRecipeListener : Listener {
|
||||
upperBound--
|
||||
}
|
||||
|
||||
val newMatrix = matrix;
|
||||
|
||||
for (i in 0..8) {
|
||||
val inMatrix = matrix[i]
|
||||
val inMatrix = event.inventory.matrix[i]
|
||||
val inRecipe = matched.parts[i]
|
||||
|
||||
if (inRecipe is TestableStack) {
|
||||
@@ -80,35 +76,13 @@ class ShapedRecipeListener : Listener {
|
||||
for (j in 0..upperBound) {
|
||||
amount -= inRecipe.amount
|
||||
}
|
||||
inMatrix.amount = amount;
|
||||
newMatrix[i] = inMatrix
|
||||
|
||||
inMatrix.amount = amount
|
||||
} else {
|
||||
inMatrix.amount = inMatrix.amount - (inRecipe.amount - 1)
|
||||
newMatrix[i] = inMatrix
|
||||
}
|
||||
} else {
|
||||
@Suppress("SENSELESS_COMPARISON")
|
||||
if (inMatrix == null) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (event.isShiftClick) {
|
||||
var amount = inMatrix.amount + 1
|
||||
for (j in 0..upperBound) {
|
||||
amount -= inRecipe.item.amount
|
||||
}
|
||||
inMatrix.amount = amount;
|
||||
newMatrix[i] = inMatrix
|
||||
} else {
|
||||
inMatrix.amount = inMatrix.amount - (inRecipe.item.amount - 1)
|
||||
newMatrix[i] = inMatrix
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event.inventory.matrix = newMatrix;
|
||||
|
||||
if (event.isShiftClick) {
|
||||
val result = event.inventory.result ?: return
|
||||
|
||||
@@ -161,4 +135,4 @@ class ShapedRecipeListener : Listener {
|
||||
listeners.add(listener)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version = 6.24.3
|
||||
version = 6.24.4
|
||||
plugin-name = eco
|
||||
kotlin.code.style = official
|
||||
Reference in New Issue
Block a user