Skip to content

Commit

Permalink
1.16.5 support (uses api 2.2.22 due to java8 support)
Browse files Browse the repository at this point in the history
  • Loading branch information
301haru committed Oct 27, 2022
1 parent 62e8c8c commit 428ea0f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
// See https://www.spigotmc.org/wiki/buildtools/
// implementation "org.bukkit:craftbukkit:${bukkit_version}"
// Use this dependency if you don't want to compile bukkit
implementation "io.papermc.paper:paper-api:${bukkit_version}"
implementation "com.destroystokyo.paper:paper-api:${bukkit_version}"
implementation "de.maxhenkel.voicechat:voicechat-api:${voicechat_api_version}"
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
org.gradle.jvmargs=-Xmx2G

java_version=17
java_version=8

bukkit_api_version=1.19
bukkit_version=1.19-R0.1-SNAPSHOT
bukkit_api_version=1.16
bukkit_version=1.16.5-R0.1-SNAPSHOT

# Target an older API to make it compatible with older versions of the voice chat
# This is the oldest available version of the voice chat API
# If you want to use features that are introduced in later versions you need to use a newer version
voicechat_api_version=2.1.12
voicechat_api_version=2.2.22

plugin_version=1.0.1
plugin_version=1.0.1-1.16.5
maven_group=de.maxhenkel.voicechat_broadcast
archives_base_name=voicechat_broadcast
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ This project is mostly used as an example for the [Simple Voice Chat Plugin API]

## Compatibility

This plugin should work with every Minecraft version that works with Simple Voice Chat 1.18.2-2.1.12 or later.
This plugin should work with every Minecraft version that works with Simple Voice Chat 1.16.5-2.2.22 or later.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ private void onMicrophone(MicrophonePacketEvent event) {
}
// Cast the generic player object of the voice chat API to an actual bukkit player
// This object should always be a bukkit player object on bukkit based servers
if (!(event.getSenderConnection().getPlayer().getPlayer() instanceof Player player)) {
if (!(event.getSenderConnection().getPlayer().getPlayer() instanceof Player)) {
return;
}

Player player = (Player) event.getSenderConnection().getPlayer().getPlayer();

// Check if the player has the broadcast permission
if (!player.hasPermission(BROADCAST_PERMISSION)) {
return;
Expand All @@ -72,7 +74,7 @@ private void onMicrophone(MicrophonePacketEvent event) {
}

// Only broadcast the voice when the group name is "broadcast"
if (!group.getName().strip().equalsIgnoreCase("broadcast")) {
if (!group.getName().equalsIgnoreCase("broadcast")) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package de.maxhenkel.voicechat_broadcast;

import de.maxhenkel.voicechat.api.BukkitVoicechatService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import javax.annotation.Nullable;
import java.util.logging.Logger;

public final class VoicechatBroadcast extends JavaPlugin {

public static final String PLUGIN_ID = "voicechat_broadcast";
public static final Logger LOGGER = LogManager.getLogger(PLUGIN_ID);
public static final Logger LOGGER = Bukkit.getLogger();

@Nullable
private BroadcastVoicechatPlugin voicechatPlugin;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: ${version}
main: de.maxhenkel.voicechat_broadcast.VoicechatBroadcast
api-version: ${bukkit_api_version}
prefix: voicechat_broadcast
authors: [ "Max Henkel" ]
authors: [ Max Henkel, Haru301 ]
description: A simple broadcast plugin for Simple Voice Chat
website: https://modrepo.de
permissions:
Expand Down

0 comments on commit 428ea0f

Please sign in to comment.