mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Added custom behaviours for chicken disguises
This commit is contained in:
parent
2f455ae6a7
commit
9071742a4c
2 changed files with 20 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
||||||
|
package com.minelittlepony.unicopia.entity.behaviour;
|
||||||
|
|
||||||
|
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.passive.ChickenEntity;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
|
public class ChickenBehaviour extends EntityBehaviour<ChickenEntity> {
|
||||||
|
@Override
|
||||||
|
public void update(Caster<?> source, ChickenEntity entity) {
|
||||||
|
Entity src = source.getEntity();
|
||||||
|
Vec3d vel = src.getVelocity();
|
||||||
|
|
||||||
|
if (!src.isOnGround() && vel.y < 0) {
|
||||||
|
src.setVelocity(vel.multiply(1, 0.6, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,6 +39,7 @@ public abstract class EntityBehaviour<T extends Entity> {
|
||||||
static {
|
static {
|
||||||
register(ShulkerBehaviour::new, EntityType.SHULKER);
|
register(ShulkerBehaviour::new, EntityType.SHULKER);
|
||||||
register(CreeperBehaviour::new, EntityType.CREEPER);
|
register(CreeperBehaviour::new, EntityType.CREEPER);
|
||||||
|
register(ChickenBehaviour::new, EntityType.CHICKEN);
|
||||||
register(MinecartBehaviour::new, EntityType.CHEST_MINECART, EntityType.COMMAND_BLOCK_MINECART, EntityType.FURNACE_MINECART, EntityType.HOPPER_MINECART, EntityType.MINECART, EntityType.SPAWNER_MINECART, EntityType.TNT_MINECART);
|
register(MinecartBehaviour::new, EntityType.CHEST_MINECART, EntityType.COMMAND_BLOCK_MINECART, EntityType.FURNACE_MINECART, EntityType.HOPPER_MINECART, EntityType.MINECART, EntityType.SPAWNER_MINECART, EntityType.TNT_MINECART);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue