GUI max page item fix

This commit is contained in:
Esophose 2019-04-28 04:10:25 -06:00
parent b6d3834211
commit f9d57c769a
3 changed files with 6 additions and 6 deletions

View file

@ -242,11 +242,11 @@ public class GuiInventoryEditData extends GuiInventory {
*/
private void populateNoteData(ParticlePair editingParticle, int pageNumber, List<GuiInventoryEditFinishedCallback> callbackList, int callbackListPosition) {
int numberOfItems = noteColorMapping.length;
int maxPages = (int) Math.ceil(numberOfItems / 28.0);
int itemsPerPage = 14;
int maxPages = (int) Math.ceil((double) numberOfItems / itemsPerPage);
int slot = 10;
int nextWrap = 17;
int maxSlot = 43;
int maxSlot = 25;
for (int i = (pageNumber - 1) * itemsPerPage; i < numberOfItems; i++) {
ColorData colorData = NMSUtil.getVersionNumber() > 13 ? noteColorMapping[i] : noteColorMappingOld[i];
@ -335,8 +335,8 @@ public class GuiInventoryEditData extends GuiInventory {
*/
private void populateItemData(ParticlePair editingParticle, int pageNumber, List<GuiInventoryEditFinishedCallback> callbackList, int callbackListPosition) {
int numberOfItems = ITEM_MATERIALS.size();
int maxPages = (int) Math.ceil(numberOfItems / 28.0);
int itemsPerPage = 28;
int maxPages = (int) Math.ceil((double) numberOfItems / itemsPerPage);
int slot = 10;
int nextWrap = 17;
int maxSlot = 43;
@ -396,8 +396,8 @@ public class GuiInventoryEditData extends GuiInventory {
*/
private void populateBlockData(ParticlePair editingParticle, int pageNumber, List<GuiInventoryEditFinishedCallback> callbackList, int callbackListPosition) {
int numberOfItems = BLOCK_MATERIALS.size();
int maxPages = (int) Math.ceil(numberOfItems / 28.0);
int itemsPerPage = 28;
int maxPages = (int) Math.ceil((double) numberOfItems / itemsPerPage);
int slot = 10;
int nextWrap = 17;
int maxSlot = 43;

View file

@ -22,8 +22,8 @@ public class GuiInventoryEditEffect extends GuiInventory {
// Select Effect Buttons
List<ParticleEffect> effectsUserHasPermissionFor = PermissionManager.getEffectsUserHasPermissionFor(pplayer.getPlayer());
int numberOfItems = effectsUserHasPermissionFor.size();
int maxPages = (int) Math.ceil(numberOfItems / 28.0);
int itemsPerPage = 28;
int maxPages = (int) Math.ceil((double) numberOfItems / itemsPerPage);
int slot = 10;
int nextWrap = 17;
int maxSlot = 43;

View file

@ -22,8 +22,8 @@ public class GuiInventoryEditStyle extends GuiInventory {
// Select Style Buttons
List<ParticleStyle> stylesUserHasPermissionFor = PermissionManager.getStylesUserHasPermissionFor(pplayer.getPlayer());
int numberOfItems = stylesUserHasPermissionFor.size();
int maxPages = (int) Math.ceil(numberOfItems / 28.0);
int itemsPerPage = 28;
int maxPages = (int) Math.ceil((double) numberOfItems / itemsPerPage);
int slot = 10;
int nextWrap = 17;
int maxSlot = 43;