Начинающий
Начинающий
- Статус
- Онлайн
- Регистрация
- 24 Сен 2024
- Сообщения
- 105
- Реакции
- 0
помогите, я не понимаю че не так у меня с кодом, я пытаюсь перенести с excellent omni слитый флай под грим, и я вообще не ебу че у меня не так но оно не работает и флагается
исходник:
JavaScript:
package zenith.zov.client.modules.impl.movement;
import com.darkmagician6.eventapi.EventTarget;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import zenith.zov.base.events.impl.player.EventUpdate;
import zenith.zov.client.modules.api.Category;
import zenith.zov.client.modules.api.Module;
import zenith.zov.client.modules.api.ModuleAnnotation;
import zenith.zov.utility.game.player.PlayerIntersectionUtil;
@ModuleAnnotation(name = "ElytrFly", category = Category.MOVEMENT, description = "Взлетает вверх с элитрой (HW)")
public final class ElytrFly extends Module {
public static final ElytrFly INSTANCE = new ElytrFly();
private ElytrFly() {}
@EventTarget
public void onTick(EventUpdate e) {
ItemStack chest = mc.player.getEquippedStack(EquipmentSlot.CHEST);
if (!chest.getItem().equals(Items.ELYTRA)) return;
boolean usable = !chest.isDamageable() || chest.getDamage() < chest.getMaxDamage() - 1;
if (mc.player.isOnGround()) {
mc.options.jumpKey.setPressed(true);
mc.player.setVelocity(mc.player.getVelocity().x, 0.42f, mc.player.getVelocity().z);
mc.player.setPitch(-90.0f);
} else if (usable && !mc.player.isGliding()) {
PlayerIntersectionUtil.startFallFlying();
mc.player.setVelocity(mc.player.getVelocity().x, 0.5f, mc.player.getVelocity().z);
mc.player.setPitch(-90.0f);
}
mc.player.setPitch(0.0f);
if (!mc.player.isOnGround()) {
mc.player.setVelocity(mc.player.getVelocity().x, 0.36f, mc.player.getVelocity().z);
}
}
}
исходник:
JavaScript:
package org.san1na.comet.client.impl.feature.impl.movement;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ElytraItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.network.play.client.CEntityActionPacket;
import org.lwjgl.glfw.GLFW;
import org.san1na.common.events.orbit.EventHandler;
import org.san1na.comet.client.events.player.UpdateEvent;
import org.san1na.comet.client.impl.feature.Category;
import org.san1na.comet.client.impl.feature.Feature;
import org.san1na.comet.client.impl.feature.FeatureInfo;
@FeatureInfo(name = "HwElytraFly", description = "Взлетает в верх используя элитру на сервере holyworld", category = Category.MOVEMENT, key = GLFW.GLFW_KEY_UNKNOWN)
@Getter
@Accessors(fluent = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
public class HwElytraFly extends Feature {
ItemStack currentStack = ItemStack.EMPTY;
@Override
public void onEnable() {
this.currentStack = ItemStack.EMPTY;
super.onEnable();
}
@Override
public void onDisable() {
super.onDisable();
}
@EventHandler
private void onUpdate(UpdateEvent event) {
handleFlyUpMode();
}
private void handleFlyUpMode() {
currentStack = mc.player.getItemStackFromSlot(EquipmentSlotType.CHEST);
if (currentStack.getItem() != Items.ELYTRA) {
return;
}
if (mc.player.isOnGround()) {
// Бля, взлетает на земле короч
mc.player.jump();
mc.player.motion.y = 0.42f;
mc.player.rotationPitchHead = -90.0f;
} else if (ElytraItem.isUsable(currentStack) && !mc.player.isElytraFlying()) {
// НАчинается магия 0_0
mc.player.startFallFlying();
mc.player.connection.sendPacket(new CEntityActionPacket(mc.player, CEntityActionPacket.Action.START_FALL_FLYING));
mc.player.motion.y = 0.5f;
mc.player.rotationPitchHead = -90.0f;
}
mc.player.rotationPitch = 0.0f;
if (!mc.player.isOnGround()) {
mc.player.motion.y = 0.36f;
}
}
}