Skip to content

Commit f71efa3

Browse files
Version 1.3.5.9
1 parent 82ab7d8 commit f71efa3

File tree

204 files changed

+2620
-1686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+2620
-1686
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Essential Mod TM
22
Source Available License Agreement
3-
Last Updated: 11th November 2024
3+
Last Updated: 22nd January 2025
44

5-
This license has been updated on 11th November 2024 to allow
5+
This license has been updated on 22nd January 2025 to allow
66
unmodified forks of the repository.
77

88
In the interest of transparency, ModCore Inc., doing business as

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Before building Essential, you must have [Java Development Kits (JDKs)](https://
1515
installed for Java versions 21, 17, 16, and 8 (even if you only want to build for a specific Minecraft version).
1616
Java 21 (or newer) must be the default Java version on your system.
1717

18-
No additional tools are required. Gradle will be automatically be installed by the
18+
No additional tools are required. Gradle will be automatically installed by the
1919
[gradle-wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) program included in the repository and
2020
available via the `./gradlew` (Linux/Mac) or `gradlew.bat` (Windows) scripts.
2121
We highly recommend using these instead of a local installation of Gradle to ensure you're using the exact same version

api/api/api.api

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,13 @@ public abstract interface class gg/essential/api/utils/GuiUtil {
423423
public abstract fun openScreen (Lnet/minecraft/client/gui/screens/Screen;)V
424424
@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
425425
public abstract fun openedScreen ()Lnet/minecraft/client/gui/screens/Screen;
426-
@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
426+
@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.3-fabric,1.21.4-fabric
427427
public static fun getOpenedScreen ()Lnet/minecraft/client/gui/screen/Screen;
428-
@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
428+
@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.3-fabric,1.21.4-fabric
429429
public static fun open (Lnet/minecraft/client/gui/screen/Screen;)V
430-
@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
430+
@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.3-fabric,1.21.4-fabric
431431
public abstract fun openScreen (Lnet/minecraft/client/gui/screen/Screen;)V
432-
@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
432+
@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.3-fabric,1.21.4-fabric
433433
public abstract fun openedScreen ()Lnet/minecraft/client/gui/screen/Screen;
434434
@1.12.2-forge,1.8.9-forge
435435
public static fun getOpenedScreen ()Lnet/minecraft/client/gui/GuiScreen;
@@ -446,9 +446,9 @@ public final class gg/essential/api/utils/GuiUtil$Companion {
446446
public final fun getOpenedScreen ()Lnet/minecraft/client/gui/screens/Screen;
447447
@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
448448
public final fun open (Lnet/minecraft/client/gui/screens/Screen;)V
449-
@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
449+
@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.3-fabric,1.21.4-fabric
450450
public final fun getOpenedScreen ()Lnet/minecraft/client/gui/screen/Screen;
451-
@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
451+
@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.3-fabric,1.21.4-fabric
452452
public final fun open (Lnet/minecraft/client/gui/screen/Screen;)V
453453
@1.12.2-forge,1.8.9-forge
454454
public final fun getOpenedScreen ()Lnet/minecraft/client/gui/GuiScreen;
@@ -512,7 +512,7 @@ public final class gg/essential/api/utils/KotlinAdapter : net/minecraftforge/fml
512512
public abstract interface class gg/essential/api/utils/MinecraftUtils {
513513
@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
514514
public abstract fun getResourceImage (Lnet/minecraft/resources/ResourceLocation;)Ljava/awt/image/BufferedImage;
515-
@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
515+
@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.3-fabric,1.21.4-fabric
516516
public abstract fun getResourceImage (Lnet/minecraft/util/Identifier;)Ljava/awt/image/BufferedImage;
517517
@1.12.2-forge,1.16.2-forge,1.8.9-forge
518518
public abstract fun getResourceImage (Lnet/minecraft/util/ResourceLocation;)Ljava/awt/image/BufferedImage;

api/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ dependencies {
5757

5858
// Core Gui Libraries
5959
val ucMcVersion = when (platform.mcVersion) {
60-
12104 -> "1.21.2"
6160
11802 -> "1.18.1"
6261
else -> mcVersionStr
6362
}

build-logic/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies {
3636
implementation("org.ow2.asm:asm-commons:9.3")
3737
implementation ("com.google.guava:guava:30.1.1-jre")
3838

39-
implementation("gg.essential:essential-gradle-toolkit:0.6.5")
39+
implementation("gg.essential:essential-gradle-toolkit:0.6.6")
4040
}
4141

4242
gradlePlugin {

build-logic/src/main/kotlin/essential/preprocessor.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fun Project.configurePreprocessTree(versions: File) {
2121
strictExtraMappings.set(true)
2222

2323
val fabric12104 = createNode("1.21.4-fabric", 12104, "yarn")
24-
val fabric12102 = createNode("1.21.2-fabric", 12102, "yarn")
24+
val fabric12103 = createNode("1.21.3-fabric", 12103, "yarn")
2525
val fabric12100 = createNode("1.21-fabric", 12100, "yarn")
2626
val fabric12006 = createNode("1.20.6-fabric", 12006, "yarn")
2727
val forge12004 = createNode("1.20.4-forge", 12004, "srg")
@@ -48,8 +48,8 @@ fun Project.configurePreprocessTree(versions: File) {
4848
val forge11202 = createNode("1.12.2-forge", 11202, "srg")
4949
val forge10809 = createNode("1.8.9-forge", 10809, "srg")
5050

51-
fabric12104.link(fabric12102, versions.resolve("1.21.4-1.21.2.txt"))
52-
fabric12102.link(fabric12100)
51+
fabric12104.link(fabric12103, versions.resolve("1.21.4-1.21.3.txt"))
52+
fabric12103.link(fabric12100)
5353
fabric12100.link(fabric12006)
5454
fabric12006.link(fabric12004)
5555
forge12004.link(fabric12004)

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ dependencies {
118118
val fapiVersion = when (platform.mcVersion) {
119119
12006 -> "0.97.8+1.20.6"
120120
12100 -> "0.99.2+1.21"
121-
12102 -> "0.106.0+1.21.2"
121+
12103 -> "0.106.0+1.21.2"
122122
12104 -> "0.110.0+1.21.4"
123123
else -> error("No fabric API version configured!")
124124
}

changelog/release-1.3.5.9.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Title: Bug Patch
2+
Summary: Minor bug fixes
3+
4+
## Improvements
5+
- Improved the screenshot upload notification to open the chat in which the screenshot was sent when clicked
6+
- Added the ability for emotes to have random variations
7+
- Added the ability for emotes to lock the player rotation
8+
- Added the ability for emotes to hide other cosmetics and held items
9+
10+
## Bug Fixes
11+
- Fixed previewing of emotes in the Wardrobe
12+
- Fixed Discord Rich Presence integration not working on latest Discord version
13+
- Fixed "BufferBuilder was empty" crash with certain cosmetics on Minecraft 1.21 and above
14+
- Fixed a Minecraft bug resulting in black screen under some conditions on Minecraft 1.17 to 1.21.1
15+
- Fixed player legs clipping through pants cosmetics when running
16+
- Fixed world difficulty setting being visible when hosting a world with locked difficulty from the main menu
17+
- Fixed Essential crashing with RandomPatches mod

elementa/layoutdsl/src/main/kotlin/gg/essential/gui/effects/GradientEffect.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ class GradientEffect(
4141
val bottomLeft = this.bottomLeft.get()
4242
val bottomRight = this.bottomRight.get()
4343

44+
lateinit var prevBlendState: BlendState
45+
4446
val dither = topLeft != topRight || topLeft != bottomLeft || bottomLeft != bottomRight
4547
if (dither) {
4648
shader.bind()
49+
} else {
50+
prevBlendState = BlendState.active()
51+
BlendState.NORMAL.activate()
4752
}
4853

4954
val buffer = UGraphics.getFromTessellator()
@@ -84,6 +89,8 @@ class GradientEffect(
8489

8590
if (dither) {
8691
shader.unbind()
92+
} else {
93+
prevBlendState.activate()
8794
}
8895
}
8996

elementa/layoutdsl/src/main/kotlin/gg/essential/gui/layoutdsl/containers.kt

Lines changed: 10 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ package gg.essential.gui.layoutdsl
1515

1616
import gg.essential.elementa.UIComponent
1717
import gg.essential.elementa.components.ScrollComponent
18-
import gg.essential.elementa.components.UIBlock
19-
import gg.essential.elementa.components.Window
2018
import gg.essential.elementa.constraints.ChildBasedMaxSizeConstraint
2119
import gg.essential.elementa.constraints.ChildBasedSizeConstraint
2220
import gg.essential.elementa.constraints.WidthConstraint
@@ -29,8 +27,6 @@ import gg.essential.gui.common.HollowUIContainer
2927
import gg.essential.gui.common.constraints.AlternateConstraint
3028
import gg.essential.gui.common.constraints.SpacedCramSiblingConstraint
3129
import gg.essential.gui.elementa.state.v2.*
32-
import gg.essential.universal.UMatrixStack
33-
import java.awt.Color
3430
import kotlin.contracts.ExperimentalContracts
3531
import kotlin.contracts.InvocationKind
3632
import kotlin.contracts.contract
@@ -41,7 +37,7 @@ fun LayoutScope.box(modifier: Modifier = Modifier, block: LayoutScope.() -> Unit
4137
}
4238

4339
val container = TransparentBlock().apply {
44-
componentName = "BoxContainer"
40+
automaticComponentName("box")
4541
setWidth(ChildBasedSizeConstraint())
4642
setHeight(ChildBasedSizeConstraint())
4743
}
@@ -61,7 +57,7 @@ fun LayoutScope.row(modifier: Modifier, horizontalArrangement: Arrangement = Arr
6157
}
6258

6359
val rowContainer = TransparentBlock().apply {
64-
componentName = "RowContainer"
60+
automaticComponentName("row")
6561
setWidth(ChildBasedSizeConstraint())
6662
setHeight(ChildBasedMaxSizeConstraint())
6763
}
@@ -83,7 +79,7 @@ fun LayoutScope.column(modifier: Modifier, verticalArrangement: Arrangement = Ar
8379
}
8480

8581
val columnContainer = TransparentBlock().apply {
86-
componentName = "ColumnContainer"
82+
automaticComponentName("column")
8783
setWidth(ChildBasedMaxSizeConstraint())
8884
setHeight(ChildBasedSizeConstraint())
8985
}
@@ -108,7 +104,7 @@ fun LayoutScope.flowContainer(
108104
}
109105

110106
val flowContainer = TransparentBlock().apply {
111-
componentName = "FlowContainer"
107+
automaticComponentName("flowContainer")
112108
setHeight(ChildBasedSizeConstraint())
113109
}
114110

@@ -147,7 +143,7 @@ fun LayoutScope.scrollable(
147143
val content = HollowUIContainer() childOf outer // actually adds to `inner` because ScrollComponent redirects it
148144

149145
outer.apply {
150-
componentName = "scrollable"
146+
automaticComponentName("scrollable")
151147
setWidth(ChildBasedSizeConstraint() boundTo content)
152148
setHeight(ChildBasedSizeConstraint() boundTo content)
153149
}
@@ -179,80 +175,10 @@ fun LayoutScope.floatingBox(
179175
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
180176
}
181177

182-
fun UIComponent.isMounted(): Boolean =
183-
parent == this || (this in parent.children && parent.isMounted())
184-
185-
// Elementa's floating system is quite tricky to work with because components that are floating are added into a
186-
// persistent list but will not automatically be removed from that list when they're removed from the component
187-
// tree, and as such will continue to render.
188-
// This class tries to work around that by canceling `draw` and automatically un-floating itself in such cases,
189-
// as well as automatically adding itself back to the floating list when it is put back into the component tree.
190-
class FloatableContainer : UIBlock(Color(0, 0, 0, 0)) {
191-
val shouldBeFloating: Boolean
192-
get() = floating.get()
193-
194-
// Keeps track of the current floating state because the parent field of the same name is private
195-
@set:JvmName("setFloating_")
196-
var isFloating: Boolean = false
197-
set(value) {
198-
if (field == value) return
199-
field = value
200-
setFloating(value)
201-
}
202-
203-
override fun animationFrame() {
204-
// animationFrame is called from the regular tree traversal, so it's safe to directly update the floating
205-
// list from here
206-
isFloating = shouldBeFloating
207-
208-
super.animationFrame()
209-
}
210-
211-
override fun draw(matrixStack: UMatrixStack) {
212-
// If we're no longer mounted in the component tree, we should no longer draw
213-
if (!isMounted()) {
214-
// and if we're still floating (likely the case because that'll be why we're still drawing), then
215-
// we also need to un-float ourselves
216-
if (isFloating) {
217-
// since this is likely called from the code that iterates over the floating list to draw each
218-
// component, modifying the floating list here would result in a CME, so we need to delay this.
219-
Window.enqueueRenderOperation {
220-
// Note: we must not assume that our shouldBe state hasn't changed since we scheduled this
221-
isFloating = shouldBeFloating && isMounted()
222-
}
223-
}
224-
return
225-
}
226-
227-
// If we should be floating but aren't right now, then this isn't being called from the floating draw loop
228-
// and it should be safe for us to immediately set us as floating.
229-
// Doing so will add us to the floating draw loop and thereby allow us to draw later.
230-
if (shouldBeFloating && !isFloating) {
231-
isFloating = true
232-
return
233-
}
234-
235-
// If we should not be floating but are right now, then this is similar to the no-longer-mounted case above
236-
// i.e. we want to un-float ourselves.
237-
// Except we're still mounted so we do still want to draw the content (this means it'll be floating for one
238-
// more frame than it's supposed to but there isn't anything we can really do about that because the regular
239-
// draw loop has already concluded by this point).
240-
if (!shouldBeFloating && isFloating) {
241-
Window.enqueueRenderOperation { isFloating = shouldBeFloating }
242-
super.draw(matrixStack)
243-
return
244-
}
245-
246-
// All as it should be, can just draw it
247-
super.draw(matrixStack)
248-
}
249-
}
250-
251-
val container = FloatableContainer().apply {
252-
componentName = "floatingBox"
253-
setWidth(ChildBasedSizeConstraint())
254-
setHeight(ChildBasedSizeConstraint())
178+
val box = box(modifier, block)
179+
box.automaticComponentName("floatingBox")
180+
effect(box) {
181+
box.isFloating = floating()
255182
}
256-
container.addChildModifier(Modifier.alignBoth(Alignment.Center))
257-
return container(modifier = modifier, block = block)
183+
return box
258184
}

0 commit comments

Comments
 (0)