aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/ItemShopExporter.kt2
-rw-r--r--src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/NPCLocationExporter.kt12
2 files changed, 9 insertions, 5 deletions
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/ItemShopExporter.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/ItemShopExporter.kt
index 9cf98e25..b9bc32dd 100644
--- a/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/ItemShopExporter.kt
+++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/ItemShopExporter.kt
@@ -60,7 +60,7 @@ class ItemShopExporter : RepoExporter {
baseNPCJson["x"] = context.mc.thePlayer.posX.toInt()
baseNPCJson["y"] = context.mc.thePlayer.posY.toInt()
baseNPCJson["z"] = context.mc.thePlayer.posZ.toInt()
- baseNPCJson["island"] = SBInfo.getInstance().getLocation()
+ baseNPCJson["island"] = SBInfo.getInstance().getLocation() ?: "none"
val recipes = mutableListOf<ItemShopRecipe>()
for (slotNum in 0 until inventory.sizeInventory) {
diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/NPCLocationExporter.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/NPCLocationExporter.kt
index 9df738ca..2b8c99ff 100644
--- a/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/NPCLocationExporter.kt
+++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/recipes/generators/NPCLocationExporter.kt
@@ -126,6 +126,11 @@ class NPCLocationExporter {
@SubscribeEvent
fun onMouseClick(event: MouseEvent) {
if (event.buttonstate || event.button != 2 || !NotEnoughUpdates.INSTANCE.config.apiData.repositoryEditing) return
+ val location = SBInfo.getInstance().getLocation()
+ if (location == null) {
+ Utils.addChatMessage("No location found")
+ return
+ }
val pointedEntity = Minecraft.getMinecraft().pointedEntity
if (pointedEntity == null) {
Utils.addChatMessage("Could not find entity under cursor")
@@ -137,7 +142,7 @@ class NPCLocationExporter {
// Just use jerry pet skin, idk, this will probably cause texture packs to overwrite us, but uhhhhh uhhhhhhh
UUID.fromString("c9540683-51e4-3942-ad17-4f2c3f3ae4b7"),
pointedEntity.position,
- SBInfo.getInstance().getLocation(),
+ location,
"822d8e751c8f2fd4c8942c44bdb2f5ca4d8ae8e575ed3eb34c18a86e93b"
)
)
@@ -149,7 +154,7 @@ class NPCLocationExporter {
NPCNamePrompt(
pointedEntity.uniqueID,
pointedEntity.position,
- SBInfo.getInstance().getLocation(),
+ location,
pointedEntity.getCurrentArmor(3)?.takeIf { it.stackSize > 0 }
?: ItemUtils.createQuestionMarkSkull("")
)
@@ -161,12 +166,11 @@ class NPCLocationExporter {
}
val uuid = pointedEntity.uniqueID
val position = pointedEntity.position
- val island = SBInfo.getInstance().getLocation()
val skin = pointedEntity.locationSkin.resourcePath?.replace("skins/", "")
if (skin == null) {
Utils.addChatMessage("Could not load skin")
return
}
- Minecraft.getMinecraft().displayGuiScreen(NPCNamePrompt(uuid, position, island, skin))
+ Minecraft.getMinecraft().displayGuiScreen(NPCNamePrompt(uuid, position, location, skin))
}
}