示例#1
0
        public override void OnGameTick(float dt)
        {
            if (World.Side == EnumAppSide.Client)
            {
                talkUtil.OnGameTick(dt);
            }

            if (Api.Side == EnumAppSide.Server || (Api as ICoreClientAPI).World.Player.PlayerUID != PlayerUID)
            {
                updateEyeHeight(dt);
            }

            climateCondAccum += dt;
            if (World.Side == EnumAppSide.Client && climateCondAccum > 0.5f)
            {
                climateCondAccum = 0;
                selfClimateCond  = Api.World.BlockAccessor.GetClimateAt(Pos.XYZ.AsBlockPos);
            }

            if (!servercontrols.Sneak && !PrevFrameCanStandUp)
            {
                // So the sneak animation plays still
                servercontrols.Sneak = true;
                base.OnGameTick(dt);
                servercontrols.Sneak = false;
            }
            else
            {
                base.OnGameTick(dt);
            }
        }
示例#2
0
 public void SetLerped(ClimateCondition left, ClimateCondition right, float w)
 {
     Temperature   = left.Temperature * (1 - w) + right.Temperature * w;
     Rainfall      = left.Rainfall * (1 - w) + right.Rainfall * w;
     Fertility     = left.Fertility * (1 - w) + right.Fertility * w;
     ForestDensity = left.ForestDensity * (1 - w) + right.ForestDensity * w;
     ShrubDensity  = left.ShrubDensity * (1 - w) + right.ShrubDensity * w;
 }