-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
23 changed files
with
3,648 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# User-specific stuff | ||
.idea/ | ||
|
||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
*~ | ||
|
||
# temporary files which can be created if a process still has a handle open of a deleted file | ||
.fuse_hidden* | ||
|
||
# KDE directory preferences | ||
.directory | ||
|
||
# Linux trash folder which might appear on any partition or disk | ||
.Trash-* | ||
|
||
# .nfs files are created when an open file is removed but is still being accessed | ||
.nfs* | ||
|
||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# Windows thumbnail cache files | ||
Thumbs.db | ||
Thumbs.db:encryptable | ||
ehthumbs.db | ||
ehthumbs_vista.db | ||
|
||
# Dump file | ||
*.stackdump | ||
|
||
# Folder config file | ||
[Dd]esktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msix | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
target/ | ||
|
||
pom.xml.tag | ||
pom.xml.releaseBackup | ||
pom.xml.versionsBackup | ||
pom.xml.next | ||
|
||
release.properties | ||
dependency-reduced-pom.xml | ||
buildNumber.properties | ||
.mvn/timing.properties | ||
.mvn/wrapper/maven-wrapper.jar | ||
.flattened-pom.xml | ||
|
||
# Common working directory | ||
run/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>me.TheJokerDev</groupId> | ||
<artifactId>FutureHolograms</artifactId> | ||
<version>1.0.3</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>FutureHolograms</name> | ||
|
||
<description>Create custom holograms with uniques options.</description> | ||
<properties> | ||
<java.version>1.8</java.version> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<url>https://github.com/TheJokerDev</url> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.8.1</version> | ||
<configuration> | ||
<source>${java.version}</source> | ||
<target>${java.version}</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-shade-plugin</artifactId> | ||
<version>3.2.4</version> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>shade</goal> | ||
</goals> | ||
<configuration> | ||
<createDependencyReducedPom>false</createDependencyReducedPom> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
</build> | ||
|
||
<repositories> | ||
<repository> | ||
<id>spigotmc-repo</id> | ||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> | ||
</repository> | ||
<repository> | ||
<id>sonatype</id> | ||
<url>https://oss.sonatype.org/content/groups/public/</url> | ||
</repository> | ||
<repository> | ||
<id>placeholderapi</id> | ||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url> | ||
</repository> | ||
<repository> | ||
<id>codemc-repo</id> | ||
<url>https://repo.codemc.io/repository/maven-public/</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot-api</artifactId> | ||
<version>1.17.1-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot</artifactId> | ||
<scope>system</scope> | ||
<version>1.17.1-R0.1-SNAPSHOT</version> | ||
<systemPath>${user.home}/Google Drive/JavaProjects/IdeaProjects/purpur-1.17.1.jar</systemPath> | ||
</dependency> | ||
<dependency> | ||
<groupId>me.clip</groupId> | ||
<artifactId>placeholderapi</artifactId> | ||
<version>2.10.9</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.gmail.filoghost.holographicdisplays</groupId> | ||
<artifactId>holographicdisplays-api</artifactId> | ||
<version>2.4.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package me.TheJokerDev.futureholograms; | ||
|
||
import me.TheJokerDev.futureholograms.commands.FHologramsCmd; | ||
import me.TheJokerDev.futureholograms.holo.FHologram; | ||
import me.TheJokerDev.futureholograms.holo.HologramsManager; | ||
import me.TheJokerDev.futureholograms.listeners.LoginListeners; | ||
import me.TheJokerDev.futureholograms.listeners.WorldListeners; | ||
import me.TheJokerDev.futureholograms.utils.Utils; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.plugin.PluginManager; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
import java.util.Arrays; | ||
|
||
public final class Main extends JavaPlugin { | ||
private static Main plugin; | ||
private static boolean papiLoaded = true; | ||
|
||
@Override | ||
public void onEnable() { | ||
saveDefaultConfig(); | ||
plugin = this; | ||
long ms = System.currentTimeMillis(); | ||
log(0, "{prefix}&7Loading plugin..."); | ||
PluginManager pm = getServer().getPluginManager(); | ||
|
||
log(0, "{prefix}&7Checking dependencies..."); | ||
if (!pm.isPluginEnabled("PlaceholderAPI")){ | ||
log(1, "&cYou need to install PlaceholderAPI to work."); | ||
papiLoaded = false; | ||
pm.disablePlugin(this); | ||
return; | ||
} else if (!pm.isPluginEnabled("HolographicDisplays")){ | ||
log(1, "&cYou need to force install HolographicDisplays to work."); | ||
pm.disablePlugin(this); | ||
return; | ||
} | ||
log(0, "{prefix}&aDependencies checked and hooked!"); | ||
|
||
log(0, "{prefix}&7Loading commands..."); | ||
getCommand("futureholograms").setExecutor(new FHologramsCmd()); | ||
getCommand("futureholograms").setTabCompleter(new FHologramsCmd()); | ||
log(0, "{prefix}&aCommands loaded!"); | ||
|
||
log(0, "{prefix}&7Loading holograms..."); | ||
HologramsManager.initHolograms(); | ||
log(0, "{prefix}&aHolograms loaded!"); | ||
|
||
log(0, "{prefix}&7Loading listeners..."); | ||
listeners(new LoginListeners(), new WorldListeners()); | ||
log(0, "{prefix}&aListeners loaded sucessfully!"); | ||
|
||
ms = System.currentTimeMillis()-ms; | ||
Utils.sendMessage(Bukkit.getConsoleSender(), | ||
"{prefix}&aPlugin fully loaded and started!", | ||
"&b&l=========================================", | ||
"&fThanks to use my plugin. Plugin loaded in", | ||
"&f"+ms/1000+" seconds.", | ||
"", | ||
"&a Made with love, by TheJokerDev &c<3", | ||
"&b&l=========================================" | ||
); | ||
} | ||
|
||
public static void listeners(Listener... list){ | ||
Arrays.stream(list).forEach(l-> Bukkit.getPluginManager().registerEvents(l, getPlugin())); | ||
} | ||
|
||
|
||
public static void log(int mode, String msg){ | ||
if (mode == 0){ | ||
Utils.sendMessage(Bukkit.getConsoleSender(), msg); | ||
} else if (mode == 1){ | ||
Utils.sendMessage(Bukkit.getConsoleSender(), "&c&lError: &7"+msg); | ||
} else if (mode == 2){ | ||
if (getPlugin().getConfig().getBoolean("debug")) { | ||
Utils.sendMessage(Bukkit.getConsoleSender(), "&e&lDebug: &7" + msg); | ||
} | ||
} | ||
} | ||
|
||
public static boolean isPapiLoaded() { | ||
return papiLoaded; | ||
} | ||
|
||
public static Main getPlugin() { | ||
return plugin; | ||
} | ||
|
||
public static String getPrefix(){ | ||
return Utils.getConfig().getString("prefix"); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
log(0, "{prefix}&7Disabling holograms..."); | ||
for (FHologram holo : HologramsManager.getHolograms()){ | ||
holo.deleteAll(); | ||
HologramsManager.hologramHashMap.remove(holo.getName()); | ||
} | ||
log(0, "{prefix}&cHolograms disabled!"); | ||
log(0, "{prefix}&cDisabling plugin..."); | ||
} | ||
} |
Oops, something went wrong.