Conversation
1660f03 to
616e6ef
Compare
616e6ef to
a35447f
Compare
| import java.util.concurrent.CompletableFuture; | ||
| import org.bukkit.Material; | ||
| import org.bukkit.inventory.ItemStack; | ||
|
|
There was a problem hiding this comment.
Nie podoba mi się ten obiekt wygląda trochę jak pomieszany z jakimś managerem/serwisem
There was a problem hiding this comment.
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" | ||
| }) |
There was a problem hiding this comment.
Nie da się tego lepiej zrobić? Nie blokując tego? Trochę obvious
|
|
||
| @Getter | ||
| @Accessors(fluent = true) | ||
| public static class ItemConfig extends OkaeriConfig implements ItemSettings { |
There was a problem hiding this comment.
Nie ma na to gotowca w jakimś innym pliku od konfiguracji GUI?
There was a problem hiding this comment.
jest ConfigItem ale narzuca kilka innych parametrów useless ale jeszcze zbadam to
There was a problem hiding this comment.
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())) { |
There was a problem hiding this comment.
Po co ten if tylko na normalny world?
| @Controller | ||
| class VanillaEnderchestController implements Listener { | ||
|
|
||
| private final Map<UUID, Location> openLids = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
proponuję stworzyć klase osobną, EnderchestPageTableID
| return 0; | ||
| } | ||
|
|
||
| EnderchestWrite prepareWrite() { |
There was a problem hiding this comment.
do wydzielenia, EnderchestWriter/EnderchestWriteService
| return slot; | ||
| } | ||
|
|
||
| private void ensureSlots(int required) { |
There was a problem hiding this comment.
cała logika slotów do wydzielenia, EnderchestSlotService
| } | ||
| } | ||
|
|
||
| private static ItemStack nullIfEmpty(ItemStack item) { |
There was a problem hiding this comment.
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; | ||
|
|
There was a problem hiding this comment.
ta klasa powinna tylko przechowywać, aktualnie zarządzą logiką slotów, page'ow, write'owania
| if (this.enderchestService.isVanillaEnderchestReplaced()) { | ||
| return; | ||
| } | ||
|
|
||
| this.noticeService.create() | ||
| .notice(translation -> translation.enderchest().openedEnderchest()) | ||
| .player(player.getUniqueId()) | ||
| .send(); |
There was a problem hiding this comment.
tutaj tego nie rozumiem, dlaczego w pierwszym if'ie nie wysyłamy żadnego komunikatu?
No description provided.