Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
package rename
mace create message
bug fix (ritual & disguise)
  • Loading branch information
Ghosty920 committed Oct 16, 2024
1 parent fe55cba commit 8b2cf6a
Show file tree
Hide file tree
Showing 32 changed files with 141 additions and 93 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
[![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/plugin/camouf2)
[![Discord](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/social/discord-plural_vector.svg)](https://discord.gg/akgp49Q76M)

**[Téléchargeable sur GitHub également !](https://github.com/Ghosty920/KamoofSMP-S2/releases/latest)**

</div>
<br>

Expand All @@ -21,8 +19,5 @@ Lorsqu'un joueur meurt, il fait tomber sa tête, qui, quand utilisée permet au
> [!WARNING]
> La configuration n'est pas compatible avec celle de la [saison 1 du KamoofSMP](https://modrinth.com/plugin/camouf), donc veuillez supprimer votre dossier `plugins/KamoofSMP` avant d'importer le nouveau plugin.
> [!NOTE]
> SVP n'hésitez pas à mettre une `⭐ Star` en haut de votre écran, et à le mettre en `❤️ Favori` sur Modrinth, ça aide à rendre le projet + visible sur google, merci à vous!
> [!CAUTION]
> Le plugin distribué par Sohran **ne** comporte **aucun** élément de la saison 2, *en + de **2 bugs majeurs**, donc **ATTENTION à vous !***
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ plugins {
id("com.gradleup.shadow") version ("8.3.0")
}

group = "me.ghosty"
version = "1.2.1"
group = "cc.ghosty"
version = "1.3.0"

repositories {
mavenCentral()
Expand Down
6 changes: 6 additions & 0 deletions configs/english.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ messages:
# You can't start a ritual during this time
# %player% = Player name
ritual-wrong-time: "<red>You can't start the ritual for the moment, come back later"
# You crafted a mace (with mace-limiter enabled)
# %player% = Player name
# %limit% = Limit of maces craftable
# %old% = Previous number of maces crafted
# %now% = New number of maces crafted
craft-mace: "<green>You crafted a MACE, the limit is : %limit% copies"


# Auto-update is a module to automatically check for a new plugin update
Expand Down
6 changes: 6 additions & 0 deletions configs/french.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ messages:
# Tu ne peux pas lancer de rituel dans la période actuelle
# %player% = Nom du joueur
ritual-wrong-time: "<red>Tu ne peux pas lancer le rituel maintenant, reviens plus tard"
# Tu viens de crafter une mace (avec mace-limiter d'activé)
# %player% = Nom du joueur
# %limit% = Limite de maces autorisées
# %old% = Ancien nombre de maces crées
# %now% = Nouveau nombre de maces crées
craft-mace: "<green>Tu as crafté une MACE, le maximum possible est de : %limit% exemplaire(s)"


# L'auto-update est un module permettant de check automatiquement pour une nouvelle mise à jour du plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package me.ghosty.kamoof;
package cc.ghosty.kamoof;

import cc.ghosty.kamoof.commands.*;
import cc.ghosty.kamoof.features.ritual.*;
import lombok.Getter;
import lombok.SneakyThrows;
import me.ghosty.kamoof.commands.*;
import me.ghosty.kamoof.features.autoupdate.UpdateChecker;
import me.ghosty.kamoof.features.disguise.DisguiseListener;
import me.ghosty.kamoof.features.disguise.DisguiseRestaurer;
import me.ghosty.kamoof.features.drophead.HeadDropper;
import me.ghosty.kamoof.features.macelimiter.MaceLimiter;
import me.ghosty.kamoof.features.ritual.*;
import me.ghosty.kamoof.utils.Lang;
import me.ghosty.kamoof.utils.Metrics;
import cc.ghosty.kamoof.commands.*;
import cc.ghosty.kamoof.features.autoupdate.UpdateChecker;
import cc.ghosty.kamoof.features.disguise.DisguiseListener;
import cc.ghosty.kamoof.features.disguise.DisguiseRestaurer;
import cc.ghosty.kamoof.features.drophead.HeadDropper;
import cc.ghosty.kamoof.features.macelimiter.MaceLimiter;
import cc.ghosty.kamoof.features.ritual.*;
import cc.ghosty.kamoof.utils.Lang;
import cc.ghosty.kamoof.utils.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.TabCompleter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.ghosty.kamoof.commands;
package cc.ghosty.kamoof.commands;

import me.ghosty.kamoof.features.drophead.SkullManager;
import me.ghosty.kamoof.utils.Lang;
import cc.ghosty.kamoof.features.drophead.SkullManager;
import cc.ghosty.kamoof.utils.Lang;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.ghosty.kamoof.commands;
package cc.ghosty.kamoof.commands;

import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.features.ritual.*;
import me.ghosty.kamoof.utils.Lang;
import me.ghosty.kamoof.utils.Message;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.features.ritual.*;
import cc.ghosty.kamoof.utils.Lang;
import cc.ghosty.kamoof.utils.Message;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.*;
Expand All @@ -13,7 +13,7 @@

import java.util.*;

import static me.ghosty.kamoof.KamoofSMP.PREFIX;
import static cc.ghosty.kamoof.KamoofSMP.PREFIX;

public final class KamoofCMD implements CommandExecutor, TabCompleter {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package me.ghosty.kamoof.commands;
package cc.ghosty.kamoof.commands;

import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.features.disguise.DisguiseManager;
import me.ghosty.kamoof.features.drophead.SkullManager;
import me.ghosty.kamoof.utils.Lang;
import me.ghosty.kamoof.utils.Message;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.features.disguise.DisguiseManager;
import cc.ghosty.kamoof.features.drophead.SkullManager;
import cc.ghosty.kamoof.utils.Lang;
import cc.ghosty.kamoof.utils.Message;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package me.ghosty.kamoof.features.autoupdate;
package cc.ghosty.kamoof.features.autoupdate;

import cc.ghosty.kamoof.utils.*;
import com.google.gson.*;
import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.utils.*;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.utils.*;
import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package me.ghosty.kamoof.features.disguise;
package cc.ghosty.kamoof.features.disguise;

import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.features.drophead.SkullManager;
import me.ghosty.kamoof.utils.Message;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.features.drophead.SkullManager;
import cc.ghosty.kamoof.utils.Message;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.*;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.*;
import org.bukkit.inventory.ItemStack;
import xyz.haoshoku.nick.api.NickAPI;

Expand Down Expand Up @@ -82,4 +82,24 @@ public void onDeath(PlayerDeathEvent event) {
DisguiseRestaurer.set(player.getUniqueId(), null);
}

@EventHandler(priority = EventPriority.HIGHEST)
public void onRequestJoin(AsyncPlayerPreLoginEvent event) {
if(event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED)
return;
Bukkit.getScheduler().runTask(KamoofSMP.getInstance(), () -> {
Player player = NickAPI.getPlayerOfNickedName(event.getName());
if(player == null)
return;
NickAPI.setGameProfileName(player, NickAPI.getOriginalGameProfileName(player));
NickAPI.refreshPlayer(player);

Bukkit.getScheduler().runTaskLater(KamoofSMP.getInstance(), () -> {
if(!player.isOnline())
return;
NickAPI.setGameProfileName(player, event.getName());
NickAPI.refreshPlayer(player);
}, 1L);
});
}

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.ghosty.kamoof.features.disguise;
package cc.ghosty.kamoof.features.disguise;

import lombok.experimental.UtilityClass;
import me.ghosty.kamoof.utils.Reflection;
import cc.ghosty.kamoof.utils.Reflection;
import org.bukkit.entity.Player;
import xyz.haoshoku.nick.api.NickAPI;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.ghosty.kamoof.features.disguise;
package cc.ghosty.kamoof.features.disguise;

import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.utils.Message;
import me.ghosty.kamoof.utils.Placeholder;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.utils.Message;
import cc.ghosty.kamoof.utils.Placeholder;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.ghosty.kamoof.features.disguise;
package cc.ghosty.kamoof.features.disguise;

import lombok.AllArgsConstructor;
import org.bukkit.entity.Player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.ghosty.kamoof.features.drophead;
package cc.ghosty.kamoof.features.drophead;

import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.features.ritual.RitualHandler;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.features.ritual.RitualHandler;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.ghosty.kamoof.features.drophead;
package cc.ghosty.kamoof.features.drophead;

import lombok.experimental.UtilityClass;
import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.utils.Placeholder;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.utils.Placeholder;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package me.ghosty.kamoof.features.macelimiter;
package cc.ghosty.kamoof.features.macelimiter;

import me.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.utils.Message;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.*;
import org.bukkit.event.block.CrafterCraftEvent;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.inventory.ItemStack;
import xyz.haoshoku.nick.api.NickAPI;

import java.util.Map;

public final class MaceLimiter implements Listener {

Expand Down Expand Up @@ -69,9 +75,14 @@ public void onCraft(CraftItemEvent event) {
return;
}

if (canCraft())
if (canCraft()) {
int old = KamoofSMP.getData().getInt("maces", 0);
int limit = KamoofSMP.config().getInt("macelimiter.limit");
add();
else
HumanEntity player = event.getView().getPlayer();
Message.send(player, "messages.craft-mace", Map.of("player", (player instanceof Player p ? NickAPI.getOriginalName(p) : player.getName()), "old", old, "now", old+1, "limit", limit));
} else
event.setCancelled(true);
}

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package me.ghosty.kamoof.features.ritual;
package cc.ghosty.kamoof.features.ritual;

import cc.ghosty.kamoof.utils.*;
import lombok.SneakyThrows;
import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.utils.*;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.utils.*;
import org.bukkit.*;
import org.bukkit.entity.ArmorStand;
import org.bukkit.inventory.ItemStack;
Expand All @@ -18,9 +19,9 @@
import java.util.UUID;
import java.util.function.Consumer;

import static me.ghosty.kamoof.KamoofSMP.config;
import static me.ghosty.kamoof.features.ritual.RitualHandler.offsets;
import static me.ghosty.kamoof.utils.Utils.interpolate;
import static cc.ghosty.kamoof.KamoofSMP.config;
import static cc.ghosty.kamoof.features.ritual.RitualHandler.offsets;
import static cc.ghosty.kamoof.utils.Utils.interpolate;

public final class RitualAnimation {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.ghosty.kamoof.features.ritual;
package cc.ghosty.kamoof.features.ritual;

import lombok.experimental.UtilityClass;
import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.utils.Message;
import me.ghosty.kamoof.utils.Placeholder;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.utils.Message;
import cc.ghosty.kamoof.utils.Placeholder;
import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.ghosty.kamoof.features.ritual;
package cc.ghosty.kamoof.features.ritual;

import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.utils.Message;
import me.ghosty.kamoof.utils.SLocation;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.utils.Message;
import cc.ghosty.kamoof.utils.SLocation;
import org.bukkit.*;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
Expand All @@ -16,7 +16,7 @@

import java.util.*;

import static me.ghosty.kamoof.KamoofSMP.config;
import static cc.ghosty.kamoof.KamoofSMP.config;

public final class RitualHandler {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package me.ghosty.kamoof.features.ritual;
package cc.ghosty.kamoof.features.ritual;

import me.ghosty.kamoof.KamoofSMP;
import me.ghosty.kamoof.features.drophead.SkullManager;
import me.ghosty.kamoof.utils.Message;
import cc.ghosty.kamoof.KamoofSMP;
import cc.ghosty.kamoof.features.drophead.SkullManager;
import cc.ghosty.kamoof.utils.Message;
import org.bukkit.*;
import org.bukkit.attribute.Attribute;
import org.bukkit.entity.ArmorStand;
Expand Down Expand Up @@ -78,8 +78,8 @@ public void onPlaceHead(PlayerArmorStandManipulateEvent event) {
if (dupes.size() >= KamoofSMP.config().getInt("ritual.dupelimit")) {
dupes.forEach(stand -> player.spawnParticle(Particle.DUST, stand.getLocation().add(0, 1.45 + 0.25 + 0.2, 0), 4, 0, 0, 0, 0, (new Particle.DustOptions(Color.ORANGE, 3)), true));
player.spawnParticle(Particle.DUST, entity.getLocation().add(0, 1.45 + 0.25 + 0.2, 0), 4, 0, 0, 0, 0, (new Particle.DustOptions(Color.ORANGE, 3)), true);
canRunRitual = false;
event.setCancelled(false);
event.setCancelled(true);
return;
}

if (canRunRitual) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.ghosty.kamoof.features.ritual;
package cc.ghosty.kamoof.features.ritual;

import lombok.SneakyThrows;
import org.bukkit.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.ghosty.kamoof.utils;
package cc.ghosty.kamoof.utils;

import lombok.experimental.UtilityClass;
import org.bukkit.Color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* You should have received a copy of the MIT License alongside this software; refer to LICENSE for information.
* If not, refer to https://mit-license.org.
*/
package me.ghosty.kamoof.utils;
package cc.ghosty.kamoof.utils;

import lombok.NonNull;
import lombok.experimental.UtilityClass;
Expand Down
Loading

0 comments on commit 8b2cf6a

Please sign in to comment.