Compare commits

...

4 Commits

Author SHA1 Message Date
f36e6b1aa0
Refactoring 2024-01-31 12:34:04 +01:00
629695ac21
Item drop bug 2024-01-31 12:27:38 +01:00
8bf35896f4
/void manage bring command 2024-01-29 18:25:13 +01:00
1d34a3040d
Show Custom Name 2024-01-29 18:23:02 +01:00
8 changed files with 34 additions and 23 deletions

18
TODO.md
View File

@ -3,15 +3,17 @@
- [x] deathBan reset
- [x] voids exchanges
- [x] /void give négatives values
- [+] Make Discord Webhoook for item changes
- [+] chest name
- [+] Show next Item
- [x] Make Discord Webhoook for item changes
- [x] chest name
- [x] Show next Item
- [x] /void manage bring
- [+] /void give afficher title
- subtitle + chat
- [ ] i18n
- [ ] /void manage bring
- [ ] Dupe bug (respawn) -> Gamerule
- [+] Double Check Inventory reset on die
- [+] Annonce
- [+] Find Map : 51 (250, 300)
- [+] Dupe bug (respawn)
- [-] i18n
- [ ] Events
- [ ] Command completions
- [ ] Annonce
- [ ] Double Check Inventory reset on die
- [ ] More descriptive /void commands

View File

@ -20,6 +20,9 @@ public class BanHourly implements Listener{
@EventHandler
public void died(PlayerDeathEvent e){
DatabaseManager.getInstance().setDeath(e.getPlayer().getUniqueId());
e.setKeepInventory(true);
e.setKeepLevel(false);
e.getDrops().clear();
e.getPlayer().kick(Component.text("Vous etes mort dans la dernière heure... Patientez la prochaine!"), Cause.BANNED);
}
}

View File

@ -11,7 +11,6 @@ import java.util.HashMap;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
public class DatabaseManager {

View File

@ -1,4 +1,4 @@
package ovh.herisson.thevoidroad.Event;
package ovh.herisson.thevoidroad;
import java.time.LocalTime;

View File

@ -1,4 +1,4 @@
package ovh.herisson.thevoidroad.Entity;
package ovh.herisson.thevoidroad;
import java.io.File;
import java.nio.file.Files;
@ -24,12 +24,6 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataType;
import net.kyori.adventure.text.Component;
import ovh.herisson.thevoidroad.DatabaseManager;
import ovh.herisson.thevoidroad.DiscordWebhook;
import ovh.herisson.thevoidroad.TheVoidRoad;
import ovh.herisson.thevoidroad.Voids;
import ovh.herisson.thevoidroad.Event.HourEvent;
import ovh.herisson.thevoidroad.util.Tuple;
//Unique, so singleton patern
public class Merchand implements Listener{
@ -89,6 +83,7 @@ public class Merchand implements Listener{
m.setGlowing(true);
m.setInvulnerable(true);
m.customName(Component.text(names.get(new Random().nextInt(names.size()))));
m.setCustomNameVisible(true);
inv = Bukkit.createInventory(null, 9, Component.text(m.getName()));
Bukkit.getServer().forEachAudience((a) -> {
if(a instanceof Player ply){
@ -177,4 +172,8 @@ public class Merchand implements Listener{
}
}
}
public void teleport(Location location) {
m.teleport(location);
}
}

View File

@ -2,9 +2,9 @@ package ovh.herisson.thevoidroad;
import org.bukkit.plugin.java.JavaPlugin;
import ovh.herisson.thevoidroad.Commands.VoidCommands;
import ovh.herisson.thevoidroad.Entity.Merchand;
import ovh.herisson.thevoidroad.Event.HourEvent;
import ovh.herisson.thevoidroad.VoidCommands;
import ovh.herisson.thevoidroad.Merchand;
import ovh.herisson.thevoidroad.HourEvent;
public class TheVoidRoad extends JavaPlugin{

View File

@ -1,4 +1,4 @@
package ovh.herisson.thevoidroad.util;
package ovh.herisson.thevoidroad;
public class Tuple<X, Y> {
public final X x;

View File

@ -1,4 +1,4 @@
package ovh.herisson.thevoidroad.Commands;
package ovh.herisson.thevoidroad;
import java.util.ArrayList;
import java.util.List;
@ -17,7 +17,7 @@ import net.kyori.adventure.text.Component;
import ovh.herisson.thevoidroad.DatabaseManager;
import ovh.herisson.thevoidroad.TheVoidRoad;
import ovh.herisson.thevoidroad.Voids;
import ovh.herisson.thevoidroad.Entity.Merchand;
import ovh.herisson.thevoidroad.Merchand;
public class VoidCommands implements CommandExecutor, TabCompleter{
private final Merchand m = Merchand.getInstance();
@ -76,6 +76,14 @@ public class VoidCommands implements CommandExecutor, TabCompleter{
sender.sendMessage("You can't teleport!");
}
break;
case "bring":
if(sender instanceof Player ply && m.getLocation() != null){
m.teleport(ply.getLocation());
}else{
return false;
}
break;
case "balance":
if(args.length < 5) return false;
switch (args[2]) {