forked from lishid/OpenInv
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix up legacy code to use new interfaces
This took way more time than it was worth. Converted line endings to Unix, some other trivial crap. Thanks to Phoenix616 for already having a multi-version pom, it would have taken me much longer to figure out without a functional example. The only legacy code which is not supported is that of the pre-versioned package era. I compiled a copy of Craftbukkit about 15 commits prior to the introduction of versioned packages, and NMS had already been fiddled with. Anyone who needs support for builds in that range can use an older OpenInv build instead, it's not like UUIDs are a big concern.
- Loading branch information
Showing
110 changed files
with
10,717 additions
and
662 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
## Goals | ||
This fork of OpenInv was created when the lag caused by offline player lookups post-UUID migration became too much to bear. Overall, it does not differ much from the original. | ||
|
||
### Changes of Note | ||
- Removed updater | ||
- Removed wand | ||
|
||
## Previous Versions | ||
Any version of Minecraft this fork has been existent for should have a [release](https://github.com/Jikoo/OpenInv/releases) tagged. Features are not backported, however. | ||
|
||
## License | ||
``` | ||
Copyright (C) 2011-2014 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/>. | ||
## Goals | ||
This fork of OpenInv was created when the lag caused by offline player lookups post-UUID migration became too much to bear. Overall, it does not differ much from the original. | ||
|
||
### Changes of Note | ||
- Removed updater | ||
- Removed wand | ||
|
||
## Previous Versions | ||
Any version of Minecraft this fork has been existent for should have a [release](https://github.com/Jikoo/OpenInv/releases) tagged. Features are not backported, however. | ||
|
||
## License | ||
``` | ||
Copyright (C) 2011-2014 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/>. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,141 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>OpenInv</groupId> | ||
<artifactId>OpenInv</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot</artifactId> | ||
<version>1.9-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.1</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>OpenInv</groupId> | ||
<artifactId>OpenInv</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot</artifactId> | ||
<version>1.9-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_9_R1</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot</artifactId> | ||
<version>1.8.8-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_8_R3</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot</artifactId> | ||
<version>1.8.3-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_8_R2</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot</artifactId> | ||
<version>1.8-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_8_R1</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.7.10-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_7_R4</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.7.9-R0.2-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_7_R3</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.7.5-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_7_R2</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.7.2-R0.4-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_7_R1</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.6.4-R2.0-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_6_R3</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.6.2-R1.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_6_R2</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.6.1-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_6_R1</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.5.2-R1.0-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_5_R3</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.5.1-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_5_R2</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.5-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_5_R1</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.4.7-R1.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_4_R1</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.4.6-R0.4-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_4_6</classifier> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.bukkit</groupId> | ||
<artifactId>craftbukkit</artifactId> | ||
<version>1.4.5-R1.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
<classifier>v1_4_5</classifier> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.1</version> | ||
<configuration> | ||
<source>1.6</source> | ||
<target>1.6</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 50 additions & 50 deletions
100
src/main/java/com/lishid/openinv/OpenInvInventoryListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
/* | ||
* Copyright (C) 2011-2014 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; | ||
|
||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
import org.bukkit.event.inventory.InventoryDragEvent; | ||
|
||
public class OpenInvInventoryListener implements Listener { | ||
|
||
private final OpenInv plugin; | ||
|
||
public OpenInvInventoryListener(OpenInv plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@EventHandler(priority = EventPriority.NORMAL) | ||
public void onInventoryClick(InventoryClickEvent event) { | ||
// If this is the top inventory | ||
// if (event.getView().convertSlot(event.getRawSlot()) == event.getRawSlot()) | ||
// { | ||
if (!plugin.getInventoryAccess().check(event.getInventory(), event.getWhoClicked())) { | ||
event.setCancelled(true); | ||
} | ||
// } | ||
} | ||
|
||
@EventHandler(priority = EventPriority.NORMAL) | ||
public void onInventoryDrag(InventoryDragEvent event) { | ||
if (!plugin.getInventoryAccess().check(event.getInventory(), event.getWhoClicked())) { | ||
event.setCancelled(true); | ||
} | ||
} | ||
} | ||
/* | ||
* Copyright (C) 2011-2014 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; | ||
|
||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.inventory.InventoryClickEvent; | ||
import org.bukkit.event.inventory.InventoryDragEvent; | ||
|
||
public class OpenInvInventoryListener implements Listener { | ||
|
||
private final OpenInv plugin; | ||
|
||
public OpenInvInventoryListener(OpenInv plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@EventHandler(priority = EventPriority.NORMAL) | ||
public void onInventoryClick(InventoryClickEvent event) { | ||
// If this is the top inventory | ||
// if (event.getView().convertSlot(event.getRawSlot()) == event.getRawSlot()) | ||
// { | ||
if (!plugin.getInventoryAccess().check(event.getInventory(), event.getWhoClicked())) { | ||
event.setCancelled(true); | ||
} | ||
// } | ||
} | ||
|
||
@EventHandler(priority = EventPriority.NORMAL) | ||
public void onInventoryDrag(InventoryDragEvent event) { | ||
if (!plugin.getInventoryAccess().check(event.getInventory(), event.getWhoClicked())) { | ||
event.setCancelled(true); | ||
} | ||
} | ||
} |
Oops, something went wrong.