Fixed an issue with chest tier rolls

This commit is contained in:
Jules 2024-07-13 01:12:30 -07:00
parent 040e7360df
commit 0553f0bfe5
3 changed files with 8 additions and 11 deletions

View File

@ -105,13 +105,6 @@
<url>https://simonsator.de/repo</url> <url>https://simonsator.de/repo</url>
</repository> </repository>
<!-- MythicDungeons repository -->
<repository>
<id>aestrus-releases</id>
<name>Aestrus's Repository</name>
<url>https://maven.aestrus.io/releases</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
@ -166,7 +159,7 @@
<dependency> <dependency>
<groupId>net.playavalon</groupId> <groupId>net.playavalon</groupId>
<artifactId>MythicDungeons</artifactId> <artifactId>MythicDungeons</artifactId>
<version>1.3.0-SNAPSHOT</version> <version>1.4.1-SNAPSHOT-CUSTOM</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>

View File

@ -1111,11 +1111,15 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD
return true; return true;
} }
public void displayActionBar(String message) { public void displayActionBar(@NotNull String message) {
displayActionBar(message, false); displayActionBar(message, false);
} }
public void displayActionBar(String message, boolean raw) { public void displayActionBar(@NotNull String message, boolean raw) {
// TODO add an option to disable action-bar properly in all casting modes
if (ChatColor.stripColor(message).isEmpty()) return;
setLastActivity(PlayerActivity.ACTION_BAR_MESSAGE); setLastActivity(PlayerActivity.ACTION_BAR_MESSAGE);
if (raw) MythicLib.plugin.getVersion().getWrapper().sendActionBarRaw(getPlayer(), message); if (raw) MythicLib.plugin.getVersion().getWrapper().sendActionBarRaw(getPlayer(), message);
else getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message)); else getPlayer().spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));

View File

@ -63,7 +63,7 @@ public class RandomWeightedRoll<T extends Weighted> {
* @return The real weight of an item considering the player's chance stat. * @return The real weight of an item considering the player's chance stat.
*/ */
private double computeRealWeight(T item, double chance) { private double computeRealWeight(T item, double chance) {
return Math.pow(item.getWeight(), 1 / Math.pow(1 + CHANCE_COEFFICIENT * chance, 1 / 3)); return Math.pow(item.getWeight(), 1 / Math.pow(1 + CHANCE_COEFFICIENT * chance, 1. / 3.));
} }
/* /*