Skip to content

Commit

Permalink
Fixed execution offset in screens callback context (gnembon#1353)
Browse files Browse the repository at this point in the history
Wrong origin in screen callbacks
  • Loading branch information
BisUmTo authored Apr 4, 2022
1 parent 6ebef9b commit fca98c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/carpet/script/value/ScreenValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
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;
Expand Down Expand Up @@ -181,7 +182,7 @@ private boolean callListener(ServerPlayer player, String action, Map<Value,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)
Expand Down

0 comments on commit fca98c7

Please sign in to comment.