当前位置: 首页>>代码示例>>Java>>正文


Java CallbackInfoReturnable.setReturnValue方法代码示例

本文整理汇总了Java中org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable.setReturnValue方法的典型用法代码示例。如果您正苦于以下问题:Java CallbackInfoReturnable.setReturnValue方法的具体用法?Java CallbackInfoReturnable.setReturnValue怎么用?Java CallbackInfoReturnable.setReturnValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable的用法示例。


在下文中一共展示了CallbackInfoReturnable.setReturnValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onShouldSideBeRendered

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method="shouldSideBeRendered(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;)Z", [email protected]("HEAD"), cancellable=true)
private void onShouldSideBeRendered(IBlockAccess blockAccess, BlockPos pos, EnumFacing facing, CallbackInfoReturnable<Boolean> ci) {
    if (UyjuliansXrayModMain.xrayEnabled()) {
        ci.setReturnValue((!UyjuliansXrayModMain.checkBlockList(this.getBlock())) && UyjuliansXrayModMain.checkBlockList(blockAccess.getBlockState(pos.offset(facing)).getBlock()));
    }
    else if (UyjuliansXrayModMain.caveFinderEnabled()) {
        ci.setReturnValue((!UyjuliansXrayModMain.checkBlockList(this.getBlock())) && blockAccess.isAirBlock(pos.offset(facing)));
    }
    else if (UyjuliansXrayModMain.specialMode1Enabled()) {
        if (!UyjuliansXrayModMain.checkBlockList(this.getBlock())) {
            boolean shouldRender = true;
            for (EnumFacing facing1 : new EnumFacing[]{EnumFacing.NORTH, EnumFacing.EAST, EnumFacing.SOUTH, EnumFacing.WEST}) {
                if (blockAccess.isAirBlock(pos.offset(facing1))) {
                    shouldRender = true;
                }
                else {
                    shouldRender = false;
                    break;
                }
            }
            ci.setReturnValue(shouldRender);
        } else {
            ci.setReturnValue(false);
        }
    }
}
 
开发者ID:uyjulian,项目名称:MinecraftX-RAY,代码行数:27,代码来源:MixinStateImplementation.java

示例2: getTeamColor

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "getTeamColor", at = @At("HEAD"), cancellable = true)
private void getTeamColor(Entity entityIn, CallbackInfoReturnable<Integer> ci) {
    TeamColorEvent event = new TeamColorEvent(entityIn);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.setReturnValue(event.getColor());
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinRender.java

示例3: canCollideCheck

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "canCollideCheck", at = @At("HEAD"), cancellable = true)
private void canCollideCheck(IBlockState state, boolean hitIfLiquid, CallbackInfoReturnable<Boolean> ci) {
    BlockCollisionEvent event = new BlockCollisionEvent((Block) (Object) this);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.setReturnValue(false);
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinBlock.java

示例4: onIsThundering

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "isThundering()Z", at = @At("HEAD"), cancellable = true)
private void onIsThundering(CallbackInfoReturnable<Boolean> ci) {
    if (!this.isRemote) {
        final IMixinWorldInfo info = (IMixinWorldInfo) this.worldInfo;
        ci.setReturnValue(info.getWeather().getThunderRate() > 0f && this.isWeatherOptimal());
    }
}
 
开发者ID:Cybermaxke,项目名称:Weathers,代码行数:8,代码来源:MixinWorld.java

示例5: onCalculateSkylightSubtracted

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
/**
 * Make sure that it won't go under zero, this can happen if the darkness < 0
 */
@Inject(method = "calculateSkylightSubtracted(F)I", at = @At("RETURN"), cancellable = true)
private void onCalculateSkylightSubtracted(float delta, CallbackInfoReturnable<Integer> ci) {
    int value = ci.getReturnValueI();
    if (value < 0) {
        ci.setReturnValue(0);
    }
}
 
开发者ID:Cybermaxke,项目名称:Weathers,代码行数:11,代码来源:MixinWorld.java

示例6: onTrySleep

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "trySleep", at = @At(value = "INVOKE"))
public void onTrySleep(BlockPos bedLocation, CallbackInfoReturnable<EntityPlayer.EnumStatus> callbackInfo) {
    if (this instanceof Player) {
        BedEnterHook bedEnterHook = (BedEnterHook)
                new BedEnterHook((Player) this, this.getWorld().getBlockAt(bedLocation.getX(),
                        bedLocation.getY(), bedLocation.getZ())).call();
        if (bedEnterHook.isCanceled()) {
            callbackInfo.setReturnValue(EntityPlayer.EnumStatus.OTHER_PROBLEM);
        }
    }
}
 
