本文整理汇总了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();
}
}
示例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());
}
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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) {}
}
}