Skip to content

Commit

Permalink
chore: merge follow up change
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Jan 27, 2024
1 parent 71a3d72 commit 00d2f39
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 674 deletions.
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
<dependency>
<groupId>com.github.starwishsama.dough</groupId>
<artifactId>dough-api</artifactId>
<version>20dcab228c</version>
<version>f266e39d48</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -445,8 +445,15 @@
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.25</version>
<version>6.0.52</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<!-- We don't need any of the dependencies -->
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- TODO: Remove this dependency -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ public void onRightClick(PlayerInteractEvent e) {
return;
}

// Fixes #4087 - Prevents players from interacting with a block that is about to be deleted
// We especially don't want to open inventories as that can cause duplication
if (e.getClickedBlock() != null && Slimefun.getTickerTask().isDeletedSoon(e.getClickedBlock().getLocation())) {
e.setCancelled(true);
return;
}

// Fire our custom Event
PlayerRightClickEvent event = new PlayerRightClickEvent(e);
Bukkit.getPluginManager().callEvent(event);
Expand Down Expand Up @@ -122,7 +115,7 @@ private boolean rightClickBlock(PlayerRightClickEvent event) {
}

boolean interactable =
sfItem.callItemHandler(BlockUseHandler.class, handler -> handler.onRightClick(event));
sfItem.callItemHandler(BlockUseHandler.class, handler -> handler.onRightClick(event));

if (!interactable) {
Player p = event.getPlayer();
Expand Down Expand Up @@ -152,22 +145,22 @@ private void openInventory(Player p, SlimefunItem item, Block clickedBlock, Play
openMenu(blockData.getBlockMenu(), clickedBlock, p);
} else {
Slimefun.getDatabaseManager()
.getBlockDataController()
.loadBlockDataAsync(blockData, new IAsyncReadCallback<>() {
@Override
public boolean runOnMainThread() {
return true;
.getBlockDataController()
.loadBlockDataAsync(blockData, new IAsyncReadCallback<>() {
@Override
public boolean runOnMainThread() {
return true;
}

@Override
public void onResult(SlimefunBlockData result) {
if (!p.isOnline()) {
return;
}

@Override
public void onResult(SlimefunBlockData result) {
if (!p.isOnline()) {
return;
}

openMenu(result.getBlockMenu(), clickedBlock, p);
}
});
openMenu(result.getBlockMenu(), clickedBlock, p);
}
});
}
}
} catch (Exception | LinkageError x) {
Expand All @@ -184,4 +177,4 @@ private void openMenu(BlockMenu menu, Block b, Player p) {
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.thebusybiscuit.slimefun4.implementation.setup;

import io.github.thebusybiscuit.slimefun4.api.events.SlimefunItemRegistryFinalizedEvent;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public PlayerData loadPlayerData(@Nonnull UUID uuid) {
items.put(i, playerFile.getItem("backpacks." + key + ".contents." + i));
}

PlayerBackpack backpack = PlayerBackpack.load(uuid, id, size, items);
//PlayerBackpack backpack = PlayerBackpack.load(uuid, id, size, items);

backpacks.put(id, backpack);
// backpacks.put(id, backpack);
} catch (Exception x) {
Slimefun.logger().log(Level.WARNING, x, () -> "Could not load Backpack \"" + key + "\" for Player \"" + uuid + '"');
}
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 00d2f39

Please sign in to comment.