fix: crash when looking at block without item (door)

closes #1
This commit is contained in:
LordMZTE 2023-03-15 16:27:12 +01:00
parent 5384e8ff48
commit 613fd90e02
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,11 @@ public class TransmutationHelper {
if (currentBlock != null) {
meta = currentBlock.damageDropped(meta);
TransmutationHelper.currentBlockStack = new ItemStack(currentBlock, 1, meta);
if (TransmutationHelper.previousBlockStack == null) {
if (TransmutationHelper.currentBlockStack.getItem() == null) {
TransmutationHelper.targetBlockStack = null;
TransmutationHelper.currentBlockStack = null;
TransmutationHelper.previousBlockStack = null;
} else if (TransmutationHelper.previousBlockStack == null) {
TransmutationHelper.previousBlockStack
= TransmutationHelper.currentBlockStack;
TransmutationHelper.targetBlockStack = getNextBlock(