Skip to content

Commit

Permalink
1.0.1 InventoryHolder追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Arisa9006 committed Nov 15, 2024
1 parent 3ea6718 commit 2dc7ecb
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 4 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/released.yml
Original file line number Diff line number Diff line change
@@ -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/*
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>dev.felnull</groupId>
<artifactId>bettergui</artifactId>
<version>1.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>

<name>BetterGUI</name>
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/dev/felnull/bettergui/core/GUIPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
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;
public GUIClickListener listener;
private HashMap<Integer, GUIItem> 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);
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/dev/felnull/bettergui/sample/SamplePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -15,6 +16,9 @@ public void setUp(){
}
@Override
public void back(){

}
@Override
public Inventory getInventory() {
return inventory;
}
}

0 comments on commit 2dc7ecb

Please sign in to comment.