Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
2cfc55813b | ||
|
0f41701429 | ||
|
9e0ca479a5 | ||
|
bd207e948a | ||
|
30425d2baa | ||
|
e3acb5384a | ||
|
6c4818dfd9 | ||
|
5b18656485 | ||
|
7ab86f2af9 | ||
|
2b563e0e1b | ||
|
2a0e0d33d8 | ||
|
889c2ffdab |
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -23,12 +23,6 @@ jobs:
|
|||||||
version: ${{ github.event.release.id }}
|
version: ${{ github.event.release.id }}
|
||||||
file: OpenInv.jar
|
file: OpenInv.jar
|
||||||
|
|
||||||
- name: Convert to HTML
|
|
||||||
id: convert_to_html
|
|
||||||
uses: lifepal/markdown-to-html@v1.2
|
|
||||||
with:
|
|
||||||
text: ${{ github.event.release.body }}
|
|
||||||
|
|
||||||
- name: Create CurseForge Release
|
- name: Create CurseForge Release
|
||||||
uses: itsmeow/curseforge-upload@v3
|
uses: itsmeow/curseforge-upload@v3
|
||||||
with:
|
with:
|
||||||
@@ -36,7 +30,7 @@ jobs:
|
|||||||
project_id: 31432
|
project_id: 31432
|
||||||
game_endpoint: minecraft
|
game_endpoint: minecraft
|
||||||
file_path: ./OpenInv.jar
|
file_path: ./OpenInv.jar
|
||||||
changelog: ${{ steps.convert_to_html.outputs.html }}
|
changelog: ${{ github.event.release.body }}
|
||||||
display_name: ${{ github.event.release.name }}
|
display_name: ${{ github.event.release.name }}
|
||||||
game_versions: ${{ env.CURSEFORGE_MINECRAFT_VERSIONS }}
|
game_versions: ${{ env.CURSEFORGE_MINECRAFT_VERSIONS }}
|
||||||
release_type: release
|
release_type: release
|
||||||
|
95
README.MD
95
README.MD
@@ -15,48 +15,7 @@ OpenInv is a [Bukkit plugin](https://dev.bukkit.org/bukkit-plugins/openinv/) whi
|
|||||||
- **AnyContainer**: Open containers, even if blocked by ocelots or blocks.
|
- **AnyContainer**: Open containers, even if blocked by ocelots or blocks.
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
<table width=100%>
|
See [the wiki](https://github.com/Jikoo/OpenInv/wiki/Commands).
|
||||||
<tr>
|
|
||||||
<th width=175px>Command</th>
|
|
||||||
<th>Aliases</th>
|
|
||||||
<th>Description</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>/openinv [player]</td>
|
|
||||||
<td>oi, inv, open</td>
|
|
||||||
<td>Open a player's inventory. If unspecified, will select last player opened or own if none opened previously.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>/openender [player]</td>
|
|
||||||
<td>oe</td>
|
|
||||||
<td>Open a player's ender chest. If unspecified, will select last player opened or own if none opened previously.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>/searchinv <item> [minAmount]</td>
|
|
||||||
<td>si</td>
|
|
||||||
<td>Lists all online players that have a certain item in their inventory.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>/searchender <item> [minAmount]</td>
|
|
||||||
<td>se</td>
|
|
||||||
<td>Lists all online players that have a certain item in their ender chest.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>/searchenchant <[enchantment] [MinLevel]></td>
|
|
||||||
<td>searchenchants</td>
|
|
||||||
<td>Lists all online players with a specific enchantment.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>/anycontainer [check]</td>
|
|
||||||
<td>ac, anychest</td>
|
|
||||||
<td>Check or toggle the AnyContainer function, allowing opening blocked containers.</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>/silentcontainer [check]</td>
|
|
||||||
<td>sc, silentchest</td>
|
|
||||||
<td>Check or toggle the SilentContainer function, allowing opening containers silently.</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
## Permissions
|
## Permissions
|
||||||
<table>
|
<table>
|
||||||
@@ -143,8 +102,39 @@ OpenInv is a [Bukkit plugin](https://dev.bukkit.org/bukkit-plugins/openinv/) whi
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
## For Developers
|
## For Developers
|
||||||
To compile, the relevant Craftbukkit/Spigot jars must be installed in your local repository using the install plugin.
|
|
||||||
Ex: `mvn install:install-file -Dpackaging=jar -Dfile=spigot-1.8-R0.1-SNAPSHOT.jar -DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.8-R0.1-SNAPSHOT`
|
### As a Dependency
|
||||||
|
The OpenInv API is available via [JitPack](https://jitpack.io/).
|
||||||
|
```xml
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>jitpack.io</id>
|
||||||
|
<url>https://jitpack.io</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
```
|
||||||
|
```xml
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.jikoo.OpenInv</groupId>
|
||||||
|
<artifactId>openinvapi</artifactId>
|
||||||
|
<version>${openinv.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compilation
|
||||||
|
To compile, the relevant Spigot jars must be installed in your local repository using the `install` plugin:
|
||||||
|
```shell
|
||||||
|
mvn install:install-file -Dpackaging=jar -Dfile=spigot-1.8-R0.1-SNAPSHOT.jar \
|
||||||
|
-DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.8-R0.1-SNAPSHOT
|
||||||
|
```
|
||||||
|
Note that BuildTools automatically installs produced files. If you use BuildTools to compile Spigot locally, you don't need to install it manually.
|
||||||
|
If you want to use Paper as a dependency, you can install it by executing PaperClip with the property `paperclip.install` set to true:
|
||||||
|
```shell
|
||||||
|
wget -O paperclip.jar https://papermc.io/api/v1/paper/1.16.5/latest/download
|
||||||
|
java -jar -Dpaperclip.install=true paperclip.jar
|
||||||
|
```
|
||||||
|
|
||||||
To compile for a single version, specify the NMS revision you are targeting: `mvn -pl <NMS module> -am clean install`
|
To compile for a single version, specify the NMS revision you are targeting: `mvn -pl <NMS module> -am clean install`
|
||||||
|
|
||||||
@@ -153,20 +143,3 @@ To compile for a set of versions, you'll need to use a profile. The only provide
|
|||||||
For more information, check out the [official Maven guide](http://maven.apache.org/guides/introduction/introduction-to-profiles.html).
|
For more information, check out the [official Maven guide](http://maven.apache.org/guides/introduction/introduction-to-profiles.html).
|
||||||
|
|
||||||
The final file is `target/OpenInv.jar`
|
The final file is `target/OpenInv.jar`
|
||||||
|
|
||||||
## License
|
|
||||||
```
|
|
||||||
Copyright (C) 2011-2020 lishid. All rights reserved.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, version 3.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
```
|
|
||||||
|
16
api/pom.xml
16
api/pom.xml
@@ -19,9 +19,9 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.1.6</version>
|
<groupId>com.lishid</groupId>
|
||||||
|
<version>4.1.7</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvapi</artifactId>
|
<artifactId>openinvapi</artifactId>
|
||||||
@@ -29,15 +29,12 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jetbrains</groupId>
|
|
||||||
<artifactId>annotations</artifactId>
|
<artifactId>annotations</artifactId>
|
||||||
<version>17.0.0</version>
|
<groupId>org.jetbrains</groupId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
<groupId>org.spigotmc</groupId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
@@ -45,11 +42,6 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
@@ -24,6 +24,7 @@ import com.lishid.openinv.internal.ISpecialPlayerInventory;
|
|||||||
import com.lishid.openinv.util.InventoryAccess;
|
import com.lishid.openinv.util.InventoryAccess;
|
||||||
import com.lishid.openinv.util.StringMetric;
|
import com.lishid.openinv.util.StringMetric;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
@@ -153,10 +154,7 @@ public interface IOpenInv {
|
|||||||
if (Bukkit.getServer().isPrimaryThread()) {
|
if (Bukkit.getServer().isPrimaryThread()) {
|
||||||
this.getLogger().warning("Call to OpenInv#matchPlayer made on the main thread!");
|
this.getLogger().warning("Call to OpenInv#matchPlayer made on the main thread!");
|
||||||
this.getLogger().warning("This can cause the server to hang, potentially severely.");
|
this.getLogger().warning("This can cause the server to hang, potentially severely.");
|
||||||
this.getLogger().warning("Trace:");
|
this.getLogger().log(Level.WARNING, new Throwable("Current stack trace"), () -> "Current stack trace");
|
||||||
for (StackTraceElement element : new Throwable().fillInStackTrace().getStackTrace()) {
|
|
||||||
this.getLogger().warning(element.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OfflinePlayer player;
|
OfflinePlayer player;
|
||||||
@@ -172,11 +170,6 @@ public interface IOpenInv {
|
|||||||
// Not a UUID
|
// Not a UUID
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure name is valid if server is in online mode to avoid unnecessary searching
|
|
||||||
if (Bukkit.getServer().getOnlineMode() && !name.matches("[a-zA-Z0-9_]{3,16}")) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
player = Bukkit.getServer().getPlayerExact(name);
|
player = Bukkit.getServer().getPlayerExact(name);
|
||||||
|
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
@@ -232,16 +225,24 @@ public interface IOpenInv {
|
|||||||
* when a container is activated with AnyChest.
|
* when a container is activated with AnyChest.
|
||||||
*
|
*
|
||||||
* @return true unless configured otherwise
|
* @return true unless configured otherwise
|
||||||
|
* @deprecated OpenInv uses action bar chat for notifications. Whether or not they show is based on language settings.
|
||||||
*/
|
*/
|
||||||
boolean notifyAnyChest();
|
@Deprecated
|
||||||
|
default boolean notifyAnyChest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the configuration value for whether or not OpenInv displays a notification to the user
|
* Check the configuration value for whether or not OpenInv displays a notification to the user
|
||||||
* when a container is activated with SilentChest.
|
* when a container is activated with SilentChest.
|
||||||
*
|
*
|
||||||
* @return true unless configured otherwise
|
* @return true unless configured otherwise
|
||||||
|
* @deprecated OpenInv uses action bar chat for notifications. Whether or not they show is based on language settings.
|
||||||
*/
|
*/
|
||||||
boolean notifySilentChest();
|
@Deprecated
|
||||||
|
default boolean notifySilentChest() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark a Player as no longer in use by a Plugin to allow OpenInv to remove it from the cache
|
* Mark a Player as no longer in use by a Plugin to allow OpenInv to remove it from the cache
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.lishid.openinv.internal;
|
package com.lishid.openinv.internal;
|
||||||
|
|
||||||
|
import org.bukkit.entity.HumanEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -48,4 +49,11 @@ public interface ISpecialInventory {
|
|||||||
*/
|
*/
|
||||||
boolean isInUse();
|
boolean isInUse();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Player associated with this ISpecialInventory.
|
||||||
|
*
|
||||||
|
* @return the HumanEntity
|
||||||
|
*/
|
||||||
|
@NotNull HumanEntity getPlayer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -21,11 +21,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.1.6</version>
|
<version>4.1.7</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvassembly</artifactId>
|
<artifactId>openinvassembly</artifactId>
|
||||||
<name>OpenInvAssembly</name>
|
<name>OpenInvAssembly</name>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<directory>../target</directory>
|
<directory>../target</directory>
|
||||||
@@ -34,7 +35,6 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
<version>3.2.0</version>
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>reactor-uberjar</id>
|
<id>reactor-uberjar</id>
|
||||||
|
@@ -14,9 +14,9 @@
|
|||||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
|
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
|
||||||
|
|
||||||
<id>reactor-uberjar</id>
|
<id>reactor-uberjar</id>
|
||||||
|
|
||||||
@@ -34,8 +34,18 @@
|
|||||||
<binaries>
|
<binaries>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
<unpack>true</unpack>
|
<unpack>true</unpack>
|
||||||
<!-- unpackOptions must be present or build breaks. -->
|
<unpackOptions>
|
||||||
<unpackOptions/>
|
<excludes>
|
||||||
|
<!--
|
||||||
|
- Exclude existing meta - assembly will write its own manifest, and the rest is maven
|
||||||
|
- details that end users don't need. Ignoring it saves around 7KB after compression
|
||||||
|
- with a single internal module present.
|
||||||
|
-->
|
||||||
|
<exclude>META-INF/**</exclude>
|
||||||
|
</excludes>
|
||||||
|
</unpackOptions>
|
||||||
|
<!-- Exclude dependencies - shade plugin will handle their inclusion as necessary in individual jars. -->
|
||||||
|
<includeDependencies>false</includeDependencies>
|
||||||
</binaries>
|
</binaries>
|
||||||
|
|
||||||
</moduleSet>
|
</moduleSet>
|
||||||
|
@@ -1,42 +0,0 @@
|
|||||||
<!--
|
|
||||||
~ Copyright (C) 2011-2020 lishid. All rights reserved.
|
|
||||||
~
|
|
||||||
~ This program is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, version 3.
|
|
||||||
~
|
|
||||||
~ This program is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<parent>
|
|
||||||
<groupId>com.lishid</groupId>
|
|
||||||
<artifactId>openinvparent</artifactId>
|
|
||||||
<version>4.1.6</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>openinvinternal</artifactId>
|
|
||||||
<name>OpenInvInternal</name>
|
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
<profiles>
|
|
||||||
|
|
||||||
<profile>
|
|
||||||
<id>all</id>
|
|
||||||
<modules>
|
|
||||||
<module>v1_16_R3</module>
|
|
||||||
</modules>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
</profiles>
|
|
||||||
|
|
||||||
</project>
|
|
@@ -20,9 +20,10 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
<artifactId>openinvparent</artifactId>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvinternal</artifactId>
|
<relativePath>../../pom.xml</relativePath>
|
||||||
<version>4.1.6</version>
|
<version>4.1.7</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvadapter1_16_R3</artifactId>
|
<artifactId>openinvadapter1_16_R3</artifactId>
|
||||||
@@ -30,44 +31,32 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
<groupId>org.spigotmc</groupId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
|
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
<artifactId>openinvapi</artifactId>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
<artifactId>openinvplugincore</artifactId>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
<version>4.1.6</version>
|
<groupId>com.lishid</groupId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>annotations</artifactId>
|
||||||
|
<groupId>org.jetbrains</groupId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.2</version>
|
|
||||||
<configuration>
|
|
||||||
<minimizeJar>true</minimizeJar>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>shade</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
@@ -32,15 +32,24 @@ public class OpenPlayer extends CraftPlayer {
|
|||||||
super(server, entity);
|
super(server, entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loadData() {
|
||||||
|
// See CraftPlayer#loadData
|
||||||
|
NBTTagCompound loaded = this.server.getHandle().playerFileData.load(this.getHandle());
|
||||||
|
if (loaded != null) {
|
||||||
|
readExtraData(loaded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
super.saveData();
|
|
||||||
EntityPlayer player = this.getHandle();
|
EntityPlayer player = this.getHandle();
|
||||||
// See net.minecraft.server.WorldNBTStorage#save(EntityPlayer)
|
// See net.minecraft.server.WorldNBTStorage#save(EntityPlayer)
|
||||||
try {
|
try {
|
||||||
WorldNBTStorage worldNBTStorage = player.server.getPlayerList().playerFileData;
|
WorldNBTStorage worldNBTStorage = player.server.getPlayerList().playerFileData;
|
||||||
|
|
||||||
NBTTagCompound playerData = player.save(new NBTTagCompound());
|
NBTTagCompound playerData = player.save(new NBTTagCompound());
|
||||||
|
setExtraData(playerData);
|
||||||
|
|
||||||
if (!isOnline()) {
|
if (!isOnline()) {
|
||||||
// Special case: save old vehicle data
|
// Special case: save old vehicle data
|
||||||
|
@@ -57,8 +57,7 @@ public class PlayerDataManager implements IPlayerDataManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
public static @NotNull EntityPlayer getHandle(final Player player) {
|
||||||
public static EntityPlayer getHandle(final Player player) {
|
|
||||||
if (player instanceof CraftPlayer) {
|
if (player instanceof CraftPlayer) {
|
||||||
return ((CraftPlayer) player).getHandle();
|
return ((CraftPlayer) player).getHandle();
|
||||||
}
|
}
|
||||||
@@ -78,9 +77,8 @@ public class PlayerDataManager implements IPlayerDataManager {
|
|||||||
return nmsPlayer;
|
return nmsPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
|
||||||
@Override
|
@Override
|
||||||
public Player loadPlayer(@NotNull final OfflinePlayer offline) {
|
public @Nullable Player loadPlayer(@NotNull final OfflinePlayer offline) {
|
||||||
// Ensure player has data
|
// Ensure player has data
|
||||||
if (!offline.hasPlayedBefore()) {
|
if (!offline.hasPlayedBefore()) {
|
||||||
return null;
|
return null;
|
||||||
|
@@ -80,6 +80,11 @@ public class SpecialEnderChest extends InventoryEnderChest implements ISpecialEn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull Player getPlayer() {
|
||||||
|
return owner.getBukkitEntity();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
this.owner.getEnderChest().update();
|
this.owner.getEnderChest().update();
|
||||||
|
@@ -212,6 +212,11 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
|
|||||||
this.playerOnline = false;
|
this.playerOnline = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @NotNull HumanEntity getPlayer() {
|
||||||
|
return this.player.getBukkitEntity();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack splitStack(int i, final int j) {
|
public ItemStack splitStack(int i, final int j) {
|
||||||
List<ItemStack> list = this.items;
|
List<ItemStack> list = this.items;
|
||||||
|
@@ -19,9 +19,9 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.1.6</version>
|
<groupId>com.lishid</groupId>
|
||||||
|
<version>4.1.7</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvplugincore</artifactId>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
@@ -29,15 +29,16 @@
|
|||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
|
||||||
<artifactId>openinvapi</artifactId>
|
<artifactId>openinvapi</artifactId>
|
||||||
<version>4.1.6</version>
|
<groupId>com.lishid</groupId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<artifactId>annotations</artifactId>
|
||||||
|
<groupId>org.jetbrains</groupId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
<groupId>org.spigotmc</groupId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
@@ -48,31 +49,13 @@
|
|||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.2.2</version>
|
|
||||||
<configuration>
|
|
||||||
<minimizeJar>true</minimizeJar>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>shade</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.1</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
@@ -334,16 +334,6 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean notifyAnyChest() {
|
|
||||||
return this.getConfig().getBoolean("notify.any-chest", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean notifySilentChest() {
|
|
||||||
return this.getConfig().getBoolean("notify.silent-chest", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
|
|
||||||
|
@@ -62,7 +62,7 @@ public class OpenInventoryView extends InventoryView {
|
|||||||
@Override
|
@Override
|
||||||
public @NotNull String getTitle() {
|
public @NotNull String getTitle() {
|
||||||
if (title == null) {
|
if (title == null) {
|
||||||
HumanEntity owner = getPlayer();
|
HumanEntity owner = inventory.getPlayer();
|
||||||
|
|
||||||
String localTitle = OpenInv.getPlugin(OpenInv.class)
|
String localTitle = OpenInv.getPlugin(OpenInv.class)
|
||||||
.getLocalizedMessage(
|
.getLocalizedMessage(
|
||||||
|
@@ -199,7 +199,7 @@ public class InventoryListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only specially handle actions in the player's own inventory.
|
// Only specially handle actions in the player's own inventory.
|
||||||
return !event.getWhoClicked().equals(event.getView().getTopInventory().getHolder());
|
return !event.getWhoClicked().equals(playerInventory.getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
153
pom.xml
153
pom.xml
@@ -21,39 +21,38 @@
|
|||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<name>OpenInv</name>
|
<name>OpenInv</name>
|
||||||
<url>http://dev.bukkit.org/bukkit-plugins/openinv/</url>
|
<url>http://dev.bukkit.org/bukkit-plugins/openinv/</url>
|
||||||
<version>4.1.6</version>
|
<version>4.1.7</version>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>api</module>
|
|
||||||
<module>plugin</module>
|
|
||||||
<module>internal</module>
|
|
||||||
<module>assembly</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
||||||
<!--
|
|
||||||
~ N.B.: All version-specific code is handled in submodules of the internal module.
|
|
||||||
~
|
|
||||||
~ Internal submodules built by each profile are handled in internal/pom.xml
|
|
||||||
-->
|
|
||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>all</id>
|
<id>all</id>
|
||||||
<activation>
|
<modules>
|
||||||
<property>
|
<module>api</module>
|
||||||
<name>all</name>
|
<module>plugin</module>
|
||||||
<value>true</value>
|
<module>internal/v1_16_R3</module>
|
||||||
</property>
|
<module>assembly</module>
|
||||||
</activation>
|
</modules>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
|
<profile>
|
||||||
|
<id>default</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
<modules>
|
||||||
|
<module>api</module>
|
||||||
|
<module>plugin</module>
|
||||||
|
<module>assembly</module>
|
||||||
|
</modules>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
@@ -63,42 +62,84 @@
|
|||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<build>
|
<dependencyManagement>
|
||||||
<plugins>
|
<dependencies>
|
||||||
<plugin>
|
<dependency>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<artifactId>annotations</artifactId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<groupId>org.jetbrains</groupId>
|
||||||
<version>3.2.2</version>
|
<scope>provided</scope>
|
||||||
<configuration>
|
<version>21.0.1</version>
|
||||||
<filters>
|
</dependency>
|
||||||
<filter>
|
<dependency>
|
||||||
<artifact>*:*</artifact>
|
<artifactId>spigot-api</artifactId>
|
||||||
<!-- Keep the file clean, don't include every single pom from all modules -->
|
<groupId>org.spigotmc</groupId>
|
||||||
<excludes>
|
<scope>provided</scope>
|
||||||
<exclude>META-INF/maven/**</exclude>
|
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||||
</excludes>
|
</dependency>
|
||||||
</filter>
|
<dependency>
|
||||||
</filters>
|
<artifactId>openinvapi</artifactId>
|
||||||
</configuration>
|
<groupId>com.lishid</groupId>
|
||||||
<executions>
|
<scope>compile</scope>
|
||||||
<execution>
|
<version>4.1.7</version>
|
||||||
<phase>package</phase>
|
</dependency>
|
||||||
<goals>
|
<dependency>
|
||||||
<goal>shade</goal>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
</goals>
|
<groupId>com.lishid</groupId>
|
||||||
</execution>
|
<scope>compile</scope>
|
||||||
</executions>
|
<version>4.1.7</version>
|
||||||
</plugin>
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
<plugin>
|
<build>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<pluginManagement>
|
||||||
<version>3.8.1</version>
|
<plugins>
|
||||||
<configuration>
|
<plugin>
|
||||||
<source>1.8</source>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<target>1.8</target>
|
<configuration>
|
||||||
</configuration>
|
<filters>
|
||||||
</plugin>
|
<filter>
|
||||||
</plugins>
|
<!-- Always shade entirety of required modules. -->
|
||||||
|
<artifact>com.lishid:openinv*</artifact>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
</filter>
|
||||||
|
<filter>
|
||||||
|
<artifact>*:*</artifact>
|
||||||
|
<!-- Don't warn about file conflicts that'll be clobbered anyway. -->
|
||||||
|
<excludes>
|
||||||
|
<exclude>META-INF/MANIFEST.MF</exclude>
|
||||||
|
</excludes>
|
||||||
|
</filter>
|
||||||
|
</filters>
|
||||||
|
<minimizeJar>true</minimizeJar>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<version>3.2.4</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<version>3.3.0</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
@@ -32,22 +32,23 @@ if [[ ${spigot_versions[@]} ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Pull Spigot dependency information from Maven.
|
# Pull Spigot dependency information from Maven.
|
||||||
modules=$(mvn help:evaluate -Dexpression=project.modules -q -DforceStdout -P all -pl internal | grep -oP '(?<=<string>)(.*)(?=<\/string>)')
|
# Since we only care about Spigot versions, only check modules in the folder internal.
|
||||||
|
readarray -t modules <<< "$(mvn help:evaluate -Dexpression=project.modules -q -DforceStdout -P all | grep -oP '(?<=<string>)(internal/.*)(?=</string>)')"
|
||||||
|
|
||||||
declare -n versions="spigot_versions"
|
declare -n versions="spigot_versions"
|
||||||
|
|
||||||
for module in "${modules[@]}"; do
|
for module in "${modules[@]}"; do
|
||||||
# Get number of dependencies declared in pom of specified internal module.
|
# Get number of dependencies declared in pom of specified internal module.
|
||||||
max_index=$(mvn help:evaluate -Dexpression=project.dependencies -q -DforceStdout -P all -pl internal/"$module" | grep -c "<dependency>")
|
max_index=$(mvn help:evaluate -Dexpression=project.dependencies -q -DforceStdout -P all -pl "$module" | grep -c "<dependency>")
|
||||||
|
|
||||||
for ((i=0; i < max_index; i++)); do
|
for ((i=0; i < max_index; i++)); do
|
||||||
# Get artifactId of dependency.
|
# Get artifactId of dependency.
|
||||||
artifact_id=$(mvn help:evaluate -Dexpression=project.dependencies["$i"].artifactId -q -DforceStdout -P all -pl internal/"$module")
|
artifact_id=$(mvn help:evaluate -Dexpression=project.dependencies["$i"].artifactId -q -DforceStdout -P all -pl "$module")
|
||||||
|
|
||||||
# Ensure dependency is Spigot.
|
# Ensure dependency is Spigot.
|
||||||
if [[ "$artifact_id" == spigot ]]; then
|
if [[ "$artifact_id" == spigot ]]; then
|
||||||
# Get Spigot version.
|
# Get Spigot version.
|
||||||
spigot_version=$(mvn help:evaluate -Dexpression=project.dependencies["$i"].version -q -DforceStdout -P all -pl internal/"$module")
|
spigot_version=$(mvn help:evaluate -Dexpression=project.dependencies["$i"].version -q -DforceStdout -P all -pl "$module")
|
||||||
versions+=("$spigot_version")
|
versions+=("$spigot_version")
|
||||||
echo "$spigot_version"
|
echo "$spigot_version"
|
||||||
break
|
break
|
||||||
|
Reference in New Issue
Block a user