Skip to content

Commit cff8a1f

Browse files
committed
feat: 1.21.11 release
1 parent dc7136d commit cff8a1f

12 files changed

Lines changed: 117 additions & 125 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ jobs:
5252
loaders: |-
5353
fabric
5454
game-versions: |-
55-
1.21.8
55+
1.21.11
5656
files: '["./build/libs/Flint-1.0.0.jar", "./build/libs/Flint-1.0.0-sources.jar"]'
5757
primary-file: "Flint-1.0.0.jar"

build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.11.4';
2+
id 'fabric-loom' version '1.14-SNAPSHOT';
33
id 'maven-publish'
44
}
55

@@ -21,11 +21,9 @@ dependencies {
2121
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
2222
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
2323

24-
modImplementation include("net.kyori:adventure-platform-fabric:${project.adventure_fabric_version}") {
25-
exclude group: "net.fabricmc.fabric-api"
26-
}
24+
modImplementation include('net.kyori:adventure-platform-fabric:6.8.0')
2725

28-
modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:1.2.1")
26+
modRuntimeOnly("me.djtheredstoner:DevAuth-fabric:1.2.2")
2927
}
3028

3129
processResources {

gradle.properties

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
org.gradle.jvmargs=-Xmx1G
22

33
# Fabric Properties
4-
minecraft_version=1.21.8
5-
yarn_mappings=1.21.8+build.1
6-
loader_version=0.17.2
4+
minecraft_version=1.21.11
5+
yarn_mappings=1.21.11+build.3
6+
loader_version=0.18.3
77

88
# Mod Properties
99
mod_version=1.0.0
1010
maven_group=io.github.redvortexdev
1111
archives_base_name=Flint
1212

1313
# Dependencies
14-
fabric_version=0.129.0+1.21.8
15-
adventure_fabric_version=6.6.0
14+
fabric_version=0.140.2+1.21.11

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/dev/dfonline/flint/Flint.java

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback;
2828
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
2929
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
30-
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
30+
import net.fabricmc.fabric.api.client.rendering.v1.world.WorldRenderEvents;
3131
import net.kyori.adventure.platform.modcommon.MinecraftAudiences;
3232
import net.kyori.adventure.platform.modcommon.MinecraftClientAudiences;
3333
import net.minecraft.client.MinecraftClient;
@@ -55,8 +55,8 @@ public static User getUser() {
5555
public void onInitializeClient() {
5656
LOGGER.info("Sparking it up");
5757

58-
// FlintAPI.setDebugging(true);
59-
// FlintAPI.confirmLocationWithLocate();
58+
// FlintAPI.setDebugging(true);
59+
// FlintAPI.confirmLocationWithLocate();
6060

6161
FlintUpdate.fetchLatestRelease();
6262

@@ -103,76 +103,65 @@ private void registerEventCallbacks() {
103103
)
104104
);
105105

106-
WorldRenderEvents.LAST.register(worldRenderContext ->
106+
WorldRenderEvents.AFTER_BLOCK_OUTLINE_EXTRACTION.register((context, hit) ->
107107
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
108-
((WorldRenderFeature) feature).worldRenderLast(worldRenderContext)
108+
((WorldRenderFeature) feature).worldRenderAfterBlockOutlineExtraction(context, hit)
109109
)
110110
);
111111

112-
WorldRenderEvents.END.register(worldRenderContext ->
112+
WorldRenderEvents.END_EXTRACTION.register(context ->
113113
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
114-
((WorldRenderFeature) feature).worldRenderEnd(worldRenderContext)
114+
((WorldRenderFeature) feature).worldRenderEndExtraction(context)
115115
)
116116
);
117117

118-
WorldRenderEvents.BEFORE_BLOCK_OUTLINE.register((worldRenderContext, hitResult) -> {
119-
boolean shouldRender = true;
120-
for (FeatureTrait feature : FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER)) {
121-
if (((WorldRenderFeature) feature).worldRenderBeforeBlockOutline(worldRenderContext, hitResult) == EventResult.CANCEL) {
122-
shouldRender = false;
123-
}
124-
}
125-
126-
return shouldRender;
127-
});
128-
129-
WorldRenderEvents.BEFORE_ENTITIES.register(worldRenderContext ->
118+
WorldRenderEvents.START_MAIN.register(context ->
130119
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
131-
((WorldRenderFeature) feature).worldRenderBeforeEntities(worldRenderContext)
120+
((WorldRenderFeature) feature).worldRenderStartMain(context)
132121
)
133122
);
134-
135-
WorldRenderEvents.AFTER_ENTITIES.register(worldRenderContext ->
123+
124+
WorldRenderEvents.BEFORE_ENTITIES.register(context ->
136125
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
137-
((WorldRenderFeature) feature).worldRenderAfterEntities(worldRenderContext)
126+
((WorldRenderFeature) feature).worldRenderBeforeEntities(context)
138127
)
139128
);
140-
141-
WorldRenderEvents.AFTER_SETUP.register(worldRenderContext ->
129+
130+
WorldRenderEvents.AFTER_ENTITIES.register(context ->
142131
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
143-
((WorldRenderFeature) feature).worldRenderAfterSetup(worldRenderContext)
132+
((WorldRenderFeature) feature).worldRenderAfterEntities(context)
144133
)
145134
);
146-
147-
WorldRenderEvents.AFTER_TRANSLUCENT.register(worldRenderContext ->
135+
136+
WorldRenderEvents.BEFORE_DEBUG_RENDER.register(context ->
148137
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
149-
((WorldRenderFeature) feature).worldRenderAfterTranslucent(worldRenderContext)
138+
((WorldRenderFeature) feature).worldRenderBeforeDebugRender(context)
150139
)
151-
);
152-
153-
WorldRenderEvents.BEFORE_DEBUG_RENDER.register(worldRenderContext ->
140+
);
141+
142+
WorldRenderEvents.BEFORE_TRANSLUCENT.register(context ->
154143
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
155-
((WorldRenderFeature) feature).worldRenderBeforeDebugRender(worldRenderContext)
144+
((WorldRenderFeature) feature).worldRenderBeforeTranslucent(context)
156145
)
157146
);
158147

