Compare commits

...

4 Commits

4 changed files with 356 additions and 330 deletions

View File

@@ -117,8 +117,20 @@ internal class CardRenderer(ICoreClientAPI api, Config config) : IDisposable
if (heldBag == null)
continue;
ItemStack[]? bagContents;
try
{
bagContents = heldBag.GetContents(bagStack, api.World);
}
catch
{
continue;
}
if (bagContents == null)
continue;
contents = [];
ItemStack[] bagContents = heldBag.GetContents(bagStack, api.World);
foreach (ItemStack contentStack in bagContents)
{
if (contentStack == null || contentStack.StackSize <= 0)

View File

@@ -14,7 +14,7 @@ namespace ChestPreview.Rendering;
internal class WorldBillboardPresenter(ICoreClientAPI api)
{
private const int multiblock_scan_radius = 2;
private static readonly float front_face_offset = 0.01f;
private static readonly float front_face_offset = 0.05f;
private readonly ICoreClientAPI api = api;
private readonly List<BillboardTarget> frameBillboards = [];
@@ -260,16 +260,16 @@ internal class WorldBillboardPresenter(ICoreClientAPI api)
switch (side.ToLowerInvariant())
{
case "north":
facing = new Vec3f(0f, 0f, -1f);
return true;
case "south":
facing = new Vec3f(0f, 0f, 1f);
return true;
case "south":
facing = new Vec3f(0f, 0f, -1f);
return true;
case "east":
facing = new Vec3f(1f, 0f, 0f);
facing = new Vec3f(-1f, 0f, 0f);
return true;
case "west":
facing = new Vec3f(-1f, 0f, 0f);
facing = new Vec3f(1f, 0f, 0f);
return true;
case "up":
facing = new Vec3f(0f, 1f, 0f);

View File

@@ -4,6 +4,9 @@
<TargetFramework>net8.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
<Configurations>Debug;Release;Version22</Configurations>
<VS_CONFIGLIB Condition="'$(VS_CONFIGLIB)' == ''">$([System.Environment]::GetEnvironmentVariable('VS_CONFIGLIB'))</VS_CONFIGLIB>
<ConfigLibAvailable Condition="'$(VS_CONFIGLIB)' != '' and Exists('$(VS_CONFIGLIB)')">true</ConfigLibAvailable>
<DefineConstants Condition="'$(ConfigLibAvailable)' == 'true'">$(DefineConstants);CONFIGLIB</DefineConstants>
</PropertyGroup>
<ItemGroup>
@@ -17,4 +20,15 @@
<HintPath>$(VINTAGE_STORY)/VintagestoryAPI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="configlib" Condition="'$(ConfigLibAvailable)' == 'true'">
<HintPath>$(VS_CONFIGLIB)</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<Target Name="WarnWithoutConfigLib" BeforeTargets="CoreCompile" Condition="'$(ConfigLibAvailable)' != 'true'">
<Warning Text="No VS_CONFIGLIB - will compile without supporting ConfigLib. Set VS_CONFIGLIB env var to a path that contains the configlib's dlls." />
</Target>
</Project>

0
ChestPreview/build.sh Normal file → Executable file
View File