Skip to content

Commit 30d5da2

Browse files
Tigerpanzer02version-bump[github-action]
andauthored
#patch MC 26 (#83)
* Bump version from 2.1.7 to 2.1.7-SNAPSHOT0 * Fixed block recreation on bridge on legacy versions (colouring) * Fixed ICCE InventoryView * Adjusted setting of how blocks are getting replaced in inventory to fix legacy coloured issues * Updated Minigamesbox & CHANGELOG.md * Bump version from 2.1.7-SNAPSHOT0 to 2.1.7-SNAPSHOT1 * Added more information for arena cuboid setup * Bump version from 2.1.7-SNAPSHOT1 to 2.1.7-SNAPSHOT2 --------- Co-authored-by: version-bump[github-action] <41898282+version-bump[github-action]@users.noreply.github.com>
1 parent 5c54ea8 commit 30d5da2

7 files changed

Lines changed: 64 additions & 29 deletions

File tree

.github/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
### 2.1.8 Release (13.05.2026)
2+
* Fixed block replacement (on bridge) and in inventory for legacy versions
3+
* Fixed InventoryView Error
4+
* Added a Base Validation check on Arena Border if already present
5+
* Updated to MinigamesBox 1.4.6
6+
17
### 2.1.7 Release (17.01.2026)
28
* Updated to MinigamesBox 1.4.5
39

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<groupId>plugily.projects</groupId>
99
<artifactId>thebridge</artifactId>
10-
<version>2.1.7</version>
10+
<version>2.1.7-SNAPSHOT2</version>
1111
<name>TheBridge</name>
1212

1313
<properties>
@@ -58,7 +58,7 @@
5858
<dependency>
5959
<groupId>plugily.projects</groupId>
6060
<artifactId>MiniGamesBox-Classic</artifactId>
61-
<version>1.4.5</version>
61+
<version>1.4.6</version>
6262
<scope>compile</scope>
6363
<optional>true</optional>
6464
</dependency>

