aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2023-01-11 21:03:50 +0100
committernea <romangraef@gmail.com>2023-01-11 21:03:50 +0100
commite87a8136ec9e980f9ea735a45685a6e0c71adf1f (patch)
treed29a7cdb11ecd0f8b7e34350943d0afd0d99039f
parent7661313838f40510235796e44cb8194b644423ee (diff)
downloadAmbientAddons-e87a8136ec9e980f9ea735a45685a6e0c71adf1f.tar.gz
AmbientAddons-e87a8136ec9e980f9ea735a45685a6e0c71adf1f.tar.bz2
AmbientAddons-e87a8136ec9e980f9ea735a45685a6e0c71adf1f.zip
Change glass colors, allow bypassing and hook up config option in Melody
-rw-r--r--src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt b/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt
index fbe60b0..0d1f62d 100644
--- a/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt
+++ b/src/main/kotlin/com/ambientaddons/features/dungeon/terminals/MelodyHelper.kt
@@ -7,6 +7,7 @@ import com.ambientaddons.utils.Extensions.chest
import com.ambientaddons.utils.Extensions.items
import com.ambientaddons.utils.Extensions.stripControlCodes
import com.ambientaddons.utils.SBLocation
+import net.minecraft.item.EnumDyeColor
import net.minecraftforge.client.event.ClientChatReceivedEvent
import net.minecraftforge.client.event.GuiOpenEvent
import net.minecraftforge.event.world.WorldEvent
@@ -56,18 +57,20 @@ object MelodyHelper {
@SubscribeEvent
fun onSlotClick(event: GuiContainerEvent.SlotClickEvent) {
+ if (!config.melodyBlockMisclicks) return
+ if (event.button != 0) return // Only block left clicks (bypass with right click)
if (SBLocation.dungeonFloor?.floor != 7) return
val chest = event.gui.chest?.lowerChestInventory
if (chest?.name != "Click the button on time!" || isThrottled) return
val colors = chest.items.map { it?.itemDamage }
- val targetPaneCol = colors.indexOf(10)
- val movingPaneIndex = colors.indexOf(5)
+ val targetPaneCol = colors.indexOf(EnumDyeColor.MAGENTA.dyeDamage)
+ val movingPaneIndex = colors.indexOf(EnumDyeColor.LIME.dyeDamage)
val movingPaneCol = movingPaneIndex % 9
val clickSlot = (movingPaneIndex / 9) * 9 + 7
if (targetPaneCol != movingPaneCol) {
event.isCanceled = true
mc.thePlayer.playSound("random.pop", 1f, 0f)
- } else if (clickSlot != event.slot?.slotIndex){
+ } else if (clickSlot != event.slot?.slotIndex) {
event.isCanceled = true
mc.thePlayer.playSound("random.pop", 1f, 10f)
}