Skip to content

Commit 7d51481

Browse files
committed
Remove Fishing Spot hotkey
This was mostly removed due to the mod being more focused on reporting bugs on MCC Island more easily. The Fishing Spot sharing hotkey was mostly a gameplay feature to help others in early testing. Since Fishing is no longer in a testing state, this feature will be removed and should be in another mod that focuses more on gameplay instead of reporting bugs, e.g. Island Utils (if they want to implement that feature).
1 parent 245876e commit 7d51481

File tree

3 files changed

+0
-71
lines changed

3 files changed

+0
-71
lines changed

src/main/kotlin/de/derniklaas/buildbugs/BugCreator.kt

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import de.derniklaas.buildbugs.utils.ServerState
55
import de.derniklaas.buildbugs.utils.Utils
66
import net.minecraft.client.MinecraftClient
77
import net.minecraft.client.util.Clipboard
8-
import net.minecraft.entity.decoration.DisplayEntity
98
import net.minecraft.util.math.BlockPos
10-
import net.minecraft.util.math.Box
119

1210
object BugCreator {
1311

@@ -55,62 +53,6 @@ object BugCreator {
5553
}
5654
}
5755

58-
fun shareFishingSpot() {
59-
val client = MinecraftClient.getInstance()
60-
val server = client.currentServerEntry ?: return
61-
val player = client.player ?: return
62-
63-
// Check if the player is connected to a server
64-
if (server.isLocal) {
65-
Utils.sendErrorMessage("You are not connected to a server.")
66-
return
67-
}
68-
69-
// Check if the player is connected to a MCC related server
70-
if (!Utils.isOnMCCServer()) {
71-
Utils.sendErrorMessage("You are not connected to a MCC related server.")
72-
return
73-
}
74-
75-
// Get the "area" of the player
76-
val area = gameState.getFancyName()
77-
val map = gameState.mapName
78-
79-
val fishHook = player.fishHook
80-
if (fishHook == null) {
81-
Utils.sendErrorMessage("You are not fishing.")
82-
return
83-
}
84-
val blockPos = fishHook.blockPos
85-
86-
val box = Box.of(blockPos.toCenterPos(), 6.0, 6.0, 6.0)
87-
val entities = player.world.getOtherEntities(null, box) { entity ->
88-
entity is DisplayEntity.TextDisplayEntity
89-
}
90-
91-
if (entities.isNotEmpty()) {
92-
val textDisplay = entities.first() as DisplayEntity.TextDisplayEntity
93-
val text = textDisplay.data!!.text.asTruncatedString(Int.MAX_VALUE)
94-
95-
val perks = text.split("\n").filter { it.contains("+") }.map { "+" + it.split("+")[1] }.joinToString(", ")
96-
if (perks.isNotEmpty()) {
97-
val minecraftMessage = getCopyMessage(area, map, blockPos).trim() + " $perks"
98-
Utils.sendMiniMessage(
99-
"<click:copy_to_clipboard:'${
100-
minecraftMessage.replace(
101-
"'", "\\\'"
102-
)
103-
}'>$minecraftMessage <yellow><bold>[CLICK TO COPY]</bold></yellow></click>", true
104-
)
105-
if (BuildBugsClientEntrypoint.config.copyToClipboard) {
106-
setClipboard(minecraftMessage)
107-
}
108-
return
109-
}
110-
}
111-
Utils.sendErrorMessage("Could not find a fishing spot.")
112-
}
113-
11456
/**
11557
* Updates [gameState] when a new packet is received.
11658
*/

src/main/kotlin/de/derniklaas/buildbugs/BuildBugsClientEntrypoint.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,10 @@ class BuildBugsClientEntrypoint : ClientModInitializer {
4040
)
4141
)
4242

43-
val shareFishingSpotKeybinding = KeyBindingHelper.registerKeyBinding(
44-
KeyBinding(
45-
"key.buildbugs.share_fishing_spot",
46-
InputUtil.Type.KEYSYM,
47-
GLFW.GLFW_KEY_J,
48-
"category.buildbugs"
49-
)
50-
)
51-
5243
ClientTickEvents.END_CLIENT_TICK.register {
5344
if (reportKeybinding.wasPressed()) {
5445
BugCreator.report()
5546
}
56-
if (shareFishingSpotKeybinding.wasPressed()) {
57-
BugCreator.shareFishingSpot()
58-
}
5947
if (bugreportKeybinding.wasPressed()) {
6048
if (!Utils.isOnMCCServer()) {
6149
Utils.sendErrorMessage("You are not connected to a MCC related server.")
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"key.buildbugs.report": "Generate a build bug report",
33
"key.buildbugs.bugreport": "Generate a /bugreport",
4-
"key.buildbugs.share_fishing_spot": "Share fishing spot",
54
"category.buildbugs": "#build-bugs"
65
}

0 commit comments

Comments
 (0)