Skip to content

Commit

Permalink
Release 1.18.1 (#1886)
Browse files Browse the repository at this point in the history
* Version 1.18.1

* Added snapshot repo to Maven info.

* Fixes console teleporting.

#1877

* Address potential NPE's

* Preveent NPEs and other items.

* Remove dead paper forks (#1884)

Tuinity has since merged with Paper, and is now not a valid fork

Airplane is shutting down / not updating to 1.18.x

* Added toString to resolve issue with arrays

* Fix minor JavaDoc mistake

Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com>
  • Loading branch information
tastybento and Fredthedoggy committed Dec 5, 2021
1 parent df2b445 commit 11a3bf9
Show file tree
Hide file tree
Showing 19 changed files with 173 additions and 350 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ BentoBox uses Maven, and its Maven repository is kindly provided by [CodeMC](htt
### Maven
```xml
<repositories>
<repository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.org/repository/maven-snapshots</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.18.0</build.version>
<build.version>1.18.1</build.version>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ public boolean execute(User user, String label, List<String> args) {
// Otherwise, ask the admin to go to a safe spot
String failureMessage = user.getTranslation("commands.admin.tp.manual", "[location]", warpSpot.getBlockX() + " " + warpSpot.getBlockY() + " "
+ warpSpot.getBlockZ());

Player player = user.getPlayer();
// Set the player
Player player = args.size() == 2 ? userToTeleport.getPlayer() : user.getPlayer();
if (args.size() == 2) {
player = userToTeleport.getPlayer();
failureMessage = userToTeleport.getTranslation(NOT_SAFE);
}

Expand All @@ -112,6 +111,7 @@ public boolean execute(User user, String label, List<String> args) {
.entity(player)
.location(warpSpot)
.failureMessage(failureMessage)
.thenRun(() -> user.sendMessage("general.success"))
.build();
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
package world.bentobox.bentobox.api.panels.reader;


import java.util.Arrays;
import java.util.Objects;

import org.bukkit.inventory.ItemStack;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
Expand All @@ -28,11 +31,11 @@
* @since 1.17.3
*/
public record PanelTemplateRecord(Panel.Type type,
@Nullable String title,
@Nullable TemplateItem border,
@Nullable TemplateItem background,
boolean[] forcedRows,
@NonNull ItemTemplateRecord[][] content)
@Nullable String title,
@Nullable TemplateItem border,
@Nullable TemplateItem background,
boolean[] forcedRows,
@NonNull ItemTemplateRecord[][] content)
{
/**
* Instantiates a new Panel template record with empty content.
Expand Down Expand Up @@ -76,4 +79,43 @@ public TemplateItem(ItemStack icon)
this(icon, null, null);
}
}


@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Arrays.deepHashCode(content);
result = prime * result + Arrays.hashCode(forcedRows);
result = prime * result + Objects.hash(background, border, title, type);
return result;
}


@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof PanelTemplateRecord)) {
return false;
}
PanelTemplateRecord other = (PanelTemplateRecord) obj;
return Objects.equals(background, other.background) && Objects.equals(border, other.border)
&& Arrays.deepEquals(content, other.content) && Arrays.equals(forcedRows, other.forcedRows)
&& Objects.equals(title, other.title) && type == other.type;
}


@Override
public String toString() {
return "PanelTemplateRecord {type=" + type +
", title=" + title +
", border=" + border +
", background=" + background +
", forcedRows=" + Arrays.toString(forcedRows) +
", content=" + Arrays.toString(content) + "}";
}


}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void setPlayerUUID(UUID uuid) {
/**
* Clears all home Locations in world
* @param world - world
* @deprecated Home locations are no longer stored for players. Use {@link IslandManager}
* @deprecated Home locations are no longer stored for players. Use {@link world.bentobox.bentobox.managers.IslandsManager}
*/
@Deprecated(since="1.18.0", forRemoval=true)
public void clearHomeLocations(World world) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public boolean onClick(Panel panel, User user, ClickType clickType, int slot) {

// Get the user's island
Island island = plugin.getIslands().getIsland(panel.getWorld().orElse(user.getWorld()), user.getUniqueId());
if (island == null || !island.getOwner().equals(user.getUniqueId())) {
if (island == null || island.getOwner() == null || !island.getOwner().equals(user.getUniqueId())) {
user.sendMessage("general.errors.not-owner");
user.getPlayer().playSound(user.getLocation(), Sound.BLOCK_METAL_HIT, 1F, 1F);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ public void onFishing(PlayerFishEvent e) {
if (this.PVPAllowed(c.getLocation())) {
return;
}
// Is PVP allowed here?
if (this.PVPAllowed(e.getCaught().getLocation())) {
return;
}
// Protect visitors
if (protectedVisitor(c)) {
User.getInstance(e.getPlayer()).notify(Flags.INVINCIBLE_VISITORS.getHintReference());
Expand Down

0 comments on commit 11a3bf9

Please sign in to comment.