Skip to content

Commit

Permalink
Merge pull request #223 from stefvanschie/0.10.6
Browse files Browse the repository at this point in the history
Version 0.10.6
  • Loading branch information
stefvanschie committed Jun 13, 2022
2 parents da5c655 + 1d8a3cb commit 3584545
Show file tree
Hide file tree
Showing 32 changed files with 1,932 additions and 20 deletions.
1 change: 1 addition & 0 deletions .github/workflows/maven.yml
Expand Up @@ -71,5 +71,6 @@ jobs:
mvn paper-nms:init -pl nms/1_18_0
mvn paper-nms:init -pl nms/1_18_1
mvn paper-nms:init -pl nms/1_18_2
mvn paper-nms:init -pl nms/1_19
- name: Build with Maven
run: mvn -B package --file pom.xml
8 changes: 7 additions & 1 deletion IF/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -100,6 +100,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<artifactId>1_19</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
Expand Down
Expand Up @@ -81,7 +81,7 @@ public ChestGui(int rows, @NotNull TextHolder title) {
public void show(@NotNull HumanEntity humanEntity) {
if (isDirty() || dirtyRows) {
this.inventory = createInventory();
this.dirtyRows = true;
this.dirtyRows = false;

markChanges();
}
Expand Down
Expand Up @@ -391,6 +391,12 @@ public static GuiItem loadItem(@NotNull Object instance, @NotNull Element elemen
TextHolder.deserialize(item.getTextContent())
.asItemDisplayName(itemMeta);

itemStack.setItemMeta(itemMeta);
} else if (nodeName.equals("modeldata")) {
ItemMeta itemMeta = Objects.requireNonNull(itemStack.getItemMeta());

itemMeta.setCustomModelData(Integer.parseInt(item.getTextContent()));

itemStack.setItemMeta(itemMeta);
} else if (nodeName.equals("skull") && itemStack.getItemMeta() instanceof SkullMeta) {
SkullMeta skullMeta = (SkullMeta) itemStack.getItemMeta();
Expand Down
Expand Up @@ -61,6 +61,8 @@ public boolean click(@NotNull Gui gui, @NotNull InventoryComponent inventoryComp
return false;
}

int previousPosition = position;

position++;

if (position == panes.size()) {
Expand All @@ -69,7 +71,8 @@ public boolean click(@NotNull Gui gui, @NotNull InventoryComponent inventoryComp

callOnClick(event);

Pane pane = panes.get(position);
//use the previous position, since that will have the pane we clicked on
Pane pane = panes.get(previousPosition);
pane.click(gui, inventoryComponent, event, slot, paneOffsetX + x, paneOffsetY + y,
length, height);

Expand Down
Expand Up @@ -80,7 +80,14 @@ public enum Version {
*
* @since 0.10.5
*/
V1_18_2;
V1_18_2,

/**
* Version 1.19
*
* @since 0.10.6
*/
V1_19;

/**
* Gets the version currently being used. If the used version is not supported, an
Expand Down Expand Up @@ -123,6 +130,8 @@ public static Version getVersion() {
return V1_18_1;
case "1.18.2":
return V1_18_2;
case "1.19":
return V1_19;
default:
throw new UnsupportedVersionException("The server version provided is not supported");
}
Expand Down
Expand Up @@ -252,6 +252,8 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.AnvilInventoryImpl.class);
ANVIL_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.AnvilInventoryImpl.class);
ANVIL_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.AnvilInventoryImpl.class);

BEACON_INVENTORIES = new EnumMap<>(Version.class);
BEACON_INVENTORIES.put(Version.V1_14,
Expand All @@ -274,6 +276,8 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.BeaconInventoryImpl.class);
BEACON_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.BeaconInventoryImpl.class);
BEACON_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.BeaconInventoryImpl.class);

CARTOGRAPHY_TABLE_INVENTORIES = new EnumMap<>(Version.class);
CARTOGRAPHY_TABLE_INVENTORIES.put(Version.V1_14,
Expand All @@ -296,6 +300,8 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.CartographyTableInventoryImpl.class);
CARTOGRAPHY_TABLE_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.CartographyTableInventoryImpl.class);
CARTOGRAPHY_TABLE_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.CartographyTableInventoryImpl.class);

ENCHANTING_TABLE_INVENTORIES = new EnumMap<>(Version.class);
ENCHANTING_TABLE_INVENTORIES.put(Version.V1_14,
Expand All @@ -318,6 +324,8 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.EnchantingTableInventoryImpl.class);
ENCHANTING_TABLE_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.EnchantingTableInventoryImpl.class);
ENCHANTING_TABLE_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.EnchantingTableInventoryImpl.class);

GRINDSTONE_INVENTORIES = new EnumMap<>(Version.class);
GRINDSTONE_INVENTORIES.put(Version.V1_14,
Expand All @@ -340,6 +348,8 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.GrindstoneInventoryImpl.class);
GRINDSTONE_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.GrindstoneInventoryImpl.class);
GRINDSTONE_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.GrindstoneInventoryImpl.class);

MERCHANT_INVENTORIES = new EnumMap<>(Version.class);
MERCHANT_INVENTORIES.put(Version.V1_14,
Expand All @@ -362,6 +372,8 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.MerchantInventoryImpl.class);
MERCHANT_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.MerchantInventoryImpl.class);
MERCHANT_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.MerchantInventoryImpl.class);

SMITHING_TABLE_INVENTORIES = new EnumMap<>(Version.class);
SMITHING_TABLE_INVENTORIES.put(Version.V1_16_1,
Expand All @@ -380,6 +392,8 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.SmithingTableInventoryImpl.class);
SMITHING_TABLE_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.SmithingTableInventoryImpl.class);
SMITHING_TABLE_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.SmithingTableInventoryImpl.class);

STONECUTTER_INVENTORIES = new EnumMap<>(Version.class);
STONECUTTER_INVENTORIES.put(Version.V1_14,
Expand All @@ -402,5 +416,7 @@ public static StonecutterInventory newStonecutterInventory(@NotNull Version vers
com.github.stefvanschie.inventoryframework.nms.v1_18_1.StonecutterInventoryImpl.class);
STONECUTTER_INVENTORIES.put(Version.V1_18_2,
com.github.stefvanschie.inventoryframework.nms.v1_18_2.StonecutterInventoryImpl.class);
STONECUTTER_INVENTORIES.put(Version.V1_19,
com.github.stefvanschie.inventoryframework.nms.v1_19.StonecutterInventoryImpl.class);
}
}
7 changes: 4 additions & 3 deletions README.md
@@ -1,6 +1,6 @@
# IF <a href="https://discord.gg/RXmy4HdR4x"><img align="right" src="https://img.shields.io/discord/780514939293925407" alt="Discord guild"></a>

*This framework works for Minecraft versions 1.14-1.18*
*This framework works for Minecraft versions 1.14-1.19*

An inventory framework for managing GUIs

Expand All @@ -14,7 +14,7 @@ To add this project as a dependency to your pom.xml, add the following to your p
<dependency>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<artifactId>IF</artifactId>
<version>0.10.5</version>
<version>0.10.6</version>
</dependency>
```
The project is in the Central Repository, so specifying a repository is not needed.
Expand Down Expand Up @@ -50,7 +50,7 @@ Replace [YOUR PACKAGE] with the top-level package of your project.
To add this project as a dependency for your Gradle project, make sure your `dependencies` section of your build.gradle looks like the following:
```Groovy
dependencies {
compile 'com.github.stefvanschie.inventoryframework:IF:0.10.5'
compile 'com.github.stefvanschie.inventoryframework:IF:0.10.6'
// ...
}
```
Expand Down Expand Up @@ -128,6 +128,7 @@ mvn paper-nms:init -pl nms/1_17_1
mvn paper-nms:init -pl nms/1_18_0
mvn paper-nms:init -pl nms/1_18_1
mvn paper-nms:init -pl nms/1_18_2
mvn paper-nms:init -pl nms/1_19
```

Your environment is now set up correctly. To create a build, run the following inside the root folder of the project.
Expand Down
2 changes: 1 addition & 1 deletion adventure-support/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion nms/1_14/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_15/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_16_1/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_16_2-3/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_16_4-5/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_17_0/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_17_1/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_18_0/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_18_1/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion nms/1_18_2/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.5</version>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
58 changes: 58 additions & 0 deletions nms/1_19/pom.xml
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>IF-parent</artifactId>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<version>0.10.6</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>1_19</artifactId>

<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>

<dependencies>
<dependency>
<groupId>com.github.stefvanschie.inventoryframework</groupId>
<artifactId>abstraction</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms</artifactId>
<version>1.19-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>ca.bkaw</groupId>
<artifactId>paper-nms-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>remap</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<pluginRepositories>
<pluginRepository>
<id>bytecode.space</id>
<url>https://repo.bytecode.space/repository/maven-public/</url>
</pluginRepository>
</pluginRepositories>
</project>

0 comments on commit 3584545

Please sign in to comment.