Skip to content
Merged
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
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
# Plugins
fabricLoom = "1.15-SNAPSHOT"
fabricLoom = "1.16-SNAPSHOT"
spotless = "8.1.0"

# Libraries
minecraft = "26.1"
fabricLoader = "0.18.4" # on change - check if fabric.mod.json needs to be increased
fabricApi = "0.144.0+26.1"
minecraft = "26.1.2"
fabricLoader = "0.18.6" # on change - check if fabric.mod.json needs to be increased
fabricApi = "0.145.4+26.1.2"

[libraries]
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public abstract class AvatarRendererMixin {
/**
* Modifies the player entity render state to set the self added uuid field.
*
* @param avatar The avatar as the source for the uuid.
* @param avatarRenderState The avatar render state to set the uuid.
* @param f The float f.
* @param entity The avatar as the entity source for the uuid.
* @param state The avatar render state to set the uuid.
* @param partialTicks The partial ticks.
* @param ci The callback info.
*/
@Inject(method = "extractRenderState(Lnet/minecraft/world/entity/Avatar;Lnet/minecraft/client/renderer/entity/state/AvatarRenderState;F)V", at = @At(value = "TAIL"))
private void modifyExtractRenderState(final Avatar avatar, final AvatarRenderState avatarRenderState, final float f, final CallbackInfo ci) {
((AvatarRenderStateAccessor) avatarRenderState).communityradar_fabric$setPlayerUuid(avatar.getUUID());
private void modifyExtractRenderState(final Avatar entity, final AvatarRenderState state, final float partialTicks, final CallbackInfo ci) {
((AvatarRenderStateAccessor) state).communityradar_fabric$setPlayerUuid(entity.getUUID());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ public abstract class ChatComponentMixin {
/**
* Modifies the player chat messages. This gets called when a message should be added to the player chat.
*
* @param component The original chat message component to modify.
* @param contents The original chat message content component to modify.
* @return Returns the modified local variable.
*/
@ModifyVariable(method = "addMessage(Lnet/minecraft/network/chat/Component;Lnet/minecraft/network/chat/MessageSignature;Lnet/minecraft/client/multiplayer/chat/GuiMessageSource;Lnet/minecraft/client/multiplayer/chat/GuiMessageTag;)V", at = @At(value = "HEAD"), index = 1, argsOnly = true)
private Component modifyAddMessage(final Component component) {
@ModifyVariable(method = "addMessage(Lnet/minecraft/network/chat/Component;Lnet/minecraft/network/chat/MessageSignature;Lnet/minecraft/client/multiplayer/chat/GuiMessageSource;Lnet/minecraft/client/multiplayer/chat/GuiMessageTag;)V", at = @At(value = "HEAD"), argsOnly = true, name = "contents")
private Component modifyAddMessage(final Component contents) {
if (!Utils.isOnGrieferGames()) {
return component;
return contents;
}

// On a chat message there should be never be the need to call to the Mojang API.
try {
final Optional<UUID> playerUuid = Utils.getChatMessagePlayer(component.getString()).get();
final Optional<UUID> playerUuid = Utils.getChatMessagePlayer(contents.getString()).get();

if (playerUuid.isPresent() && CommunityRadarMod.getListManager().isInList(playerUuid.get())) {
return Utils.includePrefixComponent(playerUuid.get(), component);
return Utils.includePrefixComponent(playerUuid.get(), contents);
}
} catch (final ExecutionException | InterruptedException e) {
logger.error("Could not get the player uuid in the message edit process", e);
}
return component;
return contents;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ public abstract class PlayerTabOverlayMixin {
* Modifies the player info component. This gets called when the player info gets updated.
*
* @param component The original chat message component to modify.
* @param playerInfo The needed local variable of the player info.
* @param info The needed local variable of the player info.
* @return Returns the modified local variable.
*/
@ModifyReturnValue(method = "getNameForDisplay", at = @At("RETURN"))
private Component modifyGetNameForDisplay(final Component component, final @Local(argsOnly = true) PlayerInfo playerInfo) {
private Component modifyGetNameForDisplay(final Component component, final @Local(argsOnly = true, name = "info") PlayerInfo info) {
if (!Utils.isOnGrieferGames()) {
return component;
}
return Utils.includePrefixComponent(playerInfo.getProfile().id(), component);
return Utils.includePrefixComponent(info.getProfile().id(), component);
}
}