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

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(