Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d50a531
Basic implementation, on new branch for testing
EBro912 Jun 21, 2022
3e0037c
ChatRoomSpy
EBro912 Jun 21, 2022
89a92b6
Mostly update to 1.19
UnknownSilicon Jun 21, 2022
a6da5bc
(untested) save/load chatrooms
EBro912 Jun 22, 2022
5056435
*actually* save/load chatrooms
EBro912 Jun 22, 2022
45e1402
Add help and msg to make messaging less confusing
EBro912 Jun 22, 2022
5420722
bugfixes and improvements
EBro912 Jun 22, 2022
467a721
final bugfixes and more improvements
EBro912 Jun 22, 2022
55ce2c1
Basic diamond implementation (untested)
EBro912 Jul 8, 2022
6fb2052
Remove riftcoin transactions + actually enable the module lol
EBro912 Jul 9, 2022
820e871
ChestShop previewing + fixes
EBro912 Jul 9, 2022
60dd4a2
trim lengthy names on signs
EBro912 Jul 9, 2022
f6d01fa
Support double chests
EBro912 Jul 11, 2022
0d04d84
Convert purchases to a shop gui + improve previews
EBro912 Jul 12, 2022
a01fa21
doublechest gui
EBro912 Jul 12, 2022
8eb53dc
Correctly handle placing signs on existing shops
EBro912 Jul 12, 2022
fd868a9
Merge branch 'main' into 1.19
UnknownSilicon Jul 12, 2022
499d09a
Bump dependencies
UnknownSilicon Jul 13, 2022
7a705cb
Merge branch 'chestshops' into 1.19
UnknownSilicon Jul 13, 2022
f42f3b6
Merge branch 'chatrooms' into 1.19
UnknownSilicon Jul 13, 2022
b15870c
copy paste moment lol
EBro912 Jul 13, 2022
6da6237
prevent some dupes
EBro912 Jul 13, 2022
c2f3321
Bump dependency versions
UnknownSilicon Jul 13, 2022
eaae802
Merge branch '1.19' of github.com:ParallelMC/ParallelUtils into 1.19
UnknownSilicon Jul 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 44 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
plugins {
id 'java'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id("io.papermc.paperweight.userdev") version "1.3.3"
id("io.papermc.paperweight.userdev") version "1.3.7"
id("xyz.jpenilla.run-paper") version "1.0.6" // Adds runServer and runMojangMappedServer tasks for testing
id 'net.minecrell.plugin-yml.bukkit' version '0.5.1'
id 'net.minecrell.plugin-yml.bukkit' version '0.5.2'
}

group = 'org.parallelmc'

version = '2.4.0'
version = '2.5.0'
description = 'A set of utilities and features for use on the Parallel Minecraft server'

