Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ec07637e9f | ||
|
b269f3509c | ||
|
f2e4c8a3ad | ||
|
35839f1548 | ||
|
a4a462a1fa | ||
|
b9f901af66 | ||
|
1333056613 | ||
|
fb23df313a |
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</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.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvassembly</artifactId>
|
<artifactId>openinvassembly</artifactId>
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvcommon</artifactId>
|
<artifactId>openinvcommon</artifactId>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvapi</artifactId>
|
<artifactId>openinvapi</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvparent</artifactId>
|
<artifactId>openinvparent</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvadapter1_13_R2</artifactId>
|
<artifactId>openinvadapter1_13_R2</artifactId>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvcommon</artifactId>
|
<artifactId>openinvcommon</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvadapter1_14_R1</artifactId>
|
<artifactId>openinvadapter1_14_R1</artifactId>
|
||||||
@@ -32,13 +32,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot</artifactId>
|
<artifactId>spigot</artifactId>
|
||||||
<version>1.14.2-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.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -21,6 +21,7 @@ import java.lang.reflect.Field;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import net.minecraft.server.v1_14_R1.AxisAlignedBB;
|
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;
|
||||||
@@ -78,11 +79,16 @@ 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 bukkitBlock) {
|
||||||
|
if (bukkitBlock.getType() == Material.BARREL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
EntityPlayer player = PlayerDataManager.getHandle(p);
|
EntityPlayer player = PlayerDataManager.getHandle(p);
|
||||||
World world = player.world;
|
World world = player.world;
|
||||||
BlockPosition blockPosition = new BlockPosition(bukkitBlock.getX(), bukkitBlock.getY(), bukkitBlock.getZ());
|
BlockPosition blockPosition = new BlockPosition(bukkitBlock.getX(), bukkitBlock.getY(), bukkitBlock.getZ());
|
||||||
@@ -258,6 +264,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);
|
||||||
@@ -287,6 +297,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;
|
||||||
|
@@ -57,7 +57,7 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP
|
|||||||
private boolean playerOnline;
|
private boolean playerOnline;
|
||||||
private EntityHuman player;
|
private EntityHuman player;
|
||||||
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));
|
||||||
@@ -76,10 +76,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,6 +123,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());
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvinternal</artifactId>
|
<artifactId>openinvinternal</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</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>openinvcommon</artifactId>
|
<artifactId>openinvcommon</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</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.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>openinvplugincore</artifactId>
|
<artifactId>openinvplugincore</artifactId>
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lishid</groupId>
|
<groupId>com.lishid</groupId>
|
||||||
<artifactId>openinvcommon</artifactId>
|
<artifactId>openinvcommon</artifactId>
|
||||||
<version>4.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
|
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.0.3</version>
|
<version>4.0.6-SNAPSHOT</version>
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user