开发者ID:NeptunePowered,项目名称:NeptuneCommon,代码行数:12,代码来源:MixinEntityPlayer.java

示例7: getFOVModifier

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "getFOVModifier", at = @At("HEAD"), cancellable = true)
private void getFOVModifier(float partialTicks, boolean useFOVSetting, CallbackInfoReturnable<Float> ci) {
    if (Camera.isCapturing())
        ci.setReturnValue(90.0F);
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:6,代码来源:MixinEntityRenderer.java

示例8: onGetBlockReachDistance

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "getBlockReachDistance()F", at = @At("RETURN"), cancellable = true)
public void onGetBlockReachDistance(CallbackInfoReturnable<Float> callbackInfo) {
    callbackInfo.setReturnValue(EventManager.post(new PlayerReach(currentGameType.isCreative() ? 5.0F : 4.5F)).getReach());
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:5,代码来源:MixinPlayerControllerMP.java

示例9: onGetCollisionBorderSize

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "getCollisionBorderSize", at = @At("RETURN"), cancellable = true)
public void onGetCollisionBorderSize(CallbackInfoReturnable<Float> callbackInfo) {
    callbackInfo.setReturnValue(EventManager.post(new HitboxSize(callbackInfo.getReturnValue())).getSize());
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:5,代码来源:MixinEntity.java

示例10: onPushOutOfBlocks

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "pushOutOfBlocks(DDD)Z", at = @At("HEAD"), cancellable = true)
public void onPushOutOfBlocks(double x, double y, double z, CallbackInfoReturnable<Boolean> callbackInfo) {
    if (EventManager.post(new PushOutOfBlocks()).isCancelled())
        callbackInfo.setReturnValue(false);
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:6,代码来源:MixinEntityPlayerSP.java

示例11: onShouldSideBeRendered

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "shouldSideBeRendered", at = @At("RETURN"), cancellable = true)
public void onShouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side, CallbackInfoReturnable<Boolean> callbackInfo) {
    callbackInfo.setReturnValue(EventManager.post(new BlockShouldSideBeRendered((Block) (Object) this, side, callbackInfo.getReturnValue())).getShouldSideBeRendered());
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:5,代码来源:MixinBlock.java

示例12: onIsUseableByPlayer

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "isUseableByPlayer", at = @At("HEAD"), cancellable = true)
public void onIsUseableByPlayer(EntityPlayer viewingPlayer, CallbackInfoReturnable<Boolean> cir) {
    if (!viewingPlayer.getUniqueID().equals(player.getUniqueID())) {
        cir.setReturnValue(true);
    }
}
 
开发者ID:NucleusPowered,项目名称:NucleusMixins,代码行数:7,代码来源:MixinInventoryPlayer.java

示例13: onIsRaining

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "isRaining()Z", at = @At("HEAD"), cancellable = true)
private void onIsRaining(CallbackInfoReturnable<Boolean> ci) {
    if (!this.isRemote) {
        ci.setReturnValue(this.getRainStrength() > 0.2f);
    }
}
 
开发者ID:Cybermaxke,项目名称:Weathers,代码行数:7,代码来源:MixinWorld.java

示例14: onGetThunderStrength

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "getThunderStrength(F)F", at = @At("HEAD"), cancellable = true)
private void onGetThunderStrength(float delta, CallbackInfoReturnable<Float> ci) {
    if (!this.isRemote) {
        ci.setReturnValue(this.getDarkness());
    }
}
 
开发者ID:Cybermaxke,项目名称:Weathers,代码行数:7,代码来源:MixinWorld.java

示例15: onGetRainStrength

import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; //导入方法依赖的package包/类
@Inject(method = "getRainStrength(F)F", at = @At("HEAD"), cancellable = true)
private void onGetRainStrength(float delta, CallbackInfoReturnable<Float> ci) {
    if (!this.isRemote) {
        ci.setReturnValue(this.getRainStrength());
    }
}
 
开发者ID:Cybermaxke,项目名称:Weathers,代码行数:7,代码来源:MixinWorld.java


注:本文中的org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable.setReturnValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。