From a8acc04a8011006d338ac3743d26aa7d569289f7 Mon Sep 17 00:00:00 2001 From: VintageStory CI Date: Sat, 18 Jan 2025 16:12:32 +0000 Subject: [PATCH] Updated to Version 1.20.1 --- BlockEntity/BEIngotMold.cs | 18 ++++++++++++------ Systems/LocatorMaps/ItemLocatorMap.cs | 2 +- .../ChunkGen/2.GenRockStrata/GenRockStrata.cs | 11 ++++++++++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/BlockEntity/BEIngotMold.cs b/BlockEntity/BEIngotMold.cs index 6e8289cc..adff6503 100644 --- a/BlockEntity/BEIngotMold.cs +++ b/BlockEntity/BEIngotMold.cs @@ -191,9 +191,12 @@ public ItemStack GetStateAwareContentsLeft() return GetShatteredStack(ContentsLeft, FillLevelLeft); } - ItemStack outstack = ContentsLeft.Clone(); - (outstack.Attributes["temperature"] as ITreeAttribute)?.RemoveAttribute("cooldownSpeed"); - return outstack; + if (TemperatureLeft < 300) + { + ItemStack outstack = ContentsLeft.Clone(); + (outstack.Attributes["temperature"] as ITreeAttribute)?.RemoveAttribute("cooldownSpeed"); + return outstack; + } } return null; @@ -212,9 +215,12 @@ public ItemStack GetStateAwareContentsRight() return GetShatteredStack(ContentsRight, FillLevelRight); } - ItemStack outstack = ContentsRight.Clone(); - (outstack.Attributes["temperature"] as ITreeAttribute)?.RemoveAttribute("cooldownSpeed"); - return outstack; + if (TemperatureRight < 300) + { + ItemStack outstack = ContentsRight.Clone(); + (outstack.Attributes["temperature"] as ITreeAttribute)?.RemoveAttribute("cooldownSpeed"); + return outstack; + } } return null; diff --git a/Systems/LocatorMaps/ItemLocatorMap.cs b/Systems/LocatorMaps/ItemLocatorMap.cs index be252211..f7e29a9c 100644 --- a/Systems/LocatorMaps/ItemLocatorMap.cs +++ b/Systems/LocatorMaps/ItemLocatorMap.cs @@ -87,7 +87,7 @@ public override void OnHeldInteractStart(ItemSlot slot, EntityAgent byEntity, Bl } catch (Exception e) { - api.Logger.Error("ItemLocatorMap attr: " + attr.ToJsonToken()); + api.Logger.Error("ItemLocatorMap attr: " + attr.ToJsonToken().Replace("{","{{").Replace("}","}}")); api.Logger.Error(e); } } diff --git a/Systems/WorldGen/Standard/ChunkGen/2.GenRockStrata/GenRockStrata.cs b/Systems/WorldGen/Standard/ChunkGen/2.GenRockStrata/GenRockStrata.cs index 0942cd80..a1d9b1d9 100644 --- a/Systems/WorldGen/Standard/ChunkGen/2.GenRockStrata/GenRockStrata.cs +++ b/Systems/WorldGen/Standard/ChunkGen/2.GenRockStrata/GenRockStrata.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Runtime.Intrinsics.Arm; using Vintagestory.API.Common; using Vintagestory.API.Datastructures; using Vintagestory.API.MathTools; @@ -243,7 +244,15 @@ public void genBlockColumn(IServerChunk[] chunks, int chunkX, int chunkZ, int lx float allowedThickness = rockGroupMaxThickness[grp] * thicknessDistort - rockGroupCurrentThickness[grp]; - strataThickness = Math.Min(allowedThickness, rockMap.GetIntLerpedCorrectly(rdx * step + step * (float)(lx + distx) / chunksize, rdz * step + step * (float)(lz + distz) / chunksize)); + var nx = rdx * step + step * (float)(lx + distx) / chunksize; + var nz = rdz * step + step * (float)(lz + distz) / chunksize; + + // 1.20 fix, only clamp the values, to prevent chunk borders + // In 1.21 we ought to simply use normalized noise * rockmapsize + nx = Math.Max(nx, -1.499f); + nz = Math.Max(nz, -1.499f); + + strataThickness = Math.Min(allowedThickness, rockMap.GetIntLerpedCorrectly(nx, nz)); if (stratum.RockGroup == EnumRockGroup.Sedimentary) strataThickness -= Math.Max(0, yupper - TerraGenConfig.seaLevel) * 0.5f;