Skip to content
Draft

26.1 #404

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
- name: Extract build version information
id: ref
run: .github/extract_refs.sh
- name: Set up JDK 21
- name: Set up JDK 25
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # 5.0.0
with:
distribution: 'temurin'
java-version: 21
java-version: 25
check-latest: true
- name: Validate JSON files
run: python3 .github/validate_json.py
Expand Down
43 changes: 16 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "fabric-loom" version "${loom_version}"
id "net.fabricmc.fabric-loom" version "${loom_version}"
}

version = "fabric-${project.mod_version}+${project.minecraft_version}"
Expand All @@ -18,34 +18,24 @@ repositories {
dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
if(!project.parchment_version.isEmpty()) {
parchment("org.parchmentmc.data:parchment-${project.minecraft_version}:${project.parchment_version}@zip")
}
}
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
implementation "net.fabricmc:fabric-loader:${project.loader_version}"

modImplementation fabricApi.module("fabric-networking-api-v1", project.fabric_version)
modImplementation fabricApi.module("fabric-key-binding-api-v1", project.fabric_version)
modImplementation fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version)
modImplementation fabricApi.module("fabric-command-api-v2", project.fabric_version)
modImplementation fabricApi.module("fabric-rendering-v1", project.fabric_version)
modImplementation fabricApi.module("fabric-resource-loader-v1", project.fabric_version)
modRuntimeOnly fabricApi.module("fabric-registry-sync-v0", project.fabric_version)
implementation fabricApi.module("fabric-networking-api-v1", project.fabric_version)
implementation fabricApi.module("fabric-key-mapping-api-v1", project.fabric_version)
implementation fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version)
implementation fabricApi.module("fabric-command-api-v2", project.fabric_version)
implementation fabricApi.module("fabric-rendering-v1", project.fabric_version)
implementation fabricApi.module("fabric-resource-loader-v1", project.fabric_version)
runtimeOnly fabricApi.module("fabric-registry-sync-v0", project.fabric_version)

// Allow logging into an actual Minecraft account in a dev env
// See https://github.com/DJtheRedstoner/DevAuth
modLocalRuntime "me.djtheredstoner:DevAuth-fabric:1.2.1"
// TODO mojang removed their dependency on Apache HTTP, which breaks DevAuth; for the time being, just re-import it
// as a dev env dependency.
localRuntime "org.apache.httpcomponents:httpclient:4.5.14"
localRuntime "org.apache.httpcomponents:httpcore:4.4.16"
localRuntime "me.djtheredstoner:DevAuth-fabric:1.2.2"

// If you want to load Mod Menu in a development environment, change this to modImplementation
// If you want to load Mod Menu in a development environment, change this to implementation
// and uncomment the associated Fabric API module.
modCompileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
//modRuntimeOnly(fabricApi.module("fabric-screen-api-v1", project.fabric_version))
compileOnly("com.terraformersmc:modmenu:${project.modmenu_version}")
//runtimeOnly(fabricApi.module("fabric-screen-api-v1", project.fabric_version))
}

processResources {
Expand All @@ -61,13 +51,12 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.20.5 (24w14a) upwards uses Java 21.
it.options.release = 21
it.options.release = 25
}

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
}

loom {
Expand Down
13 changes: 6 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ org.gradle.configuration-cache=false

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21.11
minecraft_dependency=>=1.21.11 <21.6
parchment_version=
loader_version=0.18.1
loom_version=1.14-SNAPSHOT
minecraft_version=26.1-pre-2
minecraft_dependency=>=26.1-beta.1 <26.2
loader_version=0.18.4
loom_version=1.15-SNAPSHOT

# Mod Properties
mod_version = 5.0.0-Beta.2
maven_group = com.wildfiregender.main
archives_base_name = Female-Gender-Mod

# Dependencies
fabric_version=0.139.4+1.21.11
fabric_version=0.143.13+26.1

# Note that mod menu may be several versions out of date; this is fine, as we only care about using this
# for its API, which shouldn't realistically need to be updated often (if ever).
modmenu_version=15.0.0-beta.3
modmenu_version=18.0.0-alpha.5
60 changes: 0 additions & 60 deletions src/main/java/com/wildfire/api/WildfireAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,6 @@ public final class WildfireAPI {
vec2i -> IntStream.of(vec2i.x(), vec2i.y())
), VEC2I_LEGACY_CODEC);

/**
* Add custom physics resistance attributes to a chestplate
*
* @deprecated Registering armor physics values through the API is deprecated; define these through resource pack
* data files instead.
*
* @implNote Implementations added through this method are presently ignored if a resource pack defines armor data
* at {@code NAMESPACE:wildfire_gender_data/ASSET_ID.json}, and are only used as a default implementation.
*
* @param item the item that you are linking this {@link IGenderArmor} to
* @param genderArmor the class implementing the {@link IGenderArmor} to apply to the item
* @see IGenderArmor
*/
@Deprecated(since = "4.3.5", forRemoval = true)
@ApiStatus.ScheduledForRemoval(inVersion = "First release of 26.1")
public static void addGenderArmor(Item item, IGenderArmor genderArmor) {
GENDER_ARMORS.put(item, genderArmor);
}

/**
* Get the cached config for a {@link Player}
*
Expand All @@ -99,45 +80,4 @@ public static Gender getPlayerGender(UUID uuid) {
if(cfg == null) return Configuration.GENDER.getDefault();
return cfg.getGender();
}

/**
* <p>Load data for the provided player UUID</p>
*
* <p>This attempts to load a local config file for the provided UUID, before falling back to making a
* request to the {@link com.wildfire.main.cloud.CloudSync cloud sync} server for it
* (if cloud syncing is enabled).</p>
*
* <p>Use of this method is <b>heavily</b> discouraged, as the mod will already perform this load process when
* first accessing a player's config; the exact return type of this method may also change between versions.</p>
*
* @deprecated This method will likely be removed in the future; if you depend on this for any reason,
* please open an issue explaining your use case.
*
* @param uuid the uuid of the target {@link Player}
* @param markForSync {@code true} if player data should be synced to the server upon being loaded; this only has an effect on the client player.
*/
@Deprecated(since = "4.3.3", forRemoval = true)
@ApiStatus.ScheduledForRemoval(inVersion = "First release of 26.1")
@Environment(EnvType.CLIENT)
public static CompletableFuture<@Nullable PlayerConfig> loadGenderInfo(UUID uuid, boolean markForSync) {
return WildfireGenderClient.loadGenderInfo(uuid, markForSync, false);
}

