Skip to content

Commit 7ade50f

Browse files
Tigerpanzer02version-bump[github-action]
andauthored
#patch 5.1.2 Fixed InventoryView and Vehicles (#110)
* Bump version from 5.1.1 to 5.1.1-SNAPSHOT0 * Fixed vehicle moving outside of arena plots and other worlds! * Fixed InventoryView not interface onItemMove * Fixed Method 'org.bukkit.block.banner.PatternType[] org.bukkit.block.banner.PatternType.values()' must be Methodref constant * Fixed InventoryView not interface on getGui @VoteMenu * Bump version from 5.1.1-SNAPSHOT0 to 5.1.1-SNAPSHOT1 * Updated CHANGELOG.md * Bump version from 5.1.1-SNAPSHOT1 to 5.1.1-SNAPSHOT2 --------- Co-authored-by: version-bump[github-action] <41898282+version-bump[github-action]@users.noreply.github.com>
1 parent bd12269 commit 7ade50f

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

.github/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ deploy webhooks to print changelog successfully
1010

1111
That's all, matcher will stop when detects next line started with `###` match
1212

13+
### 5.1.2 Release
14+
* Fixed InventoryView not interface on getGui @VoteMenu
15+
* Fixed Method 'org.bukkit.block.banner.PatternType[] org.bukkit.block.banner.PatternType.values()' must be Methodref constant
16+
* Fixed InventoryView not interface onItemMove
17+
* Fixed vehicle moving outside of arena plots and other worlds
18+
1319
### 5.1.1 Release
1420
* Fixed liquid flow outside plots and different worlds
1521
* Fixed forceplay console command without theme

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<groupId>plugily.projects</groupId>
2828
<artifactId>buildbattle</artifactId>
29-
<version>5.1.1</version>
29+
<version>5.1.1-SNAPSHOT2</version>
3030
<name>BuildBattle</name>
3131

3232
<properties>

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import plugily.projects.minigamesbox.classic.utils.version.events.api.PlugilyPlayerPickupArrow;
5656
import plugily.projects.minigamesbox.classic.utils.version.xseries.XEntityType;
5757
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
58+
import plugily.projects.minigamesbox.classic.utils.version.xseries.inventory.XInventoryView;
5859

