Fixed execution offset in screens callback context (#1353)

Wrong origin in screen callbacks
This commit is contained in:
BisUmTo authored and GitHub committed 2022-04-04 12:34:48 +02:00
1 parent 6ebef9b41d
commit fca98c7b37
1 file changed
+2 -1
@@ -18,6 +18,7 @@ import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.Tag;
@@ -181,7 +182,7 @@ public class ScreenValue extends Value {
CarpetScriptHost executingHost = appHost.retrieveForExecution(source,player);
try
{
Value cancelValue = executingHost.callUDF(player.blockPosition(), source.withPermission(CarpetSettings.runPermissionLevel), callback, args);
Value cancelValue = executingHost.callUDF(BlockPos.ZERO, source.withPermission(CarpetSettings.runPermissionLevel), callback, args);
return cancelValue.getString().equals("cancel");
}
catch (NullPointerException | InvalidCallbackException | IntegrityException error)