Skip to content

Commit d3379cc

Browse files
committed
first commit
0 parents  commit d3379cc

27 files changed

+2012
-0
lines changed

Diff for: .gitignore

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# User-specific stuff
2+
.idea/
3+
4+
*.iml
5+
*.ipr
6+
*.iws
7+
8+
# IntelliJ
9+
out/
10+
11+
# Compiled class file
12+
*.class
13+
14+
# Log file
15+
*.log
16+
17+
# BlueJ files
18+
*.ctxt
19+
20+
# Package Files #
21+
*.jar
22+
*.war
23+
*.nar
24+
*.ear
25+
*.zip
26+
*.tar.gz
27+
*.rar
28+
29+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
30+
hs_err_pid*
31+
32+
*~
33+
34+
# temporary files which can be created if a process still has a handle open of a deleted file
35+
.fuse_hidden*
36+
37+
# KDE directory preferences
38+
.directory
39+
40+
# Linux trash folder which might appear on any partition or disk
41+
.Trash-*
42+
43+
# .nfs files are created when an open file is removed but is still being accessed
44+
.nfs*
45+
46+
# General
47+
.DS_Store
48+
.AppleDouble
49+
.LSOverride
50+
51+
# Icon must end with two \r
52+
Icon
53+
54+
# Thumbnails
55+
._*
56+
57+
# Files that might appear in the root of a volume
58+
.DocumentRevisions-V100
59+
.fseventsd
60+
.Spotlight-V100
61+
.TemporaryItems
62+
.Trashes
63+
.VolumeIcon.icns
64+
.com.apple.timemachine.donotpresent
65+
66+
# Directories potentially created on remote AFP share
67+
.AppleDB
68+
.AppleDesktop
69+
Network Trash Folder
70+
Temporary Items
71+
.apdisk
72+
73+
# Windows thumbnail cache files
74+
Thumbs.db
75+
Thumbs.db:encryptable
76+
ehthumbs.db
77+
ehthumbs_vista.db
78+
79+
# Dump file
80+
*.stackdump
81+
82+
# Folder config file
83+
[Dd]esktop.ini
84+
85+
# Recycle Bin used on file shares
86+
$RECYCLE.BIN/
87+
88+
# Windows Installer files
89+
*.cab
90+
*.msi
91+
*.msix
92+
*.msm
93+
*.msp
94+
95+
# Windows shortcuts
96+
*.lnk
97+
98+
target/
99+
100+
pom.xml.tag
101+
pom.xml.releaseBackup
102+
pom.xml.versionsBackup
103+
pom.xml.next
104+
105+
release.properties
106+
dependency-reduced-pom.xml
107+
buildNumber.properties
108+
.mvn/timing.properties
109+
.mvn/wrapper/maven-wrapper.jar
110+
.flattened-pom.xml
111+
112+
# Common working directory
113+
run/

