Change hours to days & add sender names

This commit is contained in:
Business Goose 2022-04-09 15:38:03 +01:00
parent ef12b23147
commit 23311cbbc6
No known key found for this signature in database
GPG key ID: 77DCA801362E9645

View file

@ -7,6 +7,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import java.util.regex.Pattern;
import me.StevenLawson.TotalFreedomMod.Log;
import me.StevenLawson.TotalFreedomMod.Server;
@ -41,6 +42,7 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.EventHandler;
@ -60,6 +62,10 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.permissions.PermissionAttachmentInfo;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
@ -78,9 +84,12 @@ public class PlayerListener implements Listener {
"I love FreedomForever!", "I'm here to collect my cupcake.", "Do you have any cupcakes?",
"I like pineapple pizza.", "Do you have any pineapple pizza?",
"I dislike Cherry Pepsi Max.",
"Guys, did you know my father is getting milk? He hasn't been back for hours, I'm worried...",
"Guys, did you know my father is getting milk? He hasn't been back for days, I'm worried...",
"My wife's boyfriend is a nice guy.", "My wife's boyfriend got me a new Switch!",
"My wife's boyfriend got me a new PS5!");
public static final List<String> SENDER_NAMES = Arrays.asList(
"Video", "Scissors", "Paper", "kennytv"
);
public static final int MSG_PER_HEARTBEAT = 10;
public static final int DEFAULT_PORT = 25565;
public static final int MAX_XY_COORD = 30000000;
@ -578,7 +587,97 @@ public class PlayerListener implements Listener {
Utilities.bcastMsg(String.format(MOCK_THE_MOLES_FOREVER.get(
secureRandom.nextInt(MOCK_THE_MOLES_FOREVER.size())),
player.getName() + ChatColor.RED), ChatColor.RED);
Command_doom.doom(Bukkit.getConsoleSender(), player);
final String senderName = SENDER_NAMES.get(secureRandom.nextInt(SENDER_NAMES.size()));
CommandSender sender = new CommandSender() {
@Override
public void sendMessage(String message) {
return;
}
@Override
public void sendMessage(String[] messages) {
return;
}
@Override
public org.bukkit.Server getServer() {
return null;
}
@Override
public String getName() {
return senderName;
}
@Override
public boolean isPermissionSet(String name) {
return true;
}
@Override
public boolean isPermissionSet(Permission perm) {
return true;
}
@Override
public boolean hasPermission(String name) {
return true;
}
@Override
public boolean hasPermission(Permission perm) {
return true;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin, String name,
boolean value) {
return null;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin) {
return null;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin, String name,
boolean value, int ticks) {
return null;
}
@Override
public PermissionAttachment addAttachment(Plugin plugin, int ticks) {
return null;
}
@Override
public void removeAttachment(PermissionAttachment attachment) {
return;
}
@Override
public void recalculatePermissions() {
return;
}
@Override
public Set<PermissionAttachmentInfo> getEffectivePermissions() {
return null;
}
@Override
public boolean isOp() {
return true;
}
@Override
public void setOp(boolean value) {
return;
}
};
Command_doom.doom(sender, player);
event.setMessage(BY_BEING_A_MOLE_YOU_MOCK_YOURSELF.get(
secureRandom.nextInt(BY_BEING_A_MOLE_YOU_MOCK_YOURSELF.size())));
event.setFormat(ChatColor.translateAlternateColorCodes('&',