Search in sources :

Example 11 with FishingBobberEntity

use of net.minecraft.entity.projectile.FishingBobberEntity in project Magma-1.16.x by magmafoundation.

the class CraftFishHook method setMinWaitTime.

@Override
public void setMinWaitTime(int minWaitTime) {
    FishingBobberEntity hook = getHandle();
    Validate.isTrue(minWaitTime >= 0 && minWaitTime <= this.getMaxWaitTime(), "The minimum wait time should be between 0 and the maximum wait time.");
    hook.minWaitTime = minWaitTime;
}
Also used : FishingBobberEntity(net.minecraft.entity.projectile.FishingBobberEntity)

Example 12 with FishingBobberEntity

use of net.minecraft.entity.projectile.FishingBobberEntity in project Magma-1.16.x by magmafoundation.

the class CraftFishHook method pullHookedEntity.

@Override
public boolean pullHookedEntity() {
    FishingBobberEntity hook = getHandle();
    if (hook.hookedIn == null) {
        return false;
    }
    hook.bringInHookedEntity();
    return true;
}
Also used : FishingBobberEntity(net.minecraft.entity.projectile.FishingBobberEntity)

Example 13 with FishingBobberEntity

use of net.minecraft.entity.projectile.FishingBobberEntity in project Magma-1.16.x by magmafoundation.

the class CraftFishHook method setHookedEntity.

@Override
public void setHookedEntity(Entity entity) {
    FishingBobberEntity hook = getHandle();
    hook.hookedIn = (entity != null) ? ((CraftEntity) entity).getHandle() : null;
    hook.getEntityData().set(FishingBobberEntity.DATA_HOOKED_ENTITY, hook.hookedIn != null ? hook.hookedIn.getId() + 1 : 0);
}
Also used : FishingBobberEntity(net.minecraft.entity.projectile.FishingBobberEntity)

Example 14 with FishingBobberEntity

use of net.minecraft.entity.projectile.FishingBobberEntity in project LoliServer by Loli-Server.

the class CraftFishHook method setHookedEntity.

@Override
public void setHookedEntity(Entity entity) {
    FishingBobberEntity hook = getHandle();
    hook.hookedIn = (entity != null) ? ((CraftEntity) entity).getHandle() : null;
    hook.getEntityData().set(FishingBobberEntity.DATA_HOOKED_ENTITY, hook.hookedIn != null ? hook.hookedIn.getId() + 1 : 0);
}
Also used : FishingBobberEntity(net.minecraft.entity.projectile.FishingBobberEntity)

Aggregations

FishingBobberEntity (net.minecraft.entity.projectile.FishingBobberEntity)14 FishHook (org.bukkit.entity.FishHook)3 EntityBridge (io.izzel.arclight.common.bridge.entity.EntityBridge)2 ServerPlayerEntityBridge (io.izzel.arclight.common.bridge.entity.player.ServerPlayerEntityBridge)2 SoundInstance (net.minecraft.client.sound.SoundInstance)2 EnderPearlEntity (net.minecraft.entity.item.EnderPearlEntity)2 ExperienceBottleEntity (net.minecraft.entity.item.ExperienceBottleEntity)2 PlayerEntity (net.minecraft.entity.player.PlayerEntity)2 AbstractArrowEntity (net.minecraft.entity.projectile.AbstractArrowEntity)2 ArrowEntity (net.minecraft.entity.projectile.ArrowEntity)2 DamagingProjectileEntity (net.minecraft.entity.projectile.DamagingProjectileEntity)2 DragonFireballEntity (net.minecraft.entity.projectile.DragonFireballEntity)2 EggEntity (net.minecraft.entity.projectile.EggEntity)2 FireballEntity (net.minecraft.entity.projectile.FireballEntity)2 FireworkRocketEntity (net.minecraft.entity.projectile.FireworkRocketEntity)2 LlamaSpitEntity (net.minecraft.entity.projectile.LlamaSpitEntity)2 PotionEntity (net.minecraft.entity.projectile.PotionEntity)2 ShulkerBulletEntity (net.minecraft.entity.projectile.ShulkerBulletEntity)2 SmallFireballEntity (net.minecraft.entity.projectile.SmallFireballEntity)2 SnowballEntity (net.minecraft.entity.projectile.SnowballEntity)2