Skip to content

Bump org.jetbrains.kotlin.jvm from 1.9.23 to 2.0.0 #674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9c2b334
Human-friendly public Components API design draft (#498)
DevNatan Dec 5, 2023
0685d2c
Create `isLayoutSlot([...])` in SlotClickContext (#562)
DevNatan Dec 9, 2023
5e6594d
Per-viewer state management (#411)
DevNatan Dec 9, 2023
eeb8488
Remove reserved layout character restriction (#580)
DevNatan Dec 9, 2023
ba571d4
Component pipeline (#558)
DevNatan Dec 9, 2023
08d6025
Config `maxSize()` implementation (#584)
DevNatan Dec 9, 2023
d6602b0
Call PaginationState as state watcher (#585)
DevNatan Dec 9, 2023
757e5cc
Component state registry and access implementation (#587)
DevNatan Dec 9, 2023
e9a05ee
Allow manipulate external inventories as a regular View (#561)
DevNatan Dec 10, 2023
43c19b0
Missing some PaginationBuilder and ComponentBuilder methods (#581)
DevNatan Dec 12, 2023
d0cece5
Component slots (#599)
DevNatan Dec 15, 2023
e68f9d4
Remove PaginationImpl debug
DevNatan Dec 15, 2023
f69bfb5
Version 3.1.0-beta
DevNatan Dec 15, 2023
182e0fe
Bump net.kyori:adventure-api from 4.14.0 to 4.15.0 (#610)
dependabot[bot] Dec 18, 2023
df3ee49
Extend Pipelined in IFContext (#607)
DevNatan Jan 2, 2024
60f09f7
Bump org.jetbrains.kotlin.jvm from 1.9.10 to 1.9.22 (#611)
dependabot[bot] Jan 2, 2024
b20ed2f
Execute render and layout resolution pipeline (#615)
DevNatan Jan 2, 2024
9eb4bc9
Bump org.gradle.toolchains.foojay-resolver-convention from 0.7.0 to 0…
dependabot[bot] Jan 15, 2024
3f23d6f
Minecraft v1.20.4 support (#620)
DevNatan Jan 25, 2024
4a307ce
Create ViewFrame register(views) overload (#626)
DevNatan Feb 4, 2024
e62ad33
Check if state is mutable before redefine value on open (#629)
DevNatan Feb 4, 2024
6e1350a
Publish as snapshot if workflow was executed by non-tag event (#641)
DevNatan Feb 6, 2024
5b0f3aa
Bump junit from 5.10.1 to 5.10.2 (#632)
dependabot[bot] Feb 5, 2024
8a9306b
Bump net.kyori:adventure-api from 4.15.0 to 4.16.0 (#648)
dependabot[bot] Feb 20, 2024
8bb0dc5
Bump org.jetbrains.kotlin.jvm from 1.9.22 to 1.9.23 (#652)
dependabot[bot] Mar 7, 2024
b0206ad
Bump org.projectlombok:lombok from 1.18.30 to 1.18.32 (#654)
dependabot[bot] Mar 20, 2024
329784f
Version 3.0.9
DevNatan Apr 23, 2024
5b26eb9
Check if state is mutable before redefine value on open (#629)
DevNatan Feb 4, 2024
dcde5d6
Feat/page element count (#655)
mtbarr Mar 30, 2024
a6fe9c6
Lint
DevNatan Apr 23, 2024
bd5ae43
Add Pagination pagesCount(), isEmpty() and currentSource() (#660)
DevNatan Apr 23, 2024
a63d56e
Fix build version
DevNatan Apr 23, 2024
e5e48b2
Remove test code
DevNatan Apr 23, 2024
2785d3b
Set group and version of subprojects
DevNatan Apr 23, 2024
e4b0c22
Publish snapshot versions (#639)
DevNatan Feb 6, 2024
2678066
Do not TODO to issue on main branch and run build workflow only on PR…
DevNatan Feb 6, 2024
3532910
Publish as snapshot if workflow was executed by non-tag event (#641)
DevNatan Feb 6, 2024
37fa106
Revert "Execute render and layout resolution pipeline (#615)"
DevNatan Apr 23, 2024
511688b
Version 3.0.10
DevNatan Apr 23, 2024
b3b3c98
feat: add `cancelDefaults` in `ViewConfigBuilder` (#669)
luapascoal May 6, 2024
496df9c
doc: add `cancelOnClick` doc (#668)
luapascoal May 6, 2024
1c5162d
Bump org.spigotmc:spigot-api from 1.20.4-R0.1-SNAPSHOT to 1.20.6-R0.1…
dependabot[bot] May 6, 2024
8a7257f
Bump io.papermc.paper:paper-api from 1.20.4-R0.1-SNAPSHOT to 1.20.6-R…
dependabot[bot] May 6, 2024
4118356
dependabot[bot] May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Build

on:
push:
workflow_dispatch:
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Publish package
on:
release:
types: [published]
push:
branches: [main]
workflow_dispatch:

jobs:
Expand All @@ -12,9 +14,8 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -27,7 +28,7 @@ jobs:
- name: Publish
uses: gradle/gradle-build-action@cd3cedc781988c804f626f4cd2dc51d0bdf02a12
with:
arguments: publish
arguments: publish -Dsnapshot=${{ github.ref_type != 'tag' }}
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/test.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

name: TODO to Issue

on: [ "push" ]
on:
push:
branches-ignore: [main]

jobs:
build:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

# 3.1.0-beta (12-15-2023)

* Vertical pagination support (#387)
* Per-player state management for Shared Contexts (#411)
* isLayoutSlot(...) in click context to check if click was in a character of the layout (#562)
* New "Proxy" feature to use external inventories (like player inventory) as a extension of the view (#561)
* Do not call methods in Shared Contexts that are not supported (#545)
* Config maxSize() implementation (#584)
* Human-friendly public Components API (#498, #599)
* Components pipelining (#558)
* Using Paper as inventory factory (#544)
* Remove reserved layout character restriction (#580)

# 3.0.8 (11-28-2023)

* Interaction delay intercepting re-propagated interactions (#543)
Expand Down
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ plugins {
}

group 'me.devnatan'
version '3.0.8'
version '3.0.10'

subprojects {
group = rootProject.group
version = rootProject.version
}
15 changes: 10 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[versions]
jetbrains-annotations = "24.1.0"
spigot = "1.20.1-R0.1-SNAPSHOT"
paperSpigot = "1.20.1-R0.1-SNAPSHOT"
junit = "5.10.1"
spigot = "1.20.6-R0.1-SNAPSHOT"
paperSpigot = "1.20.6-R0.1-SNAPSHOT"
junit = "5.10.2"
mockito = "4.11.0"
adventure-api = "4.14.0"
kotlin = "1.9.10"
adventure-api = "4.16.0"
kotlin = "2.0.0"
plugin-shadowjar = "8.1.1"
plugin-spotless = "6.12.0"
plugin-bukkit = "0.6.0"
lombok = "1.18.32"

[libraries.spigot]
module = "org.spigotmc:spigot-api"
Expand Down Expand Up @@ -42,6 +43,10 @@ version.ref = "mockito"
module = "net.kyori:adventure-api"
version.ref = "adventure-api"

[libraries.lombok]
module = "org.projectlombok:lombok"
version.ref = "lombok"

[plugins]
shadowjar = { id = "com.github.johnrengelman.shadow", version.ref = "plugin-shadowjar" }
spotless = { id = "com.diffplug.spotless", version.ref = "plugin-spotless" }
Expand Down
3 changes: 1 addition & 2 deletions inventory-framework-anvil-input/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
plugins {
alias(libs.plugins.shadowjar)
alias(libs.plugins.kotlin)
}

apply from: '../library.gradle'
apply from: '../publish.gradle'

dependencies {
compileOnly libs.spigot
compileOnlyApi projects.inventoryFrameworkPlatformBukkit
compileOnly projects.inventoryFrameworkPlatformBukkit
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static AnvilInput createAnvilInput(
@ApiStatus.Experimental
public static AnvilInput createAnvilInput(@NotNull AnvilInputConfig config) {
final long id = State.next();
final StateValueFactory factory = (host, state) -> new AnvilInputStateValue(state, config);
final StateValueFactory factory = (host, state) -> new AnvilInputStateValue(id, config);

return new AnvilInput(id, factory);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.function.UnaryOperator;
import org.jetbrains.annotations.Contract;

public class AnvilInputConfig {
public final class AnvilInputConfig {

String initialInput = "";
boolean closeOnSelect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,19 @@

import static java.util.Objects.requireNonNull;
import static me.devnatan.inventoryframework.AnvilInput.defaultConfig;
import static me.devnatan.inventoryframework.IFViewFrame.FRAME_REGISTERED;

import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.function.UnaryOperator;
import me.devnatan.inventoryframework.context.CloseContext;
import me.devnatan.inventoryframework.context.IFCloseContext;
import me.devnatan.inventoryframework.context.IFContext;
import me.devnatan.inventoryframework.context.IFOpenContext;
import me.devnatan.inventoryframework.context.IFRenderContext;
import me.devnatan.inventoryframework.context.IFSlotClickContext;
import me.devnatan.inventoryframework.context.OpenContext;
import me.devnatan.inventoryframework.context.SlotClickContext;
import me.devnatan.inventoryframework.feature.Feature;
import me.devnatan.inventoryframework.pipeline.PipelineInterceptor;
import me.devnatan.inventoryframework.pipeline.StandardPipelinePhases;
import me.devnatan.inventoryframework.state.State;
import me.devnatan.inventoryframework.state.StateValue;
import me.devnatan.inventoryframework.state.StateValueHost;
import me.devnatan.inventoryframework.state.StateWatcher;
import me.devnatan.inventoryframework.pipeline.PipelinePhase;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
Expand Down Expand Up @@ -54,13 +46,15 @@ private AnvilInputFeature() {}
@Override
public @NotNull Void install(ViewFrame framework, UnaryOperator<AnvilInputConfig> configure) {
config = configure.apply(defaultConfig());
framework.getPipeline().intercept(FRAME_REGISTERED, (frameInterceptor = createFrameworkInterceptor()));
framework
.getPipeline()
.intercept(PipelinePhase.Frame.FRAME_REGISTERED, (frameInterceptor = createFrameworkInterceptor()));
return null;
}

@Override
public void uninstall(ViewFrame framework) {
framework.getPipeline().removeInterceptor(FRAME_REGISTERED, frameInterceptor);
framework.getPipeline().removeInterceptor(PipelinePhase.Frame.FRAME_REGISTERED, frameInterceptor);
}

private PipelineInterceptor createFrameworkInterceptor() {
Expand Down Expand Up @@ -97,9 +91,7 @@ private void updatePhysicalResult(String newText, ViewContainer container) {
}

private void handleClick(PlatformView view) {
view.getPipeline().intercept(StandardPipelinePhases.CLICK, (pipeline, subject) -> {
if (!(subject instanceof IFSlotClickContext)) return;

view.getPipeline().intercept(PipelinePhase.Context.CONTEXT_SLOT_CLICK, (pipeline, subject) -> {
final SlotClickContext context = (SlotClickContext) subject;
final AnvilInput anvilInput = getAnvilInput(context);
if (anvilInput == null) return;
Expand Down Expand Up @@ -127,38 +119,18 @@ private void handleClick(PlatformView view) {
}

private void handleOpen(PlatformView view) {
view.getPipeline().intercept(StandardPipelinePhases.OPEN, (pipeline, subject) -> {
if (!(subject instanceof IFOpenContext)) return;

view.getPipeline().intercept(PipelinePhase.Context.CONTEXT_OPEN, (pipeline, subject) -> {
final OpenContext context = (OpenContext) subject;
final AnvilInput anvilInput = getAnvilInput(context);
if (anvilInput == null) return;

// Forces internal state initialization
context.getInternalStateValue(anvilInput);
context.watchState(anvilInput.internalId(), new StateWatcher() {
@Override
public void stateRegistered(@NotNull State<?> state, Object caller) {}

@Override
public void stateUnregistered(@NotNull State<?> state, Object caller) {}

@Override
public void stateValueGet(
@NotNull State<?> state,
@NotNull StateValueHost host,
@NotNull StateValue internalValue,
Object rawValue) {}

@Override
public void stateValueSet(
@NotNull StateValueHost host,
@NotNull StateValue value,
Object rawOldValue,
Object rawNewValue) {
updatePhysicalResult((String) rawNewValue, ((IFRenderContext) host).getContainer());
}
});

context.watchState(
anvilInput.internalId(),
(pipelineContext, diff) -> updatePhysicalResult(
(String) diff.getNewValue(), ((IFRenderContext) diff.getHost()).getContainer()));

final String globalInitialInput = config.initialInput;
final String scopedInitialInput = anvilInput.get(context);
Expand All @@ -167,18 +139,15 @@ public void stateValueSet(
context.getPlayer(),
context.getConfig().getTitle(),
scopedInitialInput.isEmpty() ? globalInitialInput : scopedInitialInput);
final ViewContainer container =
new BukkitViewContainer(inventory, context.isShared(), ViewType.ANVIL, true);
final ViewContainer container = new BukkitViewContainer(inventory, ViewType.ANVIL, false, true);

context.setContainer(container);
});
}

private void handleClose(PlatformView view) {
view.getPipeline().intercept(StandardPipelinePhases.CLOSE, (pipeline, subject) -> {
if (!(subject instanceof IFCloseContext)) return;

final CloseContext context = (CloseContext) subject;
view.getPipeline().intercept(PipelinePhase.Context.CONTEXT_CLOSE, (pipeline, subject) -> {
final IFCloseContext context = (IFCloseContext) subject;
final AnvilInput anvilInput = getAnvilInput(context);
if (anvilInput == null) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ class AnvilInputNMS {
GET_PLAYER_NEXT_CONTAINER_COUNTER =
getMethod(ENTITY_PLAYER, "nextContainerCounter", MethodType.methodType(int.class));

GET_PLAYER_INVENTORY =
getMethod(ENTITY_PLAYER, "fN", MethodType.methodType(playerInventoryClass), false, "fR");
GET_PLAYER_INVENTORY = getMethod(
ENTITY_PLAYER, "fN", MethodType.methodType(playerInventoryClass), false, "fR", "fS" /* 1.20.4 */);

CONTAINER_WINDOW_ID = setField(CONTAINER, int.class, "windowId", "containerId", "j");
ADD_CONTAINER_SLOT_LISTENER = getMethod(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package me.devnatan.inventoryframework;

import me.devnatan.inventoryframework.state.MutableValue;
import me.devnatan.inventoryframework.state.State;

class AnvilInputStateValue extends MutableValue {

private final AnvilInputConfig config;

public AnvilInputStateValue(State<?> state, AnvilInputConfig config) {
super(state, config.initialInput);
public AnvilInputStateValue(long internalId, AnvilInputConfig config) {
super(internalId, config.initialInput);
this.config = config;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.devnatan.inventoryframework;

import java.util.Objects;
import java.util.function.Supplier;
import org.intellij.lang.annotations.PrintFormat;
import org.jetbrains.annotations.ApiStatus;
Expand All @@ -11,7 +12,7 @@
@ApiStatus.Internal
public final class IFDebug {

private static final String PREFIX = "[IF]";
private static final String PREFIX = "[InventoryFramework] [DEBUG] ";
private static final String SYSTEM_PROPERTY = "me.devnatan.inventoryframework.debug";

private static Boolean DEBUG_ENABLED = null;
Expand All @@ -24,7 +25,9 @@ private IFDebug() {}
* @return If debug is enabled.
*/
public static boolean isDebugEnabled() {
if (DEBUG_ENABLED == null) DEBUG_ENABLED = Boolean.parseBoolean(System.getProperty(SYSTEM_PROPERTY, "false"));
if (DEBUG_ENABLED == null)
DEBUG_ENABLED = Boolean.parseBoolean(System.getProperty(SYSTEM_PROPERTY, "false"))
|| Objects.equals(System.getenv("DEVELOPMENT"), "true");

return DEBUG_ENABLED;
}
Expand All @@ -46,7 +49,7 @@ public static void setEnabled(boolean enabled) {
*/
public static void debug(Supplier<String> message, Object... args) {
if (!isDebugEnabled()) return;
System.out.println(PREFIX + " " + String.format(message.get(), args));
System.out.printf(PREFIX + message.get() + "%n", args);
}

/**
Expand All @@ -57,6 +60,6 @@ public static void debug(Supplier<String> message, Object... args) {
*/
public static void debug(@PrintFormat String message, Object... args) {
if (!isDebugEnabled()) return;
System.out.println(PREFIX + " " + String.format(message, args));
System.out.printf(PREFIX + message + "%n", args);
}
}
Loading