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


Java CallbackInfo.cancel方法代码示例

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


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

示例1: onDrawScreen

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "drawScreen", at = @At("HEAD"), cancellable = true)
public void onDrawScreen(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
    Minecraft mc = Minecraft.getMinecraft();

    GuiScreen thisScreen = (GuiScreen) (Object) this;

    RenderGuiScreen renderGuiScreen = new RenderGuiScreen(thisScreen);
    EventManager.post(renderGuiScreen);

    if (renderGuiScreen.isCancelled()) {
        if (mc.currentScreen != null && mc.currentScreen != thisScreen) {
            mc.currentScreen.drawScreen(mouseX, mouseY, partialTicks);
        }
        ci.cancel();
    }

}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:18,代码来源:MixinGuiScreen.java

示例2: preUpdateWalkingPlayer

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "onUpdateWalkingPlayer()V", at = @At("HEAD"), cancellable = true)
public void preUpdateWalkingPlayer(CallbackInfo callbackInfo) {
    PlayerWalkingUpdate event = EventManager.post(new PlayerWalkingUpdate(this.rotationYaw, this.rotationPitch));

    _yaw = this.rotationYaw;
    _pitch = this.rotationPitch;

    if (event.isCancelled()) {
        callbackInfo.cancel();
    } else {
        if (event.getYaw() != _yaw || event.getPitch() != _pitch) {
            this.rotationYaw = wrapAngleTo180(event.getYaw());
            this.rotationPitch = wrapAngleTo180(event.getPitch());
        }
    }
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:17,代码来源:MixinEntityPlayerSP.java

示例3: onSetKeyBindState

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method="setKeyBindState", [email protected]("HEAD"), cancellable=true)
private static void onSetKeyBindState(int p_74510_0_, boolean p_74510_1_, CallbackInfo ci) {
	//methodhead

	// mod_controlpack
	// called on every mouse AND keyboard event (mouse button - 100 to avoid colliding numbers)
	if (ControlPackMain.instance.handleInputEvent(p_74510_0_, p_74510_1_)) {
		ci.cancel();
	}
	
	// mod_controlpack
	// ensure the correct keys are in the down state
	if (ControlPackMain.instance != null) {
		ControlPackMain.instance.resetPlayerKeyState();
	}
}
 
开发者ID:uyjulian,项目名称:ControlPack,代码行数:17,代码来源:MixinKeyBinding.java

示例4: actionPerformedPastButton

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "actionPerformed(Lnet/minecraft/client/gui/GuiButton;)V", at = @At("HEAD"), cancellable = true)
private void actionPerformedPastButton(GuiButton guiButton, CallbackInfo callbackInfo) {
    if (guiButton.enabled && guiButton.id == 2501) {
        Past.getInstance().getPastConfig().reloadConfig();
        this.mc.displayGuiScreen(new GuiPastSettings(this));
        callbackInfo.cancel();
    }
}
 
开发者ID:Gogume1er,项目名称:Past-Client,代码行数:9,代码来源:MixinGuiOptions.java

