aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-09 12:56:59 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-12-09 12:56:59 +0100
commite13a702f12a5b39fb1133972bef0d9ada1572315 (patch)
tree5f43083f394de69f98a7c077d2f16e5cddeb9ea3 /src
parent1c1c69f088036eb2e9f265c7e0c7fbcfb5d123b8 (diff)
downloadskyhanni-e13a702f12a5b39fb1133972bef0d9ada1572315.tar.gz
skyhanni-e13a702f12a5b39fb1133972bef0d9ada1572315.tar.bz2
skyhanni-e13a702f12a5b39fb1133972bef0d9ada1572315.zip
Correctly load plot names of locked plots from inventory.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt
index 64308abf1..f55f87c4c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenPlotAPI.kt
@@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
+import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern
import com.google.gson.annotations.Expose
import net.minecraft.util.AxisAlignedBB
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -17,7 +18,7 @@ import kotlin.math.floor
object GardenPlotAPI {
- private val pestNamePattern = "§aPlot §7- §b(?<name>.*)".toPattern()
+ private val plotNamePattern by RepoPattern.pattern("garden.plot.name", "§.Plot §7- §b(?<name>.*)")
var plots = listOf<Plot>()
@@ -96,7 +97,7 @@ object GardenPlotAPI {
for (plot in plots) {
val itemName = event.inventoryItems[plot.inventorySlot]?.name ?: continue
- pestNamePattern.matchMatcher(itemName) {
+ plotNamePattern.matchMatcher(itemName) {
plot.name = group("name")
}
}
@@ -104,7 +105,7 @@ object GardenPlotAPI {
fun getPlotByName(plotName: String) = plots.firstOrNull { it.name == plotName }
- fun LorenzRenderWorldEvent.renderPlot(plot: GardenPlotAPI.Plot, lineColor: Color, cornerColor: Color) {
+ fun LorenzRenderWorldEvent.renderPlot(plot: Plot, lineColor: Color, cornerColor: Color) {
// These don't refer to Minecraft chunks but rather garden plots, but I use
// the word chunk as the logic closely represents how chunk borders are rendered in latter mc versions