Compare commits
	
		
			31 Commits
		
	
	
		
			4.0.1
			...
			feature/cu
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					1dd28ac0eb | ||
| 
						 | 
					ff76f2b95a | ||
| 
						 | 
					b92543e078 | ||
| 
						 | 
					252ca34e42 | ||
| 
						 | 
					c28383ef36 | ||
| 
						 | 
					5fbab1ab8f | ||
| 
						 | 
					d97b092978 | ||
| 
						 | 
					154bf56c2a | ||
| 
						 | 
					d65a9caeb2 | ||
| 
						 | 
					b3c4253606 | ||
| 
						 | 
					b64000e89b | ||
| 
						 | 
					3faf41ef18 | ||
| 
						 | 
					db27d25a93 | ||
| 
						 | 
					0f02e6fe66 | ||
| 
						 | 
					ec07637e9f | ||
| 
						 | 
					b269f3509c | ||
| 
						 | 
					f2e4c8a3ad | ||
| 
						 | 
					35839f1548 | ||
| 
						 | 
					a4a462a1fa | ||
| 
						 | 
					b9f901af66 | ||
| 
						 | 
					1333056613 | ||
| 
						 | 
					fb23df313a | ||
| 
						 | 
					96dc400c83 | ||
| 
						 | 
					b801d36f12 | ||
| 
						 | 
					4c27599dd9 | ||
| 
						 | 
					64ad0a5267 | ||
| 
						 | 
					cba7f44192 | ||
| 
						 | 
					e8ace6bd06 | ||
| 
						 | 
					fd70f260ba | ||
| 
						 | 
					be9874ba1d | ||
| 
						 | 
					096faef161 | 
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -3,7 +3,7 @@
 | 
				
			|||||||
**/.project
 | 
					**/.project
 | 
				
			||||||
**/.classpath
 | 
					**/.classpath
 | 
				
			||||||
**/.idea
 | 
					**/.idea
 | 
				
			||||||
**/.iml
 | 
					**.iml
 | 
				
			||||||
**/target
 | 
					**/target
 | 
				
			||||||
**/bin
 | 
					**/bin
 | 
				
			||||||
