本文整理汇总了Java中org.spongepowered.asm.mixin.injection.At类的典型用法代码示例。如果您正苦于以下问题:Java At类的具体用法?Java At怎么用?Java At使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
At类属于org.spongepowered.asm.mixin.injection包,在下文中一共展示了At类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBowFov
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@ModifyVariable(method = "getFovModifier", at = @At(value = "STORE", ordinal = 4))
private float getBowFov(float f) {
if (!PastOption.INVERTED_BOW.getValue())
return f;
int i = this.getItemInUseDuration();
float f1 = (float) i / 20.0F;
if (f1 > 1.0F)
f1 = 1.0F;
else
f1 = f1 * f1;
return this.cache * (1.0F + f1 * 0.15F);
}
示例2: onDrawScreen
import org.spongepowered.asm.mixin.injection.At; //导入依赖的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();
}
}
示例3: preUpdateWalkingPlayer
import org.spongepowered.asm.mixin.injection.At; //导入依赖的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());
}
}
}
示例4: initSplashText
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "initGui()V", at = @At("RETURN"), locals = LocalCapture.CAPTURE_FAILSOFT)
private void initSplashText(CallbackInfo callbackInfo, Calendar calendar) {
if (calendar.get(Calendar.MONTH) == Calendar.JUNE && calendar.get(Calendar.DAY_OF_MONTH) == 21)
this.splashText = "Happy Birthday Gogume1er!";
}
示例5: drawMinecraftVersion
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@ModifyArg(method = "drawScreen(IIF)V",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/gui/GuiMainMenu;drawString(Lnet/minecraft/client/gui/FontRenderer;Ljava/lang/String;III)V",
ordinal = 0))
private String drawMinecraftVersion(String minecraftVersion) {
return minecraftVersion + " - Past " + Past.getVersion();
}
示例6: loadFovModifierInCache
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "getFovModifier",
at = {
@At(value = "INVOKE",
target = "Lnet/minecraft/client/entity/AbstractClientPlayer;getEntityAttribute(Lnet/minecraft/entity/ai/attributes/IAttribute;)Lnet/minecraft/entity/ai/attributes/IAttributeInstance;",
shift = Shift.AFTER),
@At(value = "INVOKE",
target = "Lnet/minecraft/client/entity/AbstractClientPlayer;getItemInUseDuration()I",
shift = Shift.AFTER)
},
locals = LocalCapture.CAPTURE_FAILEXCEPTION)
private void loadFovModifierInCache(CallbackInfoReturnable<Float> callbackInfo, float f) {
this.cache = f;
}
示例7: loadCurrentPosition
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "renderItemInFirstPerson",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/item/ItemStack;getItemUseAction()Lnet/minecraft/item/EnumAction;"),
locals = LocalCapture.CAPTURE_FAILEXCEPTION)
private void loadCurrentPosition(float partialTicks, CallbackInfo callbackInfo, float f,
AbstractClientPlayer abstractClientPlayer, float f1) {
this.currentPosition = PastOption.OLD_BLOCKHIT.getValue() ? f1 : 0.0f;
}
示例8: loadPastResourcePack
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "refreshResources",
at = @At(value = "INVOKE",
target = "Ljava/util/List;addAll(Ljava/util/Collection;)Z",
ordinal = 0,
remap = false),
locals = LocalCapture.CAPTURE_FAILEXCEPTION)
private void loadPastResourcePack(CallbackInfo callbackInfo, List<IResourcePack> list) {
list.add(Past.getInstance().getResourcePack());
}
示例9: multiplyCriticalParticle
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "onCriticalHit",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/particle/EffectRenderer;emitParticleAtEntity(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/EnumParticleTypes;)V"))
private void multiplyCriticalParticle(Entity entityHit, CallbackInfo callbackInfo) {
for (int i = 0; i < PastOption.PARTICLE_MULTIPLIER.getValue().intValue() - 1; ++i)
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT);
}
示例10: multiplyEnchantmentParticle
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "onEnchantmentCritical",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/particle/EffectRenderer;emitParticleAtEntity(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/EnumParticleTypes;)V"))
private void multiplyEnchantmentParticle(Entity entityHit, CallbackInfo callbackInfo) {
for (int i = 0; i < PastOption.PARTICLE_MULTIPLIER.getValue().intValue() - 1; ++i)
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC);
}
示例11: initKeyBinding
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "<init>", at = @At("RETURN"))
private void initKeyBinding(CallbackInfo callbackInfo) {
keys.put(this.keyCode, this);
// This map is unused, but we can't just delete it :(
hash.clearMap();
}
示例12: actionPerformedPastButton
import org.spongepowered.asm.mixin.injection.At; //导入依赖的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();
}
}
示例13: preHandleEntityStatus
import org.spongepowered.asm.mixin.injection.At; //导入依赖的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();
}
示例14: postHandleEntityStatus
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "handleEntityStatus", at = @At("RETURN"))
private void postHandleEntityStatus(SPacketEntityStatus packet, CallbackInfo ci) {
if (mc.world == null)
return;
Entity entity = packet.getEntity(mc.world);
// noinspection ConstantConditions
if (entity == null)
return;
ClientAPI.EVENT_BUS.post(new EntityStatusEvent(EventState.POST, entity, packet.getOpCode()));
}
示例15: handleCombatEvent
import org.spongepowered.asm.mixin.injection.At; //导入依赖的package包/类
@Inject(method = "handleCombatEvent", at= @At(value = "INVOKE_ASSIGN", target = "net/minecraft/network/PacketThreadUtil.checkThreadAndEnqueue(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V"))
private void handleCombatEvent(SPacketCombatEvent event, CallbackInfo ci) {
if (mc.world == null)
return;
if (event.eventType == SPacketCombatEvent.Event.ENTITY_DIED) {
Entity died = mc.world.getEntityByID(event.playerId);
Entity killer = mc.world.getEntityByID(event.entityId);
// The entity that died should always be a player, this is just a safety measure.
// The killer isn't checked because in some cases it can be null.
if (died instanceof EntityPlayer)
ClientAPI.EVENT_BUS.post(new PlayerDeathEvent((EntityPlayer) died, (EntityLivingBase) killer));
}
}