Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.biom4st3r.dynocaps;
- import com.biom4st3r.dynocaps.components.IDynocapComponent;
- import com.jamieswhiteshirt.rtree3i.Entry;
- import com.jamieswhiteshirt.rtree3i.Selection;
- import draylar.goml.api.ClaimInfo;
- import draylar.goml.api.ClaimUtils;
- import it.unimi.dsi.fastutil.booleans.BooleanArrayList;
- import net.fabricmc.loader.api.FabricLoader;
- import net.minecraft.entity.player.PlayerEntity;
- import net.minecraft.util.math.BlockPos;
- import net.minecraft.util.math.Box;
- import net.minecraft.world.World;
- public final class ModCompat {
- public static boolean hasGOML = FabricLoader.getInstance().isModLoaded("goml");;
- public static boolean hasGolmProtection(Box box,IDynocapComponent newComponent,PlayerEntity user,World world)
- {
- BlockPos bottom = new BlockPos(box.x1, box.y1, box.z1);
- BlockPos top = new BlockPos(box.x1+newComponent.getHeight(),box.y1+newComponent.getHeight(),box.z1+newComponent.getWidth());
- Selection<Entry<com.jamieswhiteshirt.rtree3i.Box, ClaimInfo>> claims = ClaimUtils.getClaimsInBox(world, bottom, top);
- BooleanArrayList list = new BooleanArrayList();
- claims.forEach((entry)->
- {
- list.add(ClaimUtils.playerHasPermission(entry, user));
- });
- return list.contains(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement