Skip to content

Commit

Permalink
Version 1.3.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
EssentialGGBot committed Dec 3, 2024
1 parent 6ac78fc commit d6adc05
Show file tree
Hide file tree
Showing 86 changed files with 1,159 additions and 808 deletions.
14 changes: 7 additions & 7 deletions api/api/api.api
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,13 @@ public abstract interface class gg/essential/api/utils/GuiUtil {
public abstract fun openScreen (Lnet/minecraft/client/gui/screens/Screen;)V
@1.17.1-forge,1.18.2-forge,1.19.2-forge,1.19.3-forge,1.19.4-forge,1.20.1-forge,1.20.2-forge,1.20.4-forge
public abstract fun openedScreen ()Lnet/minecraft/client/gui/screens/Screen;
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric,1.21.4-fabric
public static fun getOpenedScreen ()Lnet/minecraft/client/gui/screen/Screen;
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric,1.21.4-fabric
public static fun open (Lnet/minecraft/client/gui/screen/Screen;)V
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric,1.21.4-fabric
public abstract fun openScreen (Lnet/minecraft/client/gui/screen/Screen;)V
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric,1.21.4-fabric
public abstract fun openedScreen ()Lnet/minecraft/client/gui/screen/Screen;
@1.12.2-forge,1.8.9-forge
public static fun getOpenedScreen ()Lnet/minecraft/client/gui/GuiScreen;
Expand All @@ -446,9 +446,9 @@ public final class gg/essential/api/utils/GuiUtil$Companion {
public final fun getOpenedScreen ()Lnet/minecraft/client/gui/screens/Screen;
@1.17.1-forge,1.18.2-forge,1.19.2-forge,1.19.3-forge,1.19.4-forge,1.20.1-forge,1.20.2-forge,1.20.4-forge
public final fun open (Lnet/minecraft/client/gui/screens/Screen;)V
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric,1.21.4-fabric
public final fun getOpenedScreen ()Lnet/minecraft/client/gui/screen/Screen;
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric
@1.16.2-fabric,1.16.2-forge,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric,1.21.4-fabric
public final fun open (Lnet/minecraft/client/gui/screen/Screen;)V
@1.12.2-forge,1.8.9-forge
public final fun getOpenedScreen ()Lnet/minecraft/client/gui/GuiScreen;
Expand Down Expand Up @@ -512,7 +512,7 @@ public final class gg/essential/api/utils/KotlinAdapter : net/minecraftforge/fml
public abstract interface class gg/essential/api/utils/MinecraftUtils {
@1.17.1-forge,1.18.2-forge,1.19.2-forge,1.19.3-forge,1.19.4-forge,1.20.1-forge,1.20.2-forge,1.20.4-forge
public abstract fun getResourceImage (Lnet/minecraft/resources/ResourceLocation;)Ljava/awt/image/BufferedImage;
@1.16.2-fabric,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric
@1.16.2-fabric,1.17.1-fabric,1.18.1-fabric,1.18.2-fabric,1.19-fabric,1.19.2-fabric,1.19.3-fabric,1.19.4-fabric,1.20-fabric,1.20.1-fabric,1.20.2-fabric,1.20.4-fabric,1.20.6-fabric,1.21-fabric,1.21.2-fabric,1.21.4-fabric
public abstract fun getResourceImage (Lnet/minecraft/util/Identifier;)Ljava/awt/image/BufferedImage;
@1.12.2-forge,1.16.2-forge,1.8.9-forge
public abstract fun getResourceImage (Lnet/minecraft/util/ResourceLocation;)Ljava/awt/image/BufferedImage;
Expand Down
1 change: 1 addition & 0 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dependencies {

// Core Gui Libraries
val ucMcVersion = when (platform.mcVersion) {
12104 -> "1.21.2"
11802 -> "1.18.1"
else -> mcVersionStr
}
Expand Down
2 changes: 2 additions & 0 deletions build-logic/src/main/kotlin/essential/preprocessor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fun Project.configurePreprocessTree(versions: File) {
configure<RootPreprocessExtension> {
strictExtraMappings.set(true)

val fabric12104 = createNode("1.21.4-fabric", 12104, "yarn")
val fabric12102 = createNode("1.21.2-fabric", 12102, "yarn")
val fabric12100 = createNode("1.21-fabric", 12100, "yarn")
val fabric12006 = createNode("1.20.6-fabric", 12006, "yarn")
Expand Down Expand Up @@ -47,6 +48,7 @@ fun Project.configurePreprocessTree(versions: File) {
val forge11202 = createNode("1.12.2-forge", 11202, "srg")
val forge10809 = createNode("1.8.9-forge", 10809, "srg")

fabric12104.link(fabric12102, versions.resolve("1.21.4-1.21.2.txt"))
fabric12102.link(fabric12100)
fabric12100.link(fabric12006)
fabric12006.link(fabric12004)
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ dependencies {
12006 -> "0.97.8+1.20.6"
12100 -> "0.99.2+1.21"
12102 -> "0.106.0+1.21.2"
12104 -> "0.110.0+1.21.4"
else -> error("No fabric API version configured!")
}
include(modImplementation(fabricApi.module("fabric-api-base", fapiVersion))!!)
Expand Down
14 changes: 14 additions & 0 deletions changelog/release-1.3.5.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Title: Bug Patch
Summary: Minor bug fixes

## New Versions
- Added support for 1.21.4 Fabric

## Bug Fixes
- Fixed some emotes not playing properly when cosmetics are disabled in the Essential settings
- Fixed some particles being unaffected by the "Show cosmetics" setting
- Fixed Essential nametag indicator not showing when sneaking on Minecraft 1.21.2 and newer
- Fixed Wardrobe mute / unmute button showing even for emotes which do not have sound

## Compatibility
- Fixed not being able to join friends with ViaFabricPlus
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
essential.defaults.loom=0
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.16.7
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.16.9
kotlin.stdlib.default.dependency=false
org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.parallel.threads=128
org.gradle.jvmargs=-Xmx16G
minecraftVersion=11202
version=1.3.5.3
version=1.3.5.4
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,18 @@
package gg.essential.network.connectionmanager.cosmetics

import com.google.common.collect.ImmutableMap
import com.google.common.collect.MapMaker
import gg.essential.config.EssentialConfig
import gg.essential.connectionmanager.common.packet.cosmetic.ServerCosmeticPlayerSettingsPacket
import gg.essential.connectionmanager.common.packet.cosmetic.ServerCosmeticsUserEquippedPacket
import gg.essential.connectionmanager.common.packet.cosmetic.outfit.ClientCosmeticOutfitSelectedRequestPacket
import gg.essential.connectionmanager.common.packet.cosmetic.outfit.ServerCosmeticOutfitSelectedResponsePacket
import gg.essential.cosmetics.EquippedCosmetic
import gg.essential.elementa.state.v2.ReferenceHolder
import gg.essential.gui.elementa.state.v2.MutableState
import gg.essential.gui.elementa.state.v2.ReferenceHolderImpl
import gg.essential.gui.elementa.state.v2.State
import gg.essential.gui.elementa.state.v2.mutableStateOf
import gg.essential.mod.Model
import gg.essential.mod.Skin
import gg.essential.mod.cosmetics.CAPE_DISABLED_COSMETIC_ID
Expand Down Expand Up @@ -47,6 +51,8 @@ class EquippedCosmeticsManager(
private val refHolder: ReferenceHolder = ReferenceHolderImpl()
private val equippedCosmetics: MutableMap<UUID, Map<CosmeticSlot, String>> = mutableMapOf()
private val visibleCosmetics: MutableMap<UUID, ImmutableMap<CosmeticSlot, EquippedCosmetic>> = mutableMapOf()
private val visibleCosmeticsStates: MutableMap<UUID, MutableState<Map<CosmeticSlot, EquippedCosmetic>>> =
MapMaker().weakValues().makeMap()
private val cosmeticSettings: MutableMap<UUID, Map<String, List<CosmeticSetting>>> = mutableMapOf()
private var ownCosmeticsVisible = true

Expand Down Expand Up @@ -153,14 +159,15 @@ class EquippedCosmeticsManager(
// Keep old instance if unchanged, so external comparisons against it can continue to take the fast path
if (visibleCosmetics[playerId] != newValue) {
visibleCosmetics[playerId] = newValue
visibleCosmeticsStates[playerId]?.set(newValue)
}
}

private fun computeVisibleCosmetics(playerId: UUID): ImmutableMap<CosmeticSlot, EquippedCosmetic> {
val cosmeticIds = equippedCosmetics[playerId] ?: return ImmutableMap.of()
val settings = cosmeticSettings[playerId] ?: emptyMap()

val cosmeticsHidden = !ownCosmeticsVisible && playerId == ownUuid
val cosmeticsHidden = EssentialConfig.disableCosmetics || (!ownCosmeticsVisible && playerId == ownUuid)

fun isVisible(slot: CosmeticSlot): Boolean {
if (slot == CosmeticSlot.ICON) {
Expand Down Expand Up @@ -193,9 +200,17 @@ class EquippedCosmeticsManager(
return visibleCosmetics[playerId] ?: ImmutableMap.of()
}

fun getVisibleCosmeticsState(playerId: UUID): State<Map<CosmeticSlot, EquippedCosmetic>> {
return visibleCosmeticsStates.getOrPut(playerId) { mutableStateOf(visibleCosmetics[playerId] ?: emptyMap()) }
}

override fun resetState() {
equippedCosmetics.clear()
visibleCosmetics.clear()
// Note: The visibleCosmeticsState map MUST NOT be cleared here because downstream states won't necessarily be
// re-created on reconnect but should still continue to receive future updates.
// It'll be cleaned up automatically as its entries become unused by virtue of having weak values.
visibleCosmeticsStates.values.forEach { it.set(emptyMap()) }
cosmeticSettings.clear()
}

Expand All @@ -211,6 +226,8 @@ class EquippedCosmeticsManager(
equippedCosmetics.remove(uuid)
visibleCosmetics.remove(uuid)
cosmeticSettings.remove(uuid)
// Note: The entry MUST NOT be removed from the visibleCosmeticsState map. See comment in [resetState].
visibleCosmeticsStates[uuid]?.set(emptyMap())
}
}
}
4 changes: 4 additions & 0 deletions root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import essential.*
import gg.essential.gradle.util.*
import net.fabricmc.loom.task.RemapJarTask

buildscript {
dependencies.constraints.classpath("com.github.replaymod:remap:63aef8561!!")
}

plugins {
id("base")
id("essential.utils")
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ listOf(
"1.20.6-fabric",
"1.21-fabric",
"1.21.2-fabric",
"1.21.4-fabric",
).forEach { version ->
include(":$version")
project(":$version").apply {
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/gg/essential/Essential.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import gg.essential.config.EssentialConfigApiImpl;
import gg.essential.config.McEssentialConfig;
import gg.essential.cosmetics.PlayerWearableManager;
import gg.essential.cosmetics.events.AnimationEffectHandler;
import gg.essential.cosmetics.events.CosmeticEventEmitter;
import gg.essential.data.OnboardingData;
import gg.essential.elementa.components.image.FileImageCache;
import gg.essential.elementa.components.image.ImageCache;
Expand Down Expand Up @@ -139,7 +139,7 @@ public class Essential implements EssentialAPI {
private PlayerWearableManager playerWearableManager;
private final GameProfileManager gameProfileManager = new GameProfileManager();
private final MojangSkinManager skinManager = new MojangSkinManager(gameProfileManager, () -> Wardrobe.getInstance() != null);
private AnimationEffectHandler animationEffectHandler;
private CosmeticEventEmitter cosmeticEventEmitter;
private Map<Object, Boolean> dynamicListeners = new HashMap<>();
private EssentialGameRules gameRules;

Expand Down Expand Up @@ -304,8 +304,8 @@ private void init() {
registerListener(new WindowedFullscreenHandler());
registerListener(connectionManager.getSpsManager());
registerListener(connectionManager.getSocialManager());
registerListenerRequiresEssential(animationEffectHandler = new AnimationEffectHandler());
registerListenerRequiresEssential((playerWearableManager = new PlayerWearableManager(connectionManager, connectionManager.getCosmeticsManager())));
registerListenerRequiresEssential(cosmeticEventEmitter = new CosmeticEventEmitter());
registerListener(playerWearableManager = new PlayerWearableManager(connectionManager, connectionManager.getCosmeticsManager()));
registerListener(WikiToastListener.INSTANCE);
if (!OptiFineUtil.isLoaded()) {
registerListenerRequiresEssential(ZoomHandler.getInstance());
Expand Down Expand Up @@ -522,8 +522,8 @@ public gg.essential.api.data.OnboardingData onboardingData() {
return OnboardingData.INSTANCE;
}

public AnimationEffectHandler getAnimationEffectHandler() {
return animationEffectHandler;
public CosmeticEventEmitter getCosmeticEventEmitter() {
return cosmeticEventEmitter;
}

public OverlayManager getOverlayManager() {
Expand Down
Loading

0 comments on commit d6adc05

Please sign in to comment.