Prep for silent shulker boxes, backport ocelot fix to all versions

No clue why I didn't port it to all versions, seems like I stopped after 1.8 or something. Ocelots have been around since 1.2.
This commit is contained in:
Jikoo
2016-11-17 20:06:10 -05:00
parent c3f517d7ab
commit ff683d65d1
30 changed files with 1764 additions and 1092 deletions

View File

@@ -18,8 +18,22 @@ package com.lishid.openinv.internal;
import org.bukkit.entity.Player;
/**
* @deprecated Use {@link IAnySilentContainer}
*/
@Deprecated
public interface IAnySilentChest {
/**
* @deprecated Use {@link IAnySilentContainer#activateContainer(Player, boolean, boolean, int, int, int)}.
*/
@Deprecated
public boolean activateChest(Player player, boolean anychest, boolean silentchest, int x, int y, int z);
/**
* @deprecated Use {@link IAnySilentContainer#isAnyContainerNeeded(Player, int, int, int)}.
*/
@Deprecated
public boolean isAnyChestNeeded(Player player, int x, int y, int z);
public boolean activateChest(Player player, boolean anychest, boolean silentchest, int x, int y, int z);
}

View File

@@ -0,0 +1,40 @@
package com.lishid.openinv.internal;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
public interface IAnySilentContainer extends IAnySilentChest {
/**
* Checks if the given Block is a container which can be unblocked or silenced.
*
* @param block the Block
* @return true if the Block is a supported container
*/
public boolean isAnySilentContainer(Block block);
/**
* Opens the container at the given coordinates for the Player.
*
* @param player
* @param anychest whether compatibility for blocked containers is to be used
* @param silentchest whether the container's noise is to be silenced
* @param x the x coordinate
* @param y the y coordinate
* @param z the z coordinate
* @return true if the container can be opened
*/
public boolean activateContainer(Player player, boolean anychest, boolean silentchest, int x, int y, int z);
/**
* Checks if the container at the given coordinates is blocked.
*
* @param player the Player opening the container
* @param x the x coordinate
* @param y the y coordinate
* @param z the z coordinate
* @return true if the container is blocked
*/
public boolean isAnyContainerNeeded(Player player, int x, int y, int z);
}

View File

@@ -20,5 +20,14 @@ import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.Inventory;
public interface IInventoryAccess {
/**
* Check if an entity has permission to modify the contents of an inventory.
*
* @param inventory the Inventory
* @param player the HumanEntity
* @return true if the HumanEntity can modify the Inventory
*/
public boolean check(Inventory inventory, HumanEntity player);
}

View File

@@ -21,6 +21,11 @@ import org.bukkit.inventory.Inventory;
public interface ISpecialEnderChest {
/**
* Gets the Inventory associated with this ISpecialEnderChest.
*
* @return the Inventory
*/
public Inventory getBukkitInventory();
/**

View File

@@ -21,6 +21,11 @@ import org.bukkit.inventory.Inventory;
public interface ISpecialPlayerInventory {
/**
* Gets the Inventory associated with this ISpecialPlayerInventory.
*
* @return the Inventory
*/
public Inventory getBukkitInventory();
/**