Skip to content

Commit

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

* Add alternative Addon#getIslandManager method (#1797)

We have already done this to the main BentoBox class. But add-ons missed it, and it still has this weird structure: Addon#getIslands().getIslands().

This will just add the same method as it is already in BentoBox class.

* Fix bucket dupe (#1806)

Fix https://discord.com/channels/272499714048524288/310623455462686720/867790395442462760

* Removes unneeded exploit protection code for skulls (#1810)

This no longer seems to be required with 1.17.1

https://github.com/BentoBoxWorld/BSkyBlock/issues/430

* Quote filename of addon that cannot be loaded.

Provides a better understanding of which addon failed.

* Remove update when pasting chest.

Co-authored-by: BONNe <[email protected]>
Co-authored-by: Fredthedoggy <[email protected]>
Co-authored-by: Justin <[email protected]>
Co-authored-by: gecko10000 <[email protected]>
  • Loading branch information
5 people authored Jul 25, 2021
1 parent 376ac16 commit 1a7b7cd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
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.17.1</build.version>
<build.version>1.17.2</build.version>
</properties>

<!-- Profiles will allow to automatically change build version. -->
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/world/bentobox/bentobox/api/addons/Addon.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,16 @@ public PlayersManager getPlayers() {
public IslandsManager getIslands() {
return getPlugin().getIslands();
}

/**
* Get Islands Manager
* @return Islands manager
* @see #getIslands()
* @since 1.17.1
*/
public IslandsManager getIslandsManager() {
return getPlugin().getIslandsManager();
}

/**
* Get the Addon By Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ private void setBlockState(Block block, BlueprintBlock bpBlock) {
}
// Chests, in general
if (bs instanceof InventoryHolder) {
bs.update(true, false);
Inventory ih = ((InventoryHolder)bs).getInventory();
// Double chests are pasted as two blocks so inventory is filled twice. This code stops over filling for the first block.
bpBlock.getInventory().forEach(ih::setItem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.AbstractArrow;
import org.bukkit.entity.ArmorStand;
Expand All @@ -20,7 +19,6 @@
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.vehicle.VehicleDamageEvent;
import org.bukkit.util.BlockIterator;

import world.bentobox.bentobox.api.flags.FlagListener;
import world.bentobox.bentobox.lists.Flags;
Expand Down Expand Up @@ -68,21 +66,6 @@ public void onPlayerInteract(final PlayerInteractEvent e) {
if (!e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
return;
}

// Look along player's sight line to see if any blocks are skulls
try {
BlockIterator iterator = new BlockIterator(e.getPlayer(), 10);
while (iterator.hasNext()) {
Block lastBlock = iterator.next();
if (lastBlock.getType().toString().endsWith("_SKULL") || (lastBlock.getType().toString().endsWith("_HEAD") && !lastBlock.getType().equals(Material.PISTON_HEAD))) {
checkIsland(e, e.getPlayer(), lastBlock.getLocation(), Flags.BREAK_BLOCKS);
return;
}
}
} catch (Exception ignored) {
// We can ignore this exception
}

switch (e.getClickedBlock().getType()) {
case CAKE:
checkIsland(e, e.getPlayer(), e.getClickedBlock().getLocation(), Flags.BREAK_BLOCKS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ private boolean lookForLava(PlayerInteractEvent e) {
user.sendMessage("protection.flags.OBSIDIAN_SCOOPING.scooping");
player.getWorld().playSound(player.getLocation(), Sound.ITEM_BUCKET_FILL_LAVA, 1F, 1F);
b.setType(Material.AIR);
e.setCancelled(true);
Bukkit.getScheduler().runTask(BentoBox.getInstance(), () -> givePlayerLava(player, bucket));
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void loadAddon(@NonNull File f) {
}
} catch (Exception e) {
// We couldn't load the addon, aborting.
plugin.logError("Could not load addon! " + e.getMessage());
plugin.logError("Could not load addon '" + f.getName() + "'. Error is: " + e.getMessage());
plugin.logStacktrace(e);
return;
}
Expand Down

0 comments on commit 1a7b7cd

Please sign in to comment.