示例5: preHandleEntityStatus

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "handleEntityStatus", at = @At("HEAD"), cancellable = true)
private void preHandleEntityStatus(SPacketEntityStatus packet, CallbackInfo ci) {
    if (mc.world == null)
        return;

    Entity entity = packet.getEntity(mc.world);
    // noinspection ConstantConditions
    if (entity == null)
        return;

    EntityStatusEvent event = new EntityStatusEvent(EventState.PRE, entity, packet.getOpCode());
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:16,代码来源:MixinNetHandlerPlayClient.java

示例6: renderItemInFirstPerson

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "renderItemInFirstPerson(Lnet/minecraft/client/entity/AbstractClientPlayer;FFLnet/minecraft/util/EnumHand;FLnet/minecraft/item/ItemStack;F)V", at = @At("HEAD"), cancellable = true)
private void renderItemInFirstPerson(AbstractClientPlayer p_187457_1_, float p_187457_2_, float p_187457_3_, EnumHand p_187457_4_, float p_187457_5_, ItemStack p_187457_6_, float p_187457_7_, CallbackInfo ci) {
    ItemRenderEvent event = new ItemRenderEvent((ItemRenderer) (Object) this, p_187457_2_, p_187457_4_, p_187457_5_, p_187457_6_, p_187457_7_);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinItemRenderer.java

示例7: renderEffect

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "renderEffect", at = @At("HEAD"), cancellable = true)
private void renderEffect(IBakedModel model, CallbackInfo ci) {
    GlintEffectEvent event = new GlintEffectEvent(GlintEffectEvent.GlintTarget.ITEM);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinRenderItem.java

示例8: renderLivingLabel

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "renderLivingLabel", at = @At("HEAD"), cancellable = true)
private void renderLivingLabel(Entity entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) {
    RenderEntityLabelEvent event = new RenderEntityLabelEvent(entityIn, str);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinRender.java

示例9: preJump

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "jump", at = @At("HEAD"), cancellable = true)
private void preJump(CallbackInfo ci) {
    EntityJumpEvent event = new EntityJumpEvent(EventState.PRE, (EntityLivingBase) (Object) this);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinEntityLivingBase.java

示例10: applyEntityCollision

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

示例11: shutdown

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "shutdown", at = @At("HEAD"), cancellable = true)
private void shutdown(CallbackInfo ci) {
    GameShutdownEvent event = new GameShutdownEvent();
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinMinecraft.java

示例12: renderEnchantedGlint

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "renderEnchantedGlint", at = @At("HEAD"), cancellable = true)
private static void renderEnchantedGlint(RenderLivingBase<?> p_188364_0_, EntityLivingBase p_188364_1_, ModelBase model, float p_188364_3_, float p_188364_4_, float p_188364_5_, float p_188364_6_, float p_188364_7_, float p_188364_8_, float p_188364_9_, CallbackInfo ci) {
    GlintEffectEvent event = new GlintEffectEvent(GlintEffectEvent.GlintTarget.ARMOR);
    ClientAPI.EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:8,代码来源:MixinLayerArmorBase.java

示例13: onLoginEncryptionRequest

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
/**
 * Hook for EncryptionRequestEvent
 *
 * @see EncryptionRequestEvent
 */
@Inject(method = "handleEncryptionRequest", at = @At("HEAD"), cancellable = true)
private void onLoginEncryptionRequest(SPacketEncryptionRequest packet, CallbackInfo ci) {
    EncryptionRequestEvent event = new EncryptionRequestEvent((NetHandlerLoginClient) (Object) this, packet);
    EVENT_BUS.post(event);
    if (event.isCancelled())
        ci.cancel();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:13,代码来源:MixinNetHandlerLoginClient.java

示例14: onRenderHand

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "renderHand(FI)V", at = @At("HEAD"), cancellable = true)
public void onRenderHand(float partialTicks, int xOffset, CallbackInfo callbackInfo) {
    if (isShadowPass != null) {
        try {
            isShadowPass.setBoolean(null, false);
        } catch (IllegalAccessException ignored) {
        }
    }

    GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
    GL11.glPushMatrix();

    EventManager.post(new RenderWorld(partialTicks));

    GL11.glColor4d(1, 1, 1, 1);
    if (mc.gameSettings.viewBobbing) {
        mc.gameSettings.viewBobbing = false;
        GL11.glPushMatrix();
        setupCameraTransform(partialTicks, 2);
        EventManager.post(new RenderWorldBobbing(partialTicks));
        setupCameraTransform(partialTicks, 2);
        GL11.glPopMatrix();
        mc.gameSettings.viewBobbing = true;
    } else {
        EventManager.post(new RenderWorldBobbing(partialTicks));
    }

    GL11.glColor4d(1, 1, 1, 1);

    GL11.glPopMatrix();
    GL11.glPopAttrib();

    if (EventManager.post(new RenderHand()).isCancelled()) {
        callbackInfo.cancel();
    }
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:37,代码来源:MixinEntityRenderer.java

示例15: onPassSpecialRender

import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; //导入方法依赖的package包/类
@Inject(method = "passSpecialRender", at = @At("HEAD"), cancellable = true)
public void onPassSpecialRender(EntityLivingBase entitylivingbaseIn, double x, double y, double z, CallbackInfo callbackInfo) {
    if (entitylivingbaseIn instanceof EntityPlayer) {
        try {
            if (Serenity.getInstance().getModuleManager().getModule(NameTags.class).isEnabled())
                callbackInfo.cancel();
        } catch (Exception ignored) {}
    }
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:10,代码来源:MixinRendererLivingEntity.java


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