Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ImToggle committed Apr 14, 2024
1 parent 478093c commit eff5f64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/org/polyfrost/crosshair/config/Drawer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ object Drawer : BasicOption(null, null, "", "", "", "", 2) {
importButton.setClickAction {
runAsync {
IOUtils.getImageFromClipboard()?.let {
notify("Importing crosshair from your clipboard.")
loadImage(it.toBufferedImage(), true)
}
}
Expand Down Expand Up @@ -185,14 +184,15 @@ object Drawer : BasicOption(null, null, "", "", "", "", 2) {
pixels[Utils.posToIndex(posX, posY)].color = c
}
}
notify("Crosshair imported")
if (save) Utils.save(loadedImage)
return loadedImage
}

fun saveFromDrawer(close: Boolean): OneImage? {
val image = OneImage(ModConfig.canvaSize, ModConfig.canvaSize)
if (ModConfig.drawer.isEmpty() && !close) {
notify("Crosshair cant be empty.")
notify("Crosshair can't be empty.")
return null
}
for (i in ModConfig.drawer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object CrosshairRenderer {

@SubscribeEvent
fun cancel(event: RenderGameOverlayEvent.Pre) {
if (event.type != RenderGameOverlayEvent.ElementType.CROSSHAIRS) return
if (event.type != RenderGameOverlayEvent.ElementType.CROSSHAIRS || !ModConfig.enabled) return
event.isCanceled = true
}

Expand Down Expand Up @@ -88,7 +88,7 @@ object CrosshairRenderer {
val entity = mc.pointedEntity ?: return WHITE
if (dynamicColor) {
if (hostile && entity is IMob) return hostileColor
if (passive && (entity is EntityAnimal || entity is EntityAmbientCreature || entity is EntityWaterMob)) return passiveColor
if (passive && (entity is EntityVillager || entity is EntityAnimal || entity is EntityAmbientCreature || entity is EntityWaterMob)) return passiveColor
if (player && entity is EntityPlayer) return playerColor
}
}
Expand Down

0 comments on commit eff5f64

Please sign in to comment.