keep inv check close #146
This commit is contained in:
parent
c87b1e4005
commit
c9c31ddd5e
@ -1,3 +1,8 @@
|
||||
Flan 1.7.10
|
||||
================
|
||||
- Check for keep inventory when deciding if drops should be locked or not
|
||||
Stops unlock cmd message when keep inventory is on
|
||||
|
||||
Flan 1.7.9
|
||||
================
|
||||
- Move pickup check to a better place. Should fix some mod compat issues
|
||||
|
@ -23,6 +23,7 @@ import net.minecraft.network.protocol.game.ClientboundLevelParticlesPacket;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
@ -341,8 +342,11 @@ public class PlayerClaimData implements IPlayerData {
|
||||
this.additionalClaimBlocks = data.additionalClaimBlocks;
|
||||
this.defaultGroups.clear();
|
||||
this.defaultGroups.putAll(data.defaultGroups);
|
||||
if (data.setDeathItemOwner())
|
||||
this.player.displayClientMessage(PermHelper.simpleColoredText(String.format(ConfigHandler.langManager.get("unlockDropsCmd"), "/flan unlockDrops"), ChatFormatting.GOLD), false);
|
||||
if (data.setDeathItemOwner()) {
|
||||
String msg = ConfigHandler.langManager.get("unlockDropsCmd");
|
||||
if (!msg.isEmpty())
|
||||
this.player.displayClientMessage(PermHelper.simpleColoredText(String.format(msg, "/flan unlockDrops"), ChatFormatting.GOLD), false);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateScoreboard() {
|
||||
@ -383,7 +387,8 @@ public class PlayerClaimData implements IPlayerData {
|
||||
if (this.calculateShouldDrop) {
|
||||
BlockPos rounded = TeleportUtils.roundedBlockPos(this.player.position().add(0, this.player.getStandingEyeHeight(this.player.getPose(), this.player.getDimensions(this.player.getPose())), 0));
|
||||
this.shouldProtectDrop = ClaimStorage.get(this.player.getLevel()).getForPermissionCheck(rounded)
|
||||
.canInteract(this.player, PermissionRegistry.LOCKITEMS, rounded);
|
||||
.canInteract(this.player, PermissionRegistry.LOCKITEMS, rounded)
|
||||
&& !this.player.getServer().getGameRules().getBoolean(GameRules.RULE_KEEPINVENTORY);
|
||||
this.calculateShouldDrop = false;
|
||||
}
|
||||
return this.shouldProtectDrop;
|
||||
|
@ -11,7 +11,7 @@ forge_version=1.18.2-40.0.3
|
||||
loader_version=0.13.2
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.7.9
|
||||
mod_version=1.7.10
|
||||
maven_group=io.github.flemmli97
|
||||
archives_base_name=flan
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user