Search in sources :

Example 1 with JumpControl

use of net.minecraft.world.entity.ai.control.JumpControl in project Citizens2 by CitizensDev.

the class NMSImpl method setShouldJump.

@Override
public void setShouldJump(org.bukkit.entity.Entity entity) {
    Entity handle = NMSImpl.getHandle(entity);
    if (handle == null)
        return;
    if (handle instanceof Mob) {
        JumpControl controller = ((Mob) handle).getJumpControl();
        controller.jump();
    } else if (handle instanceof EntityHumanNPC) {
        ((EntityHumanNPC) handle).setShouldJump();
    }
}
Also used : CraftEntity(org.bukkit.craftbukkit.v1_17_R1.entity.CraftEntity) TrackedEntity(net.minecraft.server.level.ChunkMap.TrackedEntity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) Entity(net.minecraft.world.entity.Entity) LivingEntity(net.minecraft.world.entity.LivingEntity) Mob(net.minecraft.world.entity.Mob) JumpControl(net.minecraft.world.entity.ai.control.JumpControl) EntityHumanNPC(net.citizensnpcs.nms.v1_17_R1.entity.EntityHumanNPC)

Example 2 with JumpControl

use of net.minecraft.world.entity.ai.control.JumpControl in project Citizens2 by CitizensDev.

the class NMSImpl method setShouldJump.

@Override
public void setShouldJump(org.bukkit.entity.Entity entity) {
    Entity handle = NMSImpl.getHandle(entity);
    if (handle == null)
        return;
    if (handle instanceof Mob) {
        JumpControl controller = ((Mob) handle).getJumpControl();
        controller.jump();
    } else if (handle instanceof EntityHumanNPC) {
        ((EntityHumanNPC) handle).setShouldJump();
    }
}
Also used : TrackedEntity(net.minecraft.server.level.ChunkMap.TrackedEntity) FallingBlockEntity(net.minecraft.world.entity.item.FallingBlockEntity) SkinnableEntity(net.citizensnpcs.npc.skin.SkinnableEntity) Entity(net.minecraft.world.entity.Entity) CraftEntity(org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity) LivingEntity(net.minecraft.world.entity.LivingEntity) Mob(net.minecraft.world.entity.Mob) JumpControl(net.minecraft.world.entity.ai.control.JumpControl) EntityHumanNPC(net.citizensnpcs.nms.v1_18_R2.entity.EntityHumanNPC)

Example 3 with JumpControl

use of net.minecraft.world.entity.ai.control.JumpControl in project AlexsMobs by Alex-the-666.

the class EntityWarpedToad method switchNavigator.

private void switchNavigator(boolean onLand) {
    if (onLand) {
        this.jumpControl = new EntityWarpedToad.JumpHelperController(this);
        this.moveControl = new EntityWarpedToad.MoveHelperController(this);
        this.navigation = createNavigation(level);
        this.isLandNavigator = true;
    } else {
        this.jumpControl = new JumpControl(this);
        this.moveControl = new AquaticMoveController(this, 1.2F);
        this.navigation = new BoneSerpentPathNavigator(this, level);
        this.isLandNavigator = false;
    }
}
Also used : JumpControl(net.minecraft.world.entity.ai.control.JumpControl)

Aggregations

JumpControl (net.minecraft.world.entity.ai.control.JumpControl)3 SkinnableEntity (net.citizensnpcs.npc.skin.SkinnableEntity)2 TrackedEntity (net.minecraft.server.level.ChunkMap.TrackedEntity)2 Entity (net.minecraft.world.entity.Entity)2 LivingEntity (net.minecraft.world.entity.LivingEntity)2 Mob (net.minecraft.world.entity.Mob)2 EntityHumanNPC (net.citizensnpcs.nms.v1_17_R1.entity.EntityHumanNPC)1 EntityHumanNPC (net.citizensnpcs.nms.v1_18_R2.entity.EntityHumanNPC)1 FallingBlockEntity (net.minecraft.world.entity.item.FallingBlockEntity)1 CraftEntity (org.bukkit.craftbukkit.v1_17_R1.entity.CraftEntity)1 CraftEntity (org.bukkit.craftbukkit.v1_18_R2.entity.CraftEntity)1