Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ jobs:
- name: Set up JDK 1.16
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '16'
- name: Build in Minecraft 1.17
run: mvn package -Dspigot.api=1.17 -Dmockbukkit.api=1.17 -Dmockbukkit.version=1.7.0 --file pom.xml
run: mvn package -Dspigot.api=1.17 -Dmockbukkit.api=1.17 -Dmockbukkit.version=1.7.0 --file pom1.17.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>com.jerryio.publicbin</groupId>
<artifactId>PublicBin</artifactId>

<version>1.1.0</version>
<version>1.1.1</version>
<name>PublicBin</name>
<inceptionYear>2020</inceptionYear>
<packaging>jar</packaging>
Expand All @@ -15,11 +15,11 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spigot.api>1.17</spigot.api>
<spigot.api>1.16</spigot.api>
<spigot.version>${spigot.api}.1</spigot.version>
<spigot.javadocs>https://helpch.at/docs/${spigot.version}/</spigot.javadocs>
<mockbukkit.api>1.17</mockbukkit.api>
<mockbukkit.version>1.7.0</mockbukkit.version>
<mockbukkit.api>1.16</mockbukkit.api>
<mockbukkit.version>0.5.0</mockbukkit.version>
</properties>

<issueManagement>
Expand Down
187 changes: 187 additions & 0 deletions pom1.17.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jerryio.publicbin</groupId>
<artifactId>PublicBin</artifactId>

<version>1.1.1</version>
<name>PublicBin</name>
<inceptionYear>2020</inceptionYear>
<packaging>jar</packaging>

<description>PublicBin is a Spigot plugin that provides a place to discard unwanted items and retrieve items discarded by other players.</description>
<url>https://github.com/Jerrylum/PublicBin</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spigot.api>1.17</spigot.api>
<spigot.version>${spigot.api}.1</spigot.version>
<spigot.javadocs>https://helpch.at/docs/${spigot.version}/</spigot.javadocs>
<mockbukkit.api>1.17</mockbukkit.api>
<mockbukkit.version>1.7.0</mockbukkit.version>
<java.version>1.16</java.version>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>

<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/Jerrylum/PublicBin/issues</url>
</issueManagement>

<licenses>
<license>
<name>GNU General Public License v3.0</name>
<url>https://github.com/Jerrylum/PublicBin/blob/main/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>

<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots</url>
</repository>
<repository>
<id>placeholderapi-repo</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi</url>
</repository>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<build>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
<defaultGoal>clean package</defaultGoal>

<finalName>${project.name}_v${project.version}_mc${spigot.api}</finalName>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<excludes>
<exclude>**/package-info.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<configuration>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.jerryio.publicbin.util</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- attached to Maven test phase -->
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>

</build>

<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<url>https://repository.apache.org/snapshots/</url>
</pluginRepository>
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.10.9</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<!-- We use javax.annotation instead. Excluding this -->
<!-- prevents us from using inconsistent annotations -->
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>2.2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.seeseemelk</groupId>
<artifactId>MockBukkit-v${mockbukkit.api}</artifactId>
<version>${mockbukkit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion src/main/java/com/jerryio/publicbin/PublicBinPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void doMetricsSend() {
Class.forName("com.google.gson.JsonElement");
if (System.getProperty("MockTest") == null) {
Metrics metrics = new Metrics(this, 9744);
metrics.addCustomChart(new Metrics.SimplePie("using_mode", () -> setting.getMode().toString()));
// metrics.addCustomChart(new Metrics.SimplePie("using_mode", () -> setting.getMode().toString()));
}
} catch (Exception e) {
// nothing to do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class PluginSetting {

public static final String[] OLD_CONFIG_MD5_CHECKSUMS = {
"1a3144fbbd4835c947010725b681e6c5"
"1a3144fbbd4835c947010725b681e6c5", "CD36233E47A5C216C3580FE5BB9CBF9A"
};

private YamlConfiguration config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public void setLocale(String str) {
locale = str;
}

@Override
public org.bukkit.entity.Player.Spigot spigot() {
return new MockSpigot();
}
// @Override
// public org.bukkit.entity.Player.Spigot spigot() {
// return new MockSpigot();
// }

@Override
public void playSound(Location location, String sound, float volume, float pitch) {
Expand Down
68 changes: 68 additions & 0 deletions src/test/resources/config-1.1.0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Language used by the plugin, for example: en_US, zh_CN, zh_TW
lang: en_US

# The inventory mode can be...
# - share (default, everyone using the same bin)
# - separate (everyone has their own bin)
mode: share

# The number of rows in the bin
size: 6

# despawn after a certain amount of time
countdown-despawn:
enable: true
# The time a set of item disappear (in seconds)
time: 300

# Remove all items at regular intervals
clear-intervals:
enable: false
# The intervals (in seconds) on how often the bin will be cleared
time: 600
# Display warning messages when the time to clear items is approaching
warnings:
# The warning message type can be...
# - actionbar (default)
# - chat
type: actionbar
# Output a clear warning whenever there is a certain amount of time
# remaining. (in seconds)
period: [60, 30, 10, 0]

# Remove items when there is not much space left
remove-when-full:
enable: true
# When the number of remaining grids is less than this number, the item will
# be cleared
threshold: 6
# Sort according to these principles, priority from top to bottom
# Item with the lower priority will be removed
order:
- metadata
- type
- durability
- amount
- time

# Sort items in the bin automatically
smart-grouping:
enable: true
# Sort according to these principles, priority from top to bottom
# Item with the highest priority will be placed in the first grid
order:
- type
- metadata
- durability
- amount
- time

# put all dropped items that are about to disappear in the server into the
# public trash bin
collect-despawn:
enable: false

debug: false

# Config version identifier. DO NOT CHANGE THIS
version: 1.1.0