Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
17 changes: 10 additions & 7 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: Java CI

on: [push]
on:
push:
pull_request:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
distribution: temurin
java-version: '25'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build with Gradle
run: ./gradlew build
56 changes: 30 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
plugins {
id "org.sonarqube" version "2.6"
id 'java'
id 'idea'
}

apply plugin: 'java'
apply plugin: 'idea'
archivesBaseName = 'minicat'
version = '1.0-SNAPSHOT'

base {
archivesName = 'minicat'
}

repositories {
mavenCentral()
//mavenLocal() Enable to compile with BielAPI preinstalled on mavenlocal
/* maven{
//Repository url is ok, but server seems to be (temporarily, 02/01/17) serving wrong content
//url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}*/
mavenLocal()
maven {
url "https://hub.spigotmc.org/nexus/content/repositories/snapshots"
url = uri('https://repo.papermc.io/repository/maven-public/')
}
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
url = uri('https://jitpack.io')
}
}

jar {

java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}

def defaultEncoding = 'UTF-8'
compileJava{
options.encoding = defaultEncoding
Expand All @@ -33,18 +34,21 @@ compileTestJava{
options.encoding = defaultEncoding
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '19.0'
compile 'org.apache.commons:commons-io:1.3.2'
//Enable if you have BielAPI installed on maven local
//compile 'BielAPI:BielAPI:0.0.8-SNAPSHOT'
compile fileTree(dir: 'lib', include: '*.jar')
//Enable to use automatic download, when avaliable
//compile 'org.spigotmc:spigot-api:1.10-R0.1-SNAPSHOT'
// compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.15'

compileOnly "org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT"
// compileOnly "org.spigotmc:spigot:1.16.4-R0.1-SNAPSHOT"
testCompileOnly "org.spigotmc:spigot-api:1.16.4-R0.1-SNAPSHOT"
compileOnly 'com.google.guava:guava:33.6.0-jre'
compileOnly 'commons-io:commons-io:2.21.0'
compileOnly 'commons-lang:commons-lang:2.6'
compileOnly 'com.mysql:mysql-connector-j:9.6.0'
compileOnly 'BielAPI:BielAPI:0.0.10-SNAPSHOT'
compileOnly fileTree(dir: 'lib', include: '*.jar', exclude: [
'BielAPI-*.jar',
'NametagEdit*.jar',
'spigot-*.jar'
])
compileOnly 'io.papermc.paper:paper-api:26.2.build.92-stable'
compileOnly('com.github.decentsoftware-eu.decentholograms:plugin:2.10.1') {
transitive = false
}
testCompileOnly 'io.papermc.paper:paper-api:26.2.build.92-stable'

}

Expand All @@ -55,4 +59,4 @@ task deploy(type: Copy){
}
into 'F:\\Servers MC\\Lobby - 1.9\\plugins'
}
deploy.dependsOn assemble
deploy.dependsOn assemble
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
Empty file modified gradlew
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
}

rootProject.name = 'minicat'
27 changes: 12 additions & 15 deletions src/main/java/com/biel/lobby/Com.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@
import java.util.UUID;
import java.util.stream.Stream;

import com.gmail.filoghost.holographicdisplays.api.Hologram;
import com.gmail.filoghost.holographicdisplays.api.HologramsAPI;
import com.gmail.filoghost.holographicdisplays.api.VisibilityManager;
import com.nametagedit.plugin.NametagEdit;
import org.bukkit.*;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;

import com.biel.lobby.utilities.CBUtils;
import com.biel.lobby.utilities.ColorConverter;
import com.biel.lobby.utilities.HologramFacade;
import com.biel.lobby.utilities.Options;
import com.biel.lobby.utilities.PaperMessages;
import com.biel.lobby.utilities.PlayerTagState;
import com.biel.lobby.utilities.ScoreBoardUpdater;
import com.biel.lobby.utilities.Utils;
import com.biel.lobby.utilities.data.DataAPI;
import com.biel.lobby.utilities.data.PlayerData;
import com.connorlinfoot.titleapi.TitleAPI;

public class Com {
//HIO
Expand Down Expand Up @@ -71,22 +69,20 @@ public static void teleportPlayerToLobby(Player p){
}


private static HashMap<UUID, Hologram> playerHologramMap = new HashMap<UUID, Hologram>();
private static HashMap<UUID, HologramFacade.Handle> playerHologramMap = new HashMap<UUID, HologramFacade.Handle>();
private static void showRanking(Player player) {

Hologram hologram;
HologramFacade.Handle hologram;
if(playerHologramMap.containsKey(player.getUniqueId())) {
hologram = playerHologramMap.get(player.getUniqueId());
hologram.clearLines();
} else {
Location hologramLocation = new Location(getLobbyWorld(), -283, 72.5, 26);
hologram = HologramsAPI.createHologram(getPlugin(), hologramLocation);
hologram = HologramFacade.create(hologramLocation);
playerHologramMap.put(player.getUniqueId(), hologram);
}

VisibilityManager visibilityManager = hologram.getVisibilityManager();
visibilityManager.showTo(player);
visibilityManager.setVisibleByDefault(false);
hologram.showOnlyTo(player);

hologram.appendTextLine(ChatColor.AQUA + "MINICAT RANKING");
hologram.appendTextLine("");
Expand Down Expand Up @@ -135,10 +131,10 @@ public static void setHeadColor(Player ply, ChatColor color){
setHeadColor(ply, ColorConverter.chatToRaw(color));
}
public static void setHeadColor(Player ply, String color){
NametagEdit.getApi().setPrefix(ply, color);
PlayerTagState.setPrefix(ply, color);
}
public static void setSuffix(Player ply, String suffix){
NametagEdit.getApi().setSuffix(ply, suffix);
PlayerTagState.setSuffix(ply, suffix);
}
public static void displayRanking(Player p){
if(Com.getDataAPI().isInDatalessMode()){
Expand Down Expand Up @@ -266,12 +262,13 @@ public static void playMinicatAnimation(Player p){
f.add(ChatColor.WHITE + "" + bold + "MINICAT");
int i = 0;
for (String s : f){
Bukkit.getScheduler().runTaskLater(getPlugin(), () -> TitleAPI.sendTitle(p,0,6,0,s,Integer.toString(Bukkit.getOnlinePlayers().size())), 4 * i + 14 + (CBUtils.getPing(p) * 20 / 1000));
Bukkit.getScheduler().runTaskLater(getPlugin(), () -> PaperMessages.showTitle(p, 0, 6, 0, s,
Integer.toString(Bukkit.getOnlinePlayers().size())), 4 * i + 14 + (CBUtils.getPing(p) * 20 / 1000));
i++;
}
}
public static Material getSkullIconMaterial(Player p){
Material m = Material.LEGACY_SKULL_ITEM;
Material m = Material.PLAYER_HEAD;
if(Stream.of("amiguet", "pilota", "ball", "").anyMatch(s -> (p.getName().equalsIgnoreCase(s) || p.getName().contains(s))))
m = Material.SLIME_BALL;
return m;
Expand Down
Loading
Loading