Skip to content

Commit

Permalink
Don't crash only log it
Browse files Browse the repository at this point in the history
  • Loading branch information
TonimatasDEV committed Jul 5, 2024
1 parent af768e6 commit 993da6e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
ItemStack itemstack = interactionresultholder.getObject();
if (itemstack == p_9264_ && itemstack.getCount() == i && itemstack.getUseDuration() <= 0 && itemstack.getDamageValue() == j) {
return interactionresultholder.getResult();
@@ -294,52 +_,127 @@
@@ -294,52 +_,128 @@
}
}

Expand Down Expand Up @@ -467,6 +467,7 @@
}
- }
+ return useItemOn$result;
+ // CraftBukkit end
+ } finally {
+ useItemOn$result = InteractionResult.PASS;
+ useItemOn$cancelled = false;
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/net/minecraftforge/fluids/FluidStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.kettingpowered.ketting.core.Ketting;

import java.util.Optional;

Expand Down Expand Up @@ -172,7 +173,10 @@ public int getAmount()

public void setAmount(int amount)
{
if (getRawFluid() == Fluids.EMPTY) throw new IllegalStateException("Can't modify the empty stack.");
if (getRawFluid() == Fluids.EMPTY) {
Ketting.LOGGER.error("Can't modify the empty stack.");
return;
}
this.amount = amount;
updateEmpty();
}
Expand All @@ -197,7 +201,10 @@ public CompoundTag getTag()

public void setTag(CompoundTag tag)
{
if (getRawFluid() == Fluids.EMPTY) throw new IllegalStateException("Can't modify the empty stack.");
if (getRawFluid() == Fluids.EMPTY) {
Ketting.LOGGER.error("Can't modify the empty stack.");
return;
}
this.tag = tag;
}

Expand Down

0 comments on commit 993da6e

Please sign in to comment.