Skip to content
Open
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: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>me.bestemor.villagermarket</groupId>
<artifactId>VillagerMarket</artifactId>
<version>1.12.0-SNAPSHOT</version>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.12 is not released yet, so the version should be 1.12.0, not 1.12.1

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.12 is not released yet, so the version should be 1.12.0, not 1.12.1

<version>1.12.1-SNAPSHOT</version>

<repositories>
<repository>
Expand Down
23 changes: 22 additions & 1 deletion src/main/java/net/bestemor/villagermarket/shop/PlayerShop.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package net.bestemor.villagermarket.shop;

import me.angeschossen.lands.api.LandsIntegration;
import me.angeschossen.lands.api.flags.type.Flags;
import me.angeschossen.lands.api.land.LandWorld;
import net.bestemor.core.config.ConfigManager;
import net.bestemor.core.config.CurrencyBuilder;
import net.bestemor.core.config.VersionUtils;
Expand Down Expand Up @@ -438,7 +441,25 @@ public void removeTrusted(Player player) {
}
/** Returns true if player is trusted, false if not */
public boolean isTrusted(Player player) {
return trustedPlayers.contains(player.getUniqueId().toString());
if (trustedPlayers.contains(player.getUniqueId().toString())) {
// If the player is manually trusted, skip the rest of the checks
return true;
}

//Lands check (Add players as trusted if they have interact container flag)
if (Bukkit.getPluginManager().isPluginEnabled("Lands") && ConfigManager.getBoolean("lands")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lands config option needs to be added to the config.yml file

LandsIntegration api = LandsIntegration.of(plugin);
Entity villager = VMUtils.getEntity(entityUUID);
if (villager == null) {
return false;
}
Location location = villager.getLocation();
LandWorld world = api.getWorld(villager.getWorld());

return world != null && world.hasRoleFlag(player.getUniqueId(), location, Flags.INTERACT_CONTAINER);
}

return false;
}

public boolean isDisableNotifications() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: VillagerMarket
main: net.bestemor.villagermarket.VMPlugin
version: 1.12.0
version: 1.12.1

author: Bestem0r
description: A plugin made by Bestem0r to create Villager Shops
Expand Down