Diff for: LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 K4M1s
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# RealTimeWeather
2+
3+
Simple minecraft spigot plugin that allows counting player deaths. Data about the death of players is stored in MySQL database and displayed in sidebar.
4+
5+
## Requirements
6+
7+
- [Apache Maven](http://maven.apache.org/download.cgi)
8+
- [Java SDK](https://www.oracle.com/pl/java/technologies/javase/javase-jdk8-downloads.html)
9+
10+
## Build
11+
12+
1. Clone the repository.
13+
2. In a terminal cd into repository directory.
14+
3. Run `mvn package`,
15+
4. Move `./target/DeathCounter-xxx.jar` to your `plugins` folder.
16+
5. Start and stop your server.
17+
6. Edit configuration file in `plugins/DeathCounter/config.yml`,
18+
7. Start your server.
19+
20+
## Release History
21+
22+
* 1.0
23+
* First build of working plugin
24+
25+
## Authors
26+
27+
- **[K4M1s](https://github.com/K4M1s)** - Creator, main developer
28+
29+
## License
30+
31+
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

Diff for: pom.xml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>me.k4m1s</groupId>
8+
<artifactId>deathcounter</artifactId>
9+
<version>1.0</version>
10+
<packaging>jar</packaging>
11+
12+
<name>Deathcounter</name>
13+
14+
<description>Player's death counter with scoreboard</description>
15+
<properties>
16+
<java.version>1.8</java.version>
17+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18+
</properties>
19+
20+
<build>
21+
<plugins>
22+
<plugin>
23+
<groupId>org.apache.maven.plugins</groupId>
24+
<artifactId>maven-compiler-plugin</artifactId>
25+
<version>3.8.1</version>
26+
<configuration>
27+
<source>${java.version}</source>
28+
<target>${java.version}</target>
29+
</configuration>
30+
</plugin>
31+
<plugin>
32+
<groupId>org.apache.maven.plugins</groupId>
33+
<artifactId>maven-shade-plugin</artifactId>
34+
<version>3.2.4</version>
35+
<executions>
36+
<execution>
37+
<phase>package</phase>
38+
<goals>
39+
<goal>shade</goal>
40+
</goals>
41+
<configuration>
42+
<createDependencyReducedPom>false</createDependencyReducedPom>
43+
</configuration>
44+
</execution>
45+
</executions>
46+
</plugin>
47+
</plugins>
48+
<resources>
49+
<resource>
50+
<directory>src/main/resources</directory>
51+
<filtering>true</filtering>
52+
</resource>
53+
</resources>
54+
</build>
55+
56+
<repositories>
57+
<repository>
58+
<id>spigotmc-repo</id>
59+
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
60+
</repository>
61+
<repository>
62+
<id>sonatype</id>
63+
<url>https://oss.sonatype.org/content/groups/public/</url>
64+
</repository>
65+
</repositories>
66+
67+
<dependencies>
68+
<dependency>
69+
<groupId>org.spigotmc</groupId>
70+
<artifactId>spigot-api</artifactId>
71+
<version>1.16.3-R0.1-SNAPSHOT</version>
72+
<scope>provided</scope>
73+
</dependency>
74+
</dependencies>
75+
</project>
+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
package me.k4m1s.deathcounter.Chat;
2+
3+
import org.bukkit.ChatColor;
4+
import org.bukkit.command.CommandSender;
5+
6+
public class Messages {
7+
private static final String prefix = "&6&l[DeathCounter]&r ";
8+
9+
/**
10+
* Sends message to server console.
11+
*
12+
* @param msg Message to send.
13+
*/
14+
public static void sendMessage(String msg) {
15+
System.out.println(ChatColor.translateAlternateColorCodes('&', prefix + msg));
16+
}
17+
18+
/**
19+
* Send message to command sender.
20+
*
21+
* @param sender Subject that message should be sent to.
22+
* @param msg Message to send.
23+
*/
24+
public static void sendMessage(CommandSender sender, String msg) {
25+
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + msg));
26+
}
27+
28+
/**
29+
* Sends message to command sender.
30+
*
31+
* @param sender Subject that message should be sent to.
32+
* @param msg Message to send.
33+
* @param bPrefix Include prefix?
34+
*/
35+
public static void sendMessage(CommandSender sender, String msg, boolean bPrefix) {
36+
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', bPrefix ? prefix : "" + msg));
37+
}
38+
39+
/**
40+
* Sends header for better chat formatting.
41+
*
42+
* @param msg Message
43+
*/
44+
public static void sendHeader(String msg) {
45+
int headerLength = 42 - msg.length() - 2;
46+
String headerPart = "&6&l" + new String(new char[headerLength/2]).replace("\0", "=");
47+
String message = headerPart + " &r&l" + msg + " " + headerPart;
48+
System.out.println(ChatColor.translateAlternateColorCodes('&', message));
49+
}
50+
51+
/**
52+
* Sends header for better chat formatting.
53+
*
54+
* @param sender Message Recipient
55+
* @param msg Message
56+
*/
57+
public static void sendHeader(CommandSender sender, String msg) {
58+
int headerLength = 42 - msg.length() - 2;
59+
String headerPart = "&6&l" + new String(new char[(int)Math.floor(headerLength/2D)]).replace("\0", "=");
60+
String message = headerPart + " &r&l" + msg + " " + headerPart;
61+
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
62+
}
63+
64+
/**
65+
* Sends footer for better chat formatting.
66+
*/
67+
public static void sendFooter() {
68+
String footer = "&6&l" + new String(new char[42]).replace("\0", "=");
69+
System.out.println(ChatColor.translateAlternateColorCodes('&', footer));
70+
}
71+
72+
/**
73+
* Sends footer for better chat formatting.
74+
*
75+
* @param sender Recipient
76+
*/
77+
public static void sendFooter(CommandSender sender) {
78+
String footer = "&6&l" + new String(new char[42]).replace("\0", "=");
79+
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', footer));
80+
}
81+
}

0 commit comments

Comments
 (0)