change container check to use Inventory

This commit is contained in:
Flemmli97 2020-11-02 16:47:47 +01:00
parent db6fb6d131
commit 230c65fd5c
5 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,7 @@
Flan 1.1.1
======================
- Fix a wrong check regarding block entitys that affected modded container blocks to not be protected
Flan 1.1.0
======================
- Add global per world perms (for more info visit https://github.com/Flemmli97/Flan/wiki/Config)

View File

@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx2G
loader_version=0.9.1+build.205
# Mod Properties
mod_version = 1.1.0
mod_version = 1.1.1
maven_group = com.flemmli97.flan
archives_base_name = flan

View File

@ -18,7 +18,6 @@ import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.BoolArgumentType;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.ArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.suggestion.Suggestions;

View File

@ -121,7 +121,7 @@ public class Config {
JsonObject global = new JsonObject();
this.globalDefaultPerms.forEach((key, value) -> {
JsonObject perm = new JsonObject();
value.entrySet().forEach(eperm -> perm.addProperty(eperm.getKey().toString(), eperm.getValue()));
value.forEach((key1, value1) -> perm.addProperty(key1.toString(), value1));
global.add(key, perm);
});
obj.add("globalDefaultPerms", global);

View File

@ -13,12 +13,12 @@ import net.minecraft.block.DoorBlock;
import net.minecraft.block.LecternBlock;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.LecternBlockEntity;
import net.minecraft.block.entity.LockableContainerBlockEntity;
import net.minecraft.block.enums.DoubleBlockHalf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.projectile.ProjectileEntity;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket;
import net.minecraft.server.network.ServerPlayerEntity;
@ -69,7 +69,7 @@ public class BlockInteractEvents {
BlockState state = world.getBlockState(hitResult.getBlockPos());
BlockEntity blockEntity = world.getBlockEntity(hitResult.getBlockPos());
if (blockEntity != null) {
if (blockEntity instanceof LockableContainerBlockEntity) {
if (blockEntity instanceof Inventory) {
if (claim.canInteract(player, EnumPermission.OPENCONTAINER, hitResult.getBlockPos(), true))
return ActionResult.PASS;
PlayerClaimData.get(player).addDisplayClaim(claim, EnumDisplayType.MAIN, player.getBlockPos().getY());