Skip to content

Commit

Permalink
Add MC 1.21.3 and 1.21.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgH93 committed Dec 9, 2024
1 parent 5af9abe commit 14cd2b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import at.pcgamingfreaks.MarriageMaster.Database.DatabaseConfiguration;
import at.pcgamingfreaks.MarriageMaster.MagicValues;
import at.pcgamingfreaks.Message.MessageColor;
import at.pcgamingfreaks.Reflection;
import at.pcgamingfreaks.Util.StringUtils;
import at.pcgamingfreaks.Version;

Expand All @@ -40,6 +41,7 @@
import org.jetbrains.annotations.Nullable;

import java.io.FileNotFoundException;
import java.lang.reflect.Field;
import java.util.*;
import java.util.logging.Level;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -709,7 +711,15 @@ private Sound getSound(final @NotNull String option, final @NotNull String autoV
try
{
if (MCVersion.isNewerOrEqualThan(MCVersion.MC_1_9) && soundName.equals("ORB_PICKUP")) soundName = "ENTITY_EXPERIENCE_ORB_PICKUP";
return Sound.valueOf(soundName);
if (MCVersion.isNewerOrEqualThan(MCVersion.MC_1_21))
{
Field f = Reflection.getField(Sound.class, soundName);
if (f != null) return (Sound) f.get(null);
}
else
{
return Sound.valueOf(soundName);
}
}
catch(Exception ignored)
{
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<packaging>pom</packaging>

<properties>
<revision>2.7.7</revision>
<revision>2.7.8</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<bukkitVersion>1.15.2-R0.1-SNAPSHOT</bukkitVersion>
<bungeeVersion>1.20-R0.2</bungeeVersion>
<pcgfPluginLibVersion>1.0.39.7-SNAPSHOT</pcgfPluginLibVersion>
<pcgfPluginLibVersion>1.0.39.8-SNAPSHOT</pcgfPluginLibVersion>
<mockito.version>5.11.0</mockito.version>
<mavenShade.version>3.5.3</mavenShade.version>

Expand Down

0 comments on commit 14cd2b4

Please sign in to comment.