use of org.spongepowered.common.bridge.commands.CommandSourceStackBridge in project SpongeCommon by SpongePowered.
the class CommandSourceStackMixin method impl$copyPermissionOnCopy.
/*
* All the with* methods copy this CommandSource, so we need to do our own copy.
* This method MUST be above all other with* return injections so that the cause copy happens
* FIRST. That way, we don't overwrite any changes we then need to make.
*/
@Inject(method = { "withEntity", "withPosition", "withRotation(Lnet/minecraft/world/phys/Vec2;)Lnet/minecraft/commands/CommandSourceStack;", "withCallback(Lcom/mojang/brigadier/ResultConsumer;)Lnet/minecraft/commands/CommandSourceStack;", "withSuppressedOutput", "withPermission", "withMaximumPermission", "withAnchor", "withLevel" }, at = @At("RETURN"))
private void impl$copyPermissionOnCopy(final CallbackInfoReturnable<CommandSourceStack> cir) {
if (cir.getReturnValue() != (Object) this) {
final CommandSourceStackBridge commandSourceStackBridge = ((CommandSourceStackBridge) cir.getReturnValue());
commandSourceStackBridge.bridge$setPotentialPermissionNode(this.impl$potentialPermissionNode);
commandSourceStackBridge.bridge$setCause(this.impl$cause);
}
}
Aggregations