5960
/**
6061
* @author Plajer
@@ -296,8 +297,6 @@ public void onEnderchestClick(PlugilyPlayerInteractEvent event) {
296297
}
297298
}
298299

299-
//TODO recognise plot by location should be added, as current check will go through all plots...
300-
//Alternative use filter!!
301300
@EventHandler
302301
public void onVehicleMove(VehicleMoveEvent event) {
303302
Vehicle vehicle = event.getVehicle();
@@ -306,13 +305,14 @@ public void onVehicleMove(VehicleMoveEvent event) {
306305
continue;
307306
}
308307
for(Plot buildPlot : ((BaseArena) arena).getPlotManager().getPlots()) {
309-
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isIn(event.getTo())) {
308+
if(buildPlot.getCuboid() != null && buildPlot.getCuboid().isIn(event.getFrom()) && !buildPlot.getCuboid().isInWithMarge(event.getTo(), 1)) {
310309
vehicle.setVelocity(vehicle.getVelocity().zero());
311310
if(vehicle.getType() == XEntityType.MINECART.get()) {
312311
((Minecart) vehicle).setMaxSpeed(0);
313312
} else {
314313
vehicle.remove();
315314
}
315+
return;
316316
}
317317
}
318318
}
@@ -329,6 +329,7 @@ public void onIgniteEvent(BlockIgniteEvent event) {
329329
for(Plot buildPlot : ((BaseArena) arena).getPlotManager().getPlots()) {
330330
if(buildPlot.getCuboid() != null && buildPlot.getCuboid().isInWithMarge(blockLocation, 5)) {
331331
event.setCancelled(true);
332+
return;
332333
}
333334
}
334335
}
@@ -346,6 +347,7 @@ public void onPistonRetractEvent(BlockPistonRetractEvent event) {
346347
for(Block block : event.getBlocks()) {
347348
if(buildPlot.getCuboid() != null && !buildPlot.getCuboid().isInWithMarge(block.getLocation(), -1) && buildPlot.getCuboid().isIn(blockLocation)) {
348349
event.setCancelled(true);
350+
return;
349351
}
350352
}
351353
}
@@ -662,8 +664,8 @@ public void onItemMove(InventoryClickEvent event) {
662664

663665
if(baseArena != null && baseArena.getArenaState() != IArenaState.IN_GAME) {
664666
if(event.getClickedInventory() == humanEntity.getInventory()) {
665-
if(event.getView().getType() == InventoryType.CRAFTING
666-
|| event.getView().getType() == InventoryType.PLAYER) {
667+
if(XInventoryView.of(event.getView()).getType() == InventoryType.CRAFTING
668+
|| XInventoryView.of(event.getView()).getType() == InventoryType.PLAYER) {
667669
event.setResult(Event.Result.DENY);
668670
}
669671
}

src/main/java/plugily/projects/buildbattle/handlers/menu/registry/banner/BannerMenu.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import plugily.projects.minigamesbox.classic.utils.helper.ItemBuilder;
3535
import plugily.projects.minigamesbox.classic.utils.version.ServerVersion;
3636
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
37+
import plugily.projects.minigamesbox.classic.utils.version.xseries.XPatternType;
3738
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
3839
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
3940

@@ -104,17 +105,17 @@ private void prepareBaseStageGui() {
104105
private void prepareLayerStageGui() {
105106
NormalFastInv gui = new NormalFastInv(54, new MessageBuilder("MENU_OPTION_CONTENT_BANNER_INVENTORY_LAYER").asKey().build());
106107

107-
for(PatternType pattern : PatternType.values()) {
108+
for(XPatternType pattern : XPatternType.getValues()) {
108109
ItemStack item = banner.buildBanner();
109110
BannerMeta meta = (BannerMeta) item.getItemMeta();
110111
DyeColor color = banner.getColor() == DyeColor.BLACK ? DyeColor.WHITE : DyeColor.BLACK;
111112

112-
meta.addPattern(new Pattern(color, pattern));
113+
meta.addPattern(new Pattern(color, pattern.get()));
113114
item.setItemMeta(meta);
114115

115116
gui.addItem(new SimpleClickableItem(item, event -> {
116117
event.setCancelled(true);
117-
banner.addPattern(new BannerPattern(color, pattern));
118+
banner.addPattern(new BannerPattern(color, pattern.get()));
118119
new BannerMenu(player, banner).openInventory(PatternStage.LAYER_COLOR);
119120
}));
120121
}

src/main/java/plugily/projects/buildbattle/handlers/themes/vote/VoteMenu.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import plugily.projects.minigamesbox.classic.utils.version.xseries.XEnchantment;
4040
import plugily.projects.minigamesbox.classic.utils.version.xseries.XItemFlag;
4141
import plugily.projects.minigamesbox.classic.utils.version.xseries.XMaterial;
42+
import plugily.projects.minigamesbox.classic.utils.version.xseries.inventory.XInventoryView;
4243
import plugily.projects.minigamesbox.inventory.common.item.ClickableItem;
4344
import plugily.projects.minigamesbox.inventory.common.item.SimpleClickableItem;
4445
import plugily.projects.minigamesbox.inventory.normal.NormalFastInv;
@@ -103,7 +104,7 @@ private NormalFastInv getGUI(Player guiPlayer) {
103104
HumanEntity humanEntity = event.getPlayer();
104105
Inventory inventory = event.getInventory();
105106

106-
if(humanEntity.getOpenInventory().getTopInventory() != inventory) {
107+
if(XInventoryView.of(humanEntity.getOpenInventory()).getTopInventory() != inventory) {
107108
humanEntity.openInventory(inventory);
108109
}
109110
});

0 commit comments

Comments
 (0)