Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7c1f15974c | ||
|
d992237766 | ||
|
c93464e643 | ||
|
56afefc82b |
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvapi</artifactId>
|
<artifactId>openinvapi</artifactId>
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvassembly</artifactId>
|
<artifactId>openinvassembly</artifactId>
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvadapter1_15_R1</artifactId>
|
<artifactId>openinvadapter1_15_R1</artifactId>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvplugincore</artifactId>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -33,7 +33,6 @@ import net.minecraft.server.v1_15_R1.ContainerChest;
|
|||||||
import net.minecraft.server.v1_15_R1.Containers;
|
import net.minecraft.server.v1_15_R1.Containers;
|
||||||
import net.minecraft.server.v1_15_R1.EntityHuman;
|
import net.minecraft.server.v1_15_R1.EntityHuman;
|
||||||
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
import net.minecraft.server.v1_15_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_15_R1.EnumChatFormat;
|
|
||||||
import net.minecraft.server.v1_15_R1.EnumGamemode;
|
import net.minecraft.server.v1_15_R1.EnumGamemode;
|
||||||
import net.minecraft.server.v1_15_R1.IBlockData;
|
import net.minecraft.server.v1_15_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_15_R1.IChatBaseComponent;
|
import net.minecraft.server.v1_15_R1.IChatBaseComponent;
|
||||||
@@ -192,7 +191,7 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
InventoryEnderChest enderChest = player.getEnderChest();
|
InventoryEnderChest enderChest = player.getEnderChest();
|
||||||
enderChest.a((TileEntityEnderChest) tile);
|
enderChest.a((TileEntityEnderChest) tile);
|
||||||
player.openContainer(new TileInventory((containerCounter, playerInventory, ignored) -> {
|
player.openContainer(new TileInventory((containerCounter, playerInventory, ignored) -> {
|
||||||
Containers containers;
|
Containers<?> containers;
|
||||||
int rows = enderChest.getSize() / 9;
|
int rows = enderChest.getSize() / 9;
|
||||||
switch (rows) {
|
switch (rows) {
|
||||||
case 1:
|
case 1:
|
||||||
@@ -251,8 +250,8 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
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) {
|
if (silentchest && (rightChest.lootTable != null || leftChest.lootTable != null)) {
|
||||||
player.a(new ChatMessage("Loot not generated! Please disable /silentcontainer.").a(EnumChatFormat.RED), true);
|
OpenInv.getPlugin(OpenInv.class).sendSystemMessage(bukkitPlayer, "messages.error.lootNotGenerated");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvadapter1_16_R1</artifactId>
|
<artifactId>openinvadapter1_16_R1</artifactId>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvplugincore</artifactId>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -33,7 +33,6 @@ import net.minecraft.server.v1_16_R1.ContainerChest;
|
|||||||
import net.minecraft.server.v1_16_R1.Containers;
|
import net.minecraft.server.v1_16_R1.Containers;
|
||||||
import net.minecraft.server.v1_16_R1.EntityHuman;
|
import net.minecraft.server.v1_16_R1.EntityHuman;
|
||||||
import net.minecraft.server.v1_16_R1.EntityPlayer;
|
import net.minecraft.server.v1_16_R1.EntityPlayer;
|
||||||
import net.minecraft.server.v1_16_R1.EnumChatFormat;
|
|
||||||
import net.minecraft.server.v1_16_R1.EnumGamemode;
|
import net.minecraft.server.v1_16_R1.EnumGamemode;
|
||||||
import net.minecraft.server.v1_16_R1.IBlockData;
|
import net.minecraft.server.v1_16_R1.IBlockData;
|
||||||
import net.minecraft.server.v1_16_R1.IChatBaseComponent;
|
import net.minecraft.server.v1_16_R1.IChatBaseComponent;
|
||||||
@@ -251,8 +250,8 @@ public class AnySilentContainer implements IAnySilentContainer {
|
|||||||
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) {
|
if (silentchest && (rightChest.lootTable != null || leftChest.lootTable != null)) {
|
||||||
player.a(new ChatMessage("Loot not generated! Please disable /silentcontainer.").a(EnumChatFormat.RED), true);
|
OpenInv.getPlugin(OpenInv.class).sendSystemMessage(bukkitPlayer, "messages.error.lootNotGenerated");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvadapter1_8_R3</artifactId>
|
<artifactId>openinvadapter1_8_R3</artifactId>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvplugincore</artifactId>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvplugincore</artifactId>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvapi</artifactId>
|
<artifactId>openinvapi</artifactId>
|
||||||
<version>4.1.2</version>
|
<version>4.1.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
|
@@ -54,6 +54,12 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||||
|
|
||||||
|
// Do not cancel 3rd party plugins' custom events
|
||||||
|
if (!PlayerInteractEvent.class.equals(event.getClass())) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.getPlayer().isSneaking()
|
if (event.getAction() != Action.RIGHT_CLICK_BLOCK || event.getPlayer().isSneaking()
|
||||||
|| event.useInteractedBlock() == Result.DENY || event.getClickedBlock() == null
|
|| event.useInteractedBlock() == Result.DENY || event.getClickedBlock() == null
|
||||||
|| !plugin.getAnySilentContainer().isAnySilentContainer(event.getClickedBlock())) {
|
|| !plugin.getAnySilentContainer().isAnySilentContainer(event.getClickedBlock())) {
|
||||||
|
2
pom.xml
2
pom.xml
@@ -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.1.2</version>
|
<version>4.1.3</version>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user