/**
* Get every registered {@link IGenderArmor custom armor configuration}
*
* @deprecated Registering armor physics values through the API is deprecated; define these through resource pack
* data files instead.
*
* @implNote This does not include armors registered through resource packs;
* see {@link com.wildfire.resources.GenderArmorResourceManager} for that.
*
* @see #addGenderArmor
*/
@Deprecated(since = "4.3.5", forRemoval = true)
@ApiStatus.ScheduledForRemoval(inVersion = "First release of 26.1")
public static Map<Item, IGenderArmor> getGenderArmors() {
return GENDER_ARMORS;
}

}
6 changes: 0 additions & 6 deletions src/main/java/com/wildfire/api/impl/BreastArmorTexture.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,4 @@ public record BreastArmorTexture(
Vector2ic rightUv,
Vector2ic dimensions
) implements IBreastArmorTexture {
/**
* @deprecated Use {@link IBreastArmorTexture#DEFAULT} instead
*/
@Deprecated(forRemoval = true)
@ApiStatus.ScheduledForRemoval(inVersion = "First release of 26.1")
public static final IBreastArmorTexture DEFAULT = IBreastArmorTexture.DEFAULT;
}
13 changes: 0 additions & 13 deletions src/main/java/com/wildfire/api/impl/GenderArmor.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,4 @@ public record GenderArmor(
boolean armorStandsCopySettings,
IBreastArmorTexture texture
) implements IGenderArmor {
/**
* @deprecated Use {@link IGenderArmor#DEFAULT} instead
*/
@Deprecated(forRemoval = true)
@ApiStatus.ScheduledForRemoval(inVersion = "First release of 26.1")
public static final IGenderArmor DEFAULT = IGenderArmor.DEFAULT;

/**
* @deprecated Use {@link IGenderArmor#EMPTY} instead
*/
@Deprecated(forRemoval = true)
@ApiStatus.ScheduledForRemoval(inVersion = "First release of 26.1")
public static final IGenderArmor EMPTY = IGenderArmor.EMPTY;
}
2 changes: 1 addition & 1 deletion src/main/java/com/wildfire/compat/ModMenuIntegration.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static class NotInWorldScreen extends ConfirmScreen {

public NotInWorldScreen(Minecraft client, Screen parent) {
super(
result -> client.setScreen(parent),
_ -> client.setScreen(parent),
Component.translatable("wildfire_gender.not_in_world.title").withStyle(ChatFormatting.RED),
Component.translatable("wildfire_gender.not_in_world")
);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/wildfire/gui/FakeGUIPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private static Supplier<GUIMannequin> createPlayerSupplier(final UUID uuid, fina
try {
// while we don't have proper support for mannequins right now, we can most certainly fake it
config = (PlayerConfig) EntityConfig.CACHE.get(entity.getUUID(), () -> new PlayerConfig(entity.getUUID()));
} catch(ExecutionException | ClassCastException ignored) {
} catch(ExecutionException | ClassCastException _) {
return entity;
}

Expand Down Expand Up @@ -140,13 +140,13 @@ public void applyLoadedSkin() {
try {
skinLookup.get().ifPresent(accessor::invokeSetSkin);
accessor.setSkinLookup(null);
} catch(Exception ignored) {
} catch(Exception _) {
}
}
}

@Override
protected ResolvableProfile getProfile() {
public ResolvableProfile getProfile() {
return copySkinFrom;
}
}
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/com/wildfire/gui/GuiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.gui.screens.inventory.InventoryScreen;
import net.minecraft.client.renderer.entity.state.EntityRenderState;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
Expand Down Expand Up @@ -56,25 +56,25 @@ public static MutableComponent doneNarrationText() {
}

// Reimplementation of DrawContext#drawCenteredTextWithShadow but with the text shadow removed
public static void drawCenteredText(GuiGraphics ctx, Font font, Component text, int x, int y, int color) {
public static void drawCenteredText(GuiGraphicsExtractor graphics, Font font, Component text, int x, int y, int color) {
int centeredX = x - font.width(text) / 2;
ctx.drawString(font, text, centeredX, y, color, false);
graphics.text(font, text, centeredX, y, color, false);
}

public static void drawCenteredText(GuiGraphics ctx, Font font, FormattedCharSequence text, int x, int y, int color) {
public static void drawCenteredText(GuiGraphicsExtractor graphics, Font font, FormattedCharSequence text, int x, int y, int color) {
int centeredX = x - font.width(text) / 2;
ctx.drawString(font, text, centeredX, y, color, false);
graphics.text(font, text, centeredX, y, color, false);
}

public static void drawCenteredTextWrapped(GuiGraphics ctx, Font font, FormattedText text, int x, int y, int width, int color) {
public static void drawCenteredTextWrapped(GuiGraphicsExtractor graphics, Font font, FormattedText text, int x, int y, int width, int color) {
for(var var7 = font.split(text, width).iterator(); var7.hasNext(); y += 9) {
FormattedCharSequence orderedText = var7.next();
GuiUtils.drawCenteredText(ctx, font, orderedText, x, y, color);
GuiUtils.drawCenteredText(graphics, font, orderedText, x, y, color);
}
}

// Reimplementation of ClickableWidget#drawScrollableText but with the text shadow removed
public static void drawScrollableTextWithoutShadow(Justify justify, GuiGraphics context, Font font, Component text, int left, int top, int right, int bottom, int color) {
public static void drawScrollableTextWithoutShadow(Justify justify, GuiGraphicsExtractor graphics, Font font, Component text, int left, int top, int right, int bottom, int color) {
color = ARGB.opaque(color);
int i = font.width(text);
int j = (top + bottom - 9) / 2 + 1;
Expand All @@ -85,20 +85,20 @@ public static void drawScrollableTextWithoutShadow(Justify justify, GuiGraphics
double e = Math.max(l * 0.5, 3.0);
double f = Math.sin(HALF_PI * Math.cos(DOUBLE_PI * d / e)) / 2.0 + 0.5;
double g = Mth.lerp(f, 0.0, l);
context.enableScissor(left, top, right, bottom);
context.drawString(font, text, left - (int)g, j, color, false);
context.disableScissor();
graphics.enableScissor(left, top, right, bottom);
graphics.text(font, text, left - (int)g, j, color, false);
graphics.disableScissor();
} else {
if(justify == Justify.CENTER) {
drawCenteredText(context, font, text, (left + right) / 2, j, color);
drawCenteredText(graphics, font, text, (left + right) / 2, j, color);
} else if(justify == Justify.LEFT) {
context.drawString(font, text, left, j, color, false);
graphics.text(font, text, left, j, color, false);
}
}
}

// copy of InventoryScreen#renderEntityInInventoryFollowsMouse that allows for applying an X/Y offset to the drawn entity
public static void drawEntityOnScreen(GuiGraphics graphics, int x1, int y1, int x2, int y2, int size, float mouseX, float mouseY, float xOffset, float yOffset, LivingEntity entity) {
public static void drawEntityOnScreen(GuiGraphicsExtractor graphics, int x1, int y1, int x2, int y2, int size, float mouseX, float mouseY, float xOffset, float yOffset, LivingEntity entity) {
float centerX = (x1 + x2) / 2.0F;
float centerY = (y1 + y2) / 2.0F;
float xAngle = (float)Math.atan((centerX - mouseX) / 40.0F);
Expand All @@ -122,11 +122,11 @@ public static void drawEntityOnScreen(GuiGraphics graphics, int x1, int y1, int
}

Vector3f translation = new Vector3f(xOffset, entityRenderState.boundingBoxHeight / 2.0F + ENTITY_SCALE + yOffset, 0.0F);
graphics.submitEntityRenderState(entityRenderState, size, translation, rotation, xRotation, x1, y1, x2, y2);
graphics.entity(entityRenderState, size, translation, rotation, xRotation, x1, y1, x2, y2);
}

// TODO this could probably be removed and replaced with references to the real method we're copying here
public static void drawEntityOnScreen(GuiGraphics graphics, int x1, int y1, int x2, int y2, int size, float mouseX, float mouseY, LivingEntity entity) {
public static void drawEntityOnScreen(GuiGraphicsExtractor graphics, int x1, int y1, int x2, int y2, int size, float mouseX, float mouseY, LivingEntity entity) {
drawEntityOnScreen(graphics, x1, y1, x2, y2, size, mouseX, mouseY, 0f, 0f, entity);
}
}
8 changes: 4 additions & 4 deletions src/main/java/com/wildfire/gui/SyncedPlayerList.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.network.chat.Component;

import java.util.ArrayList;
Expand All @@ -46,21 +46,21 @@ private SyncedPlayerList() {
ClientTickEvents.END_CLIENT_TICK.register(SyncedPlayerList::onTick);
}

public static void drawSyncedPlayers(GuiGraphics context, Font font) {
public static void drawSyncedPlayers(GuiGraphicsExtractor context, Font font) {
if(syncedPlayers.isEmpty()) {
return;
}

var header = Component.translatable("wildfire_gender.wardrobe.players_using_mod").withStyle(ChatFormatting.AQUA);
context.drawString(font, header, 5, 5, 0xFFFFFFFF, true);
context.text(font, header, 5, 5, 0xFFFFFFFF, true);

int yPos = 18;
for(var entry : syncedPlayers) {
var text = Component.empty()
.append(Component.literal(entry.name()).withColor(entry.color()))
.append(" - ")
.append(entry.gender().getDisplayName());
context.drawString(font, text, 10, yPos, 0xFFFFFFFF, false);
context.text(font, text, 10, yPos, 0xFFFFFFFF, false);
yPos += 10;
}
}
Expand Down
Loading
Loading