159-
WorldRenderEvents.BLOCK_OUTLINE.register((worldRenderContext, blockOutlineContext) -> {
148+
WorldRenderEvents.BEFORE_BLOCK_OUTLINE.register((context, outlineRenderState) -> {
160149
boolean shouldRender = true;
161150
for (FeatureTrait feature : FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER)) {
162-
if (((WorldRenderFeature) feature).worldRenderBlockOutline(worldRenderContext, blockOutlineContext) == EventResult.CANCEL) {
151+
if (((WorldRenderFeature) feature).worldRenderBeforeBlockOutline(context, outlineRenderState) == EventResult.CANCEL) {
163152
shouldRender = false;
164153
}
165154
}
166155

167156
return shouldRender;
168157
});
169158

170-
WorldRenderEvents.START.register(worldRenderContext ->
159+
WorldRenderEvents.END_MAIN.register(context ->
171160
FEATURE_MANAGER.getByTrait(FeatureTraitType.WORLD_RENDER).forEach(feature ->
172-
((WorldRenderFeature) feature).worldRenderStart(worldRenderContext)
161+
((WorldRenderFeature) feature).worldRenderEndMain(context)
173162
)
174163
);
175-
164+
176165
ClientLifecycleEvents.CLIENT_STOPPING.register(client ->
177166
FEATURE_MANAGER.getByTrait(FeatureTraitType.SHUTDOWN).forEach(feature ->
178167
((ShutdownFeature) feature).onShutdown()

src/main/java/dev/dfonline/flint/data/DFItem.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package dev.dfonline.flint.data;
22

3+
import com.google.common.collect.ArrayListMultimap;
4+
import com.google.common.collect.ImmutableMultimap;
5+
import com.google.common.collect.Multimap;
6+
import com.mojang.authlib.GameProfile;
37
import com.mojang.authlib.properties.Property;
48
import com.mojang.authlib.properties.PropertyMap;
59
import net.minecraft.component.DataComponentTypes;
@@ -14,7 +18,9 @@
1418
import net.minecraft.util.Unit;
1519
import org.jetbrains.annotations.Nullable;
1620

21+
import java.util.HashMap;
1722
import java.util.List;
23+
import java.util.Map;
1824
import java.util.Optional;
1925
import java.util.UUID;
2026
import java.util.function.Consumer;
@@ -194,16 +200,14 @@ public void setDyeColor(int color) {
194200
this.item.set(DataComponentTypes.DYED_COLOR, new DyedColorComponent(color));
195201
}
196202

197-
// Since this is currently unused we can keep it that way for now
198-
// TODO: Reimplement (custom model data works differently now so this needs a full rework)
199-
// /**
200-
// * Sets the custom model data of the item.
201-
// *
202-
// * @param modelData The new custom model data to set.
203-
// */
204-
// public void setCustomModelData(int modelData) {
205-
// this.item.set(DataComponentTypes.CUSTOM_MODEL_DATA, new CustomModelDataComponent());
206-
// }
203+
/**
204+
* Sets the custom model data of the item.
205+
*
206+
* @param modelData The new custom model data to set.
207+
*/
208+
public void setCustomModelData(int modelData) {
209+
this.item.set(DataComponentTypes.CUSTOM_MODEL_DATA, new CustomModelDataComponent(List.of((float) modelData), List.of(), List.of(), List.of()));
210+
}
207211

208212
/**
209213
* Sets the profile of the item, for use with player heads.
@@ -213,9 +217,10 @@ public void setDyeColor(int color) {
213217
* @param signature The signature of the profile.
214218
*/
215219
public void setProfile(UUID uuid, String value, String signature) {
216-
PropertyMap map = new PropertyMap();
217-
map.put("textures", new Property("textures", value, signature));
218-
this.item.set(DataComponentTypes.PROFILE, new ProfileComponent(Optional.empty(), Optional.ofNullable(uuid), map));
220+
Multimap<String, Property> map = ImmutableMultimap.<String, Property>builder()
221+
.put("textures", new Property("textures", value, signature))
222+
.build();
223+
this.item.set(DataComponentTypes.PROFILE, ProfileComponent.ofStatic(new GameProfile(uuid, value, new PropertyMap(map))));
219224
}
220225

221226
/**

src/main/java/dev/dfonline/flint/feature/impl/StateDebugDisplayFeature.java

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import static net.minecraft.text.Text.literal;
2121

22-
public class StateDebugDisplayFeature implements RenderedFeature, ModeSwitchListeningFeature {
22+
public class StateDebugDisplayFeature implements RenderedFeature {
2323

2424
private static final Logger LOGGER = Logger.of(StateDebugDisplayFeature.class);
2525
private static final int STARTING_Y = 5;
@@ -71,22 +71,5 @@ public boolean isEnabled() {
7171
return FlintAPI.isDebugging();
7272
}
7373

74-
@Override
75-
public void onSwitchMode(Mode oldMode, Mode newMode) {
76-
if (Flint.getClient().player == null) {
77-
LOGGER.info("Null player :scream:");
78-
return;
79-
}
80-
81-
Flint.getUser().getPlayer().sendMessage(literal(
82-
"Old: " + ObjectUtil.toString(oldMode, Mode::getName) + " -> New: " + ObjectUtil.toString(newMode, Mode::getName)
83-
), false);
84-
85-
Flint.getUser().getPlayer().sendMessage(literal(
86-
ObjectUtil.toString(Flint.getUser().getPlot(), Plot::toReadableString, "No Plot")
87-
), false);
88-
89-
}
90-
9174
}
9275

src/main/java/dev/dfonline/flint/feature/trait/RenderedFeature.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
package dev.dfonline.flint.feature.trait;
22

33
import dev.dfonline.flint.feature.core.FeatureTrait;
4+
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
5+
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
46
import net.minecraft.client.gui.DrawContext;
57
import net.minecraft.client.render.RenderTickCounter;
68

79
/**
810
* A feature that renders to the screen.
11+
*
12+
* @deprecated Use {@link HudElementRegistry} instead, as per {@link HudRenderCallback}.
913
*/
14+
@Deprecated
1015
public interface RenderedFeature extends FeatureTrait {
1116

1217
/**

0 commit comments

Comments
 (0)