FoundationGames / Sandwichable

Customizable Sandwich mod for Minecraft
MIT License
32 stars 28 forks source link

if a toaster is interacted with non player element, when it finishes toasting a toast, it toasts the server #127

Closed SRAZKVT closed 2 years ago

SRAZKVT commented 2 years ago

Whenever a toaster is interacted with non player element, the variable lastUser isn't set to anything, it stays as null, when the toaster finishes toasting it just ends up crashing the server because the toaster checks for last user to increment a statistic (i suppose), but in this case, the last user is null, which causes a null pointer exception. crash-2022-02-26_12.57.38-server.txt Where it fails:

as you can see, here the line contains if (!world.isClient()) { and then directly goes on to the player uuid easiest way to fix imo would be to just change that line to if (!world.isClient() && this.lastUser != null) {

Might be related to #126 , since the logs seem extremely similar, and the stacktraces are basically identical, although i am not 100% sure

celophys commented 2 years ago

Same error for me

FoundationGames commented 2 years ago

This has been fixed