src/main/java/plugily/projects/thebridge/arena/Arena.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.bukkit.block.Block;
2626
import org.bukkit.entity.Player;
2727
import org.bukkit.potion.PotionEffect;
28-
import org.bukkit.potion.PotionEffectType;
2928
import org.jetbrains.annotations.Nullable;
3029
import plugily.projects.minigamesbox.api.arena.IArenaState;
3130
import plugily.projects.minigamesbox.classic.arena.PluginArena;
@@ -63,7 +62,7 @@ public class Arena extends PluginArena {
6362
private final ArrayList<Block> placedBlocks = new ArrayList<>();
6463

6564
private List<Cuboid> bridgeCuboid;
66-
private final HashMap<Location, Material> brokenBlocks = new HashMap<>();
65+
private final HashMap<Location, XMaterial> brokenBlocks = new HashMap<>();
6766

6867
private final HashMap<Player, Player> hits = new HashMap<>();
6968
private int resetRound = 0;
@@ -350,10 +349,10 @@ public void addBridgeCuboid(Cuboid cuboid) {
350349
this.bridgeCuboid.add(cuboid);
351350
}
352351

353-
public HashMap<Location, Material> getBrokenBlocks() {
352+
public HashMap<Location, XMaterial> getBrokenBlocks() {
354353
return brokenBlocks;
355354
}
356-
public void addBrokenBlock(Location location, Material material) {
355+
public void addBrokenBlock(Location location, XMaterial material) {
357356
this.brokenBlocks.put(location, material);
358357
}
359358

@@ -365,7 +364,7 @@ public void resetPlacedBlocks() {
365364
}
366365

367366
public void resetBrokenBlocks() {
368-
brokenBlocks.forEach((location, material) -> XBlock.setType(location.getBlock(), XMaterial.matchXMaterial(material)));
367+
brokenBlocks.forEach((location, material) -> XBlock.setType(location.getBlock(), material));
369368
brokenBlocks.clear();
370369
}
371370

src/main/java/plugily/projects/thebridge/arena/ArenaEvents.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@
4444
import plugily.projects.minigamesbox.classic.utils.version.VersionUtils;
4545
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyEntityPickupItemEvent;
4646
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerPickupArrow;
47+
import plugily.projects.minigamesbox.classic.utils.version.xseries.XBlock;
4748
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
4849
import plugily.projects.minigamesbox.classic.utils.version.xseries.XSound;
50+
import plugily.projects.minigamesbox.classic.utils.version.xseries.inventory.XInventoryView;
4951
import plugily.projects.thebridge.Main;
5052
import plugily.projects.thebridge.arena.base.Base;
5153
import plugily.projects.thebridge.arena.managers.ScoreboardManager;
@@ -114,7 +116,7 @@ public void onBlockBreakEvent(BlockBreakEvent event) {
114116
// Only add blocks to the list if the block is not found to be in the broken blocks list
115117
// Making it so that resetting placed blocks and resetting broken blocks will not tamper with each other
116118
if(!arena.getBrokenBlocks().containsKey(event.getBlock().getLocation())) {
117-
arena.addBrokenBlock(event.getBlock().getLocation(), event.getBlock().getType());
119+
arena.addBrokenBlock(event.getBlock().getLocation(), XBlock.getType(event.getBlock()));
118120
}
119121
} else {
120122
new MessageBuilder("IN_GAME_MESSAGES_ARENA_BUILD_BREAK")
@@ -613,8 +615,8 @@ public void onItemMove(InventoryClickEvent event) {
613615
if(plugin.getArenaRegistry().getArena(((Player) event.getWhoClicked())).getArenaState()
614616
!= IArenaState.IN_GAME) {
615617
if(event.getClickedInventory() == event.getWhoClicked().getInventory()) {
616-
if(event.getView().getType() == InventoryType.CRAFTING
617-
|| event.getView().getType() == InventoryType.PLAYER) {
618+
if(XInventoryView.of(event.getView()).getType() == InventoryType.CRAFTING
619+
|| XInventoryView.of(event.getView()).getType() == InventoryType.PLAYER) {
618620
event.setResult(Event.Result.DENY);
619621
}
620622
}

src/main/java/plugily/projects/thebridge/handlers/setup/LocationCategory.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@
2020

2121
package plugily.projects.thebridge.handlers.setup;
2222

23+
import plugily.projects.minigamesbox.classic.handlers.language.MessageBuilder;
2324
import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginLocationCategory;
2425
import plugily.projects.minigamesbox.classic.handlers.setup.items.category.LocationItem;
2526
import plugily.projects.minigamesbox.classic.handlers.setup.items.category.LocationSelectorItem;
27+
import plugily.projects.minigamesbox.classic.utils.dimensional.Cuboid;
2628
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
29+
import plugily.projects.minigamesbox.classic.utils.serialization.LocationSerializer;
2730
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
2831
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
2932

@@ -42,7 +45,19 @@ public void addItems(NormalFastInv gui) {
4245
gui.setItem((getInventoryLine() * 9) + 4, midLocation);
4346
getItemList().add(midLocation);
4447

45-
LocationSelectorItem arenaBorder = new LocationSelectorItem(getSetupInventory(), new ItemBuilder(XMaterial.BEDROCK.parseMaterial()), "Arena", "Location where all bases and lines are in \n (players will be able to build inside) \n MAKE SURE TO SET IT OUTSIDE \n OF THE BASES WHICH YOU SET BEFORE!", "arenalocation");
48+
LocationSelectorItem arenaBorder = new LocationSelectorItem(getSetupInventory(), new ItemBuilder(XMaterial.BEDROCK.parseMaterial()), "Arena Cuboid/Border", "Location where all bases and lines are in \n (players will be able to build inside) \n MAKE SURE TO SET IT OUTSIDE \n OF THE BASES (Baselocations) WHICH YOU SET BEFORE!", "arenalocation", inventoryClickEvent -> {
49+
String path = "instances." + getSetupInventory().getArenaKey();
50+
if(getSetupInventory().getConfig().getString(path + ".arenalocation.1") != null && getSetupInventory().getConfig().getString(path + ".arenalocation.2") != null) {
51+
Cuboid arenaCuboid = new Cuboid(LocationSerializer.getLocation(getSetupInventory().getConfig().getString(path + ".arenalocation.1", "world,364.0,63.0,-72.0,0.0,0.0")), LocationSerializer.getLocation(getSetupInventory().getConfig().getString(path + ".arenalocation.2", "world,364.0,63.0,-72.0,0.0,0.0")));
52+
for(String bases : getSetupInventory().getConfig().getConfigurationSection("instances." + getSetupInventory().getArenaKey() + ".bases").getKeys(false)) {
53+
if(getSetupInventory().getConfig().getString(path + "." + bases + ".baselocation.1") != null && getSetupInventory().getConfig().getString(path + "." + bases + ".baselocation.2") != null) {
54+
if(!(arenaCuboid.isIn(LocationSerializer.getLocation(getSetupInventory().getConfig().getString(path + "." + bases + ".baselocation.1"))) && arenaCuboid.isIn(LocationSerializer.getLocation(getSetupInventory().getConfig().getString(path + "." + bases + ".baselocation.2"))))) {
55+
new MessageBuilder("&c&l✘ &cArena validation failed! Please set your arena cuboids outside your base cuboids! The arena needs to be bigger than your bases locations! The following base is not inside the arena cuboid: " + bases).prefix().player(getSetupInventory().getPlayer()).sendPlayer();
56+
}
57+
}
58+
}
59+
}
60+
});
4661
gui.setItem((getInventoryLine() * 9) + 5, arenaBorder);
4762
getItemList().add(arenaBorder);
4863
}

src/main/java/plugily/projects/thebridge/handlers/setup/components/BasePage.java

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ public Prompt acceptInput(ConversationContext context, String input) {
6969
NormalFastInv pagedGui = new BasePage(9, setupInventory.getPlugin().getPluginMessagePrefix() + "Base Editor Menu", setupInventory);
7070
pagedGui.open(setupInventory.getPlayer());
7171
return Prompt.END_OF_CONVERSATION;
72-
} catch (IllegalArgumentException ignored) {
72+
} catch(IllegalArgumentException ignored) {
7373
context.getForWhom().sendRawMessage(new MessageBuilder("&cTry again. This is not an color!").prefix().build());
7474
return Prompt.END_OF_CONVERSATION;
7575
}
7676
}
7777
}).buildFor((Player) event.getWhoClicked());
7878
}));
7979

80-
LocationSelectorItem baseCorners = new LocationSelectorItem(setupInventory, new ItemBuilder(XMaterial.BEDROCK.parseMaterial()), "Base", "Set the corners of one base", "bases." + getId(setupInventory.getPlayer()) + ".baselocation");
80+
LocationSelectorItem baseCorners = new LocationSelectorItem(setupInventory, new ItemBuilder(XMaterial.BEDROCK.parseMaterial()), "Base", "Set the corners of one base", "bases." + getId(setupInventory.getPlayer()) + ".baselocation");
8181
setItem(1, baseCorners);
8282

8383
//portal in mid function? LocationSerializer.saveLoc(setupInventory.getPlugin(), setupInventory.getConfig(), "arenas", "instances." + setupInventory.getArenaKey() + ".bases." + getId(setupInventory.getPlayer()) + ".portalhologram", new Cuboid(selection.getFirstPos(), selection.getSecondPos()).getCenter().add(0, 2, 0));
@@ -103,30 +103,41 @@ public Prompt acceptInput(ConversationContext context, String input) {
103103
.lore(ChatColor.GREEN + "Click to finish & save the setup of this base")
104104
.build(), event -> {
105105
String path = "instances." + setupInventory.getArenaKey() + ".bases." + getId(setupInventory.getPlayer());
106-
if (setupInventory.getConfig().get(path + ".baselocation.1") == null) {
106+
if(setupInventory.getConfig().get(path + ".baselocation.1") == null) {
107107
new MessageBuilder("&c&l✘ &cBase validation failed! Please configure base location properly!").prefix().player(setupInventory.getPlayer()).sendPlayer();
108108
return;
109109
}
110-
if (setupInventory.getConfig().get(path + ".portallocation.1") == null) {
110+
if(setupInventory.getConfig().get(path + ".portallocation.1") == null) {
111111
new MessageBuilder("&c&l✘ &cBase validation failed! Please configure portal location properly!").prefix().player(setupInventory.getPlayer()).sendPlayer();
112112
return;
113113
}
114-
if (setupInventory.getConfig().get(path + ".spawnpoint") == null) {
114+
if(setupInventory.getConfig().get(path + ".spawnpoint") == null) {
115115
new MessageBuilder("&c&l✘ &cBase validation failed! Please configure spawnpoint properly!").prefix().player(setupInventory.getPlayer()).sendPlayer();
116116
return;
117117
}
118-
if (setupInventory.getConfig().get(path + ".respawnpoint") == null) {
118+
if(setupInventory.getConfig().get(path + ".respawnpoint") == null) {
119119
new MessageBuilder("&c&l✘ &cBase validation failed! Please configure respawnpoint properly!").prefix().player(setupInventory.getPlayer()).sendPlayer();
120120
return;
121121
}
122-
if (setupInventory.getConfig().get(path + ".color") == null) {
122+
if(setupInventory.getConfig().get(path + ".color") == null) {
123123
new MessageBuilder("&c&l✘ &cBase validation failed! Please configure color properly!").prefix().player(setupInventory.getPlayer()).sendPlayer();
124124
return;
125125
}
126-
if (setupInventory.getConfig().get(path + ".portalhologram") == null) {
126+
if(setupInventory.getConfig().get(path + ".portalhologram") == null) {
127127
new MessageBuilder("&c&l✘ &cBase validation failed! Please configure portalhologram properly!").prefix().player(setupInventory.getPlayer()).sendPlayer();
128128
return;
129129
}
130+
if(setupInventory.getConfig().get(path + ".portalhologram") == null) {
131+
new MessageBuilder("&c&l✘ &cBase validation failed! Please configure portalhologram properly!").prefix().player(setupInventory.getPlayer()).sendPlayer();
132+
return;
133+
}
134+
if(setupInventory.getConfig().getString("instances." + setupInventory.getArenaKey() + ".arenalocation.1") != null && setupInventory.getConfig().getString("instances." + setupInventory.getArenaKey() + ".arenalocation.2") != null) {
135+
Cuboid arenaBorder = new Cuboid(LocationSerializer.getLocation(setupInventory.getConfig().getString("instances." + setupInventory.getArenaKey() + ".arenalocation.1", "world,364.0,63.0,-72.0,0.0,0.0")), LocationSerializer.getLocation(setupInventory.getConfig().getString("instances." + setupInventory.getArenaKey() + ".arenalocation.2", "world,364.0,63.0,-72.0,0.0,0.0")));
136+
if(!(arenaBorder.isIn(LocationSerializer.getLocation(setupInventory.getConfig().getString(path + ".baselocation.1"))) && arenaBorder.isIn(LocationSerializer.getLocation(setupInventory.getConfig().getString(path + ".baselocation.2"))))) {
137+
new MessageBuilder("&c&l✘ &cBase validation failed! Please set your base cuboids (baselocation.1 and baselocation.2) inside your arena cuboid (Main Setup Menu of Arena -> Arena)!").prefix().player(setupInventory.getPlayer()).sendPlayer();
138+
return;
139+
}
140+
}
130141
new MessageBuilder("&a&l✔ &aValidation succeeded! Registering new base: " + getId(setupInventory.getPlayer())).prefix().player(setupInventory.getPlayer()).sendPlayer();
131142
setupInventory.setConfig("bases." + getId(setupInventory.getPlayer()) + ".isdone", true);
132143
Base base = new Base(
@@ -139,13 +150,13 @@ public Prompt acceptInput(ConversationContext context, String input) {
139150
LocationSerializer.getLocation(setupInventory.getConfig().getString(path + ".portallocation.2")),
140151
setupInventory.getConfig().getInt(path + ".maximumsize")
141152
);
142-
if (setupInventory.getConfig().get(path + ".cagelocation.1") != null && setupInventory.getConfig().get(path + ".cagelocation.2") != null) {
153+
if(setupInventory.getConfig().get(path + ".cagelocation.1") != null && setupInventory.getConfig().get(path + ".cagelocation.2") != null) {
143154
base.setCageCuboid(new Cuboid(LocationSerializer.getLocation(setupInventory.getConfig().getString(path + ".cagelocation.1")), LocationSerializer.getLocation(setupInventory.getConfig().getString(path + ".cagelocation.2"))));
144155
}
145156
Arena arena = (Arena) setupInventory.getPlugin().getArenaRegistry().getArena(setupInventory.getArenaKey());
146157
arena.addBase(base);
147158
ArmorStandHologram portal = new ArmorStandHologram(setupInventory.getPlugin().getBukkitHelper().getBlockCenter(LocationSerializer.getLocation(setupInventory.getConfig().getString(path + ".portalhologram"))));
148-
for (String str : setupInventory.getPlugin().getLanguageManager().getLanguageMessage(setupInventory.getPlugin().getMessageManager().getPath("IN_GAME_MESSAGES_ARENA_PORTAL_HOLOGRAM")).split(";")) {
159+
for(String str : setupInventory.getPlugin().getLanguageManager().getLanguageMessage(setupInventory.getPlugin().getMessageManager().getPath("IN_GAME_MESSAGES_ARENA_PORTAL_HOLOGRAM")).split(";")) {
149160
portal.appendLine(str.replace("%arena_base_color_formatted%", base.getFormattedColor()));
150161
}
151162
base.setArmorStandHologram(portal);
@@ -167,14 +178,14 @@ String getPromptText(ConversationContext context) {
167178

168179
@Override
169180
public Prompt acceptInput(ConversationContext context, String input) {
170-
if (!NumberUtils.isInteger(input)) {
181+
if(!NumberUtils.isInteger(input)) {
171182
context.getForWhom().sendRawMessage(new MessageBuilder("&cTry again. Its not a number!").prefix().build());
172183
return Prompt.END_OF_CONVERSATION;
173184
}
174185
int number = Integer.parseInt(input);
175186

176-
if (setupInventory.getConfig().getConfigurationSection("instances." + setupInventory.getArenaKey() + ".bases") != null) {
177-
if (number >= setupInventory.getConfig().getConfigurationSection("instances." + setupInventory.getArenaKey() + ".bases").getKeys(false).size()) {
187+
if(setupInventory.getConfig().getConfigurationSection("instances." + setupInventory.getArenaKey() + ".bases") != null) {
188+
if(number >= setupInventory.getConfig().getConfigurationSection("instances." + setupInventory.getArenaKey() + ".bases").getKeys(false).size()) {
178189
context.getForWhom().sendRawMessage(new MessageBuilder("&cTry again. The number is higher than bases that you have!").prefix().build());
179190
return Prompt.END_OF_CONVERSATION;
180191
}
@@ -195,9 +206,9 @@ public Prompt acceptInput(ConversationContext context, String input) {
195206

196207

197208
public int getId(Player player) {
198-
if (!BaseUtilities.check(player)) {
209+
if(!BaseUtilities.check(player)) {
199210
int id = 0;
200-
if (setupInventory.getConfig().getConfigurationSection("instances." + setupInventory.getArenaKey() + ".bases") != null) {
211+
if(setupInventory.getConfig().getConfigurationSection("instances." + setupInventory.getArenaKey() + ".bases") != null) {
201212
id = setupInventory.getConfig().getConfigurationSection("instances." + setupInventory.getArenaKey() + ".bases").getKeys(false).size();
202213
}
203214
BaseUtilities.getBaseId().put(player, id);

src/main/java/plugily/projects/thebridge/kits/KitUtils.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ public static ItemStack handleItem(PluginMain plugin, Player player, ItemStack i
2727
plugin.getDebugger().performance("Kit", "Arena {0} Handle item method called for player {1} item stack {2}.", arena.getId(), player, itemStack);
2828

2929
// Replaces white terracotta with coloured terracotta if the player is in a team
30-
if(itemStack.getType().equals(XMaterial.matchXMaterial(plugin.getConfig().getString("Kit.Colored-Block-Replace-Material", "WHITE_WOOL")).orElse(XMaterial.WHITE_WOOL).parseMaterial())) {
30+
if(XMaterial.matchXMaterial(plugin.getConfig().getString("Kit.Colored-Block-Replace-Material", "WHITE_WOOL")).orElse(XMaterial.WHITE_WOOL).isSimilar(itemStack)) {
3131
Optional<XMaterial> material = XMaterial.matchXMaterial(arena.getBase(player).getMaterialColor().toUpperCase() + "_" + plugin.getConfig().getString("Kit.Colored-Block-Material", "WOOL"));
32-
material.ifPresent(xMaterial -> itemStack.setType(Objects.requireNonNull(xMaterial.parseMaterial())));
32+
material.ifPresent(xMaterial -> {
33+
xMaterial.setType(itemStack);
34+
});
3335
plugin.getDebugger().performance("Kit", "Arena {0} Changing coloured block to {1}.", arena.getId(), arena.getBase(player).getMaterialColor().toUpperCase() + "_" + plugin.getConfig().getString("Kit.Colored-Block-Material", "WOOL"));
3436
return itemStack;
3537
}
3638

3739
// Replaces leather armour with the coloured leather armour if the player is in a team
38-
if(itemStack.getType().equals(XMaterial.LEATHER_HELMET.parseMaterial()) || itemStack.getType().equals(XMaterial.LEATHER_CHESTPLATE.parseMaterial()) || itemStack.getType().equals(XMaterial.LEATHER_LEGGINGS.parseMaterial()) || itemStack.getType().equals(XMaterial.LEATHER_BOOTS.parseMaterial())) {
40+
if(XMaterial.LEATHER_HELMET.isSimilar(itemStack) || XMaterial.LEATHER_CHESTPLATE.isSimilar(itemStack) || XMaterial.LEATHER_LEGGINGS.isSimilar(itemStack) || XMaterial.LEATHER_BOOTS.isSimilar(itemStack)) {
3941
LeatherArmorMeta itemMeta = (LeatherArmorMeta) itemStack.getItemMeta();
4042
assert itemMeta != null;
4143
itemMeta.setColor(ColorUtil.fromChatColor(ChatColor.valueOf(arena.getBase(player).getColor().toUpperCase())));

0 commit comments

Comments
 (0)