mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 01:16:46 -04:00
general: improvements, fixes
This commit is contained in:
parent
b568fa7f07
commit
641d77f4fb
@ -274,7 +274,6 @@ class RenderWindow(
|
||||
Log.log(LogMessageType.RENDERING_LOADING) { "Starting loop" }
|
||||
var closed = false
|
||||
connection.registerEvent(CallbackEventInvoker.of<WindowCloseEvent> { closed = true })
|
||||
|
||||
while (true) {
|
||||
if (connection.wasConnected || closed) {
|
||||
break
|
||||
|
@ -274,9 +274,9 @@ class HotbarHealthElement(hudRenderer: HUDRenderer) : AbstractHotbarHealthElemen
|
||||
}
|
||||
|
||||
companion object {
|
||||
val POISON_TEXT_COLOR = "#602020".asColor()
|
||||
val WITHER_TEXT_COLOR = "#2b2b2b".asColor()
|
||||
val FROZEN_TEXT_COLOR = "#a8f7ff".asColor()
|
||||
val ABSORPTION_TEXT_COLOR = "#d4af37".asColor()
|
||||
private val POISON_TEXT_COLOR = "#602020".asColor()
|
||||
private val WITHER_TEXT_COLOR = "#2b2b2b".asColor()
|
||||
private val FROZEN_TEXT_COLOR = "#a8f7ff".asColor()
|
||||
private val ABSORPTION_TEXT_COLOR = "#d4af37".asColor()
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ package de.bixilon.minosoft.gui.rendering.gui.hud.elements.hotbar
|
||||
import de.bixilon.minosoft.data.entities.entities.LivingEntity
|
||||
import de.bixilon.minosoft.data.registries.effects.attributes.DefaultStatusEffectAttributeNames
|
||||
import de.bixilon.minosoft.data.text.ChatComponent
|
||||
import de.bixilon.minosoft.data.text.RGBColor.Companion.asColor
|
||||
import de.bixilon.minosoft.data.text.TextComponent
|
||||
import de.bixilon.minosoft.gui.rendering.gui.elements.Pollable
|
||||
import de.bixilon.minosoft.gui.rendering.gui.elements.primitive.ImageElement
|
||||
@ -101,4 +102,8 @@ class HotbarVehicleHealthElement(hudRenderer: HUDRenderer) : AbstractHotbarHealt
|
||||
override fun tick() {
|
||||
apply()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val NORMAL_TEXT_COLOR = "#da662c".asColor()
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Deprecated
|
||||
public class JavaBackport {
|
||||
/**
|
||||
* The maximum size of array to allocate.
|
||||
|
@ -23,6 +23,8 @@ import de.bixilon.minosoft.gui.rendering.system.base.PixelTypes
|
||||
import de.bixilon.minosoft.terminal.RunConfiguration
|
||||
import de.bixilon.minosoft.util.Util
|
||||
import de.bixilon.minosoft.util.task.pool.DefaultThreadPool
|
||||
import de.bixilon.minosoft.util.task.pool.ThreadPool
|
||||
import de.bixilon.minosoft.util.task.pool.ThreadPoolRunnable
|
||||
import glm_.vec2.Vec2i
|
||||
import java.awt.image.BufferedImage
|
||||
import java.io.File
|
||||
@ -49,7 +51,7 @@ class ScreenshotTaker(
|
||||
}
|
||||
}
|
||||
|
||||
DefaultThreadPool += {
|
||||
DefaultThreadPool += ThreadPoolRunnable(priority = ThreadPool.HIGHER) {
|
||||
try {
|
||||
val bufferedImage = BufferedImage(width, height, BufferedImage.TYPE_INT_RGB)
|
||||
|
||||
@ -97,7 +99,7 @@ class ScreenshotTaker(
|
||||
|
||||
private fun Throwable?.fail() {
|
||||
this?.printStackTrace()
|
||||
renderWindow.sendDebugMessage("§cFailed to make a screenshot!")
|
||||
renderWindow.sendDebugMessage("§cFailed to make a screenshot: ${this?.message}")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -99,7 +99,7 @@ open class InByteBuffer {
|
||||
}
|
||||
|
||||
fun readVelocity(): Vec3d {
|
||||
return Vec3d(readShort(), readShort(), readShort()) / ProtocolDefinition.VELOCITY_CONSTANT
|
||||
return Vec3d(readShort(), readShort(), readShort()) / ProtocolDefinition.VELOCITY_NETWORK_DIVIDER
|
||||
}
|
||||
|
||||
fun readInt(): Int {
|
||||
|
@ -90,7 +90,7 @@ public final class ProtocolDefinition {
|
||||
public static final float TICK_TIMEf = (float) TICK_TIME;
|
||||
public static final double TICK_TIMEd = TICK_TIME;
|
||||
|
||||
public static final float VELOCITY_CONSTANT = 8000.0f;
|
||||
public static final float VELOCITY_NETWORK_DIVIDER = 8000.0f;
|
||||
|
||||
public static final float GRAVITY = 32;
|
||||
public static final boolean FAST_MOVEMENT = true;
|
||||
|
@ -193,10 +193,12 @@ open class ThreadPool(
|
||||
}
|
||||
|
||||
companion object Priorities {
|
||||
const val HIGHEST = 500
|
||||
const val HIGHEST = Int.MAX_VALUE
|
||||
const val HIGHER = 500
|
||||
const val HIGH = 100
|
||||
const val NORMAL = 0
|
||||
const val LOW = -HIGH
|
||||
const val LOWEST = -HIGHEST
|
||||
const val LOWER = -HIGHER
|
||||
const val LOWEST = Int.MIN_VALUE
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user