Skip to content

GH-1301 Add paginated ender chests - #1440

Draft
Pawelusze wants to merge 8 commits into
EternalCodeTeam:masterfrom
Pawelusze:feature/paginated-enderchest
Draft

Pawelusze wants to merge 8 commits into
EternalCodeTeam:masterfrom
Pawelusze:feature/paginated-enderchest

Conversation

@Pawelusze

Copy link
Copy Markdown
Contributor

No description provided.

@Pawelusze
Pawelusze requested a review from a team as a code owner September 21, 2026 13:29
@Pawelusze Pawelusze self-assigned this Sep 21, 2026
@Pawelusze Pawelusze added 🆕 feature New feature or request ✅ needs testing Issue needs verification. labels Sep 21, 2026
@Pawelusze
Pawelusze marked this pull request as draft September 21, 2026 13:35
@Pawelusze
Pawelusze force-pushed the feature/paginated-enderchest branch from 1660f03 to 616e6ef Compare September 21, 2026 13:56
@Pawelusze
Pawelusze force-pushed the feature/paginated-enderchest branch from 616e6ef to a35447f Compare September 21, 2026 13:57
@Pawelusze Pawelusze linked an issue Sep 21, 2026 that may be closed by this pull request
@Pawelusze
Pawelusze marked this pull request as ready for review September 21, 2026 16:22
import java.util.concurrent.CompletableFuture;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nie podoba mi się ten obiekt wygląda trochę jak pomieszany z jakimś managerem/serwisem

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ta klasa powinna tylko przechowywać, aktualnie zarządzą logiką slotów, page'ow, write'owania

"# Opening one that is already open closes it for the other player and has to be repeated",
"#",
"# Recommended to keep on, two players sharing one ender chest can duplicate or lose items"
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nie da się tego lepiej zrobić? Nie blokując tego? Trochę obvious


@Getter
@Accessors(fluent = true)
public static class ItemConfig extends OkaeriConfig implements ItemSettings {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nie ma na to gotowca w jakimś innym pliku od konfiguracji GUI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jest ConfigItem ale narzuca kilka innych parametrów useless ale jeszcze zbadam to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jak dobrze pamiętam tego czego nie używasz dajesz null i wtedy ci tego nie generuje w cfg


@EventHandler
void onWorldSave(WorldSaveEvent event) {
if (event.getWorld().equals(this.server.getWorlds().getFirst())) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Po co ten if tylko na normalny world?

@Controller
class VanillaEnderchestController implements Listener {

private final Map<UUID, Location> openLids = new ConcurrentHashMap<>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memory leak jak nie zostanie usunięty a coś się stanie z tym światem - dla bezpieczeństwa użył bym Position

ConnectionSource connectionSource = databaseManager.connectionSource();
TableUtils.createTableIfNotExists(connectionSource, EnderchestPageTable.class);

if (connectionSource.getDatabaseType() instanceof MysqlDatabaseType) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Po co ten dziwny if

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mysql ma na zwykłym BLOB okolo 64 KB limitu więc poszerzamy do MEDIUM BLOB

/**
* @return whether ender chests are blocked entirely, which overrides {@link #isVanillaEnderchestReplaced()}
*/
boolean areEnderchestsBlocked();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co to oznacza? dajmy tutaj szczegółowsze javadocs'y lub lepszą nazwę tej metody

/**
* @return whether paginated ender chests are enabled in the configuration
*/
boolean isVanillaEnderchestReplaced();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co to oznacza? Jeśli to dotyczy konfiguracji i tego, czy enderchesty mają być paginated - to nazwa metody do zmiany

this.contents = contents;
}

static String idOf(UUID ownerUniqueId, int page) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proponuję stworzyć klase osobną, EnderchestPageTableID

return 0;
}

EnderchestWrite prepareWrite() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do wydzielenia, EnderchestWriter/EnderchestWriteService

return slot;
}

private void ensureSlots(int required) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cała logika slotów do wydzielenia, EnderchestSlotService

}
}

private static ItemStack nullIfEmpty(ItemStack item) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

co to oznacza? do czego to używamy? nazwa metody trochę myląca

import java.util.concurrent.CompletableFuture;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ta klasa powinna tylko przechowywać, aktualnie zarządzą logiką slotów, page'ow, write'owania

Comment on lines +38 to +45
if (this.enderchestService.isVanillaEnderchestReplaced()) {
return;
}

this.noticeService.create()
.notice(translation -> translation.enderchest().openedEnderchest())
.player(player.getUniqueId())
.send();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tutaj tego nie rozumiem, dlaczego w pierwszym if'ie nie wysyłamy żadnego komunikatu?

@Pawelusze
Pawelusze marked this pull request as draft September 22, 2026 08:45

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 feature New feature or request ✅ needs testing Issue needs verification.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add custom ender chests for players

3 participants