Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BlockEntity/BECuckooClock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public override void RegisterRenderer(ICoreClientAPI capi)
capi.Event.RegisterRenderer(rendererCuckooClock =
new(capi, Pos), EnumRenderStage.Opaque);
rendererCuckooClock.MinuteTick += () => { if (!MuteSounds) TickSound?.Start(); };
rendererCuckooClock.HourTick += (_) => { if (!MuteSounds && rendererCuckoo.Cu) cuckooSound?.Start(); };
rendererCuckooClock.HourTick += (_) => { if (!MuteSounds && rendererCuckoo.TryCu()) cuckooSound?.Start(); };
}

public override void OnBlockRemoved()
Expand Down
9 changes: 1 addition & 8 deletions DecoClock.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- <TargetFramework>netstandard2.0</TargetFramework> -->
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net7</TargetFramework>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -17,11 +17,4 @@
<ItemGroup>
<PackageReference Include="Nullable" Version="1.3.1" />
</ItemGroup>

<ItemGroup>
<Folder Include="Assets\" />
<Folder Include="Mods\" />
<Folder Include="schematics\" />
<Folder Include="Releases\" />
</ItemGroup>
</Project>
9 changes: 5 additions & 4 deletions Mod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<PropertyGroup>
<Name>DecO'Clock</Name>
<ModId>decoclock</ModId>
<Version>0.9.4</Version>
<Version>0.10.0</Version>
<Authors>Svarozhich</Authors>
<GameVersion>1.20.0-rc.1</GameVersion>
<GameVersion>1.20.7</GameVersion>
<MinimalGameVersion>1.20.0</MinimalGameVersion>
<Description>Adds to the game several types of mechanical clocks showing the current game time</Description>
<NoLang>True</NoLang>
<NoLang>true</NoLang>
<Website></Website>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<IncludeFiles Include="modicon.png" />
<IncludeFiles Include="LICENSE" />
<IncludeFiles Include="README.md" />
Expand Down
9 changes: 8 additions & 1 deletion Render/CuckooRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ internal class CuckooRenderer(ICoreClientAPI capi, BlockPos pos) : IRenderer
float timeAnimation = 0;
public double RenderOrder => 0.5;
public int RenderRange => 24;
public bool Cu => cuckoo != null;

public void OnRenderFrame(float deltaTime, EnumRenderStage stage)
{
Expand Down Expand Up @@ -152,6 +151,14 @@ public void Update(MeshData? cuckoo, float cuckooDy, float cuckooDz,
}
}

public bool TryCu()
{
if (cuckoo == null)
return false;

cu = true;
return true;
}

public void Dispose()
{
Expand Down