mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Improved Slimefun Guide Performance
This commit is contained in:
parent
861ddba869
commit
25e6dd337b
@ -3,6 +3,7 @@ package me.mrCookieSlime.Slimefun;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -57,7 +58,8 @@ public final class SlimefunGuide {
|
|||||||
private SlimefunGuide() {}
|
private SlimefunGuide() {}
|
||||||
|
|
||||||
private static final int category_size = 36;
|
private static final int category_size = 36;
|
||||||
|
private static final int[] slots = new int[] {0, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35};
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static ItemStack getItem() {
|
public static ItemStack getItem() {
|
||||||
return getItem(SlimefunGuideLayout.CHEST);
|
return getItem(SlimefunGuideLayout.CHEST);
|
||||||
@ -86,8 +88,6 @@ public final class SlimefunGuide {
|
|||||||
return new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&eSlimefun Guide &7(Right Click)", (book ? "": "&2"), "&rThis is your basic Guide for Slimefun", "&rYou can see all Items added by this Plugin", "&ror its Addons including their Recipes", "&ra bit of information and more");
|
return new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&eSlimefun Guide &7(Right Click)", (book ? "": "&2"), "&rThis is your basic Guide for Slimefun", "&rYou can see all Items added by this Plugin", "&ror its Addons including their Recipes", "&ra bit of information and more");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int[] slots = new int[] {0, 2, 3, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35};
|
|
||||||
|
|
||||||
public static void openSettings(Player p, final ItemStack guide) {
|
public static void openSettings(Player p, final ItemStack guide) {
|
||||||
final ChestMenu menu = new ChestMenu("Settings / Info");
|
final ChestMenu menu = new ChestMenu("Settings / Info");
|
||||||
|
|
||||||
@ -184,16 +184,12 @@ public final class SlimefunGuide {
|
|||||||
final ChestMenu menu = new ChestMenu("Credits");
|
final ChestMenu menu = new ChestMenu("Credits");
|
||||||
|
|
||||||
menu.setEmptySlotsClickable(false);
|
menu.setEmptySlotsClickable(false);
|
||||||
menu.addMenuOpeningHandler(
|
menu.addMenuOpeningHandler(pl -> pl.playSound(pl.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F));
|
||||||
pl -> pl.playSound(pl.getLocation(), Sound.BLOCK_NOTE_BLOCK_HARP, 0.7F, 0.7F)
|
|
||||||
);
|
|
||||||
|
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
if (i != 4) {
|
if (i != 4) {
|
||||||
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "));
|
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "));
|
||||||
menu.addMenuClickHandler(i,
|
menu.addMenuClickHandler(i, (pl, slot, item, action) -> false);
|
||||||
(pl, slot, item, action) -> false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
menu.addItem(4, new CustomItem(new ItemStack(Material.EMERALD), "&7\u21E6 Back to Settings"));
|
menu.addItem(4, new CustomItem(new ItemStack(Material.EMERALD), "&7\u21E6 Back to Settings"));
|
||||||
@ -205,11 +201,7 @@ public final class SlimefunGuide {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int index = 9;
|
int index = 9;
|
||||||
double total = 0;
|
double total = 1.0 * SlimefunPlugin.getUtilities().contributors.stream().mapToInt(Contributor::getCommits).sum();
|
||||||
|
|
||||||
for (Contributor contributor : SlimefunPlugin.getUtilities().contributors) {
|
|
||||||
total += contributor.getCommits();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (final Contributor contributor: SlimefunPlugin.getUtilities().contributors) {
|
for (final Contributor contributor: SlimefunPlugin.getUtilities().contributors) {
|
||||||
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
|
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
|
||||||
@ -259,7 +251,10 @@ public final class SlimefunGuide {
|
|||||||
public static void openGuide(Player p, boolean book) {
|
public static void openGuide(Player p, boolean book) {
|
||||||
if (!SlimefunPlugin.getWhitelist().getBoolean(p.getWorld().getName() + ".enabled")) return;
|
if (!SlimefunPlugin.getWhitelist().getBoolean(p.getWorld().getName() + ".enabled")) return;
|
||||||
if (!SlimefunPlugin.getWhitelist().getBoolean(p.getWorld().getName() + ".enabled-items.SLIMEFUN_GUIDE")) return;
|
if (!SlimefunPlugin.getWhitelist().getBoolean(p.getWorld().getName() + ".enabled-items.SLIMEFUN_GUIDE")) return;
|
||||||
if (!getHistory().containsKey(p.getUniqueId())) openMainMenu(p, true, book, 1);
|
|
||||||
|
if (!getHistory().containsKey(p.getUniqueId())) {
|
||||||
|
openMainMenu(p, true, book, 1);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Object last = getLastEntry(p, false);
|
Object last = getLastEntry(p, false);
|
||||||
if (last instanceof Category) openCategory(p, (Category) last, true, 1, book);
|
if (last instanceof Category) openCategory(p, (Category) last, true, 1, book);
|
||||||
@ -270,8 +265,9 @@ public final class SlimefunGuide {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void openMainMenu(final Player p, final boolean survival, final boolean book, final int selected_page) {
|
public static void openMainMenu(final Player p, final boolean survival, final boolean book, final int selected_page) {
|
||||||
if (survival)
|
if (survival) {
|
||||||
clearHistory(p.getUniqueId());
|
clearHistory(p.getUniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
if (book) {
|
if (book) {
|
||||||
List<TellRawMessage> pages = new ArrayList<>();
|
List<TellRawMessage> pages = new ArrayList<>();
|
||||||
@ -293,7 +289,7 @@ public final class SlimefunGuide {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (locked) {
|
if (locked) {
|
||||||
// Dont display that Category...
|
// Don't display that Category...
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (tier < category.getTier()) {
|
if (tier < category.getTier()) {
|
||||||
@ -400,9 +396,7 @@ public final class SlimefunGuide {
|
|||||||
final ChestMenu menu = new ChestMenu("Slimefun Guide");
|
final ChestMenu menu = new ChestMenu("Slimefun Guide");
|
||||||
|
|
||||||
menu.setEmptySlotsClickable(false);
|
menu.setEmptySlotsClickable(false);
|
||||||
menu.addMenuOpeningHandler(
|
menu.addMenuOpeningHandler(pl -> pl.playSound(pl.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 0.7F));
|
||||||
pl -> pl.playSound(pl.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 0.7F)
|
|
||||||
);
|
|
||||||
|
|
||||||
List<Category> categories = SlimefunPlugin.getUtilities().enabledCategories;
|
List<Category> categories = SlimefunPlugin.getUtilities().enabledCategories;
|
||||||
List<GuideHandler> handlers = SlimefunPlugin.getUtilities().guideHandlers.values().stream().flatMap(List::stream).collect(Collectors.toList());
|
List<GuideHandler> handlers = SlimefunPlugin.getUtilities().guideHandlers.values().stream().flatMap(List::stream).collect(Collectors.toList());
|
||||||
@ -412,16 +406,12 @@ public final class SlimefunGuide {
|
|||||||
|
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "));
|
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "));
|
||||||
menu.addMenuClickHandler(i,
|
menu.addMenuClickHandler(i, (pl, slot, item, action) -> false);
|
||||||
(pl, slot, item, action) -> false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 45; i < 54; i++) {
|
for (int i = 45; i < 54; i++) {
|
||||||
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "));
|
menu.addItem(i, new CustomItem(new ItemStack(Material.GRAY_STAINED_GLASS_PANE), " "));
|
||||||
menu.addMenuClickHandler(i,
|
menu.addMenuClickHandler(i, (pl, slot, item, action) -> false);
|
||||||
(pl, slot, item, action) -> false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int target = (category_size * (selected_page - 1)) - 1;
|
int target = (category_size * (selected_page - 1)) - 1;
|
||||||
@ -435,12 +425,13 @@ public final class SlimefunGuide {
|
|||||||
target++;
|
target++;
|
||||||
|
|
||||||
if (target >= categories.size()) {
|
if (target >= categories.size()) {
|
||||||
if (!survival) break;
|
if (!survival) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
index = handlers.get(target - categories.size()).next(p, index, menu);
|
index = handlers.get(target - categories.size()).next(p, index, menu);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final Category category = categories.get(target);
|
final Category category = categories.get(target);
|
||||||
|
|
||||||
boolean locked = true;
|
boolean locked = true;
|
||||||
|
|
||||||
for (SlimefunItem item: category.getItems()) {
|
for (SlimefunItem item: category.getItems()) {
|
||||||
@ -487,13 +478,13 @@ public final class SlimefunGuide {
|
|||||||
parents.add(ChatColor.translateAlternateColorCodes('&', "&rYou need to unlock all Items"));
|
parents.add(ChatColor.translateAlternateColorCodes('&', "&rYou need to unlock all Items"));
|
||||||
parents.add(ChatColor.translateAlternateColorCodes('&', "&rfrom the following Categories first:"));
|
parents.add(ChatColor.translateAlternateColorCodes('&', "&rfrom the following Categories first:"));
|
||||||
parents.add("");
|
parents.add("");
|
||||||
|
|
||||||
for (Category parent : ((LockedCategory) category).getParents()) {
|
for (Category parent : ((LockedCategory) category).getParents()) {
|
||||||
parents.add(parent.getItem().getItemMeta().getDisplayName());
|
parents.add(parent.getItem().getItemMeta().getDisplayName());
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addItem(index, new CustomItem(Material.BARRIER, "&4LOCKED &7- &r" + category.getItem().getItemMeta().getDisplayName(), parents.toArray(new String[parents.size()])));
|
menu.addItem(index, new CustomItem(Material.BARRIER, "&4LOCKED &7- &r" + category.getItem().getItemMeta().getDisplayName(), parents.toArray(new String[parents.size()])));
|
||||||
menu.addMenuClickHandler(index,
|
menu.addMenuClickHandler(index, (pl, slot, item, action) -> false);
|
||||||
(pl, slot, item, action) -> false
|
|
||||||
);
|
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -611,19 +602,23 @@ public final class SlimefunGuide {
|
|||||||
for (int i = 0; i < texts.size(); i = i + 10) {
|
for (int i = 0; i < texts.size(); i = i + 10) {
|
||||||
TellRawMessage page = new TellRawMessage();
|
TellRawMessage page = new TellRawMessage();
|
||||||
page.addText(ChatColor.translateAlternateColorCodes('&', "&b&l- Slimefun Guide -\n\n"));
|
page.addText(ChatColor.translateAlternateColorCodes('&', "&b&l- Slimefun Guide -\n\n"));
|
||||||
|
|
||||||
for (int j = i; j < texts.size() && j < i + 10; j++) {
|
for (int j = i; j < texts.size() && j < i + 10; j++) {
|
||||||
page.addText(texts.get(j) + "\n");
|
page.addText(texts.get(j) + "\n");
|
||||||
if (tooltips.get(j) != null) page.addHoverEvent(HoverAction.SHOW_TEXT, tooltips.get(j));
|
if (tooltips.get(j) != null) page.addHoverEvent(HoverAction.SHOW_TEXT, tooltips.get(j));
|
||||||
if (actions.get(j) != null) page.addClickEvent(actions.get(j));
|
if (actions.get(j) != null) page.addClickEvent(actions.get(j));
|
||||||
}
|
}
|
||||||
|
|
||||||
page.addText("\n");
|
page.addText("\n");
|
||||||
page.addText(ChatColor.translateAlternateColorCodes('&', "&6\u21E6 &lBack"));
|
page.addText(ChatColor.translateAlternateColorCodes('&', "&6\u21E6 &lBack"));
|
||||||
page.addHoverEvent(HoverAction.SHOW_TEXT, ChatColor.translateAlternateColorCodes('&', "&eClick to go back to the Category Overview"));
|
page.addHoverEvent(HoverAction.SHOW_TEXT, ChatColor.translateAlternateColorCodes('&', "&eClick to go back to the Category Overview"));
|
||||||
page.addClickEvent(new PlayerRunnable(2) {
|
page.addClickEvent(new PlayerRunnable(2) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final Player p) {
|
public void run(final Player p) {
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, () -> openMainMenu(p, survival, true, 1), 1L);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(SlimefunPlugin.instance, () -> openMainMenu(p, survival, true, 1), 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
pages.add(page);
|
pages.add(page);
|
||||||
}
|
}
|
||||||
@ -680,10 +675,12 @@ public final class SlimefunGuide {
|
|||||||
int target = categoryIndex + i;
|
int target = categoryIndex + i;
|
||||||
if (target >= category.getItems().size()) break;
|
if (target >= category.getItems().size()) break;
|
||||||
final SlimefunItem sfitem = category.getItems().get(target);
|
final SlimefunItem sfitem = category.getItems().get(target);
|
||||||
|
|
||||||
if (Slimefun.isEnabled(p, sfitem, false)) {
|
if (Slimefun.isEnabled(p, sfitem, false)) {
|
||||||
if (survival && !Slimefun.hasUnlocked(p, sfitem.getItem(), false) && sfitem.getResearch() != null) {
|
if (survival && !Slimefun.hasUnlocked(p, sfitem.getItem(), false) && sfitem.getResearch() != null) {
|
||||||
if (Slimefun.hasPermission(p, sfitem, false)) {
|
if (Slimefun.hasPermission(p, sfitem, false)) {
|
||||||
final Research research = sfitem.getResearch();
|
final Research research = sfitem.getResearch();
|
||||||
|
|
||||||
menu.addItem(index, new CustomItem(Material.BARRIER, "&r" + StringUtils.formatItemName(sfitem.getItem(), false), "&4&lLOCKED", "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level"));
|
menu.addItem(index, new CustomItem(Material.BARRIER, "&r" + StringUtils.formatItemName(sfitem.getItem(), false), "&4&lLOCKED", "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level"));
|
||||||
menu.addMenuClickHandler(index, (pl, slot, item, action) -> {
|
menu.addMenuClickHandler(index, (pl, slot, item, action) -> {
|
||||||
if (!Research.isResearching(pl)) {
|
if (!Research.isResearching(pl)) {
|
||||||
@ -716,10 +713,8 @@ public final class SlimefunGuide {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
List<String> list = Messages.local.getTranslation("tooltips.item-permission");
|
List<String> tooltip = Messages.local.getTranslation("tooltips.item-permission");
|
||||||
String[] strings = list.toArray(new String[list.size()]);
|
menu.addItem(index, new CustomItem(Material.BARRIER, StringUtils.formatItemName(sfitem.getItem(), false), tooltip.toArray(new String[tooltip.size()])));
|
||||||
CustomItem display = new CustomItem(Material.BARRIER, StringUtils.formatItemName(sfitem.getItem(), false), strings);
|
|
||||||
menu.addItem(index, display);
|
|
||||||
menu.addMenuClickHandler(index, (pl, slot, item, action) -> false);
|
menu.addMenuClickHandler(index, (pl, slot, item, action) -> false);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
@ -745,25 +740,28 @@ public final class SlimefunGuide {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void addToHistory(Player p, Object obj) {
|
public static void addToHistory(Player p, Object obj) {
|
||||||
List<Object> list = new ArrayList<>();
|
LinkedList<Object> list = getHistory().get(p.getUniqueId());
|
||||||
if (getHistory().containsKey(p.getUniqueId())) list = getHistory().get(p.getUniqueId());
|
|
||||||
|
if (list == null) {
|
||||||
|
list = new LinkedList<>();
|
||||||
|
getHistory().put(p.getUniqueId(), list);
|
||||||
|
}
|
||||||
|
|
||||||
list.add(obj);
|
list.add(obj);
|
||||||
getHistory().put(p.getUniqueId(), list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Object getLastEntry(Player p, boolean remove) {
|
private static Object getLastEntry(Player p, boolean remove) {
|
||||||
List<Object> list = new ArrayList<>();
|
LinkedList<Object> history = getHistory().get(p.getUniqueId());
|
||||||
if (getHistory().containsKey(p.getUniqueId())) list = getHistory().get(p.getUniqueId());
|
|
||||||
|
|
||||||
if (remove && !list.isEmpty()) {
|
if (remove && history != null && !history.isEmpty()) {
|
||||||
Object obj = list.get(list.size() - 1);
|
history.removeLast();
|
||||||
list.remove(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list.isEmpty()) getHistory().remove(p.getUniqueId());
|
if (history != null && history.isEmpty()) {
|
||||||
else getHistory().put(p.getUniqueId(), list);
|
getHistory().remove(p.getUniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
return list.isEmpty() ? null: list.get(list.size() - 1);
|
return history == null || history.isEmpty() ? null: history.getLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void displayItem(Player p, final ItemStack item, boolean addToHistory, final boolean book, final int page) {
|
public static void displayItem(Player p, final ItemStack item, boolean addToHistory, final boolean book, final int page) {
|
||||||
@ -834,7 +832,9 @@ public final class SlimefunGuide {
|
|||||||
|
|
||||||
if (addToHistory) addToHistory(p, sfItem != null ? sfItem: item);
|
if (addToHistory) addToHistory(p, sfItem != null ? sfItem: item);
|
||||||
|
|
||||||
if (getHistory().containsKey(p.getUniqueId()) && getHistory().get(p.getUniqueId()).size() > 1) {
|
LinkedList<Object> history = getHistory().get(p.getUniqueId());
|
||||||
|
|
||||||
|
if (history != null && history.size() > 1) {
|
||||||
menu.addItem(0, new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&7\u21E6 Back", "", "&rLeft Click: &7Go back to previous Page", "&rShift + left Click: &7Go back to Main Menu"));
|
menu.addItem(0, new CustomItem(new ItemStack(Material.ENCHANTED_BOOK), "&7\u21E6 Back", "", "&rLeft Click: &7Go back to previous Page", "&rShift + left Click: &7Go back to Main Menu"));
|
||||||
menu.addMenuClickHandler(0, (pl, slot, itemstack, action) -> {
|
menu.addMenuClickHandler(0, (pl, slot, itemstack, action) -> {
|
||||||
if (action.isShiftClicked()) openMainMenu(p, true, book, 1);
|
if (action.isShiftClicked()) openMainMenu(p, true, book, 1);
|
||||||
@ -1021,7 +1021,7 @@ public final class SlimefunGuide {
|
|||||||
menu.open(p);
|
menu.open(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Map<UUID, List<Object>> getHistory() {
|
private static Map<UUID, LinkedList<Object>> getHistory() {
|
||||||
return SlimefunPlugin.getUtilities().guideHistory;
|
return SlimefunPlugin.getUtilities().guideHistory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,8 +82,11 @@ public class BlockListener implements Listener {
|
|||||||
if (mb.getTriggerBlock() == b.getType()) {
|
if (mb.getTriggerBlock() == b.getType()) {
|
||||||
Material[] blocks = mb.getBuild();
|
Material[] blocks = mb.getBuild();
|
||||||
|
|
||||||
if (mb.getTriggerBlock() == blocks[1]) {
|
// Please.
|
||||||
if (
|
// Someone please find a better way to do this...
|
||||||
|
|
||||||
|
if ((
|
||||||
|
mb.getTriggerBlock() == blocks[1] &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b, blocks[0]) &&
|
BlockAdjacents.hasMaterialOnSide(b, blocks[0]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b, blocks[2]) &&
|
BlockAdjacents.hasMaterialOnSide(b, blocks[2]) &&
|
||||||
BlockAdjacents.isMaterial(b.getRelative(BlockFace.DOWN), blocks[4]) &&
|
BlockAdjacents.isMaterial(b.getRelative(BlockFace.DOWN), blocks[4]) &&
|
||||||
@ -92,42 +95,49 @@ public class BlockListener implements Listener {
|
|||||||
BlockAdjacents.isMaterial(b.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN), blocks[7]) &&
|
BlockAdjacents.isMaterial(b.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN), blocks[7]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN), blocks[6]) &&
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN), blocks[6]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN), blocks[8])
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN), blocks[8])
|
||||||
) {
|
&&
|
||||||
if (blocks[0] != null && blocks[0] == blocks[2] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 0, 0), blocks[0]));
|
blocks[0] != null && blocks[0] == blocks[2]
|
||||||
else if (blocks[3] != null && blocks[3] == blocks[5] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, -1, 0), blocks[5]));
|
&& BlockAdjacents.hasMaterialOnBothSides(b, blocks[0]) &&
|
||||||
else if (blocks[6] != null && blocks[6] == blocks[8] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, -2, 0), blocks[8]));
|
blocks[3] != null && blocks[3] == blocks[5]
|
||||||
else multiblocks.add(mb);
|
&& BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, -1, 0), blocks[5]) &&
|
||||||
}
|
blocks[6] != null && blocks[6] == blocks[8]
|
||||||
}
|
&& BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, -2, 0), blocks[8])
|
||||||
else if (mb.getTriggerBlock() == blocks[4] &&
|
) || (
|
||||||
BlockAdjacents.hasMaterialOnSide(b, blocks[3]) &&
|
mb.getTriggerBlock() == blocks[4] &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b, blocks[5]) &&
|
BlockAdjacents.hasMaterialOnSide(b, blocks[3]) &&
|
||||||
BlockAdjacents.isMaterial(b.getRelative(BlockFace.DOWN), blocks[7]) &&
|
BlockAdjacents.hasMaterialOnSide(b, blocks[5]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN), blocks[6]) &&
|
BlockAdjacents.isMaterial(b.getRelative(BlockFace.DOWN), blocks[7]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN), blocks[8]) &&
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN), blocks[6]) &&
|
||||||
BlockAdjacents.isMaterial(b.getRelative(BlockFace.UP), blocks[1]) &&
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.DOWN), blocks[8]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[0]) &&
|
BlockAdjacents.isMaterial(b.getRelative(BlockFace.UP), blocks[1]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[2])
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[0]) &&
|
||||||
) {
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[2])
|
||||||
if (blocks[0] != null && blocks[0] == blocks[2] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 1, 0), blocks[0]));
|
&&
|
||||||
else if (blocks[3] != null && blocks[3] == blocks[5] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 0, 0), blocks[5]));
|
blocks[0] != null && blocks[0] == blocks[2]
|
||||||
else if (blocks[6] != null && blocks[6] == blocks[8] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, -1, 0), blocks[8]));
|
&& BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 1, 0), blocks[0]) &&
|
||||||
else multiblocks.add(mb);
|
blocks[3] != null && blocks[3] == blocks[5]
|
||||||
}
|
&& BlockAdjacents.hasMaterialOnBothSides(b, blocks[5]) &&
|
||||||
else if (mb.getTriggerBlock() == blocks[7] &&
|
blocks[6] != null && blocks[6] == blocks[8]
|
||||||
BlockAdjacents.hasMaterialOnSide(b, blocks[6]) &&
|
&& BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, -1, 0), blocks[8])
|
||||||
BlockAdjacents.hasMaterialOnSide(b, blocks[8]) &&
|
) || (
|
||||||
BlockAdjacents.isMaterial(b.getRelative(BlockFace.UP).getRelative(BlockFace.UP), blocks[1]) &&
|
mb.getTriggerBlock() == blocks[7] &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP).getRelative(BlockFace.UP), blocks[0]) &&
|
BlockAdjacents.hasMaterialOnSide(b, blocks[6]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP).getRelative(BlockFace.UP), blocks[2]) &&
|
BlockAdjacents.hasMaterialOnSide(b, blocks[8]) &&
|
||||||
BlockAdjacents.isMaterial(b.getRelative(BlockFace.UP), blocks[4]) &&
|
BlockAdjacents.isMaterial(b.getRelative(BlockFace.UP).getRelative(BlockFace.UP), blocks[1]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[3]) &&
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP).getRelative(BlockFace.UP), blocks[0]) &&
|
||||||
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[5])
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP).getRelative(BlockFace.UP), blocks[2]) &&
|
||||||
) {
|
BlockAdjacents.isMaterial(b.getRelative(BlockFace.UP), blocks[4]) &&
|
||||||
if (blocks[0] != null && blocks[0] == blocks[2] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 2, 0), blocks[0]));
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[3]) &&
|
||||||
else if (blocks[3] != null && blocks[3] == blocks[5] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 1, 0), blocks[5]));
|
BlockAdjacents.hasMaterialOnSide(b.getRelative(BlockFace.UP), blocks[5])
|
||||||
else if (blocks[6] != null && blocks[6] == blocks[8] && !BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 0, 0), blocks[8]));
|
&&
|
||||||
else multiblocks.add(mb);
|
blocks[0] != null && blocks[0] == blocks[2]
|
||||||
|
&& BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 2, 0), blocks[0]) &&
|
||||||
|
blocks[3] != null && blocks[3] == blocks[5]
|
||||||
|
&& BlockAdjacents.hasMaterialOnBothSides(b.getRelative(0, 1, 0), blocks[5]) &&
|
||||||
|
blocks[6] != null && blocks[6] == blocks[8]
|
||||||
|
&& BlockAdjacents.hasMaterialOnBothSides(b, blocks[8])
|
||||||
|
)) {
|
||||||
|
multiblocks.add(mb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public final class Utilities {
|
|||||||
public final Map<String, String> contributorHeads = new HashMap<>();
|
public final Map<String, String> contributorHeads = new HashMap<>();
|
||||||
public final List<Contributor> contributors = new ArrayList<>();
|
public final List<Contributor> contributors = new ArrayList<>();
|
||||||
|
|
||||||
public final Map<UUID, List<Object>> guideHistory = new HashMap<>();
|
public final Map<UUID, LinkedList<Object>> guideHistory = new HashMap<>();
|
||||||
|
|
||||||
public final List<CargoTransportEvent> cargoTransportEvents = new ArrayList<>();
|
public final List<CargoTransportEvent> cargoTransportEvents = new ArrayList<>();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user