Fixed execution offset in screens callback context (#1353)
Wrong origin in screen callbacks
This commit is contained in:
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.Map;
|
||||||
import java.util.OptionalInt;
|
import java.util.OptionalInt;
|
||||||
import net.minecraft.commands.CommandSourceStack;
|
import net.minecraft.commands.CommandSourceStack;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.nbt.ListTag;
|
import net.minecraft.nbt.ListTag;
|
||||||
import net.minecraft.nbt.Tag;
|
import net.minecraft.nbt.Tag;
|
||||||
@@ -181,7 +182,7 @@ public class ScreenValue extends Value {
|
|||||||
CarpetScriptHost executingHost = appHost.retrieveForExecution(source,player);
|
CarpetScriptHost executingHost = appHost.retrieveForExecution(source,player);
|
||||||
try
|
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");
|
return cancelValue.getString().equals("cancel");
|
||||||
}
|
}
|
||||||
catch (NullPointerException | InvalidCallbackException | IntegrityException error)
|
catch (NullPointerException | InvalidCallbackException | IntegrityException error)
|
||||||
|
|||||||
Reference in new issue
Block a user