net.minecraft.entity.passive.AbstractTraderEntity Java Examples

The following examples show how to use net.minecraft.entity.passive.AbstractTraderEntity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VillagerPonyModel.java    From MineLittlePony with MIT License 6 votes vote down vote up
@Override
public void setAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
    super.setAngles(entity, move, swing, ticks, headYaw, headPitch);

    boolean isHeadRolling = entity instanceof AbstractTraderEntity
            && ((AbstractTraderEntity)entity).getHeadRollingTimeLeft() > 0;

    if (isHeadRolling) {
        float roll = 0.3F * MathHelper.sin(0.45F * ticks);

        this.head.roll = roll;
        this.helmet.roll = roll;

        this.head.pitch = 0.4F;
        this.helmet.pitch = 0.4F;
    } else {
        this.head.roll = 0.0F;
        this.helmet.roll = 0.0F;
    }
}
 
Example #2
Source File: Protocol_1_14.java    From multiconnect with MIT License 4 votes vote down vote up
@Override
public boolean acceptEntityData(Class<? extends Entity> clazz, TrackedData<?> data) {
    if (clazz == AbstractTraderEntity.class && data == AbstractTraderEntityAccessor.getHeadRollingTimeLeft())
        return false;
    return super.acceptEntityData(clazz, data);
}
 
Example #3
Source File: VillagerEntity_wartFarmMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 4 votes vote down vote up
public VillagerEntity_wartFarmMixin(EntityType<? extends AbstractTraderEntity> entityType, World world)
{
    super(entityType, world);
}
 
Example #4
Source File: VillagerEntity_aiMixin.java    From fabric-carpet with MIT License 4 votes vote down vote up
public VillagerEntity_aiMixin(EntityType<? extends AbstractTraderEntity> entityType_1, World world_1)
{
    super(entityType_1, world_1);
}