mirror of
https://github.com/Jikoo/OpenInv.git
synced 2026-11-04 08:42:05 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19eafddfac | ||
|
|
8a388b5620 | ||
|
|
206fff2c0a | ||
|
|
6656e431b6 | ||
|
|
f8df83b31d | ||
|
|
eb98bd79d3 | ||
|
|
e948fdc011 | ||
|
|
f5c31c32d3 | ||
|
|
56f8cf4d71 | ||
|
|
7f1f6ccc82 | ||
|
|
9196ab3e61 | ||
|
|
0ac7575bad | ||
|
|
b0c7c8421e | ||
|
|
9b54e4e22e | ||
|
|
5ac09bc5a3 | ||
|
|
4e89a04b36 | ||
|
|
73a9c743a6 | ||
|
|
8d897664ef | ||
|
|
03ea798ee0 | ||
|
|
08d4a0ea27 | ||
|
|
cd7219f472 | ||
|
|
532dffc068 | ||
|
|
6df4de1dd3 |
No files matched your search
@@ -34,7 +34,7 @@ jobs:
|
||||
|
||||
- name: Create Release
|
||||
id: create-release
|
||||
uses: softprops/action-gh-release@v2.0.8
|
||||
uses: softprops/action-gh-release@v2.2.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<artifactId>openinvparent</artifactId>
|
||||
<groupId>com.lishid</groupId>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<version>5.1.3</version>
|
||||
<version>5.1.6</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>openinvtogglepersist</artifactId>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>openinvparent</artifactId>
|
||||
<groupId>com.lishid</groupId>
|
||||
<version>5.1.3</version>
|
||||
<version>5.1.6</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>openinvapi</artifactId>
|
||||
|
||||
@@ -16,9 +16,17 @@
|
||||
|
||||
package com.lishid.openinv.internal;
|
||||
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* An {@link ISpecialInventory} representing an ender chest.
|
||||
*/
|
||||
public interface ISpecialEnderChest extends ISpecialInventory {
|
||||
|
||||
@Override
|
||||
default @NotNull InventoryType getBukkitType() {
|
||||
return InventoryType.ENDER_CHEST;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ package com.lishid.openinv.internal;
|
||||
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -33,6 +34,13 @@ public interface ISpecialInventory {
|
||||
*/
|
||||
@NotNull Inventory getBukkitInventory();
|
||||
|
||||
/**
|
||||
* Get the {@link InventoryType} corresponding to this {@code ISpecialInventory}.
|
||||
*
|
||||
* @return the type of Bukkit inventory
|
||||
*/
|
||||
@NotNull InventoryType getBukkitType();
|
||||
|
||||
/**
|
||||
* Set the owning {@link Player} instance to a newly-joined user.
|
||||
*
|
||||
|
||||
@@ -16,35 +16,17 @@
|
||||
|
||||
package com.lishid.openinv.internal;
|
||||
|
||||
import java.util.List;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* An {@link ISpecialInventory} representing a player inventory.
|
||||
*/
|
||||
public interface ISpecialPlayerInventory extends ISpecialInventory {
|
||||
|
||||
/*
|
||||
* Player inventory usage varies from all other inventories - as the inventory is technically open at all times,
|
||||
* if the player is online or has been online while the inventory is open, they are in the viewer list.
|
||||
*/
|
||||
@Override
|
||||
default boolean isInUse() {
|
||||
Inventory inventory = getBukkitInventory();
|
||||
List<HumanEntity> viewers = inventory.getViewers();
|
||||
|
||||
if (viewers.size() != 1) {
|
||||
return !viewers.isEmpty();
|
||||
}
|
||||
|
||||
HumanEntity viewer = viewers.get(0);
|
||||
|
||||
if (!viewer.getUniqueId().equals(getPlayer().getUniqueId())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return viewer.getOpenInventory().getTopInventory().equals(inventory);
|
||||
default @NotNull InventoryType getBukkitType() {
|
||||
return InventoryType.PLAYER;
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>com.lishid</groupId>
|
||||
<artifactId>openinvparent</artifactId>
|
||||
<version>5.1.3</version>
|
||||
<version>5.1.6</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>openinvcommon</artifactId>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<artifactId>openinvparent</artifactId>
|
||||
<groupId>com.lishid</groupId>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<version>5.1.3</version>
|
||||
<version>5.1.6</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>openinvadapter1_21_R2</artifactId>
|
||||
|
||||
+10
-1
@@ -4,6 +4,7 @@ import com.lishid.openinv.internal.ViewOnly;
|
||||
import net.minecraft.world.Container;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_21_R2.inventory.CraftInventory;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -17,8 +18,16 @@ import java.util.ListIterator;
|
||||
*/
|
||||
public class OpenDummyInventory extends CraftInventory implements ViewOnly {
|
||||
|
||||
public OpenDummyInventory(Container inventory) {
|
||||
private final InventoryType type;
|
||||
|
||||
public OpenDummyInventory(Container inventory, InventoryType type) {
|
||||
super(inventory);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull InventoryType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package com.lishid.openinv.internal.v1_21_R2.container.bukkit;
|
||||
|
||||
import net.minecraft.world.Container;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class OpenDummyPlayerInventory extends OpenDummyInventory implements PlayerInventory {
|
||||
|
||||
public OpenDummyPlayerInventory(Container inventory) {
|
||||
super(inventory, InventoryType.PLAYER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HumanEntity getHolder() {
|
||||
return (HumanEntity) super.getHolder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack[] getArmorContents() {
|
||||
return new ItemStack[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack[] getExtraContents() {
|
||||
return new ItemStack[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getHelmet() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getChestplate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getLeggings() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getBoots() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getItem(@NotNull EquipmentSlot slot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArmorContents(@Nullable ItemStack[] items) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraContents(@Nullable ItemStack[] items) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHelmet(@Nullable ItemStack helmet) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChestplate(@Nullable ItemStack chestplate) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLeggings(@Nullable ItemStack leggings) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoots(@Nullable ItemStack boots) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getItemInMainHand() {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInMainHand(@Nullable ItemStack item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getItemInOffHand() {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInOffHand(@Nullable ItemStack item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getItemInHand() {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInHand(@Nullable ItemStack stack) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeldItemSlot() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeldItemSlot(int slot) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+4
-3
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +144,7 @@ public abstract class OpenChestMenu<T extends Container & ISpecialInventory & In
|
||||
protected @NotNull CraftInventoryView<OpenChestMenu<T>, Inventory> createBukkitEntity() {
|
||||
Inventory top;
|
||||
if (viewOnly) {
|
||||
top = new OpenDummyInventory(container);
|
||||
top = new OpenDummyInventory(container, container.getBukkitType());
|
||||
} else {
|
||||
top = container.getBukkitInventory();
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@ package com.lishid.openinv.internal.v1_21_R2.container.menu;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.lishid.openinv.internal.v1_21_R2.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R2.container.bukkit.OpenDummyInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R2.container.bukkit.OpenDummyPlayerInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R2.container.bukkit.OpenPlayerInventorySelf;
|
||||
import com.lishid.openinv.internal.v1_21_R2.container.slot.ContentDrop;
|
||||
import com.lishid.openinv.internal.v1_21_R2.container.slot.ContentEquipment;
|
||||
@@ -102,7 +102,7 @@ public class OpenInventoryMenu extends OpenChestMenu<OpenInventory> {
|
||||
protected @NotNull CraftInventoryView<OpenChestMenu<OpenInventory>, Inventory> createBukkitEntity() {
|
||||
org.bukkit.inventory.Inventory bukkitInventory;
|
||||
if (viewOnly) {
|
||||
bukkitInventory = new OpenDummyInventory(container);
|
||||
bukkitInventory = new OpenDummyPlayerInventory(container);
|
||||
} else if (ownContainer) {
|
||||
bukkitInventory = new OpenPlayerInventorySelf(container, offset);
|
||||
} else {
|
||||
|
||||
+8
-1
@@ -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()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -23,16 +23,16 @@
|
||||
<artifactId>openinvparent</artifactId>
|
||||
<groupId>com.lishid</groupId>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
<version>5.1.3</version>
|
||||
<version>5.1.6</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>openinvadapter1_21_R1</artifactId>
|
||||
<name>OpenInvAdapter1_21_R1</name>
|
||||
<artifactId>openinvadapter1_21_R3</artifactId>
|
||||
<name>OpenInvAdapter1_21_R3</name>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.system>21</maven.compiler.system>
|
||||
<maven.compiler.release>21</maven.compiler.release>
|
||||
<spigot.version>1.21.1-R0.1-SNAPSHOT</spigot.version>
|
||||
<spigot.version>1.21.4-R0.1-SNAPSHOT</spigot.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
+7
-7
@@ -1,19 +1,19 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1;
|
||||
package com.lishid.openinv.internal.v1_21_R3;
|
||||
|
||||
import com.lishid.openinv.internal.Accessor;
|
||||
import com.lishid.openinv.internal.IAnySilentContainer;
|
||||
import com.lishid.openinv.internal.ISpecialEnderChest;
|
||||
import com.lishid.openinv.internal.ISpecialInventory;
|
||||
import com.lishid.openinv.internal.ISpecialPlayerInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.AnySilentContainer;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenEnderChest;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R1.player.PlayerManager;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.AnySilentContainer;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenEnderChest;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R3.player.PlayerManager;
|
||||
import com.lishid.openinv.util.lang.LanguageManager;
|
||||
import net.minecraft.world.Container;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftInventory;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
+3
-3
@@ -14,11 +14,11 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.lishid.openinv.internal.v1_21_R1.container;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container;
|
||||
|
||||
import com.lishid.openinv.internal.AnySilentContainerBase;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.menu.OpenChestMenu;
|
||||
import com.lishid.openinv.internal.v1_21_R1.player.PlayerManager;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.menu.OpenChestMenu;
|
||||
import com.lishid.openinv.internal.v1_21_R3.player.PlayerManager;
|
||||
import com.lishid.openinv.util.ReflectionHelper;
|
||||
import com.lishid.openinv.util.lang.LanguageManager;
|
||||
import net.minecraft.core.BlockPos;
|
||||
+7
-7
@@ -1,22 +1,22 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container;
|
||||
|
||||
import com.lishid.openinv.internal.ISpecialEnderChest;
|
||||
import com.lishid.openinv.internal.InternalOwned;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.menu.OpenEnderChestMenu;
|
||||
import com.lishid.openinv.internal.v1_21_R1.player.PlayerManager;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.menu.OpenEnderChestMenu;
|
||||
import com.lishid.openinv.internal.v1_21_R3.player.PlayerManager;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.ContainerHelper;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.player.StackedContents;
|
||||
import net.minecraft.world.entity.player.StackedItemContents;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.StackedContentsCompatible;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftInventory;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -174,7 +174,7 @@ public class OpenEnderChest implements Container, StackedContentsCompatible, Int
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillStackedContents(StackedContents stackedContents) {
|
||||
public void fillStackedContents(StackedItemContents stackedContents) {
|
||||
for (ItemStack itemstack : items) {
|
||||
stackedContents.accountStack(itemstack);
|
||||
}
|
||||
+16
-16
@@ -1,20 +1,20 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container;
|
||||
|
||||
import com.lishid.openinv.internal.ISpecialPlayerInventory;
|
||||
import com.lishid.openinv.internal.InternalOwned;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.bukkit.OpenPlayerInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.menu.OpenInventoryMenu;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.Content;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentCrafting;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentCraftingResult;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentCursor;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentDrop;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentEquipment;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentList;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentOffHand;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentViewOnly;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.SlotViewOnly;
|
||||
import com.lishid.openinv.internal.v1_21_R1.player.PlayerManager;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.bukkit.OpenPlayerInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.menu.OpenInventoryMenu;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.Content;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentCrafting;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentCraftingResult;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentCursor;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentDrop;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentEquipment;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentList;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentOffHand;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentViewOnly;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.SlotViewOnly;
|
||||
import com.lishid.openinv.internal.v1_21_R3.player.PlayerManager;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -29,8 +29,8 @@ import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.entity.CraftHumanEntity;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftInventory;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
@@ -20,7 +20,7 @@ import net.minecraft.world.level.block.entity.BannerPattern;
|
||||
import net.minecraft.world.level.block.entity.BannerPatternLayers;
|
||||
import net.minecraft.world.level.block.entity.BannerPatterns;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.CraftRegistry;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.CraftRegistry;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.EnumMap;
|
||||
@@ -29,7 +29,7 @@ import java.util.Optional;
|
||||
|
||||
public final class Placeholders {
|
||||
|
||||
private static final CustomModelData DEFAULT_CUSTOM_MODEL_DATA = new CustomModelData(9999);
|
||||
private static final CustomModelData DEFAULT_CUSTOM_MODEL_DATA = new CustomModelData(List.of(), List.of(), List.of("openinv:custom"), List.of());
|
||||
public static final @NotNull EnumMap<GameType, ItemStack> BLOCKED_GAME_TYPE = new EnumMap<>(GameType.class);
|
||||
public static @NotNull ItemStack craftingOutput = defaultCraftingOutput();
|
||||
public static @NotNull ItemStack cursor = defaultCursor();
|
||||
@@ -103,10 +103,10 @@ public final class Placeholders {
|
||||
// Cursor-like banner with no tooltip
|
||||
ItemStack itemStack = new ItemStack(Items.WHITE_BANNER);
|
||||
RegistryAccess minecraftRegistry = CraftRegistry.getMinecraftRegistry();
|
||||
Registry<BannerPattern> bannerPatterns = minecraftRegistry.registryOrThrow(Registries.BANNER_PATTERN);
|
||||
BannerPattern halfDiagBottomRight = bannerPatterns.getOrThrow(BannerPatterns.DIAGONAL_RIGHT);
|
||||
BannerPattern downRight = bannerPatterns.getOrThrow(BannerPatterns.STRIPE_DOWNRIGHT);
|
||||
BannerPattern border = bannerPatterns.getOrThrow(BannerPatterns.BORDER);
|
||||
Registry<BannerPattern> bannerPatterns = minecraftRegistry.lookupOrThrow(Registries.BANNER_PATTERN);
|
||||
BannerPattern halfDiagBottomRight = bannerPatterns.getOrThrow(BannerPatterns.DIAGONAL_RIGHT).value();
|
||||
BannerPattern downRight = bannerPatterns.getOrThrow(BannerPatterns.STRIPE_DOWNRIGHT).value();
|
||||
BannerPattern border = bannerPatterns.getOrThrow(BannerPatterns.BORDER).value();
|
||||
itemStack.set(DataComponents.BANNER_PATTERNS,
|
||||
new BannerPatternLayers(List.of(
|
||||
new BannerPatternLayers.Layer(bannerPatterns.wrapAsHolder(halfDiagBottomRight), DyeColor.GRAY),
|
||||
@@ -140,12 +140,12 @@ public final class Placeholders {
|
||||
ItemStack itemStack = new ItemStack(Items.SHIELD);
|
||||
itemStack.set(DataComponents.BASE_COLOR, DyeColor.MAGENTA);
|
||||
RegistryAccess minecraftRegistry = CraftRegistry.getMinecraftRegistry();
|
||||
Registry<BannerPattern> bannerPatterns = minecraftRegistry.registryOrThrow(Registries.BANNER_PATTERN);
|
||||
BannerPattern halfLeft = bannerPatterns.getOrThrow(BannerPatterns.HALF_VERTICAL);
|
||||
BannerPattern topLeft = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_TOP_LEFT);
|
||||
BannerPattern topRight = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_TOP_RIGHT);
|
||||
BannerPattern bottomLeft = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_BOTTOM_LEFT);
|
||||
BannerPattern bottomRight = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_BOTTOM_RIGHT);
|
||||
Registry<BannerPattern> bannerPatterns = minecraftRegistry.lookupOrThrow(Registries.BANNER_PATTERN);
|
||||
BannerPattern halfLeft = bannerPatterns.getOrThrow(BannerPatterns.HALF_VERTICAL).value();
|
||||
BannerPattern topLeft = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_TOP_LEFT).value();
|
||||
BannerPattern topRight = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_TOP_RIGHT).value();
|
||||
BannerPattern bottomLeft = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_BOTTOM_LEFT).value();
|
||||
BannerPattern bottomRight = bannerPatterns.getOrThrow(BannerPatterns.SQUARE_BOTTOM_RIGHT).value();
|
||||
itemStack.set(DataComponents.BANNER_PATTERNS,
|
||||
new BannerPatternLayers(List.of(
|
||||
new BannerPatternLayers.Layer(bannerPatterns.wrapAsHolder(halfLeft), DyeColor.BLACK),
|
||||
+12
-3
@@ -1,9 +1,10 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.bukkit;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.bukkit;
|
||||
|
||||
import com.lishid.openinv.internal.ViewOnly;
|
||||
import net.minecraft.world.Container;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftInventory;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -17,8 +18,16 @@ import java.util.ListIterator;
|
||||
*/
|
||||
public class OpenDummyInventory extends CraftInventory implements ViewOnly {
|
||||
|
||||
public OpenDummyInventory(Container inventory) {
|
||||
private final InventoryType type;
|
||||
|
||||
public OpenDummyInventory(Container inventory, InventoryType type) {
|
||||
super(inventory);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull InventoryType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.bukkit;
|
||||
|
||||
import net.minecraft.world.Container;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class OpenDummyPlayerInventory extends OpenDummyInventory implements PlayerInventory {
|
||||
|
||||
public OpenDummyPlayerInventory(Container inventory) {
|
||||
super(inventory, InventoryType.PLAYER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HumanEntity getHolder() {
|
||||
return (HumanEntity) super.getHolder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack[] getArmorContents() {
|
||||
return new ItemStack[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack[] getExtraContents() {
|
||||
return new ItemStack[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getHelmet() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getChestplate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getLeggings() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getBoots() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable ItemStack getItem(@NotNull EquipmentSlot slot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setArmorContents(@Nullable ItemStack[] items) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraContents(@Nullable ItemStack[] items) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHelmet(@Nullable ItemStack helmet) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChestplate(@Nullable ItemStack chestplate) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLeggings(@Nullable ItemStack leggings) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBoots(@Nullable ItemStack boots) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getItemInMainHand() {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInMainHand(@Nullable ItemStack item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getItemInOffHand() {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInOffHand(@Nullable ItemStack item) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull ItemStack getItemInHand() {
|
||||
return new ItemStack(Material.AIR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInHand(@Nullable ItemStack stack) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeldItemSlot() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHeldItemSlot(int slot) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.bukkit;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.bukkit;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenInventory;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftInventory;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.bukkit;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.bukkit;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenInventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
+9
-8
@@ -1,11 +1,11 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.menu;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.menu;
|
||||
|
||||
import com.google.common.base.Suppliers;
|
||||
import com.lishid.openinv.internal.ISpecialInventory;
|
||||
import com.lishid.openinv.internal.InternalOwned;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.bukkit.OpenDummyInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.SlotPlaceholder;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.SlotViewOnly;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.bukkit.OpenDummyInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.SlotPlaceholder;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.SlotViewOnly;
|
||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -21,7 +21,7 @@ import net.minecraft.world.inventory.DataSlot;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryView;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftInventoryView;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +144,7 @@ public abstract class OpenChestMenu<T extends Container & ISpecialInventory & In
|
||||
protected @NotNull CraftInventoryView<OpenChestMenu<T>, Inventory> createBukkitEntity() {
|
||||
Inventory top;
|
||||
if (viewOnly) {
|
||||
top = new OpenDummyInventory(container);
|
||||
top = new OpenDummyInventory(container, container.getBukkitType());
|
||||
} else {
|
||||
top = container.getBukkitInventory();
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.menu;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.menu;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenEnderChest;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenEnderChest;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
+10
-10
@@ -1,12 +1,12 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.menu;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.menu;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.bukkit.OpenDummyInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.bukkit.OpenPlayerInventorySelf;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentDrop;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.ContentEquipment;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.slot.SlotViewOnly;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.bukkit.OpenDummyPlayerInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.bukkit.OpenPlayerInventorySelf;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentDrop;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.ContentEquipment;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.slot.SlotViewOnly;
|
||||
import com.lishid.openinv.util.Permissions;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
@@ -15,8 +15,8 @@ import net.minecraft.world.inventory.ChestMenu;
|
||||
import net.minecraft.world.inventory.MenuType;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftInventoryView;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftInventoryView;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.inventory.CraftItemStack;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
@@ -102,7 +102,7 @@ public class OpenInventoryMenu extends OpenChestMenu<OpenInventory> {
|
||||
protected @NotNull CraftInventoryView<OpenChestMenu<OpenInventory>, Inventory> createBukkitEntity() {
|
||||
org.bukkit.inventory.Inventory bukkitInventory;
|
||||
if (viewOnly) {
|
||||
bukkitInventory = new OpenDummyInventory(container);
|
||||
bukkitInventory = new OpenDummyPlayerInventory(container);
|
||||
} else if (ownContainer) {
|
||||
bukkitInventory = new OpenPlayerInventorySelf(container, offset);
|
||||
} else {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.Placeholders;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.ContainerHelper;
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.Placeholders;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.inventory.InventoryMenu;
|
||||
@@ -23,7 +23,7 @@ public class ContentCraftingResult extends ContentViewOnly {
|
||||
@Override
|
||||
public ItemStack get() {
|
||||
InventoryMenu inventoryMenu = holder.inventoryMenu;
|
||||
return inventoryMenu.getSlot(inventoryMenu.getResultSlotIndex()).getItem();
|
||||
return inventoryMenu.getResultSlot().getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -35,7 +35,7 @@ public class ContentCraftingResult extends ContentViewOnly {
|
||||
return Placeholders.survivalOnly(holder);
|
||||
}
|
||||
InventoryMenu inventoryMenu = holder.inventoryMenu;
|
||||
return inventoryMenu.getSlot(inventoryMenu.getResultSlotIndex()).getItem();
|
||||
return inventoryMenu.getResultSlot().getItem();
|
||||
}
|
||||
};
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.Placeholders;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.Placeholders;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.Placeholders;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
+9
-2
@@ -1,8 +1,10 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
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()));
|
||||
}
|
||||
}
|
||||
};
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.Container;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.container.slot;
|
||||
package com.lishid.openinv.internal.v1_21_R3.container.slot;
|
||||
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.Placeholders;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.Placeholders;
|
||||
import net.minecraft.world.Container;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
+4
-3
@@ -1,4 +1,4 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.player;
|
||||
package com.lishid.openinv.internal.v1_21_R3.player;
|
||||
|
||||
import com.lishid.openinv.event.OpenEvents;
|
||||
import com.mojang.logging.LogUtils;
|
||||
@@ -9,8 +9,8 @@ import net.minecraft.nbt.NumericTag;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.level.storage.PlayerDataStorage;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.entity.CraftPlayer;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -51,6 +51,7 @@ public class OpenPlayer extends CraftPlayer {
|
||||
"SpawnAngle",
|
||||
"SpawnDimension",
|
||||
"raid_omen_position",
|
||||
"ender_pearls",
|
||||
// Player#addAdditionalSaveData(CompoundTag)
|
||||
"ShoulderEntityLeft",
|
||||
"ShoulderEntityRight",
|
||||
+10
-8
@@ -1,8 +1,8 @@
|
||||
package com.lishid.openinv.internal.v1_21_R1.player;
|
||||
package com.lishid.openinv.internal.v1_21_R3.player;
|
||||
|
||||
import com.lishid.openinv.internal.ISpecialInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenEnderChest;
|
||||
import com.lishid.openinv.internal.v1_21_R1.container.OpenInventory;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenEnderChest;
|
||||
import com.lishid.openinv.internal.v1_21_R3.container.OpenInventory;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.serialization.Dynamic;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.protocol.game.ClientboundOpenScreenPacket;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ClientInformation;
|
||||
import net.minecraft.server.level.ParticleStatus;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
@@ -22,10 +23,10 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_21_R1.event.CraftEventFactory;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_21_R3.event.CraftEventFactory;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -123,7 +124,8 @@ public class PlayerManager implements com.lishid.openinv.internal.PlayerManager
|
||||
ServerPlayer.DEFAULT_MODEL_CUSTOMIZATION,
|
||||
ServerPlayer.DEFAULT_MAIN_HAND,
|
||||
true,
|
||||
false // Don't list in player list (not that this player is in the list anyway).
|
||||
false, // Don't list in player list (not that this player is in the list anyway).
|
||||
ParticleStatus.MINIMAL
|
||||
);
|
||||
|
||||
ServerPlayer entity = new ServerPlayer(server, worldServer, profile, dummyInfo);
|
||||
+5
-5
@@ -21,7 +21,7 @@
|
||||
<parent>
|
||||
<artifactId>openinvparent</artifactId>
|
||||
<groupId>com.lishid</groupId>
|
||||
<version>5.1.3</version>
|
||||
<version>5.1.6</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>openinvplugin</artifactId>
|
||||
@@ -46,14 +46,14 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lishid</groupId>
|
||||
<artifactId>openinvadapter1_21_R2</artifactId>
|
||||
<version>5.1.3</version>
|
||||
<artifactId>openinvadapter1_21_R3</artifactId>
|
||||
<version>5.1.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.lishid</groupId>
|
||||
<artifactId>openinvadapter1_21_R1</artifactId>
|
||||
<version>5.1.3</version>
|
||||
<artifactId>openinvadapter1_21_R2</artifactId>
|
||||
<version>5.1.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -250,35 +250,37 @@ public class OpenInv extends JavaPlugin implements IOpenInv {
|
||||
if (inventory instanceof ISpecialPlayerInventory) {
|
||||
edit = ownContainer ? Permissions.INVENTORY_EDIT_SELF : Permissions.INVENTORY_EDIT_OTHER;
|
||||
} else if (inventory instanceof ISpecialEnderChest) {
|
||||
edit = ownContainer ? Permissions.ENDERCHEST_EDIT_SELF : Permissions.ENDERCHEST_OPEN_OTHER;
|
||||
edit = ownContainer ? Permissions.ENDERCHEST_EDIT_SELF : Permissions.ENDERCHEST_EDIT_OTHER;
|
||||
}
|
||||
|
||||
boolean viewOnly = edit != null && !edit.hasPermission(player);
|
||||
|
||||
if (!ownContainer && !viewOnly) {
|
||||
for (int level = 4; level > 0; --level) {
|
||||
String permission = "openinv.access.level." + level;
|
||||
// If the target doesn't have this access level...
|
||||
if (!target.hasPermission(permission)) {
|
||||
// If the viewer does have the access level, all good.
|
||||
if (player.hasPermission(permission)) {
|
||||
break;
|
||||
}
|
||||
// Otherwise check next access level.
|
||||
continue;
|
||||
}
|
||||
if (ownContainer || viewOnly && config.getAccessEqualMode() != AccessEqualMode.DENY) {
|
||||
return this.accessor.openInventory(player, inventory, viewOnly);
|
||||
}
|
||||
|
||||
// If the player doesn't have an equal access level or equal access is a denial, deny.
|
||||
if (!player.hasPermission(permission) || config.getAccessEqualMode() == AccessEqualMode.DENY) {
|
||||
return null;
|
||||
for (int level = 4; level > 0; --level) {
|
||||
String permission = "openinv.access.level." + level;
|
||||
// If the target doesn't have this access level...
|
||||
if (!target.hasPermission(permission)) {
|
||||
// If the viewer does have the access level, all good.
|
||||
if (player.hasPermission(permission)) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Since this is a tie, setting decides view state.
|
||||
if (config.getAccessEqualMode() == AccessEqualMode.VIEW) {
|
||||
viewOnly = true;
|
||||
}
|
||||
break;
|
||||
// Otherwise check next access level.
|
||||
continue;
|
||||
}
|
||||
|
||||
// If the viewer doesn't have an equal access level or equal access is a denial, deny.
|
||||
if (!player.hasPermission(permission) || config.getAccessEqualMode() == AccessEqualMode.DENY) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Since this is a tie, setting decides view state.
|
||||
if (config.getAccessEqualMode() == AccessEqualMode.VIEW) {
|
||||
viewOnly = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return this.accessor.openInventory(player, inventory, viewOnly);
|
||||
|
||||
@@ -40,10 +40,10 @@ public class InternalAccessor {
|
||||
public InternalAccessor(@NotNull Logger logger, @NotNull LanguageManager lang) {
|
||||
|
||||
try {
|
||||
if (BukkitVersions.MINECRAFT.equals(Version.of(1, 21, 3))) {
|
||||
if (BukkitVersions.MINECRAFT.equals(Version.of(1, 21, 4))) {
|
||||
internal = new com.lishid.openinv.internal.v1_21_R3.InternalAccessor(logger, lang);
|
||||
} else if (BukkitVersions.MINECRAFT.equals(Version.of(1, 21, 3))) {
|
||||
internal = new com.lishid.openinv.internal.v1_21_R2.InternalAccessor(logger, lang);
|
||||
} else if (BukkitVersions.MINECRAFT.equals(Version.of(1, 21, 1))) {
|
||||
internal = new com.lishid.openinv.internal.v1_21_R1.InternalAccessor(logger, lang);
|
||||
}
|
||||
if (internal != null) {
|
||||
InventoryAccess.setProvider(internal::get);
|
||||
@@ -124,6 +124,9 @@ public class InternalAccessor {
|
||||
if (BukkitVersions.MINECRAFT.lessThanOrEqual(Version.of(1, 21))) { // 1.20.4, 1.20.6, 1.21
|
||||
return "https://github.com/Jikoo/OpenInv/releases/tag/5.1.2";
|
||||
}
|
||||
if (BukkitVersions.MINECRAFT.lessThanOrEqual(Version.of(1, 21, 2))) {
|
||||
return "https://github.com/Jikoo/OpenInv/releases/tag/5.1.3";
|
||||
}
|
||||
return "https://github.com/Jikoo/OpenInv/releases";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
/*
|
||||
* Copyright (C) 2011-2021 lishid. All rights reserved.
|
||||
* This file is an amalgamation of code from the Simmetrics authors.
|
||||
* The originals may be found here:
|
||||
* https://github.com/Simmetrics/simmetrics/blob/master/simmetrics-core/src/main/java/org/simmetrics/metrics/JaroWinkler.java
|
||||
* https://github.com/Simmetrics/simmetrics/blob/master/simmetrics-core/src/main/java/org/simmetrics/metrics/Jaro.java
|
||||
*
|
||||
* 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.
|
||||
* Copyright (C) 2014 - 2016 Simmetrics Authors
|
||||
*
|
||||
* 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.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.lishid.openinv.util;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
config-version: 8
|
||||
settings:
|
||||
equal-access: view
|
||||
equal-access: allow
|
||||
command:
|
||||
open:
|
||||
no-args-opens-self: false
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<modules>
|
||||
<module>common</module>
|
||||
</modules>
|
||||
<version>5.1.3</version>
|
||||
<version>5.1.6</version>
|
||||
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@@ -43,8 +43,8 @@
|
||||
<module>api</module>
|
||||
<module>addon/togglepersist</module>
|
||||
<module>common</module>
|
||||
<module>internal/v1_21_R3</module>
|
||||
<module>internal/v1_21_R2</module>
|
||||
<module>internal/v1_21_R1</module>
|
||||
<module>plugin</module>
|
||||
</modules>
|
||||
</profile>
|
||||
@@ -101,7 +101,7 @@
|
||||
<artifactId>planarwrappers</artifactId>
|
||||
<groupId>com.github.jikoo</groupId>
|
||||
<scope>compile</scope>
|
||||
<version>3.2.3</version>
|
||||
<version>3.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
@@ -116,7 +116,7 @@
|
||||
-->
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.8.1</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
@@ -151,11 +151,12 @@
|
||||
<path>
|
||||
<groupId>com.google.errorprone</groupId>
|
||||
<artifactId>error_prone_core</artifactId>
|
||||
<version>2.33.0</version>
|
||||
<version>2.36.0</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
<compilerArgs>
|
||||
<arg>-XDcompilePolicy=simple</arg>
|
||||
<arg>--should-stop=ifError=FLOW</arg>
|
||||
<arg>-Xplugin:ErrorProne</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
|
||||
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"texture_size": [ 16, 32 ],
|
||||
"textures": {
|
||||
"layer0": "openinv:item/crafting_output"
|
||||
"layer0": "openinv:item/crafting_output",
|
||||
"particle": "minecraft:block/crafting_table_front"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/empty_armor_slot_boots"
|
||||
"layer0": "openinv:item/empty_boots"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/empty_armor_slot_chestplate"
|
||||
"layer0": "openinv:item/empty_chestplate"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/empty_armor_slot_helmet"
|
||||
"layer0": "openinv:item/empty_helmet"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/empty_armor_slot_leggings"
|
||||
"layer0": "openinv:item/empty_leggings"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "minecraft:item/empty_armor_slot_shield"
|
||||
"layer0": "openinv:item/empty_shield"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 111 B |
Binary file not shown.
|
After Width: | Height: | Size: 112 B |
Binary file not shown.
|
After Width: | Height: | Size: 110 B |
Binary file not shown.
|
After Width: | Height: | Size: 102 B |
Binary file not shown.
|
After Width: | Height: | Size: 169 B |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/crafting_output"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:block/crafting_table"
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/drop"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:block/dropper"
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/empty_boots"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_quartz_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:quartz"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_iron_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:iron"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_netherite_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:netherite"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_redstone_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:redstone"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_copper_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:copper"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_gold_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:gold"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_emerald_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:emerald"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_diamond_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:diamond"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_lapis_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:lapis"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_amethyst_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:amethyst"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots_resin_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:resin"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_boots",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"property": "minecraft:trim_material"
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/empty_chestplate"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_quartz_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:quartz"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_iron_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:iron"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_netherite_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:netherite"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_redstone_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:redstone"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_copper_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:copper"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_gold_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:gold"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_emerald_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:emerald"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_diamond_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:diamond"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_lapis_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:lapis"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_amethyst_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:amethyst"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate_resin_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:resin"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_chestplate",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"property": "minecraft:trim_material"
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/empty_helmet"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_quartz_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:quartz"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_iron_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:iron"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_netherite_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:netherite"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_redstone_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:redstone"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_copper_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:copper"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_gold_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:gold"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_emerald_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:emerald"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_diamond_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:diamond"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_lapis_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:lapis"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_amethyst_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:amethyst"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet_resin_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:resin"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_helmet",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"property": "minecraft:trim_material"
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/empty_leggings"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_quartz_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:quartz"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_iron_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:iron"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_netherite_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:netherite"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_redstone_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:redstone"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_copper_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:copper"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_gold_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:gold"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_emerald_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:emerald"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_diamond_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:diamond"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_lapis_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:lapis"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_amethyst_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:amethyst"
|
||||
},
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings_resin_trim",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"when": "minecraft:resin"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "minecraft:item/leather_leggings",
|
||||
"tints": [
|
||||
{
|
||||
"type": "minecraft:dye",
|
||||
"default": -6265536
|
||||
}
|
||||
]
|
||||
},
|
||||
"property": "minecraft:trim_material"
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/empty_shield"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:condition",
|
||||
"on_false": {
|
||||
"type": "minecraft:special",
|
||||
"base": "minecraft:item/shield",
|
||||
"model": {
|
||||
"type": "minecraft:shield"
|
||||
}
|
||||
},
|
||||
"on_true": {
|
||||
"type": "minecraft:special",
|
||||
"base": "minecraft:item/shield_blocking",
|
||||
"model": {
|
||||
"type": "minecraft:shield"
|
||||
}
|
||||
},
|
||||
"property": "minecraft:using_item"
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "openinv:item/cursor"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:special",
|
||||
"base": "minecraft:item/template_banner",
|
||||
"model": {
|
||||
"type": "minecraft:banner",
|
||||
"color": "white"
|
||||
}
|
||||
},
|
||||
"property": "minecraft:custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:select",
|
||||
"cases": [
|
||||
{
|
||||
"model": {
|
||||
"type": "model",
|
||||
"model": "openinv:item/not_a_slot"
|
||||
},
|
||||
"when": "openinv:custom"
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "model",
|
||||
"model": "item/white_stained_glass_pane"
|
||||
},
|
||||
"property": "custom_model_data"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"pack": {
|
||||
"description": "Improve OpenInv's legibility",
|
||||
"pack_format": 34
|
||||
"pack_format": 46,
|
||||
"supported_formats": [ 34, 46 ]
|
||||
},
|
||||
"overlays": {
|
||||
"entries": [
|
||||
{
|
||||
"formats": [ 44, 46 ],
|
||||
"directory": "openinv_44"
|
||||
},
|
||||
{
|
||||
"formats": [ 34, 43 ],
|
||||
"directory": "openinv_34"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Reference in new issue
Block a user