From 2dc7ecbd75a30af11f0c67268145251a81173582 Mon Sep 17 00:00:00 2001
From: miyabi0333 <57523862+Arisa9006@users.noreply.github.com>
Date: Fri, 15 Nov 2024 14:40:59 +0900
Subject: [PATCH] =?UTF-8?q?1.0.1=20InventoryHolder=E8=BF=BD=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/released.yml | 44 +++++++++++++++++++
pom.xml | 2 +-
.../dev/felnull/bettergui/core/GUIPage.java | 5 ++-
.../felnull/bettergui/sample/SamplePage.java | 6 ++-
4 files changed, 53 insertions(+), 4 deletions(-)
create mode 100644 .github/workflows/released.yml
diff --git a/.github/workflows/released.yml b/.github/workflows/released.yml
new file mode 100644
index 0000000..9fa9093
--- /dev/null
+++ b/.github/workflows/released.yml
@@ -0,0 +1,44 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+
+jobs:
+ # ビルドとリリースまでの処理
+ build-release:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Setup JDK #JDKセットアップ
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'corretto'
+ java-version: '16'
+
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ - name: Collect Releases #リリースしたものを収集
+ run: |
+ mkdir release
+ cp target/*.jar release/
+
+
+ - name: Upload Artifact #アーティファクトをアップロード
+ uses: actions/upload-artifact@v3
+ with:
+ name: releases
+ path: release/*
+
+ - name: ${{ github.ref_name }}リリース #GiHubにリリース
+ uses: softprops/action-gh-release@v1
+ with:
+ files: release/*
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 0d8e78a..aaa330c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
dev.felnull
bettergui
- 1.0
+ 1.0.1
jar
BetterGUI
diff --git a/src/main/java/dev/felnull/bettergui/core/GUIPage.java b/src/main/java/dev/felnull/bettergui/core/GUIPage.java
index c7adbd0..07880ec 100644
--- a/src/main/java/dev/felnull/bettergui/core/GUIPage.java
+++ b/src/main/java/dev/felnull/bettergui/core/GUIPage.java
@@ -5,11 +5,12 @@
import org.bukkit.Bukkit;
import org.bukkit.event.HandlerList;
import org.bukkit.inventory.Inventory;
+import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import java.util.HashMap;
-public abstract class GUIPage {
+public abstract class GUIPage implements InventoryHolder {
private final BetterGUI plugin = BetterGUI.getInstance();
public InventoryGUI gui;
public Inventory inventory;
@@ -17,7 +18,7 @@ public abstract class GUIPage {
private HashMap items = new HashMap<>();
public GUIPage(InventoryGUI gui, String name, int size) {
- inventory = Bukkit.createInventory(null, size, name);
+ inventory = Bukkit.createInventory(this, size, name);
this.gui = gui;
listener = new GUIClickListener(this);
Bukkit.getPluginManager().registerEvents(listener, plugin);
diff --git a/src/main/java/dev/felnull/bettergui/sample/SamplePage.java b/src/main/java/dev/felnull/bettergui/sample/SamplePage.java
index 00047b9..02fecce 100644
--- a/src/main/java/dev/felnull/bettergui/sample/SamplePage.java
+++ b/src/main/java/dev/felnull/bettergui/sample/SamplePage.java
@@ -3,6 +3,7 @@
import dev.felnull.bettergui.core.GUIPage;
import dev.felnull.bettergui.core.InventoryGUI;
import org.bukkit.ChatColor;
+import org.bukkit.inventory.Inventory;
public class SamplePage extends GUIPage {
public SamplePage(InventoryGUI gui){
@@ -15,6 +16,9 @@ public void setUp(){
}
@Override
public void back(){
-
+ }
+ @Override
+ public Inventory getInventory() {
+ return inventory;
}
}