Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chunk claim checking to dropoff #35

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ dependencies {
api("com.github.GTNewHorizons:ModularUI:1.2.17:dev")
api("com.github.GTNewHorizons:GTNHLib:0.6.0:dev")

// used for chunk claim checking
compileOnly("com.github.GTNewHorizons:ServerUtilities:2.1.12:dev")

// api("com.github.GTNewHorizons:AdventureBackpack2:1.2.4-GTNH:dev")
compileOnly("com.github.GTNewHorizons:AdventureBackpack2:1.2.4-GTNH:dev")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
import net.minecraft.util.Vec3;
import net.minecraft.world.World;

import com.cleanroommc.bogosorter.compat.loader.Mods;

import serverutils.data.ClaimedChunks;

public class InventoryManager {

private final int SCAN_RADIUS = 4;
Expand Down Expand Up @@ -66,9 +70,15 @@ public <T extends TileEntity & IInventory> List<InventoryData> getNearbyInventor
InventoryData currentInvData;

if (currentEntity instanceof IInventory) {
if (Mods.ServerUtilities.isLoaded()) {
if (ClaimedChunks.blockBlockInteractions(player, x, y, z, 0)) continue;
}
// noinspection unchecked
currentInvData = getInventoryData((T) currentEntity);
} else if (currentEntity instanceof TileEntityEnderChest) {
if (Mods.ServerUtilities.isLoaded()) {
if (ClaimedChunks.blockBlockInteractions(player, x, y, z, 0)) continue;
}
currentInvData = getInventoryData((TileEntityEnderChest) currentEntity);
} else {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public enum Mods {
GalacticraftCore("galacticraftcore"),
AdventureBackpack2("adventurebackpack"),
ProjectE("ProjectE"),
Tconstruct("TConstruct"),;
Tconstruct("TConstruct"),
ServerUtilities("serverutilities");

public final String modid;
private final Supplier<Boolean> supplier;
Expand Down