java {
Expand All @@ -29,22 +29,23 @@ repositories {
maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
maven { url = 'https://repo.dmulloy2.net/repository/public/' }
maven { url = 'https://repo.codemc.org/repository/maven-public/' }
maven { url = 'https://repo.rosewooddev.io/repository/public/' }
}

dependencies {
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.18.2-R0.1-SNAPSHOT")
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.19-R0.1-SNAPSHOT")

compileOnly "io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT"
implementation 'org.jetbrains:annotations:16.0.1'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
compileOnly "io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT"
implementation 'org.jetbrains:annotations:23.0.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
implementation 'net.dv8tion:JDA:4.4.0_350'
compileOnly 'me.clip:placeholderapi:2.10.10'
compileOnly 'me.clip:placeholderapi:2.11.2'
compileOnly fileTree('libs') { include '*.jar' }
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.6'
implementation 'mysql:mysql-connector-java:8.0.26'
compileOnly 'net.luckperms:api:5.3'
compileOnly 'com.comphenix.protocol:ProtocolLib:4.7.0'
compileOnly 'dev.esophose:playerparticles:7.25'
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.7'
implementation 'mysql:mysql-connector-java:8.0.29'
compileOnly 'net.luckperms:api:5.4'
compileOnly 'com.comphenix.protocol:ProtocolLib:4.8.0'
compileOnly 'dev.esophose:playerparticles:8.2'
}

artifacts {
Expand Down Expand Up @@ -81,7 +82,7 @@ bukkit {

main = 'parallelmc.parallelutils.Parallelutils'

apiVersion = '1.18'
apiVersion = '1.19'

depend = ['PlaceholderAPI', 'ProtocolLib']
softDepend = ['Multiverse-Core', 'FractalForest', 'WorldGuard', 'VoteParty', 'PlayerParticles', 'ProNouns']
Expand All @@ -93,6 +94,12 @@ bukkit {
permissionMessage = 'You do not have permission'
aliases = ['pu',]
}
chatroom {
description = 'Base command for all ChatRoom commands'
usage = '/cr'
permissionMessage = 'You do not have permission'
aliases = ['cr',]
}
depositexp {
description = 'Deposit exp into the player\' s ender chest '
usage = '/depositexp <amount | all>'
Expand Down Expand Up @@ -176,6 +183,12 @@ bukkit {
permissionMessage = 'You do not have permission'
permission = 'parallelutils.commandspy'
}
chatroomspy {
description = 'Toggles chatroom spy'
usage = '/chatroomspy'
permissionMessage = 'You do not have permission'
permission = 'parallelutils.chatrooms.chatroomspy'
}
mutechat {
description = 'Mute or unmute the chat'
usage = '/mutechat'
Expand Down Expand Up @@ -329,7 +342,7 @@ bukkit {
}
'parallelutils.bypass' {
description = 'Bypasses some ParallelUtils modules'
childrenMap = ['parallelutils.bypass.anticaps': true, 'parallelutils.bypass.antislur': true, 'parallelutils.bypass.clearchat': true, 'parallelutils.bypass.socialspy': true, 'parallelutils.bypass.commandspy': true, 'parallelutils.bypass.mutechat': true,]
childrenMap = ['parallelutils.bypass.anticaps': true, 'parallelutils.bypass.antislur': true, 'parallelutils.bypass.clearchat': true, 'parallelutils.bypass.socialspy': true, 'parallelutils.bypass.commandspy': true, 'parallelutils.bypass.mutechat': true,'parallelutils.bypass.chestshops': true, 'parallelutils.bypass.chatroomspy': true]
}
'parallelutils.bypass.anticaps' {
description = 'Bypasses the Anti-Caps module'
Expand All @@ -346,15 +359,31 @@ bukkit {
'parallelutils.bypass.commandspy' {
description = 'Bypasses the Command Spy module'
}
'parallelutils.bypass.chatroomspy' {
description = 'Bypasses the ChatRoom Spy module'
}
'parallelutils.bypass.mutechat' {
description = 'Bypasses chat being muted'
}
'parallelutils.bypass.chestshops' {
description = 'Bypasses chest shop protection'
}
'parallelutils.notify' {
description = 'Be notified by some ParallelUtils modules'
childrenMap = ['parallelutils.notify.antislur': true,]
}
'parallelutils.notify.antislur' {
description = 'Be notified of swearing'
}
'parallelutils.chestshops.create' {
description = 'Allows creation of Chest Shops'
}
'parallelutils.chatrooms' {
description = 'Chatroom admin permissions'
childrenMap = ['parallelutils.chatrooms.chatroomspy': true,]
}
'parallelutils.chatrooms.chatroomspy' {
description = 'View messages from all chatrooms'
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/parallelmc/parallelutils/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public class Constants {

public static final Version VERSION = new Version(2, 4, 0);
public static final Version VERSION = new Version(2, 5, 0);
public static final String PLUGIN_NAME = "ParallelUtils";
public static final String DEFAULT_WORLD = "world2";
}
50 changes: 48 additions & 2 deletions src/main/java/parallelmc/parallelutils/Parallelutils.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import parallelmc.parallelutils.commands.*;
import parallelmc.parallelutils.modules.charms.ParallelCharms;
import parallelmc.parallelutils.modules.bitsandbobs.BitsAndBobs;
import parallelmc.parallelutils.modules.chestshops.ChestShops;
import parallelmc.parallelutils.modules.custommobs.CustomMobs;
import parallelmc.parallelutils.modules.customtrees.ParallelTrees;
import parallelmc.parallelutils.modules.discordintegration.DiscordIntegration;
import parallelmc.parallelutils.modules.expstorage.ExpStorage;
import parallelmc.parallelutils.modules.gamemode4.beehiveInspector.BeehiveInspector;
import parallelmc.parallelutils.modules.parallelchat.ParallelChat;
import parallelmc.parallelutils.modules.parallelchat.commands.chatrooms.*;
import parallelmc.parallelutils.modules.parallelflags.ParallelFlags;
import parallelmc.parallelutils.modules.parallelitems.ParallelItems;
import parallelmc.parallelutils.modules.effectextender.EffectExtender;
Expand Down Expand Up @@ -47,6 +49,8 @@ public final class Parallelutils extends JavaPlugin {
private HashMap<String, ParallelModule> registeredModules;
private Commands commands;

private ChatroomCommands chatroomCommands;

@Override
public void onLoad() {
registeredModules = new HashMap<>();
Expand Down Expand Up @@ -151,17 +155,34 @@ public void onEnable() {
}

commands = new Commands();
chatroomCommands = new ChatroomCommands();

addCommand("help", new ParallelHelpCommand());
addCommand("test", new ParallelTestCommand());
addCommand("wait", new ParallelWaitCommand(this));

addChatRoomCommand("create", new ParallelCreateChatroom());
addChatRoomCommand("leave", new ParallelLeaveChatroom());
addChatRoomCommand("join", new ParallelJoinChatroom());
addChatRoomCommand("promote", new ParallelPromoteMember());
addChatRoomCommand("demote", new ParallelDemoteMember());
addChatRoomCommand("members", new ParallelListMembers());
addChatRoomCommand("kick", new ParallelKickMember());
addChatRoomCommand("list", new ParallelListChatrooms());
addChatRoomCommand("invite", new ParallelSendInvite());
addChatRoomCommand("accept", new ParallelAcceptInvite());
addChatRoomCommand("disband", new ParallelDisbandChatroom());
addChatRoomCommand("help", new ParallelHelpChatrooms());
addChatRoomCommand("msg", new ParallelMsgChatroom());

getCommand("parallelutils").setExecutor(commands);
getCommand("parallelutils").setTabCompleter(commands);
getCommand("pu").setExecutor(commands);
getCommand("pu").setTabCompleter(commands);


getCommand("chatroom").setExecutor(chatroomCommands);
getCommand("chatroom").setTabCompleter(chatroomCommands);
getCommand("cr").setExecutor(chatroomCommands);
getCommand("cr").setTabCompleter(chatroomCommands);

// Setup modules

Expand Down Expand Up @@ -270,6 +291,14 @@ public void onEnable() {
e.printStackTrace();
}

try {
ChestShops chestShops = new ChestShops();
chestShops.onEnable();
} catch (Exception e) {
Parallelutils.log(Level.SEVERE, "Error while enabling module ChestShops!");
e.printStackTrace();
}

// TODO: Make this not horrible
try {
ParallelModule flags = getModule("ParallelFlags");
Expand Down Expand Up @@ -423,6 +452,15 @@ public boolean addCommand(String name, ParallelCommand command) {
return commands.addCommand(name, command);
}

/**
* Wrapper for {@code parallelmc.parallelutils.modules.parallelchat.commands.chatrooms.ChatroomCommand.addCommand}
* Adds a new command to the commandmap
* @param name The name of the command
* @param command The command to be run when the name is called
* @return Returns true when the command was added successfully, false if the command already exists.
*/
public boolean addChatRoomCommand(String name, ChatroomCommand command) { return chatroomCommands.addCommand(name, command); }

/**
* Wrapper for {@code parallelmc.parallelutils.commands.Commands.getCommands}
* @return A deep copy of the command map
Expand All @@ -431,6 +469,14 @@ public Map<String, ParallelCommand> getCommands() {
return commands.getCommands();
}

/**
* Wrapper for {@code parallelmc.parallelutils.modules.parallelchat.commands.chatrooms.ChatroomCommands#getCommands()}
* @return A deep copy of the command map
*/
public Map<String, ChatroomCommand> getChatroomCommands() {
return chatroomCommands.getCommands();
}

/**
* A helper method to log a message at a specific log level with the prefix "[ParallelUtils] "
* @param level The level to log the message at
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/parallelmc/parallelutils/commands/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.command.*;
import org.bukkit.craftbukkit.v1_18_R2.command.ServerCommandSender;
import org.bukkit.craftbukkit.v1_19_R1.command.ServerCommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -88,7 +88,7 @@ public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Comman

String lowerName = command.getName().toLowerCase().strip();

if (lowerName.equals("parallelutils") || lowerName.equals("pu") && args.length == 1) {
if ((lowerName.equals("parallelutils") || lowerName.equals("pu")) && args.length == 1) {
// List every sub-command
list.addAll(commandMap.keySet());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import net.minecraft.nbt.CompoundTag;
import org.bukkit.Material;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.bukkit.Material;
import org.bukkit.Particle;
import org.bukkit.block.data.BlockData;
import org.bukkit.craftbukkit.v1_18_R2.block.data.CraftBlockData;
import org.bukkit.craftbukkit.v1_19_R1.block.data.CraftBlockData;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import dev.esophose.playerparticles.styles.ParticleStyle;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.v1_18_R2.inventory.CraftInventoryPlayer;
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventoryPlayer;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.world.inventory.*;
import net.minecraft.world.item.ItemStack;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_18_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down
Loading