Compare commits

...
4 Commits
Author SHA1 Message Date
Jikoo 19eafddfac Bump version to 5.1.6 for release 2025-01-18 13:57:48 -05:00
Adam 8a388b5620 Fix view-only ender chest (#278)
Fixes access permissions being checked against self
2025-01-18 17:45:44 +00:00
Adam 206fff2c0a Fix off-hand update relying on Spigot method (#277) 2025-01-18 11:56:22 -05:00
Jikoo 6656e431b6 Bump version to 5.1.6-SNAPSHOT for development 2025-01-10 11:02:10 -05:00
12 changed files with 32 additions and 16 deletions

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@
<artifactId>openinvparent</artifactId>
<groupId>com.lishid</groupId>
<relativePath>../../pom.xml</relativePath>
<version>5.1.5</version>
<version>5.1.6</version>
</parent>
<artifactId>openinvtogglepersist</artifactId>
+1 -1
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>openinvparent</artifactId>
<groupId>com.lishid</groupId>
<version>5.1.5</version>
<version>5.1.6</version>
</parent>
<artifactId>openinvapi</artifactId>
+1 -1
View File
@@ -7,7 +7,7 @@
<parent>
<groupId>com.lishid</groupId>
<artifactId>openinvparent</artifactId>
<version>5.1.5</version>
<version>5.1.6</version>
</parent>
<artifactId>openinvcommon</artifactId>
+1 -1
View File
@@ -23,7 +23,7 @@
<artifactId>openinvparent</artifactId>
<groupId>com.lishid</groupId>
<relativePath>../../pom.xml</relativePath>
<version>5.1.5</version>
<version>5.1.6</version>
</parent>
<artifactId>openinvadapter1_21_R2</artifactId>
@@ -124,10 +124,11 @@ public abstract class OpenChestMenu<T extends Container & ISpecialInventory & In
protected void preSlotSetup() {}
protected @NotNull Slot getUpperSlot(int index, int x, int y) {
Slot slot = new Slot(container, index, x, y);
if (viewOnly) {
return new SlotViewOnly(container, index, x, y);
return SlotViewOnly.wrap(slot);
}
return new Slot(container, index, x, y);
return slot;
}
@@ -1,8 +1,10 @@
package com.lishid.openinv.internal.v1_21_R2.container.slot;
import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.Container;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.inventory.Slot;
import org.bukkit.event.inventory.InventoryType;
import org.jetbrains.annotations.NotNull;
@@ -37,7 +39,12 @@ public class ContentOffHand extends ContentEquipment {
if (holder.connection != null
&& !holder.connection.isDisconnected()
&& holder.containerMenu != holder.inventoryMenu) {
holder.resendItemInHands();
holder.connection.send(
new ClientboundContainerSetSlotPacket(
holder.inventoryMenu.containerId,
holder.inventoryMenu.incrementStateId(),
InventoryMenu.SHIELD_SLOT,
holder.getOffhandItem()));
}
}
};
+1 -1
View File
@@ -23,7 +23,7 @@
<artifactId>openinvparent</artifactId>
<groupId>com.lishid</groupId>
<relativePath>../../pom.xml</relativePath>
<version>5.1.5</version>
<version>5.1.6</version>
</parent>
<artifactId>openinvadapter1_21_R3</artifactId>
@@ -124,10 +124,11 @@ public abstract class OpenChestMenu<T extends Container & ISpecialInventory & In
protected void preSlotSetup() {}
protected @NotNull Slot getUpperSlot(int index, int x, int y) {
Slot slot = new Slot(container, index, x, y);
if (viewOnly) {
return new SlotViewOnly(container, index, x, y);
return SlotViewOnly.wrap(slot);
}
return new Slot(container, index, x, y);
return slot;
}
@@ -1,8 +1,10 @@
package com.lishid.openinv.internal.v1_21_R3.container.slot;
import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.Container;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.inventory.Slot;
import org.bukkit.event.inventory.InventoryType;
import org.jetbrains.annotations.NotNull;
@@ -37,7 +39,12 @@ public class ContentOffHand extends ContentEquipment {
if (holder.connection != null
&& !holder.connection.isDisconnected()
&& holder.containerMenu != holder.inventoryMenu) {
holder.resendItemInHands();
holder.connection.send(
new ClientboundContainerSetSlotPacket(
holder.inventoryMenu.containerId,
holder.inventoryMenu.incrementStateId(),
InventoryMenu.SHIELD_SLOT,
holder.getOffhandItem()));
}
}
};
+3 -3
View File
@@ -21,7 +21,7 @@
<parent>
<artifactId>openinvparent</artifactId>
<groupId>com.lishid</groupId>
<version>5.1.5</version>
<version>5.1.6</version>
</parent>
<artifactId>openinvplugin</artifactId>
@@ -47,13 +47,13 @@
<dependency>
<groupId>com.lishid</groupId>
<artifactId>openinvadapter1_21_R3</artifactId>
<version>5.1.5</version>
<version>5.1.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.lishid</groupId>
<artifactId>openinvadapter1_21_R2</artifactId>
<version>5.1.5</version>
<version>5.1.6</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -256,7 +256,7 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
boolean viewOnly = edit != null && !edit.hasPermission(player);
if (ownContainer || viewOnly && config.getAccessEqualMode() != AccessEqualMode.DENY) {
this.accessor.openInventory(player, inventory, viewOnly);
return this.accessor.openInventory(player, inventory, viewOnly);
}
for (int level = 4; level > 0; --level) {
+1 -1
View File
@@ -24,7 +24,7 @@
<modules>
<module>common</module>
</modules>
<version>5.1.5</version>
<version>5.1.6</version>
<packaging>pom</packaging>