parent
e3e5f58f32
commit
7598aded28
12 changed files with 283 additions and 82 deletions
18
.forgejo/workflows/build.yml
Normal file
18
.forgejo/workflows/build.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: docker
|
||||||
|
container: debian:sid
|
||||||
|
steps:
|
||||||
|
- name: Prepare for installation
|
||||||
|
run: apt update
|
||||||
|
- name: Install JDK
|
||||||
|
run: apt install --no-install-recommends -y openjdk-21-jdk-headless maven git nodejs
|
||||||
|
- name: Clone repository
|
||||||
|
run: git clone https://git.m724.eu/Minecon724/mutils.git .
|
||||||
|
- name: Build
|
||||||
|
run: mvn clean package
|
||||||
|
- name: Upload artifacts
|
||||||
|
uses: https://github.com/actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
path: target/mutils-*.jar
|
22
src/main/java/eu/m724/tweaks/TweaksPlugin.java
Normal file
22
src/main/java/eu/m724/tweaks/TweaksPlugin.java
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
package eu.m724.tweaks;
|
||||||
|
|
||||||
|
import eu.m724.tweaks.chat.ChatCommands;
|
||||||
|
import eu.m724.tweaks.chat.ChatManager;
|
||||||
|
import eu.m724.tweaks.door.DoorListener;
|
||||||
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class TweaksPlugin extends JavaPlugin {
|
||||||
|
@Override
|
||||||
|
public void onEnable() {
|
||||||
|
ChatManager chatManager = new ChatManager(this);
|
||||||
|
chatManager.init();
|
||||||
|
|
||||||
|
ChatCommands chatCommands = new ChatCommands(chatManager);
|
||||||
|
Objects.requireNonNull(getCommand("chat")).setExecutor(chatCommands);
|
||||||
|
Objects.requireNonNull(getCommand("chatmanage")).setExecutor(chatCommands);
|
||||||
|
|
||||||
|
getServer().getPluginManager().registerEvents(new DoorListener(), this);
|
||||||
|
}
|
||||||
|
}
|
20
src/main/java/eu/m724/tweaks/auth/AuthListener.java
Normal file
20
src/main/java/eu/m724/tweaks/auth/AuthListener.java
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package eu.m724.tweaks.auth;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
|
|
||||||
|
public class AuthListener implements Listener {
|
||||||
|
private final AuthManager authManager;
|
||||||
|
|
||||||
|
public AuthListener(AuthManager authManager) {
|
||||||
|
this.authManager = authManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerLogin(PlayerLoginEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
String hostname = event.getHostname();
|
||||||
|
}
|
||||||
|
}
|
11
src/main/java/eu/m724/tweaks/auth/AuthManager.java
Normal file
11
src/main/java/eu/m724/tweaks/auth/AuthManager.java
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
package eu.m724.tweaks.auth;
|
||||||
|
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
public class AuthManager {
|
||||||
|
private final Plugin plugin;
|
||||||
|
|
||||||
|
public AuthManager(Plugin plugin) {
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.m724.utils.chat;
|
package eu.m724.tweaks.chat;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
@ -57,6 +57,8 @@ public class ChatCommands implements CommandExecutor {
|
||||||
component = new ComponentBuilder("Invalid password").color(ChatColor.RED)
|
component = new ComponentBuilder("Invalid password").color(ChatColor.RED)
|
||||||
.create();
|
.create();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
authenticated = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
component = new ComponentBuilder("No room named ").color(ChatColor.RED)
|
component = new ComponentBuilder("No room named ").color(ChatColor.RED)
|
||||||
|
@ -79,66 +81,92 @@ public class ChatCommands implements CommandExecutor {
|
||||||
} else if (command.getName().equals("chatmanage")) {
|
} else if (command.getName().equals("chatmanage")) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
ChatRoom chatRoom = manager.getPlayerChatRoom(player);
|
ChatRoom chatRoom = manager.getPlayerChatRoom(player);
|
||||||
|
boolean isOwner = player.equals(chatRoom.owner);
|
||||||
if (!chatRoom.owner.equals(player)) {
|
|
||||||
sender.sendMessage("You're not the owner of %s, please enter the room you want to make changes in".formatted(chatRoom.id));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
String action = args[0];
|
String action = args[0];
|
||||||
String argument = args[1];
|
String argument = args[1];
|
||||||
if (action.equals("create")) {
|
|
||||||
try {
|
switch (action) {
|
||||||
ChatRoom newRoom = manager.createChatRoom(argument, null, player);
|
case "create" -> {
|
||||||
sender.sendMessage("Created a chat room. Join it: /c " + newRoom.id);
|
|
||||||
sender.sendMessage("You might also want to protect it with a password: /cm setpassword");
|
|
||||||
} catch (ChatManager.InvalidIdException e) {
|
|
||||||
sender.sendMessage("ID is invalid: " + e.getMessage());
|
|
||||||
} catch (ChatManager.ChatRoomExistsException e) {
|
|
||||||
sender.sendMessage("Room %s already exists".formatted(argument));
|
|
||||||
} catch (IOException e) {
|
|
||||||
sender.sendMessage("Failed to create room");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
} else if (action.equals("delete")) {
|
|
||||||
// TODO
|
|
||||||
} else if (action.equals("setowner")) {
|
|
||||||
Player newOwner = Bukkit.getPlayer(argument);
|
|
||||||
if (newOwner != null && newOwner.isOnline()) {
|
|
||||||
chatRoom.owner = newOwner;
|
|
||||||
try {
|
try {
|
||||||
manager.saveChatRoom(chatRoom);
|
ChatRoom newRoom = manager.createChatRoom(argument, null, player);
|
||||||
sender.sendMessage("Owner changed to " + newOwner.getName());
|
sender.sendMessage("Created a chat room. Join it: /c " + newRoom.id);
|
||||||
|
sender.sendMessage("You might also want to protect it with a password: /cm setpassword");
|
||||||
|
} catch (ChatManager.InvalidIdException e) {
|
||||||
|
sender.sendMessage("ID is invalid: " + e.getMessage());
|
||||||
|
} catch (ChatManager.ChatRoomExistsException e) {
|
||||||
|
sender.sendMessage("Room %s already exists".formatted(argument));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
sender.sendMessage("Failed to change owner");
|
sender.sendMessage("Failed to create room");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
sender.sendMessage("Player must be online");
|
|
||||||
}
|
}
|
||||||
} else if (action.equals("setpassword")) {
|
case "delete" -> {
|
||||||
chatRoom.password = Arrays.stream(args).skip(1).collect(Collectors.joining(" ")).strip();
|
if (argument.equals(chatRoom.id)) {
|
||||||
try {
|
if (isOwner) {
|
||||||
manager.saveChatRoom(chatRoom);
|
// TODO
|
||||||
sender.sendMessage("Password changed");
|
} else {
|
||||||
} catch (IOException e) {
|
sender.sendMessage("You're not the owner of %s, please enter the room you want to make changes in".formatted(chatRoom.id));
|
||||||
sender.sendMessage("Failed to change password");
|
}
|
||||||
e.printStackTrace();
|
} else {
|
||||||
}
|
sender.sendMessage("Pass %s as an argument to confirm".formatted(chatRoom.id));
|
||||||
} else if (action.equals("setcolor")) {
|
|
||||||
ChatColor newColor = ChatColor.of(argument);
|
|
||||||
if (newColor != null) {
|
|
||||||
chatRoom.color = newColor;
|
|
||||||
try {
|
|
||||||
manager.saveChatRoom(chatRoom);
|
|
||||||
sender.sendMessage("Message color changed to " + newColor.getName());
|
|
||||||
} catch (IOException e) {
|
|
||||||
sender.sendMessage("Failed to change color");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
sender.sendMessage("Invalid color");
|
case "setowner" -> {
|
||||||
|
if (isOwner) {
|
||||||
|
Player newOwner = Bukkit.getPlayer(argument);
|
||||||
|
if (newOwner != null && newOwner.isOnline()) {
|
||||||
|
chatRoom.owner = newOwner;
|
||||||
|
try {
|
||||||
|
manager.saveChatRoom(chatRoom);
|
||||||
|
sender.sendMessage("Owner changed to " + newOwner.getName());
|
||||||
|
} catch (IOException e) {
|
||||||
|
sender.sendMessage("Failed to change owner");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("Player must be online");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("You're not the owner of %s, please enter the room you want to make changes in".formatted(chatRoom.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "setpassword" -> {
|
||||||
|
if (isOwner) {
|
||||||
|
chatRoom.password = Arrays.stream(args).skip(1).collect(Collectors.joining(" ")).strip();
|
||||||
|
try {
|
||||||
|
manager.saveChatRoom(chatRoom);
|
||||||
|
sender.sendMessage("Password changed");
|
||||||
|
} catch (IOException e) {
|
||||||
|
sender.sendMessage("Failed to change password");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("You're not the owner of %s, please enter the room you want to make changes in".formatted(chatRoom.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case "setcolor" -> {
|
||||||
|
if (isOwner) {
|
||||||
|
ChatColor newColor = ChatColor.of(argument);
|
||||||
|
if (newColor != null) {
|
||||||
|
chatRoom.color = newColor;
|
||||||
|
try {
|
||||||
|
manager.saveChatRoom(chatRoom);
|
||||||
|
sender.sendMessage("Message color changed to " + newColor.getName());
|
||||||
|
} catch (IOException e) {
|
||||||
|
sender.sendMessage("Failed to change color");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("Invalid color");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sender.sendMessage("You're not the owner of %s, please enter the room you want to make changes in".formatted(chatRoom.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
sender.sendMessage("Actions: create, delete, setowner, setpassword, setcolor");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (args.length > 0) {
|
} else if (args.length > 0) {
|
||||||
|
@ -153,10 +181,11 @@ public class ChatCommands implements CommandExecutor {
|
||||||
sender.sendMessage("To change the password of room %s, pass the new password as an argument for this action.".formatted(chatRoom));
|
sender.sendMessage("To change the password of room %s, pass the new password as an argument for this action.".formatted(chatRoom));
|
||||||
case "setcolor" ->
|
case "setcolor" ->
|
||||||
sender.sendMessage("To change the message color of room %s, pass the new color as an argument for this action. #hex or color name.".formatted(chatRoom));
|
sender.sendMessage("To change the message color of room %s, pass the new color as an argument for this action. #hex or color name.".formatted(chatRoom));
|
||||||
default -> sender.sendMessage("create, delete, setowner, setpassword");
|
default ->
|
||||||
|
sender.sendMessage("Actions: create, delete, setowner, setpassword, setcolor");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage("create, delete, setowner, setpassword, setcolor");
|
sender.sendMessage("Actions: create, delete, setowner, setpassword, setcolor");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.m724.utils.chat;
|
package eu.m724.tweaks.chat;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.m724.utils.chat;
|
package eu.m724.tweaks.chat;
|
||||||
|
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.m724.utils.chat;
|
package eu.m724.tweaks.chat;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
|
@ -6,6 +6,7 @@ import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -37,14 +38,17 @@ public class ChatRoom {
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
builder = builder.append("\nOwner: ").color(ChatColor.GOLD)
|
builder = builder.append("\nOwner: ").color(ChatColor.GOLD)
|
||||||
.append(owner.getName()).color(ChatColor.AQUA);
|
.append(owner.getName()).color(ChatColor.AQUA);
|
||||||
builder = builder.append("\nOnline (%d): ".formatted(players.size())).color(ChatColor.GOLD);
|
|
||||||
|
|
||||||
List<Player> playersList = players.stream().sorted().toList();
|
if (!players.isEmpty()) {
|
||||||
builder = builder.append(playersList.removeFirst().getName()).color(ChatColor.GRAY);
|
builder = builder.append("\nOnline (%d): ".formatted(players.size())).color(ChatColor.GOLD);
|
||||||
|
|
||||||
for (Player player : playersList) {
|
List<Player> playersList = new ArrayList<>(players);
|
||||||
builder = builder.append(", ").color(ChatColor.GRAY)
|
builder = builder.append(playersList.removeFirst().getName()).color(ChatColor.GRAY);
|
||||||
.append(player.getName()).color(ChatColor.AQUA);
|
|
||||||
|
for (Player player : playersList) {
|
||||||
|
builder = builder.append(", ").color(ChatColor.GRAY)
|
||||||
|
.append(player.getName()).color(ChatColor.AQUA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder.create();
|
return builder.create();
|
|
@ -1,4 +1,4 @@
|
||||||
package eu.m724.utils.chat;
|
package eu.m724.tweaks.chat;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
@ -37,7 +37,7 @@ public class ChatRoomLoader {
|
||||||
return 2;
|
return 2;
|
||||||
} else if (!id.equals(id.toLowerCase())) {
|
} else if (!id.equals(id.toLowerCase())) {
|
||||||
return 3;
|
return 3;
|
||||||
} else if (id.chars().allMatch(Character::isLetterOrDigit)) {
|
} else if (!id.chars().allMatch(Character::isLetterOrDigit)) {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
113
src/main/java/eu/m724/tweaks/door/DoorListener.java
Normal file
113
src/main/java/eu/m724/tweaks/door/DoorListener.java
Normal file
|
@ -0,0 +1,113 @@
|
||||||
|
package eu.m724.tweaks.door;
|
||||||
|
|
||||||
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
|
import org.bukkit.block.data.type.Door;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.Action;
|
||||||
|
import org.bukkit.event.block.BlockDamageEvent;
|
||||||
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.util.RayTraceResult;
|
||||||
|
|
||||||
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
|
public class DoorListener implements Listener {
|
||||||
|
@EventHandler
|
||||||
|
public void onBlockDamage(BlockDamageEvent event) {
|
||||||
|
Block block = event.getBlock();
|
||||||
|
if (!(block.getBlockData() instanceof Door door)) return;
|
||||||
|
|
||||||
|
World world = block.getLocation().getWorld();
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
|
// TODO maybe it would be faster to check just player and the door
|
||||||
|
RayTraceResult result = player.rayTraceBlocks(5);
|
||||||
|
if (result == null) return;
|
||||||
|
|
||||||
|
Location hitLocation = result.getHitPosition().toLocation(world);
|
||||||
|
double distance = player.getEyeLocation().distanceSquared(hitLocation);
|
||||||
|
if (distance > 12) return;
|
||||||
|
|
||||||
|
Sound sound = block.getType() == Material.IRON_DOOR ? Sound.ENTITY_ZOMBIE_ATTACK_IRON_DOOR : Sound.ENTITY_ZOMBIE_ATTACK_WOODEN_DOOR;
|
||||||
|
float volume = player.isSneaking() ? 0.4f : 1f;
|
||||||
|
float pitch = player.getFallDistance() > 0 ? 1f : 1.5f;
|
||||||
|
|
||||||
|
if (player.hasPotionEffect(PotionEffectType.NAUSEA)) {
|
||||||
|
pitch = ThreadLocalRandom.current().nextFloat(0.5f, 0.7f);
|
||||||
|
}
|
||||||
|
|
||||||
|
PotionEffect weakness = player.getPotionEffect(PotionEffectType.WEAKNESS);
|
||||||
|
PotionEffect fatigue = player.getPotionEffect(PotionEffectType.MINING_FATIGUE);
|
||||||
|
int level = (weakness != null ? weakness.getAmplifier() : 0) + (fatigue != null ? fatigue.getAmplifier() : 0);
|
||||||
|
|
||||||
|
if (weakness != null || fatigue != null) {
|
||||||
|
volume /= level / 3f;
|
||||||
|
pitch /= level;
|
||||||
|
}
|
||||||
|
|
||||||
|
volume *= (float) ((10.0 - Math.min(distance - 2, 10.0)) / 10.0);
|
||||||
|
|
||||||
|
world.playSound(hitLocation, sound, volume, pitch);
|
||||||
|
world.spawnParticle(Particle.BLOCK, hitLocation, (int) (10 * volume), door);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
|
// make sure the player is opening a door
|
||||||
|
if (!event.hasBlock()) return;
|
||||||
|
if (event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
|
||||||
|
Block block = event.getClickedBlock();
|
||||||
|
if (!(block.getBlockData() instanceof Door door)) return;
|
||||||
|
|
||||||
|
// check if the doors are in like one line
|
||||||
|
boolean right = door.getHinge() == Door.Hinge.RIGHT;
|
||||||
|
Location location = block.getLocation();
|
||||||
|
BlockFace expectedFacing = door.getFacing();
|
||||||
|
|
||||||
|
switch (door.getFacing()) {
|
||||||
|
case NORTH -> location.add(right ? -1 : 1, 0, 0);
|
||||||
|
case SOUTH -> location.add(right ? 1 : -1, 0, 0);
|
||||||
|
case EAST -> location.add(0, 0, right ? -1 : 1);
|
||||||
|
case WEST -> location.add(0, 0, right ? 1 : -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if not, check if the doors are a corner
|
||||||
|
if (location.getBlock().isEmpty()) {
|
||||||
|
location = block.getLocation();
|
||||||
|
|
||||||
|
switch (door.getFacing()) {
|
||||||
|
case NORTH -> {
|
||||||
|
location.add(right ? -1 : 1, 0, 1);
|
||||||
|
expectedFacing = right ? BlockFace.WEST : BlockFace.EAST;
|
||||||
|
}
|
||||||
|
case SOUTH -> {
|
||||||
|
location.add(right ? 1 : -1, 0, -1);
|
||||||
|
expectedFacing = right ? BlockFace.EAST : BlockFace.WEST;
|
||||||
|
}
|
||||||
|
case EAST -> {
|
||||||
|
location.add(-1, 0, right ? -1 : 1);
|
||||||
|
expectedFacing = right ? BlockFace.NORTH : BlockFace.SOUTH;
|
||||||
|
}
|
||||||
|
case WEST -> {
|
||||||
|
location.add(1, 0, right ? 1 : -1);
|
||||||
|
expectedFacing = right ? BlockFace.SOUTH : BlockFace.NORTH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if there's a second door placed correctly
|
||||||
|
if (location.getBlock().getType() == block.getType()) {
|
||||||
|
Door nextDoor = (Door) location.getBlock().getBlockData();
|
||||||
|
if (nextDoor.getHinge() == door.getHinge()) return;
|
||||||
|
if (nextDoor.getFacing() != expectedFacing) return;
|
||||||
|
// ! because it seems door is actually opening after this event
|
||||||
|
nextDoor.setOpen(!door.isOpen());
|
||||||
|
location.getBlock().setBlockData(nextDoor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,16 +0,0 @@
|
||||||
package eu.m724.utils;
|
|
||||||
|
|
||||||
import eu.m724.utils.chat.ChatCommands;
|
|
||||||
import eu.m724.utils.chat.ChatManager;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
public class UtilsPlugin extends JavaPlugin {
|
|
||||||
@Override
|
|
||||||
public void onEnable() {
|
|
||||||
ChatManager chatManager = new ChatManager(this);
|
|
||||||
chatManager.init();
|
|
||||||
|
|
||||||
ChatCommands chatCommands = new ChatCommands(chatManager);
|
|
||||||
getCommand("chat").setExecutor(chatCommands);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
name: mUtils724
|
name: Tweaks724
|
||||||
version: ${project.version}
|
version: ${project.version}
|
||||||
|
|
||||||
main: eu.m724.utils.UtilsPlugin
|
main: eu.m724.tweaks.TweaksPlugin
|
||||||
api-version: 1.21.1
|
api-version: 1.21.1
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
|
|
Loading…
Reference in a new issue