Search in sources :

Example 1 with EntityWarg

use of com.lying.variousoddities.entity.mount.EntityWarg in project VariousOddities by Lyinginbedmon.

the class PacketSit method handle.

public static void handle(PacketSit msg, Supplier<NetworkEvent.Context> cxt) {
    NetworkEvent.Context context = cxt.get();
    if (context.getDirection().getReceptionSide().isServer()) {
        World world = context.getSender().getEntityWorld();
        PlayerEntity player = world.getPlayerByUuid(msg.playerID);
        if (player != null)
            if (player.getRidingEntity() != null && player.getRidingEntity().getType() == VOEntities.WARG) {
                EntityWarg warg = (EntityWarg) player.getRidingEntity();
                warg.func_233687_w_(msg.sitting);
            }
    }
    context.setPacketHandled(true);
}
Also used : NetworkEvent(net.minecraftforge.fml.network.NetworkEvent) World(net.minecraft.world.World) EntityWarg(com.lying.variousoddities.entity.mount.EntityWarg) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 2 with EntityWarg

use of com.lying.variousoddities.entity.mount.EntityWarg in project VariousOddities by Lyinginbedmon.

the class EntityWorg method func_241840_a.

public AgeableEntity func_241840_a(ServerWorld arg0, AgeableEntity arg1) {
    if (arg1.getType() == VOEntities.WORG) {
        EntityWorg worg2 = (EntityWorg) arg1;
        Genetics genesA = getGenetics();
        Genetics genesB = worg2.getGenetics();
        Genetics genesC = Genetics.cross(genesA, genesB, getRNG());
        AbstractGoblinWolf offspring;
        if (genesC.gene(6) == false && genesC.gene(7) == false) {
            EntityWarg warg = VOEntities.WARG.create(arg0);
            warg.setGenetics(genesC);
            offspring = warg;
        } else {
            EntityWorg worg = VOEntities.WORG.create(arg0);
            worg.setGenetics(genesC);
            offspring = worg;
        }
        offspring.setColor(getRNG().nextBoolean() ? getColor() : worg2.getColor());
        return offspring;
    }
    return null;
}
Also used : EntityWarg(com.lying.variousoddities.entity.mount.EntityWarg) AbstractGoblinWolf(com.lying.variousoddities.entity.AbstractGoblinWolf)

Aggregations

EntityWarg (com.lying.variousoddities.entity.mount.EntityWarg)2 AbstractGoblinWolf (com.lying.variousoddities.entity.AbstractGoblinWolf)1 PlayerEntity (net.minecraft.entity.player.PlayerEntity)1 World (net.minecraft.world.World)1 NetworkEvent (net.minecraftforge.fml.network.NetworkEvent)1