**/out
 | 
					**/out
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								README.MD
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								README.MD
									
									
									
									
									
								
							@@ -132,15 +132,19 @@ OpenInv is a [Bukkit plugin](https://dev.bukkit.org/bukkit-plugins/openinv/) whi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## For Developers
 | 
					## For Developers
 | 
				
			||||||
To compile, the relevant Craftbukkit/Spigot jars must be installed in your local repository using the install plugin.
 | 
					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.11-R0.1-SNAPSHOT.jar -DgroupId=org.spigotmc -DartifactId=spigot -Dversion=1.11-R0.1-SNAPSHOT`
 | 
					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`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To compile for a specific version or set of versions, you'll need to use a profile. Provided profiles are `latest`, `recent` (last 2 major Minecraft versions), and `all`. Select an existing profile using the `-P` argument (ex: `mvn clean package -am -P all`) or make your own. For more information, check out the [official guide](http://maven.apache.org/guides/introduction/introduction-to-profiles.html).
 | 
					To compile for a single version, specify the NMS revision you are targeting: `mvn -pl <NMS module> -am clean install`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The final file is target/OpenInv.jar
 | 
					To compile for a set of versions, you'll need to use a profile. The only provided profile is `all`. Select a profile using the `-P` argument: `mvn clean package -am -P all`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## License
 | 
					## License
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This program is free software: you can redistribute it and/or modify
 | 
					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
 | 
					it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										35
									
								
								api/pom.xml
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								api/pom.xml
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvparent</artifactId>
 | 
					    <artifactId>openinvparent</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvapi</artifactId>
 | 
					  <artifactId>openinvapi</artifactId>
 | 
				
			||||||
@@ -37,7 +37,38 @@
 | 
				
			|||||||
      <groupId>org.spigotmc</groupId>
 | 
					      <groupId>org.spigotmc</groupId>
 | 
				
			||||||
      <artifactId>spigot-api</artifactId>
 | 
					      <artifactId>spigot-api</artifactId>
 | 
				
			||||||
      <version>1.8.8-R0.1-SNAPSHOT</version>
 | 
					      <version>1.8.8-R0.1-SNAPSHOT</version>
 | 
				
			||||||
 | 
					      <scope>provided</scope>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
  </dependencies>
 | 
					  </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <build>
 | 
				
			||||||
 | 
					    <plugins>
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 | 
					        <artifactId>maven-shade-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.0.0</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <minimizeJar>true</minimizeJar>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					        <executions>
 | 
				
			||||||
 | 
					          <execution>
 | 
				
			||||||
 | 
					            <phase>package</phase>
 | 
				
			||||||
 | 
					            <goals>
 | 
				
			||||||
 | 
					              <goal>shade</goal>
 | 
				
			||||||
 | 
					            </goals>
 | 
				
			||||||
 | 
					          </execution>
 | 
				
			||||||
 | 
					        </executions>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.8.1</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <source>1.8</source>
 | 
				
			||||||
 | 
					          <target>1.8</target>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					    </plugins>
 | 
				
			||||||
 | 
					  </build>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,21 +12,6 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 * You should have received a copy of the GNU General Public License
 | 
					 * You should have received a copy of the GNU General Public License
 | 
				
			||||||
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 | 
					 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 | 
				
			||||||
 * *
 | 
					 | 
				
			||||||
 * Copyright (C) 2014 - 2018 Simmetrics Authors
 | 
					 | 
				
			||||||
 * Copyright (C) 2010 The Guava Authors
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
					 | 
				
			||||||
 * you may not use this file except in compliance with the License.
 | 
					 | 
				
			||||||
 * You may obtain a copy of the License at
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 *      http://www.apache.org/licenses/LICENSE-2.0
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * Unless required by applicable law or agreed to in writing, software
 | 
					 | 
				
			||||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
					 | 
				
			||||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
					 | 
				
			||||||
 * See the License for the specific language governing permissions and
 | 
					 | 
				
			||||||
 * limitations under the License.
 | 
					 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package com.lishid.openinv.util;
 | 
					package com.lishid.openinv.util;
 | 
				
			||||||
@@ -36,14 +21,14 @@ public class StringMetric {
 | 
				
			|||||||
    public static float compareJaroWinkler(String a, String b) {
 | 
					    public static float compareJaroWinkler(String a, String b) {
 | 
				
			||||||
        final float jaroScore = compareJaro(a, b);
 | 
					        final float jaroScore = compareJaro(a, b);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (jaroScore < (float) 0.1) {
 | 
					        if (jaroScore < (float) 0.7) {
 | 
				
			||||||
            return jaroScore;
 | 
					            return jaroScore;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        String prefix = commonPrefix(a, b);
 | 
					        String prefix = commonPrefix(a, b);
 | 
				
			||||||
        int prefixLength = Math.min(prefix.codePointCount(0, prefix.length()), 4);
 | 
					        int prefixLength = Math.min(prefix.codePointCount(0, prefix.length()), 4);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return jaroScore + (prefixLength * (float) 0.7 * (1.0f - jaroScore));
 | 
					        return jaroScore + (prefixLength * (float) 0.1 * (1.0f - jaroScore));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvparent</artifactId>
 | 
					    <artifactId>openinvparent</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvassembly</artifactId>
 | 
					  <artifactId>openinvassembly</artifactId>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvparent</artifactId>
 | 
					    <artifactId>openinvparent</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvcommon</artifactId>
 | 
					  <artifactId>openinvcommon</artifactId>
 | 
				
			||||||
@@ -31,8 +31,44 @@
 | 
				
			|||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>com.lishid</groupId>
 | 
					      <groupId>com.lishid</groupId>
 | 
				
			||||||
      <artifactId>openinvapi</artifactId>
 | 
					      <artifactId>openinvapi</artifactId>
 | 
				
			||||||
      <version>4.0.1</version>
 | 
					      <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
 | 
					    </dependency>
 | 
				
			||||||
 | 
					    <dependency>
 | 
				
			||||||
 | 
					      <groupId>org.spigotmc</groupId>
 | 
				
			||||||
 | 
					      <artifactId>spigot-api</artifactId>
 | 
				
			||||||
 | 
					      <version>1.8.8-R0.1-SNAPSHOT</version>
 | 
				
			||||||
 | 
					      <scope>provided</scope>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
  </dependencies>
 | 
					  </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <build>
 | 
				
			||||||
 | 
					    <plugins>
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 | 
					        <artifactId>maven-shade-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.0.0</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <minimizeJar>true</minimizeJar>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					        <executions>
 | 
				
			||||||
 | 
					          <execution>
 | 
				
			||||||
 | 
					            <phase>package</phase>
 | 
				
			||||||
 | 
					            <goals>
 | 
				
			||||||
 | 
					              <goal>shade</goal>
 | 
				
			||||||
 | 
					            </goals>
 | 
				
			||||||
 | 
					          </execution>
 | 
				
			||||||
 | 
					        </executions>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.8.1</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <source>1.8</source>
 | 
				
			||||||
 | 
					          <target>1.8</target>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					    </plugins>
 | 
				
			||||||
 | 
					  </build>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -19,11 +19,11 @@ package com.lishid.openinv.util;
 | 
				
			|||||||
import com.google.common.collect.Multimap;
 | 
					import com.google.common.collect.Multimap;
 | 
				
			||||||
import com.google.common.collect.TreeMultimap;
 | 
					import com.google.common.collect.TreeMultimap;
 | 
				
			||||||
import java.util.ArrayList;
 | 
					import java.util.ArrayList;
 | 
				
			||||||
import java.util.Comparator;
 | 
					 | 
				
			||||||
import java.util.HashMap;
 | 
					import java.util.HashMap;
 | 
				
			||||||
import java.util.Iterator;
 | 
					import java.util.Iterator;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.Map;
 | 
					import java.util.Map;
 | 
				
			||||||
 | 
					import java.util.Objects;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * A minimal thread-safe time-based cache implementation backed by a HashMap and TreeMultimap.
 | 
					 * A minimal thread-safe time-based cache implementation backed by a HashMap and TreeMultimap.
 | 
				
			||||||
@@ -45,20 +45,9 @@ public class Cache<K, V> {
 | 
				
			|||||||
     * @param postRemoval Function used to perform any operations required when a key is invalidated
 | 
					     * @param postRemoval Function used to perform any operations required when a key is invalidated
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public Cache(final long retention, final Function<V> inUseCheck, final Function<V> postRemoval) {
 | 
					    public Cache(final long retention, final Function<V> inUseCheck, final Function<V> postRemoval) {
 | 
				
			||||||
        this.internal = new HashMap<K, V>();
 | 
					        this.internal = new HashMap<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.expiry = TreeMultimap.create(new Comparator<Long>() {
 | 
					        this.expiry = TreeMultimap.create(Long::compareTo, (k1, k2) -> Objects.equals(k1, k2) ? 0 : 1);
 | 
				
			||||||
                    @Override
 | 
					 | 
				
			||||||
                    public int compare(final Long long1, final Long long2) {
 | 
					 | 
				
			||||||
                        return long1.compareTo(long2);
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                },
 | 
					 | 
				
			||||||
                new Comparator<K>() {
 | 
					 | 
				
			||||||
                    @Override
 | 
					 | 
				
			||||||
                    public int compare(final K k1, final K k2) {
 | 
					 | 
				
			||||||
                        return k1 == k2 || k1 != null && k1.equals(k2) ? 0 : 1;
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.retention = retention;
 | 
					        this.retention = retention;
 | 
				
			||||||
        this.inUseCheck = inUseCheck;
 | 
					        this.inUseCheck = inUseCheck;
 | 
				
			||||||
@@ -160,7 +149,7 @@ public class Cache<K, V> {
 | 
				
			|||||||
    private void lazyCheck() {
 | 
					    private void lazyCheck() {
 | 
				
			||||||
        long now = System.currentTimeMillis();
 | 
					        long now = System.currentTimeMillis();
 | 
				
			||||||
        synchronized (this.internal) {
 | 
					        synchronized (this.internal) {
 | 
				
			||||||
            List<K> inUse = new ArrayList<K>();
 | 
					            List<K> inUse = new ArrayList<>();
 | 
				
			||||||
            for (Iterator<Map.Entry<Long, K>> iterator = this.expiry.entries().iterator(); iterator
 | 
					            for (Iterator<Map.Entry<Long, K>> iterator = this.expiry.entries().iterator(); iterator
 | 
				
			||||||
                    .hasNext();) {
 | 
					                    .hasNext();) {
 | 
				
			||||||
                Map.Entry<Long, K> entry = iterator.next();
 | 
					                Map.Entry<Long, K> entry = iterator.next();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										53
									
								
								common/src/main/java/com/lishid/openinv/util/Pair.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								common/src/main/java/com/lishid/openinv/util/Pair.java
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Copyright (C) 2011-2019 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/>.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package com.lishid.openinv.util;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Simple tuple.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @param <L> the left value
 | 
				
			||||||
 | 
					 * @param <R> the right value
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author Jikoo
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					public class Pair<L, R> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private L left;
 | 
				
			||||||
 | 
					    private R right;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public Pair(L left, R right) {
 | 
				
			||||||
 | 
					        this.left = left;
 | 
				
			||||||
 | 
					        this.right = right;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public L getLeft() {
 | 
				
			||||||
 | 
					        return left;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void setLeft(L left) {
 | 
				
			||||||
 | 
					        this.left = left;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public R getRight() {
 | 
				
			||||||
 | 
					        return right;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void setRight(R right) {
 | 
				
			||||||
 | 
					        this.right = right;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,201 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Copyright (C) 2011-2019 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/>.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package com.lishid.openinv.util;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.AbstractCollection;
 | 
				
			||||||
 | 
					import java.util.Collection;
 | 
				
			||||||
 | 
					import java.util.Iterator;
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					import java.util.ListIterator;
 | 
				
			||||||
 | 
					import java.util.NoSuchElementException;
 | 
				
			||||||
 | 
					import java.util.Objects;
 | 
				
			||||||
 | 
					import java.util.function.Consumer;
 | 
				
			||||||
 | 
					import java.util.function.Supplier;
 | 
				
			||||||
 | 
					import org.jetbrains.annotations.NotNull;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * A List implementation intended for wrapping a single field.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @param <V> the type of the field
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author Jikoo
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					public class SingleFieldList<V> extends AbstractCollection<V> implements List<V> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private final Supplier<V> fieldGetter;
 | 
				
			||||||
 | 
					    private final Consumer<V> fieldSetter;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public SingleFieldList(@NotNull Supplier<V> fieldGetter, @NotNull Consumer<V> fieldSetter) {
 | 
				
			||||||
 | 
					        this.fieldGetter = fieldGetter;
 | 
				
			||||||
 | 
					        this.fieldSetter = fieldSetter;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public int size() {
 | 
				
			||||||
 | 
					        return 1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public boolean contains(Object o) {
 | 
				
			||||||
 | 
					        return Objects.equals(o, fieldGetter.get());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @NotNull
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public Iterator<V> iterator() {
 | 
				
			||||||
 | 
					        return listIterator();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public boolean addAll(int index, @NotNull Collection<? extends V> c) {
 | 
				
			||||||
 | 
					        return super.addAll(c);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public boolean equals(Object o) {
 | 
				
			||||||
 | 
					        return o instanceof SingleFieldList
 | 
				
			||||||
 | 
					                && fieldGetter.equals(((SingleFieldList) o).fieldGetter)
 | 
				
			||||||
 | 
					                && fieldSetter.equals(((SingleFieldList) o).fieldSetter);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public int hashCode() {
 | 
				
			||||||
 | 
					        return fieldSetter.hashCode() * 17 * fieldGetter.hashCode();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public V get(int index) {
 | 
				
			||||||
 | 
					        if (index != 0) {
 | 
				
			||||||
 | 
					            throw new IndexOutOfBoundsException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return fieldGetter.get();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public V set(int index, V element) {
 | 
				
			||||||
 | 
					        if (index != 0) {
 | 
				
			||||||
 | 
					            throw new IndexOutOfBoundsException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        V old = fieldGetter.get();
 | 
				
			||||||
 | 
					        fieldSetter.accept(element);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return old;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void add(int index, V element) {
 | 
				
			||||||
 | 
					        throw new UnsupportedOperationException();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public V remove(int index) {
 | 
				
			||||||
 | 
					        throw new UnsupportedOperationException();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public int indexOf(Object o) {
 | 
				
			||||||
 | 
					        return fieldGetter.get().equals(o) ? 0 : -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public int lastIndexOf(Object o) {
 | 
				
			||||||
 | 
					        return indexOf(o);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @NotNull
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public ListIterator<V> listIterator() {
 | 
				
			||||||
 | 
					        return new ListIterator<V>() {
 | 
				
			||||||
 | 
					            private boolean hasNext = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public boolean hasNext() {
 | 
				
			||||||
 | 
					                return hasNext;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public V next() {
 | 
				
			||||||
 | 
					                if (!hasNext) {
 | 
				
			||||||
 | 
					                    throw new NoSuchElementException();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                return fieldGetter.get();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public boolean hasPrevious() {
 | 
				
			||||||
 | 
					                return !hasNext;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public V previous() {
 | 
				
			||||||
 | 
					                if (hasNext) {
 | 
				
			||||||
 | 
					                    throw new NoSuchElementException();
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                return fieldGetter.get();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public int nextIndex() {
 | 
				
			||||||
 | 
					                return hasNext ? 0 : 1;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public int previousIndex() {
 | 
				
			||||||
 | 
					                return hasNext ? -1 : 0;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public void remove() {
 | 
				
			||||||
 | 
					                throw new UnsupportedOperationException();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public void set(V v) {
 | 
				
			||||||
 | 
					                fieldSetter.accept(v);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            @Override
 | 
				
			||||||
 | 
					            public void add(V v) {
 | 
				
			||||||
 | 
					                throw new UnsupportedOperationException();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @NotNull
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public ListIterator<V> listIterator(int index) {
 | 
				
			||||||
 | 
					        if (index != 0) {
 | 
				
			||||||
 | 
					            throw new IndexOutOfBoundsException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return listIterator();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @NotNull
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public List<V> subList(int fromIndex, int toIndex) {
 | 
				
			||||||
 | 
					        if (fromIndex != 0 || toIndex != 1) {
 | 
				
			||||||
 | 
					            throw new IndexOutOfBoundsException();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return this;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void clear() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -20,7 +20,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvparent</artifactId>
 | 
					    <artifactId>openinvparent</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvinternal</artifactId>
 | 
					  <artifactId>openinvinternal</artifactId>
 | 
				
			||||||
@@ -30,22 +30,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  <profiles>
 | 
					  <profiles>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <profile>
 | 
					 | 
				
			||||||
      <id>latest</id>
 | 
					 | 
				
			||||||
      <modules>
 | 
					 | 
				
			||||||
        <module>v1_14_R1</module>
 | 
					 | 
				
			||||||
      </modules>
 | 
					 | 
				
			||||||
    </profile>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <profile>
 | 
					 | 
				
			||||||
      <id>recent</id>
 | 
					 | 
				
			||||||
      <!-- The recent profile is for the most recent 2 versions. -->
 | 
					 | 
				
			||||||
      <modules>
 | 
					 | 
				
			||||||
        <module>v1_13_R2</module>
 | 
					 | 
				
			||||||
        <module>v1_14_R1</module>
 | 
					 | 
				
			||||||
      </modules>
 | 
					 | 
				
			||||||
    </profile>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <profile>
 | 
					    <profile>
 | 
				
			||||||
      <id>all</id>
 | 
					      <id>all</id>
 | 
				
			||||||
      <modules>
 | 
					      <modules>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvinternal</artifactId>
 | 
					    <artifactId>openinvinternal</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvadapter1_13_R2</artifactId>
 | 
					  <artifactId>openinvadapter1_13_R2</artifactId>
 | 
				
			||||||
@@ -37,8 +37,38 @@
 | 
				
			|||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>com.lishid</groupId>
 | 
					      <groupId>com.lishid</groupId>
 | 
				
			||||||
      <artifactId>openinvcommon</artifactId>
 | 
					      <artifactId>openinvcommon</artifactId>
 | 
				
			||||||
      <version>4.0.1</version>
 | 
					      <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
  </dependencies>
 | 
					  </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <build>
 | 
				
			||||||
 | 
					    <plugins>
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 | 
					        <artifactId>maven-shade-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.0.0</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <minimizeJar>true</minimizeJar>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					        <executions>
 | 
				
			||||||
 | 
					          <execution>
 | 
				
			||||||
 | 
					            <phase>package</phase>
 | 
				
			||||||
 | 
					            <goals>
 | 
				
			||||||
 | 
					              <goal>shade</goal>
 | 
				
			||||||
 | 
					            </goals>
 | 
				
			||||||
 | 
					          </execution>
 | 
				
			||||||
 | 
					        </executions>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.8.1</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <source>1.8</source>
 | 
				
			||||||
 | 
					          <target>1.8</target>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					    </plugins>
 | 
				
			||||||
 | 
					  </build>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -56,7 +56,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
    private final CraftInventory inventory = new CraftInventory(this);
 | 
					    private final CraftInventory inventory = new CraftInventory(this);
 | 
				
			||||||
    private boolean playerOnline;
 | 
					    private boolean playerOnline;
 | 
				
			||||||
    private NonNullList<ItemStack> items, armor, extraSlots;
 | 
					    private NonNullList<ItemStack> items, armor, extraSlots;
 | 
				
			||||||
    private final List<NonNullList<ItemStack>> f;
 | 
					    private List<NonNullList<ItemStack>> f;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public SpecialPlayerInventory(final Player bukkitPlayer, final Boolean online) {
 | 
					    public SpecialPlayerInventory(final Player bukkitPlayer, final Boolean online) {
 | 
				
			||||||
        super(PlayerDataManager.getHandle(bukkitPlayer));
 | 
					        super(PlayerDataManager.getHandle(bukkitPlayer));
 | 
				
			||||||
@@ -73,10 +73,14 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
            EntityPlayer entityPlayer = PlayerDataManager.getHandle(player);
 | 
					            EntityPlayer entityPlayer = PlayerDataManager.getHandle(player);
 | 
				
			||||||
            entityPlayer.inventory.transaction.addAll(this.transaction);
 | 
					            entityPlayer.inventory.transaction.addAll(this.transaction);
 | 
				
			||||||
            this.player = entityPlayer;
 | 
					            this.player = entityPlayer;
 | 
				
			||||||
            this.player.inventory.a(this);
 | 
					            for (int i = 0; i < getSize(); ++i) {
 | 
				
			||||||
 | 
					                this.player.inventory.setItem(i, getRawItem(i));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            this.player.inventory.itemInHandIndex = this.itemInHandIndex;
 | 
				
			||||||
            this.items = this.player.inventory.items;
 | 
					            this.items = this.player.inventory.items;
 | 
				
			||||||
            this.armor = this.player.inventory.armor;
 | 
					            this.armor = this.player.inventory.armor;
 | 
				
			||||||
            this.extraSlots = this.player.inventory.extraSlots;
 | 
					            this.extraSlots = this.player.inventory.extraSlots;
 | 
				
			||||||
 | 
					            this.f = ImmutableList.of(this.items, this.armor, this.extraSlots);
 | 
				
			||||||
            this.playerOnline = true;
 | 
					            this.playerOnline = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -116,6 +120,19 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
        return list.get(i);
 | 
					        return list.get(i);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private ItemStack getRawItem(int i) {
 | 
				
			||||||
 | 
					        NonNullList<ItemStack> list = null;
 | 
				
			||||||
 | 
					        for (NonNullList<ItemStack> next : this.f) {
 | 
				
			||||||
 | 
					            if (i < next.size()) {
 | 
				
			||||||
 | 
					                list = next;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            i -= next.size();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return list == null ? ItemStack.a : list.get(i);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public IChatBaseComponent getDisplayName() {
 | 
					    public IChatBaseComponent getDisplayName() {
 | 
				
			||||||
        return new ChatMessage(this.player.getName());
 | 
					        return new ChatMessage(this.player.getName());
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,7 +22,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvinternal</artifactId>
 | 
					    <artifactId>openinvinternal</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvadapter1_14_R1</artifactId>
 | 
					  <artifactId>openinvadapter1_14_R1</artifactId>
 | 
				
			||||||
@@ -32,14 +32,44 @@
 | 
				
			|||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>org.spigotmc</groupId>
 | 
					      <groupId>org.spigotmc</groupId>
 | 
				
			||||||
      <artifactId>spigot</artifactId>
 | 
					      <artifactId>spigot</artifactId>
 | 
				
			||||||
      <version>1.14.1-R0.1-SNAPSHOT</version>
 | 
					      <version>1.14.3-R0.1-SNAPSHOT</version>
 | 
				
			||||||
      <scope>provided</scope>
 | 
					      <scope>provided</scope>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>com.lishid</groupId>
 | 
					      <groupId>com.lishid</groupId>
 | 
				
			||||||
      <artifactId>openinvcommon</artifactId>
 | 
					      <artifactId>openinvcommon</artifactId>
 | 
				
			||||||
      <version>4.0.1</version>
 | 
					      <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
  </dependencies>
 | 
					  </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <build>
 | 
				
			||||||
 | 
					    <plugins>
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 | 
					        <artifactId>maven-shade-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.0.0</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <minimizeJar>true</minimizeJar>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					        <executions>
 | 
				
			||||||
 | 
					          <execution>
 | 
				
			||||||
 | 
					            <phase>package</phase>
 | 
				
			||||||
 | 
					            <goals>
 | 
				
			||||||
 | 
					              <goal>shade</goal>
 | 
				
			||||||
 | 
					            </goals>
 | 
				
			||||||
 | 
					          </execution>
 | 
				
			||||||
 | 
					        </executions>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.8.1</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <source>1.8</source>
 | 
				
			||||||
 | 
					          <target>1.8</target>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					    </plugins>
 | 
				
			||||||
 | 
					  </build>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
@@ -18,9 +18,8 @@ package com.lishid.openinv.internal.v1_14_R1;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.lishid.openinv.internal.IAnySilentContainer;
 | 
					import com.lishid.openinv.internal.IAnySilentContainer;
 | 
				
			||||||
import java.lang.reflect.Field;
 | 
					import java.lang.reflect.Field;
 | 
				
			||||||
import javax.annotation.Nullable;
 | 
					 | 
				
			||||||
import net.minecraft.server.v1_14_R1.AxisAlignedBB;
 | 
					 | 
				
			||||||
import net.minecraft.server.v1_14_R1.Block;
 | 
					import net.minecraft.server.v1_14_R1.Block;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_14_R1.BlockBarrel;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.BlockChest;
 | 
					import net.minecraft.server.v1_14_R1.BlockChest;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.BlockChestTrapped;
 | 
					import net.minecraft.server.v1_14_R1.BlockChestTrapped;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.BlockEnderChest;
 | 
					import net.minecraft.server.v1_14_R1.BlockEnderChest;
 | 
				
			||||||
@@ -30,11 +29,9 @@ import net.minecraft.server.v1_14_R1.BlockShulkerBox;
 | 
				
			|||||||
import net.minecraft.server.v1_14_R1.ChatMessage;
 | 
					import net.minecraft.server.v1_14_R1.ChatMessage;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.Container;
 | 
					import net.minecraft.server.v1_14_R1.Container;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.ContainerChest;
 | 
					import net.minecraft.server.v1_14_R1.ContainerChest;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.Entity;
 | 
					 | 
				
			||||||
import net.minecraft.server.v1_14_R1.EntityCat;
 | 
					 | 
				
			||||||
import net.minecraft.server.v1_14_R1.EntityHuman;
 | 
					import net.minecraft.server.v1_14_R1.EntityHuman;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.EntityPlayer;
 | 
					import net.minecraft.server.v1_14_R1.EntityPlayer;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.EnumDirection;
 | 
					import net.minecraft.server.v1_14_R1.EnumChatFormat;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.EnumGamemode;
 | 
					import net.minecraft.server.v1_14_R1.EnumGamemode;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.IBlockData;
 | 
					import net.minecraft.server.v1_14_R1.IBlockData;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.IChatBaseComponent;
 | 
					import net.minecraft.server.v1_14_R1.IChatBaseComponent;
 | 
				
			||||||
@@ -46,15 +43,23 @@ import net.minecraft.server.v1_14_R1.PlayerInventory;
 | 
				
			|||||||
import net.minecraft.server.v1_14_R1.TileEntity;
 | 
					import net.minecraft.server.v1_14_R1.TileEntity;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.TileEntityChest;
 | 
					import net.minecraft.server.v1_14_R1.TileEntityChest;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.TileEntityEnderChest;
 | 
					import net.minecraft.server.v1_14_R1.TileEntityEnderChest;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.TileEntityShulkerBox;
 | 
					import net.minecraft.server.v1_14_R1.TileEntityLootable;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.TileInventory;
 | 
					import net.minecraft.server.v1_14_R1.TileInventory;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.VoxelShapes;
 | 
					 | 
				
			||||||
import net.minecraft.server.v1_14_R1.World;
 | 
					import net.minecraft.server.v1_14_R1.World;
 | 
				
			||||||
import org.bukkit.Material;
 | 
					import org.bukkit.Material;
 | 
				
			||||||
import org.bukkit.Statistic;
 | 
					import org.bukkit.Statistic;
 | 
				
			||||||
 | 
					import org.bukkit.block.Barrel;
 | 
				
			||||||
 | 
					import org.bukkit.block.BlockFace;
 | 
				
			||||||
import org.bukkit.block.BlockState;
 | 
					import org.bukkit.block.BlockState;
 | 
				
			||||||
 | 
					import org.bukkit.block.EnderChest;
 | 
				
			||||||
 | 
					import org.bukkit.block.ShulkerBox;
 | 
				
			||||||
 | 
					import org.bukkit.block.data.BlockData;
 | 
				
			||||||
 | 
					import org.bukkit.block.data.Directional;
 | 
				
			||||||
 | 
					import org.bukkit.block.data.type.Chest;
 | 
				
			||||||
 | 
					import org.bukkit.entity.Cat;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
import org.bukkit.inventory.InventoryView;
 | 
					import org.bukkit.inventory.InventoryView;
 | 
				
			||||||
 | 
					import org.bukkit.util.BoundingBox;
 | 
				
			||||||
import org.jetbrains.annotations.NotNull;
 | 
					import org.jetbrains.annotations.NotNull;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class AnySilentContainer implements IAnySilentContainer {
 | 
					public class AnySilentContainer implements IAnySilentContainer {
 | 
				
			||||||
@@ -78,94 +83,87 @@ public class AnySilentContainer implements IAnySilentContainer {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
        BlockState state = bukkitBlock.getState();
 | 
					        BlockState state = bukkitBlock.getState();
 | 
				
			||||||
        return state instanceof org.bukkit.block.Chest
 | 
					        return state instanceof org.bukkit.block.Chest
 | 
				
			||||||
                || state instanceof org.bukkit.block.ShulkerBox;
 | 
					                || state instanceof org.bukkit.block.ShulkerBox
 | 
				
			||||||
 | 
					                || state instanceof org.bukkit.block.Barrel;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean isAnyContainerNeeded(@NotNull final Player p, @NotNull final org.bukkit.block.Block bukkitBlock) {
 | 
					    public boolean isAnyContainerNeeded(@NotNull final Player p, @NotNull final org.bukkit.block.Block block) {
 | 
				
			||||||
        EntityPlayer player = PlayerDataManager.getHandle(p);
 | 
					        BlockState blockState = block.getState();
 | 
				
			||||||
        World world = player.world;
 | 
					 | 
				
			||||||
        BlockPosition blockPosition = new BlockPosition(bukkitBlock.getX(), bukkitBlock.getY(), bukkitBlock.getZ());
 | 
					 | 
				
			||||||
        IBlockData blockData = world.getType(blockPosition);
 | 
					 | 
				
			||||||
        Block block = blockData.getBlock();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (block instanceof BlockShulkerBox) {
 | 
					        // Barrels do not require AnyContainer.
 | 
				
			||||||
            return this.isBlockedShulkerBox(world, blockPosition, blockData);
 | 
					        if (blockState instanceof Barrel) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (block instanceof BlockEnderChest) {
 | 
					        // Enderchests require a non-occluding block on top to open.
 | 
				
			||||||
            // Ender chests are not blocked by ocelots.
 | 
					        if (blockState instanceof EnderChest) {
 | 
				
			||||||
            return world.getType(blockPosition.up()).isOccluding(world, blockPosition);
 | 
					            return block.getRelative(0, 1, 0).getType().isOccluding();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Check if chest is blocked or has an ocelot on top
 | 
					        // Shulker boxes require 1/2 a block clear in the direction they open.
 | 
				
			||||||
        if (this.isBlockedChest(world, blockPosition)) {
 | 
					        if (blockState instanceof ShulkerBox) {
 | 
				
			||||||
 | 
					            BoundingBox boundingBox = block.getBoundingBox();
 | 
				
			||||||
 | 
					            if (boundingBox.getVolume() > 1) {
 | 
				
			||||||
 | 
					                // Shulker box is already open.
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            BlockData blockData = block.getBlockData();
 | 
				
			||||||
 | 
					            if (!(blockData instanceof Directional)) {
 | 
				
			||||||
 | 
					                // Shouldn't be possible. Just in case, demand AnyChest.
 | 
				
			||||||
                return true;
 | 
					                return true;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Check for matching adjacent chests that are blocked or have an ocelot on top
 | 
					            Directional directional = (Directional) blockData;
 | 
				
			||||||
        BlockPropertyChestType chestType = blockData.get(BlockChest.b);
 | 
					            BlockFace face = directional.getFacing();
 | 
				
			||||||
 | 
					            boundingBox.shift(face.getDirection());
 | 
				
			||||||
 | 
					            // Return whether or not bounding boxes overlap.
 | 
				
			||||||
 | 
					            return block.getRelative(face, 1).getBoundingBox().overlaps(boundingBox);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (chestType == BlockPropertyChestType.SINGLE) {
 | 
					        if (!(blockState instanceof org.bukkit.block.Chest)) {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        BlockPosition adjacentBlockPosition = blockPosition.shift(BlockChest.j(blockData));
 | 
					        if (isBlockedChest(block)) {
 | 
				
			||||||
        IBlockData adjacentBlockData = world.getType(adjacentBlockPosition);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (adjacentBlockData.getBlock() == block) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            BlockPropertyChestType adjacentChestType = adjacentBlockData.get(BlockChest.b);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
            if (adjacentChestType != BlockPropertyChestType.SINGLE && chestType != adjacentChestType
 | 
					 | 
				
			||||||
                    && adjacentBlockData.get(BlockChest.FACING) == blockData.get(BlockChest.FACING)) {
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                return this.isBlockedChest(world, adjacentBlockPosition);
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return false;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private boolean isBlockedShulkerBox(final World world, final BlockPosition blockPosition,
 | 
					 | 
				
			||||||
                                        final IBlockData blockData) {
 | 
					 | 
				
			||||||
        // For reference, look at net.minecraft.server.BlockShulkerBox
 | 
					 | 
				
			||||||
        TileEntity tile = world.getTileEntity(blockPosition);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (!(tile instanceof TileEntityShulkerBox)) {
 | 
					 | 
				
			||||||
            return false;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        EnumDirection enumDirection = blockData.get(BlockShulkerBox.a);
 | 
					 | 
				
			||||||
        if (((TileEntityShulkerBox) tile).t() == TileEntityShulkerBox.AnimationPhase.CLOSED) {
 | 
					 | 
				
			||||||
            AxisAlignedBB axisAlignedBB = VoxelShapes.b().getBoundingBox()
 | 
					 | 
				
			||||||
                    .b(0.5F * enumDirection.getAdjacentX(), 0.5F * enumDirection.getAdjacentY(), 0.5F * enumDirection.getAdjacentZ())
 | 
					 | 
				
			||||||
                    .a(enumDirection.getAdjacentX(), enumDirection.getAdjacentY(), enumDirection.getAdjacentZ());
 | 
					 | 
				
			||||||
            return !world.getCubes(null, axisAlignedBB.a(blockPosition.shift(enumDirection)));
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        return false;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private boolean isBlockedChest(final World world, final BlockPosition blockPosition) {
 | 
					 | 
				
			||||||
        // For reference, loot at net.minecraft.server.BlockChest
 | 
					 | 
				
			||||||
        return world.getType(blockPosition.up()).isOccluding(world, blockPosition) || this.hasOcelotOnTop(world, blockPosition);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private boolean hasOcelotOnTop(final World world, final BlockPosition blockPosition) {
 | 
					 | 
				
			||||||
        for (Entity entity : world.a(EntityCat.class,
 | 
					 | 
				
			||||||
                new AxisAlignedBB(blockPosition.getX(), blockPosition.getY() + 1,
 | 
					 | 
				
			||||||
                        blockPosition.getZ(), blockPosition.getX() + 1, blockPosition.getY() + 2,
 | 
					 | 
				
			||||||
                        blockPosition.getZ() + 1))) {
 | 
					 | 
				
			||||||
            EntityCat entityCat = (EntityCat) entity;
 | 
					 | 
				
			||||||
            if (entityCat.isSitting()) {
 | 
					 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        BlockData blockData = block.getBlockData();
 | 
				
			||||||
 | 
					        if (!(blockData instanceof Chest) || ((Chest) blockData).getType() == Chest.Type.SINGLE) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Chest chest = (Chest) blockData;
 | 
				
			||||||
 | 
					        int ordinal = (chest.getFacing().ordinal() + 4 + (chest.getType() == Chest.Type.RIGHT ? -1 : 1)) % 4;
 | 
				
			||||||
 | 
					        BlockFace relativeFace = BlockFace.values()[ordinal];
 | 
				
			||||||
 | 
					        org.bukkit.block.Block relative = block.getRelative(relativeFace);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (relative.getType() != block.getType()) {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        BlockData relativeData = relative.getBlockData();
 | 
				
			||||||
 | 
					        if (!(relativeData instanceof Chest)) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        Chest relativeChest = (Chest) relativeData;
 | 
				
			||||||
 | 
					        if (relativeChest.getFacing() != chest.getFacing()
 | 
				
			||||||
 | 
					                || relativeChest.getType() != (chest.getType() == Chest.Type.RIGHT ? Chest.Type.LEFT : Chest.Type.RIGHT)) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return isBlockedChest(relative);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private boolean isBlockedChest(org.bukkit.block.Block block) {
 | 
				
			||||||
 | 
					        org.bukkit.block.Block relative = block.getRelative(0, 1, 0);
 | 
				
			||||||
 | 
					        return relative.getType().isOccluding()
 | 
				
			||||||
 | 
					                || block.getWorld().getNearbyEntities(BoundingBox.of(relative), entity -> entity instanceof Cat).size() > 0;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public boolean activateContainer(@NotNull final Player bukkitPlayer, final boolean silentchest,
 | 
					    public boolean activateContainer(@NotNull final Player bukkitPlayer, final boolean silentchest,
 | 
				
			||||||
                                     @NotNull final org.bukkit.block.Block bukkitBlock) {
 | 
					                                     @NotNull final org.bukkit.block.Block bukkitBlock) {
 | 
				
			||||||
@@ -181,7 +179,7 @@ public class AnySilentContainer implements IAnySilentContainer {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        final World world = player.world;
 | 
					        final World world = player.world;
 | 
				
			||||||
        final BlockPosition blockPosition = new BlockPosition(bukkitBlock.getX(), bukkitBlock.getY(), bukkitBlock.getZ());
 | 
					        final BlockPosition blockPosition = new BlockPosition(bukkitBlock.getX(), bukkitBlock.getY(), bukkitBlock.getZ());
 | 
				
			||||||
        final Object tile = world.getTileEntity(blockPosition);
 | 
					        final TileEntity tile = world.getTileEntity(blockPosition);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (tile == null) {
 | 
					        if (tile == null) {
 | 
				
			||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
@@ -226,16 +224,17 @@ public class AnySilentContainer implements IAnySilentContainer {
 | 
				
			|||||||
                        if (adjacentTile instanceof TileEntityChest && tileInventory instanceof  TileEntityChest) {
 | 
					                        if (adjacentTile instanceof TileEntityChest && tileInventory instanceof  TileEntityChest) {
 | 
				
			||||||
                            TileEntityChest rightChest = chestType == BlockPropertyChestType.RIGHT ? ((TileEntityChest) tileInventory) : (TileEntityChest) adjacentTile;
 | 
					                            TileEntityChest rightChest = chestType == BlockPropertyChestType.RIGHT ? ((TileEntityChest) tileInventory) : (TileEntityChest) adjacentTile;
 | 
				
			||||||
                            TileEntityChest leftChest = chestType == BlockPropertyChestType.RIGHT ? (TileEntityChest) adjacentTile : ((TileEntityChest) tileInventory);
 | 
					                            TileEntityChest leftChest = chestType == BlockPropertyChestType.RIGHT ? (TileEntityChest) adjacentTile : ((TileEntityChest) tileInventory);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            if (rightChest.lootTable != null || leftChest.lootTable != null) {
 | 
				
			||||||
 | 
					                                player.a(new ChatMessage("Loot not generated! Please disable /silentcontainer.").a(EnumChatFormat.RED), true);
 | 
				
			||||||
 | 
					                                return false;
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            tileInventory = new ITileInventory() {
 | 
					                            tileInventory = new ITileInventory() {
 | 
				
			||||||
                                @Nullable
 | 
					 | 
				
			||||||
                                public Container createMenu(int containerCounter, PlayerInventory playerInventory, EntityHuman entityHuman) {
 | 
					                                public Container createMenu(int containerCounter, PlayerInventory playerInventory, EntityHuman entityHuman) {
 | 
				
			||||||
                                    if (leftChest.e(entityHuman) && rightChest.e(entityHuman)) {
 | 
					 | 
				
			||||||
                                    leftChest.d(playerInventory.player);
 | 
					                                    leftChest.d(playerInventory.player);
 | 
				
			||||||
                                    rightChest.d(playerInventory.player);
 | 
					                                    rightChest.d(playerInventory.player);
 | 
				
			||||||
                                    return ContainerChest.b(containerCounter, playerInventory, new InventoryLargeChest(rightChest, leftChest));
 | 
					                                    return ContainerChest.b(containerCounter, playerInventory, new InventoryLargeChest(rightChest, leftChest));
 | 
				
			||||||
                                    } else {
 | 
					 | 
				
			||||||
                                        return null;
 | 
					 | 
				
			||||||
                                    }
 | 
					 | 
				
			||||||
                                }
 | 
					                                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                public IChatBaseComponent getScoreboardDisplayName() {
 | 
					                                public IChatBaseComponent getScoreboardDisplayName() {
 | 
				
			||||||
@@ -258,6 +257,10 @@ public class AnySilentContainer implements IAnySilentContainer {
 | 
				
			|||||||
            bukkitPlayer.incrementStatistic(Statistic.SHULKER_BOX_OPENED);
 | 
					            bukkitPlayer.incrementStatistic(Statistic.SHULKER_BOX_OPENED);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (block instanceof BlockBarrel) {
 | 
				
			||||||
 | 
					            bukkitPlayer.incrementStatistic(Statistic.OPEN_BARREL);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // AnyChest only - SilentChest not active, container unsupported, or unnecessary.
 | 
					        // AnyChest only - SilentChest not active, container unsupported, or unnecessary.
 | 
				
			||||||
        if (!silentchest || player.playerInteractManager.getGameMode() == EnumGamemode.SPECTATOR) {
 | 
					        if (!silentchest || player.playerInteractManager.getGameMode() == EnumGamemode.SPECTATOR) {
 | 
				
			||||||
            player.openContainer(tileInventory);
 | 
					            player.openContainer(tileInventory);
 | 
				
			||||||
@@ -269,6 +272,14 @@ public class AnySilentContainer implements IAnySilentContainer {
 | 
				
			|||||||
            return false;
 | 
					            return false;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (tile instanceof TileEntityLootable) {
 | 
				
			||||||
 | 
					            TileEntityLootable lootable = (TileEntityLootable) tile;
 | 
				
			||||||
 | 
					            if (lootable.lootTable != null) {
 | 
				
			||||||
 | 
					                player.a(new ChatMessage("Loot not generated! Please disable /silentcontainer.").a(EnumChatFormat.RED), true);
 | 
				
			||||||
 | 
					                return false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        EnumGamemode gamemode = player.playerInteractManager.getGameMode();
 | 
					        EnumGamemode gamemode = player.playerInteractManager.getGameMode();
 | 
				
			||||||
        this.forceGameMode(player, EnumGamemode.SPECTATOR);
 | 
					        this.forceGameMode(player, EnumGamemode.SPECTATOR);
 | 
				
			||||||
        player.openContainer(tileInventory);
 | 
					        player.openContainer(tileInventory);
 | 
				
			||||||
@@ -287,6 +298,7 @@ public class AnySilentContainer implements IAnySilentContainer {
 | 
				
			|||||||
            case CHEST:
 | 
					            case CHEST:
 | 
				
			||||||
            case ENDER_CHEST:
 | 
					            case ENDER_CHEST:
 | 
				
			||||||
            case SHULKER_BOX:
 | 
					            case SHULKER_BOX:
 | 
				
			||||||
 | 
					            case BARREL:
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -100,6 +100,7 @@ public class PlayerDataManager implements IPlayerDataManager {
 | 
				
			|||||||
        String title;
 | 
					        String title;
 | 
				
			||||||
        if (inventory instanceof SpecialEnderChest) {
 | 
					        if (inventory instanceof SpecialEnderChest) {
 | 
				
			||||||
            HumanEntity owner = (HumanEntity) ((SpecialEnderChest) inventory).getBukkitOwner();
 | 
					            HumanEntity owner = (HumanEntity) ((SpecialEnderChest) inventory).getBukkitOwner();
 | 
				
			||||||
 | 
					            //noinspection ConstantConditions // Owner name can be null when loaded under certain conditions.
 | 
				
			||||||
            title = (owner.getName() != null ? owner.getName() : owner.getUniqueId().toString()) + "'s Ender Chest";
 | 
					            title = (owner.getName() != null ? owner.getName() : owner.getUniqueId().toString()) + "'s Ender Chest";
 | 
				
			||||||
        } else if (inventory instanceof SpecialPlayerInventory) {
 | 
					        } else if (inventory instanceof SpecialPlayerInventory) {
 | 
				
			||||||
            EntityHuman owner = ((PlayerInventory) inventory).player;
 | 
					            EntityHuman owner = ((PlayerInventory) inventory).player;
 | 
				
			||||||
@@ -132,7 +133,22 @@ public class PlayerDataManager implements IPlayerDataManager {
 | 
				
			|||||||
        }, nmsPlayer, nmsPlayer.nextContainerCounter()) {
 | 
					        }, nmsPlayer, nmsPlayer.nextContainerCounter()) {
 | 
				
			||||||
            @Override
 | 
					            @Override
 | 
				
			||||||
            public Containers<?> getType() {
 | 
					            public Containers<?> getType() {
 | 
				
			||||||
                return inventory instanceof SpecialEnderChest ? Containers.GENERIC_9X3 : Containers.GENERIC_9X5;
 | 
					                switch (inventory.getBukkitInventory().getSize()) {
 | 
				
			||||||
 | 
					                    case 9:
 | 
				
			||||||
 | 
					                        return Containers.GENERIC_9X1;
 | 
				
			||||||
 | 
					                    case 18:
 | 
				
			||||||
 | 
					                        return Containers.GENERIC_9X2;
 | 
				
			||||||
 | 
					                    case 27:
 | 
				
			||||||
 | 
					                    default:
 | 
				
			||||||
 | 
					                        return Containers.GENERIC_9X3;
 | 
				
			||||||
 | 
					                    case 36:
 | 
				
			||||||
 | 
					                        return Containers.GENERIC_9X4;
 | 
				
			||||||
 | 
					                    case 45:
 | 
				
			||||||
 | 
					                        return Containers.GENERIC_9X5;
 | 
				
			||||||
 | 
					                    case 41: // PLAYER
 | 
				
			||||||
 | 
					                    case 54:
 | 
				
			||||||
 | 
					                        return Containers.GENERIC_9X6;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,8 @@ package com.lishid.openinv.internal.v1_14_R1;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import com.google.common.collect.ImmutableList;
 | 
					import com.google.common.collect.ImmutableList;
 | 
				
			||||||
import com.lishid.openinv.internal.ISpecialPlayerInventory;
 | 
					import com.lishid.openinv.internal.ISpecialPlayerInventory;
 | 
				
			||||||
 | 
					import com.lishid.openinv.util.Pair;
 | 
				
			||||||
 | 
					import com.lishid.openinv.util.SingleFieldList;
 | 
				
			||||||
import java.util.Iterator;
 | 
					import java.util.Iterator;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.function.Predicate;
 | 
					import java.util.function.Predicate;
 | 
				
			||||||
@@ -32,12 +34,12 @@ import net.minecraft.server.v1_14_R1.EntityPlayer;
 | 
				
			|||||||
import net.minecraft.server.v1_14_R1.EnumItemSlot;
 | 
					import net.minecraft.server.v1_14_R1.EnumItemSlot;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.IBlockData;
 | 
					import net.minecraft.server.v1_14_R1.IBlockData;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.IChatBaseComponent;
 | 
					import net.minecraft.server.v1_14_R1.IChatBaseComponent;
 | 
				
			||||||
 | 
					import net.minecraft.server.v1_14_R1.IInventory;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.Item;
 | 
					import net.minecraft.server.v1_14_R1.Item;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.ItemArmor;
 | 
					import net.minecraft.server.v1_14_R1.ItemArmor;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.ItemStack;
 | 
					import net.minecraft.server.v1_14_R1.ItemStack;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.NBTTagCompound;
 | 
					import net.minecraft.server.v1_14_R1.NBTTagCompound;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.NBTTagList;
 | 
					import net.minecraft.server.v1_14_R1.NBTTagList;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.NonNullList;
 | 
					 | 
				
			||||||
import net.minecraft.server.v1_14_R1.PacketPlayOutSetSlot;
 | 
					import net.minecraft.server.v1_14_R1.PacketPlayOutSetSlot;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.PlayerInventory;
 | 
					import net.minecraft.server.v1_14_R1.PlayerInventory;
 | 
				
			||||||
import net.minecraft.server.v1_14_R1.ReportedException;
 | 
					import net.minecraft.server.v1_14_R1.ReportedException;
 | 
				
			||||||
@@ -45,6 +47,7 @@ import net.minecraft.server.v1_14_R1.World;
 | 
				
			|||||||
import org.bukkit.Location;
 | 
					import org.bukkit.Location;
 | 
				
			||||||
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftHumanEntity;
 | 
					import org.bukkit.craftbukkit.v1_14_R1.entity.CraftHumanEntity;
 | 
				
			||||||
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftInventory;
 | 
					import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftInventory;
 | 
				
			||||||
 | 
					import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftInventoryCrafting;
 | 
				
			||||||
import org.bukkit.entity.HumanEntity;
 | 
					import org.bukkit.entity.HumanEntity;
 | 
				
			||||||
import org.bukkit.entity.Player;
 | 
					import org.bukkit.entity.Player;
 | 
				
			||||||
import org.bukkit.inventory.InventoryHolder;
 | 
					import org.bukkit.inventory.InventoryHolder;
 | 
				
			||||||
@@ -56,8 +59,11 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
    private final CraftInventory inventory;
 | 
					    private final CraftInventory inventory;
 | 
				
			||||||
    private boolean playerOnline;
 | 
					    private boolean playerOnline;
 | 
				
			||||||
    private EntityHuman player;
 | 
					    private EntityHuman player;
 | 
				
			||||||
    private NonNullList<ItemStack> items, armor, extraSlots;
 | 
					    private List<ItemStack> items, armor, extraSlots, crafting;
 | 
				
			||||||
    private final List<NonNullList<ItemStack>> f;
 | 
					    @SuppressWarnings("MismatchedQueryAndUpdateOfCollection") // Backing field is mutable.
 | 
				
			||||||
 | 
					    // TODO: cursor requires an additional slot listener
 | 
				
			||||||
 | 
					    private final List<ItemStack> cursor = new SingleFieldList<>(this::getCarried, this::setCarried);
 | 
				
			||||||
 | 
					    private List<List<ItemStack>> f;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public SpecialPlayerInventory(final Player bukkitPlayer, final Boolean online) {
 | 
					    public SpecialPlayerInventory(final Player bukkitPlayer, final Boolean online) {
 | 
				
			||||||
        super(PlayerDataManager.getHandle(bukkitPlayer));
 | 
					        super(PlayerDataManager.getHandle(bukkitPlayer));
 | 
				
			||||||
@@ -67,7 +73,12 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
        this.items = this.player.inventory.items;
 | 
					        this.items = this.player.inventory.items;
 | 
				
			||||||
        this.armor = this.player.inventory.armor;
 | 
					        this.armor = this.player.inventory.armor;
 | 
				
			||||||
        this.extraSlots = this.player.inventory.extraSlots;
 | 
					        this.extraSlots = this.player.inventory.extraSlots;
 | 
				
			||||||
        this.f = ImmutableList.of(this.items, this.armor, this.extraSlots);
 | 
					        this.crafting = this.getCrafting().getContents();
 | 
				
			||||||
 | 
					        this.f = ImmutableList.of(this.items, this.armor, this.extraSlots, this.crafting, this.cursor);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private IInventory getCrafting() {
 | 
				
			||||||
 | 
					        return ((CraftInventoryCrafting) this.player.defaultContainer.getBukkitView().getTopInventory()).getInventory();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@@ -76,10 +87,16 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
            EntityPlayer entityPlayer = PlayerDataManager.getHandle(player);
 | 
					            EntityPlayer entityPlayer = PlayerDataManager.getHandle(player);
 | 
				
			||||||
            entityPlayer.inventory.transaction.addAll(this.transaction);
 | 
					            entityPlayer.inventory.transaction.addAll(this.transaction);
 | 
				
			||||||
            this.player = entityPlayer;
 | 
					            this.player = entityPlayer;
 | 
				
			||||||
            this.player.inventory.a(this);
 | 
					            for (int i = 0; i < getSize(); ++i) {
 | 
				
			||||||
 | 
					                this.player.inventory.setItem(i, getRawItem(i));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            // Crafting/cursor are not insertable while player is offline and do not need special treatment.
 | 
				
			||||||
 | 
					            this.player.inventory.itemInHandIndex = this.itemInHandIndex;
 | 
				
			||||||
            this.items = this.player.inventory.items;
 | 
					            this.items = this.player.inventory.items;
 | 
				
			||||||
            this.armor = this.player.inventory.armor;
 | 
					            this.armor = this.player.inventory.armor;
 | 
				
			||||||
            this.extraSlots = this.player.inventory.extraSlots;
 | 
					            this.extraSlots = this.player.inventory.extraSlots;
 | 
				
			||||||
 | 
					            this.crafting = this.getCrafting().getContents();
 | 
				
			||||||
 | 
					            this.f = ImmutableList.of(this.items, this.armor, this.extraSlots, this.crafting, this.cursor);
 | 
				
			||||||
            this.playerOnline = true;
 | 
					            this.playerOnline = true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -119,6 +136,19 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
        return list.get(i);
 | 
					        return list.get(i);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private ItemStack getRawItem(int i) {
 | 
				
			||||||
 | 
					        List<ItemStack> list = null;
 | 
				
			||||||
 | 
					        for (List<ItemStack> next : this.f) {
 | 
				
			||||||
 | 
					            if (i < next.size()) {
 | 
				
			||||||
 | 
					                list = next;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            i -= next.size();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return list == null ? ItemStack.a : list.get(i);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public IChatBaseComponent getDisplayName() {
 | 
					    public IChatBaseComponent getDisplayName() {
 | 
				
			||||||
        return new ChatMessage(this.player.getName());
 | 
					        return new ChatMessage(this.player.getName());
 | 
				
			||||||
@@ -154,7 +184,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public int getSize() {
 | 
					    public int getSize() {
 | 
				
			||||||
        return 45;
 | 
					        return 54;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@@ -162,30 +192,35 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
        return !this.getViewers().isEmpty();
 | 
					        return !this.getViewers().isEmpty();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    private Pair<List<ItemStack>, Integer> getLocalizedIndex(int i) {
 | 
				
			||||||
    public void setItem(int i, final ItemStack itemstack) {
 | 
					        List<ItemStack> localList = null;
 | 
				
			||||||
        List<ItemStack> list = this.items;
 | 
					        for (List<ItemStack> list : this.f) {
 | 
				
			||||||
 | 
					            if (i < list.size()) {
 | 
				
			||||||
        if (i >= list.size()) {
 | 
					                localList = list;
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            i -= list.size();
 | 
					            i -= list.size();
 | 
				
			||||||
            list = this.armor;
 | 
					        }
 | 
				
			||||||
        } else {
 | 
					
 | 
				
			||||||
 | 
					        if (localList == this.armor) {
 | 
				
			||||||
 | 
					            i = this.getReversedArmorSlotNum(i);
 | 
				
			||||||
 | 
					        } else if (localList == this.items) {
 | 
				
			||||||
            i = this.getReversedItemSlotNum(i);
 | 
					            i = this.getReversedItemSlotNum(i);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (i >= list.size()) {
 | 
					        return new Pair<>(localList, i);
 | 
				
			||||||
            i -= list.size();
 | 
					 | 
				
			||||||
            list = this.extraSlots;
 | 
					 | 
				
			||||||
        } else if (list == this.armor) {
 | 
					 | 
				
			||||||
            i = this.getReversedArmorSlotNum(i);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (i >= list.size()) {
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void setItem(int i, final ItemStack itemstack) {
 | 
				
			||||||
 | 
					        Pair<List<ItemStack>, Integer> localizedIndex = getLocalizedIndex(i);
 | 
				
			||||||
 | 
					        if (localizedIndex.getLeft() == null
 | 
				
			||||||
 | 
					                // TODO: should this be a constant instead of comparing to transient slot containers?
 | 
				
			||||||
 | 
					                || !playerOnline && (localizedIndex.getLeft() == crafting || localizedIndex.getLeft() == cursor)) {
 | 
				
			||||||
            this.player.drop(itemstack, true);
 | 
					            this.player.drop(itemstack, true);
 | 
				
			||||||
            return;
 | 
					        } else {
 | 
				
			||||||
 | 
					            localizedIndex.getLeft().set(localizedIndex.getRight(), itemstack);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					 | 
				
			||||||
        list.set(i, itemstack);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@@ -195,51 +230,26 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public ItemStack splitStack(int i, final int j) {
 | 
					    public ItemStack splitStack(int i, final int j) {
 | 
				
			||||||
        List<ItemStack> list = this.items;
 | 
					        Pair<List<ItemStack>, Integer> localizedIndex = getLocalizedIndex(i);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (i >= list.size()) {
 | 
					        if (localizedIndex.getLeft() == null) {
 | 
				
			||||||
            i -= list.size();
 | 
					 | 
				
			||||||
            list = this.armor;
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            i = this.getReversedItemSlotNum(i);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (i >= list.size()) {
 | 
					 | 
				
			||||||
            i -= list.size();
 | 
					 | 
				
			||||||
            list = this.extraSlots;
 | 
					 | 
				
			||||||
        } else if (list == this.armor) {
 | 
					 | 
				
			||||||
            i = this.getReversedArmorSlotNum(i);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (i >= list.size()) {
 | 
					 | 
				
			||||||
            return ItemStack.a;
 | 
					            return ItemStack.a;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return list.get(i).isEmpty() ? ItemStack.a : ContainerUtil.a(list, i, j);
 | 
					        return localizedIndex.getLeft().get(i).isEmpty() ? ItemStack.a : ContainerUtil.a(localizedIndex.getLeft(), localizedIndex.getRight(), j);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public ItemStack splitWithoutUpdate(int i) {
 | 
					    public ItemStack splitWithoutUpdate(int i) {
 | 
				
			||||||
        List<ItemStack> list = this.items;
 | 
					        Pair<List<ItemStack>, Integer> localizedIndex = getLocalizedIndex(i);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (i >= list.size()) {
 | 
					        if (localizedIndex.getLeft() == null) {
 | 
				
			||||||
            i -= list.size();
 | 
					 | 
				
			||||||
            list = this.armor;
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
            i = this.getReversedItemSlotNum(i);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (i >= list.size()) {
 | 
					 | 
				
			||||||
            i -= list.size();
 | 
					 | 
				
			||||||
            list = this.extraSlots;
 | 
					 | 
				
			||||||
        } else if (list == this.armor) {
 | 
					 | 
				
			||||||
            i = this.getReversedArmorSlotNum(i);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (i >= list.size()) {
 | 
					 | 
				
			||||||
            return ItemStack.a;
 | 
					            return ItemStack.a;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        List<ItemStack> list = localizedIndex.getLeft();
 | 
				
			||||||
 | 
					        i = localizedIndex.getRight();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!list.get(i).isEmpty()) {
 | 
					        if (!list.get(i).isEmpty()) {
 | 
				
			||||||
            ItemStack itemstack = list.get(i);
 | 
					            ItemStack itemstack = list.get(i);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -263,11 +273,13 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void onOpen(CraftHumanEntity who) {
 | 
					    public void onOpen(CraftHumanEntity who) {
 | 
				
			||||||
        this.transaction.add(who);
 | 
					        this.transaction.add(who);
 | 
				
			||||||
 | 
					        this.getCrafting().getViewers().add(who);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void onClose(CraftHumanEntity who) {
 | 
					    public void onClose(CraftHumanEntity who) {
 | 
				
			||||||
        this.transaction.remove(who);
 | 
					        this.transaction.remove(who);
 | 
				
			||||||
 | 
					        this.getCrafting().getViewers().remove(who);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
@@ -309,7 +321,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!this.a(itemstack, itemstack1)) {
 | 
					            if (!this.a(itemstack, itemstack1)) {
 | 
				
			||||||
                remains -= (itemstack1.getMaxStackSize() < this.getMaxStackSize() ? itemstack1.getMaxStackSize() : this.getMaxStackSize()) - itemstack1.getCount();
 | 
					                remains -= Math.min(itemstack1.getMaxStackSize(), this.getMaxStackSize()) - itemstack1.getCount();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (remains <= 0) {
 | 
					            if (remains <= 0) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvinternal</artifactId>
 | 
					    <artifactId>openinvinternal</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvadapter1_8_R3</artifactId>
 | 
					  <artifactId>openinvadapter1_8_R3</artifactId>
 | 
				
			||||||
@@ -37,8 +37,38 @@
 | 
				
			|||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>com.lishid</groupId>
 | 
					      <groupId>com.lishid</groupId>
 | 
				
			||||||
      <artifactId>openinvcommon</artifactId>
 | 
					      <artifactId>openinvcommon</artifactId>
 | 
				
			||||||
      <version>4.0.1</version>
 | 
					      <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
  </dependencies>
 | 
					  </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  <build>
 | 
				
			||||||
 | 
					    <plugins>
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 | 
					        <artifactId>maven-shade-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.0.0</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <minimizeJar>true</minimizeJar>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					        <executions>
 | 
				
			||||||
 | 
					          <execution>
 | 
				
			||||||
 | 
					            <phase>package</phase>
 | 
				
			||||||
 | 
					            <goals>
 | 
				
			||||||
 | 
					              <goal>shade</goal>
 | 
				
			||||||
 | 
					            </goals>
 | 
				
			||||||
 | 
					          </execution>
 | 
				
			||||||
 | 
					        </executions>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.8.1</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <source>1.8</source>
 | 
				
			||||||
 | 
					          <target>1.8</target>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					    </plugins>
 | 
				
			||||||
 | 
					  </build>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
  <parent>
 | 
					  <parent>
 | 
				
			||||||
    <groupId>com.lishid</groupId>
 | 
					    <groupId>com.lishid</groupId>
 | 
				
			||||||
    <artifactId>openinvparent</artifactId>
 | 
					    <artifactId>openinvparent</artifactId>
 | 
				
			||||||
    <version>4.0.1</version>
 | 
					    <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
  </parent>
 | 
					  </parent>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <artifactId>openinvplugincore</artifactId>
 | 
					  <artifactId>openinvplugincore</artifactId>
 | 
				
			||||||
@@ -31,7 +31,13 @@
 | 
				
			|||||||
    <dependency>
 | 
					    <dependency>
 | 
				
			||||||
      <groupId>com.lishid</groupId>
 | 
					      <groupId>com.lishid</groupId>
 | 
				
			||||||
      <artifactId>openinvcommon</artifactId>
 | 
					      <artifactId>openinvcommon</artifactId>
 | 
				
			||||||
      <version>4.0.1</version>
 | 
					      <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
 | 
					    </dependency>
 | 
				
			||||||
 | 
					    <dependency>
 | 
				
			||||||
 | 
					      <groupId>org.spigotmc</groupId>
 | 
				
			||||||
 | 
					      <artifactId>spigot-api</artifactId>
 | 
				
			||||||
 | 
					      <version>1.8.8-R0.1-SNAPSHOT</version>
 | 
				
			||||||
 | 
					      <scope>provided</scope>
 | 
				
			||||||
    </dependency>
 | 
					    </dependency>
 | 
				
			||||||
  </dependencies>
 | 
					  </dependencies>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -42,6 +48,33 @@
 | 
				
			|||||||
        <filtering>true</filtering>
 | 
					        <filtering>true</filtering>
 | 
				
			||||||
      </resource>
 | 
					      </resource>
 | 
				
			||||||
    </resources>
 | 
					    </resources>
 | 
				
			||||||
 | 
					    <plugins>
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <groupId>org.apache.maven.plugins</groupId>
 | 
				
			||||||
 | 
					        <artifactId>maven-shade-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.0.0</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <minimizeJar>true</minimizeJar>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					        <executions>
 | 
				
			||||||
 | 
					          <execution>
 | 
				
			||||||
 | 
					            <phase>package</phase>
 | 
				
			||||||
 | 
					            <goals>
 | 
				
			||||||
 | 
					              <goal>shade</goal>
 | 
				
			||||||
 | 
					            </goals>
 | 
				
			||||||
 | 
					          </execution>
 | 
				
			||||||
 | 
					        </executions>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      <plugin>
 | 
				
			||||||
 | 
					        <artifactId>maven-compiler-plugin</artifactId>
 | 
				
			||||||
 | 
					        <version>3.8.1</version>
 | 
				
			||||||
 | 
					        <configuration>
 | 
				
			||||||
 | 
					          <source>1.8</source>
 | 
				
			||||||
 | 
					          <target>1.8</target>
 | 
				
			||||||
 | 
					        </configuration>
 | 
				
			||||||
 | 
					      </plugin>
 | 
				
			||||||
 | 
					    </plugins>
 | 
				
			||||||
  </build>
 | 
					  </build>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					 * Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * This program is free software: you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,6 +5,7 @@ author: lishid
 | 
				
			|||||||
authors: [Jikoo, ShadowRanger]
 | 
					authors: [Jikoo, ShadowRanger]
 | 
				
			||||||
description: >
 | 
					description: >
 | 
				
			||||||
             This plugin allows you to open a player's inventory as a chest and interact with it in real time.
 | 
					             This plugin allows you to open a player's inventory as a chest and interact with it in real time.
 | 
				
			||||||
 | 
					api-version: "1.13"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
permissions:
 | 
					permissions:
 | 
				
			||||||
  OpenInv.any.default:
 | 
					  OpenInv.any.default:
 | 
				
			||||||
@@ -13,47 +14,57 @@ permissions:
 | 
				
			|||||||
  OpenInv.silent.default:
 | 
					  OpenInv.silent.default:
 | 
				
			||||||
    description: Permission for SilentContainer to default on prior to toggling.
 | 
					    description: Permission for SilentContainer to default on prior to toggling.
 | 
				
			||||||
    default: false
 | 
					    default: false
 | 
				
			||||||
 | 
					  OpenInv.*:
 | 
				
			||||||
 | 
					    description: Permission for all OpenInv features.
 | 
				
			||||||
 | 
					    default: op
 | 
				
			||||||
 | 
					    children:
 | 
				
			||||||
 | 
					      OpenInv.openinv: true
 | 
				
			||||||
 | 
					      OpenInv.openender: true
 | 
				
			||||||
 | 
					      OpenInv.search: true
 | 
				
			||||||
 | 
					      OpenInv.silent: true
 | 
				
			||||||
 | 
					      OpenInv.anychest: true
 | 
				
			||||||
 | 
					      OpenInv.searchenchant: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
commands:
 | 
					commands:
 | 
				
			||||||
  openinv:
 | 
					  openinv:
 | 
				
			||||||
    aliases: [oi, inv, open]
 | 
					    aliases: [oi, inv, open]
 | 
				
			||||||
    description: Open a player's inventory
 | 
					    description: Open a player's inventory
 | 
				
			||||||
    permission: OpenInv.*;OpenInv.openinv
 | 
					    permission: OpenInv.openinv
 | 
				
			||||||
    usage: |-
 | 
					    usage: |-
 | 
				
			||||||
           /<command> [Player] - Open a player's inventory
 | 
					           /<command> [Player] - Open a player's inventory
 | 
				
			||||||
  openender:
 | 
					  openender:
 | 
				
			||||||
    aliases: [oe]
 | 
					    aliases: [oe]
 | 
				
			||||||
    description: Opens the enderchest of a player
 | 
					    description: Opens the enderchest of a player
 | 
				
			||||||
    permission: OpenInv.*;OpenInv.openender
 | 
					    permission: OpenInv.openender
 | 
				
			||||||
    usage: |-
 | 
					    usage: |-
 | 
				
			||||||
           /<command> [Player] - Open a player's enderchest
 | 
					           /<command> [Player] - Open a player's enderchest
 | 
				
			||||||
  searchinv:
 | 
					  searchinv:
 | 
				
			||||||
    aliases: [si]
 | 
					    aliases: [si]
 | 
				
			||||||
    description: Search and list players having a specific item
 | 
					    description: Search and list players having a specific item
 | 
				
			||||||
    permission: OpenInv.*;OpenInv.search
 | 
					    permission: OpenInv.search
 | 
				
			||||||
    usage: |-
 | 
					    usage: |-
 | 
				
			||||||
           /<command> <Item> [MinAmount] - Item is the ID or the Bukkit Material, MinAmount is the minimum amount required
 | 
					           /<command> <Item> [MinAmount] - Item is the ID or the Bukkit Material, MinAmount is the minimum amount required
 | 
				
			||||||
  searchender:
 | 
					  searchender:
 | 
				
			||||||
    aliases: [se]
 | 
					    aliases: [se]
 | 
				
			||||||
    permission: OpenInv.*;OpenInv.search
 | 
					    permission: OpenInv.search
 | 
				
			||||||
    description: Searches and lists players having a specific item in their ender chest
 | 
					    description: Searches and lists players having a specific item in their ender chest
 | 
				
			||||||
    usage: |-
 | 
					    usage: |-
 | 
				
			||||||
           /<command> <item> [MinAmount] - Item is the ID or the Bukkit Material, MinAmount is the minimum amount required
 | 
					           /<command> <item> [MinAmount] - Item is the ID or the Bukkit Material, MinAmount is the minimum amount required
 | 
				
			||||||
  silentcontainer:
 | 
					  silentcontainer:
 | 
				
			||||||
    aliases: [sc, silent, silentchest]
 | 
					    aliases: [sc, silent, silentchest]
 | 
				
			||||||
    description: Toggle SilentContainer function, which stops sounds and animations when using containers.
 | 
					    description: Toggle SilentContainer function, which stops sounds and animations when using containers.
 | 
				
			||||||
    permission: OpenInv.*;OpenInv.silent
 | 
					    permission: OpenInv.silent
 | 
				
			||||||
    usage: |-
 | 
					    usage: |-
 | 
				
			||||||
           /<command> [Check] - Check or toggle silent chest
 | 
					           /<command> [Check] - Check or toggle silent chest
 | 
				
			||||||
  anycontainer:
 | 
					  anycontainer:
 | 
				
			||||||
    aliases: [ac, anychest]
 | 
					    aliases: [ac, anychest]
 | 
				
			||||||
    description: Toggle AnyContainer function, which allows opening of blocked containers.
 | 
					    description: Toggle AnyContainer function, which allows opening of blocked containers.
 | 
				
			||||||
    permission: OpenInv.*;OpenInv.anychest
 | 
					    permission: OpenInv.anychest
 | 
				
			||||||
    usage: |-
 | 
					    usage: |-
 | 
				
			||||||
           /<command> [Check] - Checks or toggle anychest
 | 
					           /<command> [Check] - Checks or toggle anychest
 | 
				
			||||||
  searchenchant:
 | 
					  searchenchant:
 | 
				
			||||||
    aliases: [searchenchants]
 | 
					    aliases: [searchenchants]
 | 
				
			||||||
    description: Search and list players with a specific enchantment.
 | 
					    description: Search and list players with a specific enchantment.
 | 
				
			||||||
    permission: OpenInv.*;OpenInv.searchenchant
 | 
					    permission: OpenInv.searchenchant
 | 
				
			||||||
    usage: |-
 | 
					    usage: |-
 | 
				
			||||||
           /<command> <[enchantment] [MinLevel]> - Enchantment is the enchantment type, MinLevel is the minimum level. One is optional
 | 
					           /<command> <[enchantment] [MinLevel]> - Enchantment is the enchantment type, MinLevel is the minimum level. One is optional
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								pom.xml
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
				
			|||||||
<!--
 | 
					<!--
 | 
				
			||||||
  ~ Copyright (C) 2011-2018 lishid. All rights reserved.
 | 
					  ~ Copyright (C) 2011-2019 lishid. All rights reserved.
 | 
				
			||||||
  ~
 | 
					  ~
 | 
				
			||||||
  ~ This program is free software: you can redistribute it and/or modify
 | 
					  ~ 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
 | 
					  ~ it under the terms of the GNU General Public License as published by
 | 
				
			||||||
@@ -21,7 +21,7 @@
 | 
				
			|||||||
  <artifactId>openinvparent</artifactId>
 | 
					  <artifactId>openinvparent</artifactId>
 | 
				
			||||||
  <name>OpenInvParent</name>
 | 
					  <name>OpenInvParent</name>
 | 
				
			||||||
  <url>http://dev.bukkit.org/bukkit-plugins/openinv/</url>
 | 
					  <url>http://dev.bukkit.org/bukkit-plugins/openinv/</url>
 | 
				
			||||||
  <version>4.0.1</version>
 | 
					  <version>4.0.8-SNAPSHOT</version>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <packaging>pom</packaging>
 | 
					  <packaging>pom</packaging>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user