Comments (3)
Unfortunately OpenInv does not have a way to account for external inventory storage. If you're running a plugin that changes inventory storage, that plugin needs to be responsible for offline viewing and modification.
To help avoid accidents you should consider negating the node OpenInv.openoffline
.
You can also use the config node settings.disable-saving
to prevent OpenInv from saving changes to offline players. Note that this will not prevent OpenInv modifying inventory contents on login if the player has been recently modified and is in the cache. OpenInv runs on lowest priority to attempt better compatibility with other inventory modification plugins (anticheats that filter items, etc.) so ideally PlayerSQL should overwrite any changes made by OpenInv in the mirroring process.
Related to lishid#171, need a way to more completely disable offline access.
from openinv.
Not sure how technical you are @YTiceice but the solution we are using for exactly the same problem is to build our own version of OpenInv with this patch:
+++ b/plugin/src/main/java/com/lishid/openinv/OpenInv.java
@@ -447,12 +447,23 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
// Replace stored player with our own version
this.playerCache.put(key, this.accessor.getPlayerDataManager().inject(player));
+ /* Remove the cached entry if it exists */
+ this.playerCache.invalidate(key);
+
if (this.inventories.containsKey(key)) {
- this.inventories.get(key).setPlayerOffline();
+ Iterator<HumanEntity> iterator = this.inventories.remove(key).getBukkitInventory().getViewers().iterator();
+ while (iterator.hasNext()) {
+ HumanEntity human = iterator.next();
+ human.closeInventory();
+ }
}
if (this.enderChests.containsKey(key)) {
- this.enderChests.get(key).setPlayerOffline();
+ Iterator<HumanEntity> iterator = this.enderChests.remove(key).getBukkitInventory().getViewers().iterator();
+ while (iterator.hasNext()) {
+ HumanEntity human = iterator.next();
+ human.closeInventory();
+ }
}
}
I would someday still like a config option to do something like this so I don't have to build my own OpenInv plugin every time there's a new MC version.
Similarly to YTiceice, we are using a separate database for player data storage.
from openinv.
Ok
from openinv.
Related Issues (20)
- Add an option in the configuration file to disable playername history HOT 2
- Minecraft v1.19.3 support HOT 7
- Console Error HOT 1
- OpenEnder Perm not working anymore. HOT 2
- Bug removed inventory HOT 3
- Openender + Delete HOT 1
- Error with checking other people inventory HOT 2
- Changes to inv are not persisting HOT 3
- /sc command overriding staffchat commands HOT 1
- How to disable per-player languages? HOT 6
- Improve LanguageManager flexibility
- Minecraft 1.19 HOT 3
- Different worlds/different inventories HOT 1
- Cant openoffline enderchest. HOT 1
- Release build for 1.19.1 HOT 1
- openender chest in 1.19.1 crashes server HOT 3
- 1.19.1 /open error HOT 1
- Why it uses owner's locale instead of command sender's locale? HOT 1
- -
- 1.16.5 /openender error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openinv.