Skip to content

Commit

Permalink
Merge branch '1.19.4' into 1.19.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
#	gradle.properties
#	src/main/java/de/erdbeerbaerlp/dcintegration/forge/DiscordIntegrationMod.java
#	update_checker.json
  • Loading branch information
ErdbeerbaerLP committed Dec 6, 2023
2 parents 694c908 + 02451ed commit e680bf4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ apply plugin: 'org.spongepowered.mixin'


//Build variables
version = "3.0.4.1"
version = "3.0.5"
group = "de.erdbeerbaerlp.dcintegration"
archivesBaseName = "dcintegration-forge"

Expand Down Expand Up @@ -94,8 +94,9 @@ configurations.all {
//Dependencies
dependencies {
// ========= Common =====================
embed('de.erdbeerbaerlp:dcintegration.common:3.0.4.1') {
embed('de.erdbeerbaerlp:dcintegration.common:3.0.5') {
changing = true
transitive = false
}

// ========= Minecraft Forge =============
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
changelog=Fix death message custom embed
changelog=Fix server stopping not working\nFix update checker\nImplement URL Encoded advancement message
releaseType = BETA
mcVersion = 1.19.2
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@

import java.io.File;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -135,13 +137,15 @@ public void serverSetup(FMLDedicatedServerSetupEvent ev) {
}

public static final HashMap<String, PermissionNode<Boolean>> nodes = new HashMap();

@SubscribeEvent
public void addPermissions(final PermissionGatherEvent.Nodes ev) {
for(MinecraftPermission p : MinecraftPermission.values()){
for (MinecraftPermission p : MinecraftPermission.values()) {
nodes.put(p.getAsString(), new PermissionNode<>("dcintegration", p.getAsString().replace("dcintegration.", ""), PermissionTypes.BOOLEAN, (player, playerUUID, context) -> p.getDefaultValue()));
}
ev.addNodes(nodes.values().toArray(new PermissionNode[0]));
}

@SubscribeEvent
public void playerJoin(final PlayerEvent.PlayerLoggedInEvent ev) {
if (INSTANCE != null) {
Expand Down Expand Up @@ -206,6 +210,8 @@ public void advancement(AdvancementEvent.AdvancementEarnEvent ev) {
.replace("%avatarURL%", avatarURL)
.replace("%advName%", ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getTitle().getString()))
.replace("%advDesc%", ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getDescription().getString()))
.replace("%advNameURL%", URLEncoder.encode(ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getTitle().getString()), StandardCharsets.UTF_8))
.replace("%advDescURL%", URLEncoder.encode(ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getDescription().getString()), StandardCharsets.UTF_8))
.replace("%avatarURL%", avatarURL)
.replace("%playerColor%", "" + TextColors.generateFromUUID(ev.getEntity().getUUID()).getRGB())
);
Expand All @@ -223,7 +229,9 @@ public void advancement(AdvancementEvent.AdvancementEarnEvent ev) {
.getDisplay()
.getDescription()
.getString()))
.replace("\\n", "\n"));
.replace("\\n", "\n").replace("%advNameURL%", URLEncoder.encode(ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getTitle().getString()), StandardCharsets.UTF_8))
.replace("%advDescURL%", URLEncoder.encode(ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getDescription().getString()), StandardCharsets.UTF_8))
);
INSTANCE.sendMessage(new DiscordMessage(b.build()));
}
} else INSTANCE.sendMessage(Localization.instance().advancementMessage.replace("%player%",
Expand All @@ -237,7 +245,8 @@ public void advancement(AdvancementEvent.AdvancementEarnEvent ev) {
ChatFormatting.stripFormatting(ev.getAdvancement()
.getDisplay()
.getDescription()
.getString()))
.getString()).replace("%advNameURL%", URLEncoder.encode(ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getTitle().getString()), StandardCharsets.UTF_8))
.replace("%advDescURL%", URLEncoder.encode(ChatFormatting.stripFormatting(ev.getAdvancement().getDisplay().getDescription().getString()), StandardCharsets.UTF_8)))
.replace("\\n", "\n"));
}
}
Expand Down Expand Up @@ -444,7 +453,8 @@ else if (ev.getServer().isRunning() && !Localization.instance().serverCrash.isBl
@SubscribeEvent
public void chat(ServerChatEvent ev) {
if (Localization.instance().discordChatMessage.isBlank()) return;
if(!DiscordIntegration.INSTANCE.getServerInterface().playerHasPermissions(ev.getPlayer().getUUID(), MinecraftPermission.SEMD_MESSAGES,MinecraftPermission.USER)) return;
if (!DiscordIntegration.INSTANCE.getServerInterface().playerHasPermissions(ev.getPlayer().getUUID(), MinecraftPermission.SEMD_MESSAGES, MinecraftPermission.USER))
return;
if (LinkManager.isPlayerLinked(ev.getPlayer().getUUID()) && LinkManager.getLink(null, ev.getPlayer().getUUID()).settings.hideFromDiscord)
return;
final net.minecraft.network.chat.Component msg = ev.getMessage();
Expand Down
11 changes: 9 additions & 2 deletions update_checker.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
[
{
"version": "3.0.5",
"changelog": "Fix server stopping not working\nFix update checker\nImplement URL Encoded advancement message",
"type": "beta"
},{
"version": "3.0.4.1",
"changelog": "Fix death message custom embed",
"type": "beta"
},{
"version": "3.0.4",
"changelog": "More bug fixes\nImplement permissions",
"type": "beta"
},
{
},{
"version": "3.0.3",
"changelog": "Large discord integration rewrite adding new features and fixing long existing bugs\nOld configuration can be used as-is\n\nAdded custom status\nAdded tellraw\nAdded option to disable chat message editing for compatibility reasons\nFixed lots of bugs",
"type": "beta"
},{
"version": "3.0.0",
"changelog": "Added new event handling methods for addons\nOtherwise mostly a bug fix update\nDon't forget to use 'discord migrate' in console when updating from below 2.6.0",
"type": "alpha"
Expand Down

0 comments on commit e680bf4

Please sign in to comment.