Compare commits
2 Commits
e2115397fe
...
c4b7f6e78e
Author | SHA1 | Date | |
---|---|---|---|
c4b7f6e78e | |||
aac28a4704 |
@ -134,7 +134,7 @@ object AndroidResearchManager : SimpleJsonResourceReloadListener(GsonBuilder().s
|
|||||||
}
|
}
|
||||||
|
|
||||||
context.enqueueWork {
|
context.enqueueWork {
|
||||||
minecraft.player?.matteryPlayer?.reloadResearch(MINECRAFT_SERVER.registryAccess())
|
context.player().matteryPlayer.reloadResearch(context.player().registryAccess())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,12 +331,14 @@ object MatteryGUI {
|
|||||||
fun onLayerRenderEvent(event: RenderGuiLayerEvent.Pre) {
|
fun onLayerRenderEvent(event: RenderGuiLayerEvent.Pre) {
|
||||||
val gui = minecraft.gui
|
val gui = minecraft.gui
|
||||||
|
|
||||||
|
if (minecraft.gameMode?.canHurtPlayer() == true && !minecraft.options.hideGui) {
|
||||||
if (event.name == VanillaGuiLayers.FOOD_LEVEL || event.name == VanillaGuiLayers.AIR_LEVEL) {
|
if (event.name == VanillaGuiLayers.FOOD_LEVEL || event.name == VanillaGuiLayers.AIR_LEVEL) {
|
||||||
renderFoodAndAir(event, gui)
|
renderFoodAndAir(event, gui)
|
||||||
} else if (event.name == VanillaGuiLayers.PLAYER_HEALTH) {
|
} else if (event.name == VanillaGuiLayers.PLAYER_HEALTH) {
|
||||||
renderPlayerHealth(event, gui)
|
renderPlayerHealth(event, gui)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun renderShieldCooldownOverlay(graphics: GuiGraphics, font: Font, stack: ItemStack, x: Int, y: Int): Boolean {
|
fun renderShieldCooldownOverlay(graphics: GuiGraphics, font: Font, stack: ItemStack, x: Int, y: Int): Boolean {
|
||||||
if (!stack.isEmpty && stack.item is ShieldItem) {
|
if (!stack.isEmpty && stack.item is ShieldItem) {
|
||||||
|
@ -101,6 +101,7 @@ import ru.dbotthepony.mc.otm.core.writeComponent
|
|||||||
import ru.dbotthepony.mc.otm.core.writeItemType
|
import ru.dbotthepony.mc.otm.core.writeItemType
|
||||||
import ru.dbotthepony.mc.otm.matter.MatterManager.Finder
|
import ru.dbotthepony.mc.otm.matter.MatterManager.Finder
|
||||||
import ru.dbotthepony.mc.otm.milliTime
|
import ru.dbotthepony.mc.otm.milliTime
|
||||||
|
import ru.dbotthepony.mc.otm.onceServer
|
||||||
import ru.dbotthepony.mc.otm.registry.MDeferredRegister
|
import ru.dbotthepony.mc.otm.registry.MDeferredRegister
|
||||||
import ru.dbotthepony.mc.otm.registry.RegistryDelegate
|
import ru.dbotthepony.mc.otm.registry.RegistryDelegate
|
||||||
import ru.dbotthepony.mc.otm.secondTime
|
import ru.dbotthepony.mc.otm.secondTime
|
||||||
@ -1771,10 +1772,18 @@ object MatterManager {
|
|||||||
|
|
||||||
LOGGER.debug("Encoding matter registry packets took ${time.millis}ms, (${totalSize} bytes total, $compressedSize bytes compressed)")
|
LOGGER.debug("Encoding matter registry packets took ${time.millis}ms, (${totalSize} bytes total, $compressedSize bytes compressed)")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delay sending by one server tick;
|
||||||
|
* this way client is guaranteed to be in "PLAY" state, with local player present.
|
||||||
|
* This hack is required because we manually compressing and splitting packet between multiple payloads,
|
||||||
|
* hence it is impossible to "read" parsed data from network directly, using provided RegistryFriendlyByteBuf.
|
||||||
|
*/
|
||||||
|
onceServer {
|
||||||
for (chunk in chunks) {
|
for (chunk in chunks) {
|
||||||
distributor.invoke(chunk)
|
distributor.invoke(chunk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun playRegistryPackets(registry: RegistryAccess) {
|
private fun playRegistryPackets(registry: RegistryAccess) {
|
||||||
val time = SystemTime()
|
val time = SystemTime()
|
||||||
|
Loading…
Reference in New Issue
Block a user