Skip to content

Commit

Permalink
* Fix deployment usages with unity gui and add 1.19.2 anvil support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hempfest committed Sep 6, 2022
1 parent e349b0e commit e65f85c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public Inventory getParent() {

@Override
public Deployable<Void> remove(ItemCompost compost) {
return Deployable.of(null, unused -> compost.remove(this), 0);
return Deployable.of(() -> {
compost.remove(this);
}, 0);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static MenuRegistration getInstance() {

@Override
public <M extends Menu> Deployable<Void> register(M menu) throws MenuDuplicationException, MenuNotCacheableException {
return Deployable.of(null, unused -> {
return Deployable.of(() -> {
PantherCollection<Menu> menus = cache.get(menu.getHost());
if (menus != null) {
if (menus.contains(menu))
Expand All @@ -55,7 +55,7 @@ public <M extends Menu> Deployable<Void> register(M menu) throws MenuDuplication

@Override
public Deployable<Void> unregister(Menu menu) throws MenuNotCacheableException {
return Deployable.of(null, unused -> {
return Deployable.of(() -> {
PantherCollection<Menu> menus = cache.get(menu.getHost());
if (menus != null) {
if (!menus.contains(menu)) throw new MenuNotCacheableException("Menu not cached.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ public Menu.Builder<T, K> build() {
}

public boolean exists(String key) {
return registration.get(key) != null;
return registration.get(key).deploy().get() != null;
}

public T get(String key) {
return (T) registration.get(key);
return (T) registration.get(key).deploy().get();
}

public T get(Predicate<Menu> predicate) {
for (Menu m : registration.getAll().get()) {
for (Menu m : registration.getAll().deploy().get()) {
if (predicate.test(m)) {
return (T) m;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public <V> MemoryDocket<T> setUniqueDataConverter(@NotNull V t, @NotNull BiFunct
r = dataConverter.apply(r, value);
}
MenuRegistration registration = MenuRegistration.getInstance();
Menu registered = registration.get(r).get();
Menu registered = registration.get(r).deploy().get();
if (registered != null) {
registered.open(click.getElement());
} else {
Expand Down Expand Up @@ -361,7 +361,7 @@ protected void handleClickEvent(MemoryItem item, ItemElement<?> ed) {
open = uniqueDataConverter.apply(open, uniqueData);
}
MenuRegistration registration = MenuRegistration.getInstance();
Menu registered = registration.get(open).deploy().get();
Menu registered = registration.get(open).deploy().complete();
if (registered != null) {
registered.open(click.getElement());
} else {
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<templates.version>1.1.0</templates.version>
<panther.version>1.0.0</panther.version>
<panther.version>1.0.1.R1-SNAPSHOT</panther.version>
<project.version>${version}</project.version>
</properties>

Expand Down

0 comments on commit e65f85c

Please sign in to comment.