File tree Expand file tree Collapse file tree 8 files changed +10
-18
lines changed
java/net/bestemor/villagermarket Expand file tree Collapse file tree 8 files changed +10
-18
lines changed Original file line number Diff line number Diff line change 1111
1212 <groupId >me.bestemor.villagermarket</groupId >
1313 <artifactId >VillagerMarket</artifactId >
14- <version >1.11.0 -SNAPSHOT</version >
14+ <version >1.11.1 -SNAPSHOT</version >
1515
1616 <repositories >
1717 <repository >
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ protected void onPluginEnable() {
5252 this .playerListener = new PlayerListener (this );
5353 registerEvents ();
5454
55- //Bukkit.getLogger().warning("[VillagerMarket] §cYou are running a §aBETA 1.11.0-#6 of VillagerMarket! Please expect and report all bugs in my discord server");
55+ //Bukkit.getLogger().warning("[VillagerMarket] §cYou are running a §aBETA 1.11.1-#1 of VillagerMarket! Please expect and report all bugs in my discord server");
5656
5757 Bukkit .getScheduler ().runTaskLater (this , () -> {
5858 if (Bukkit .getPluginManager ().getPlugin ("VillagerBank" ) != null ) {
Original file line number Diff line number Diff line change @@ -48,11 +48,8 @@ public class PlayerListener implements Listener {
4848 private final List <UUID > cancelledPlayers = new ArrayList <>();
4949 private final Map <UUID , Entity > cachedEntities = new HashMap <>();
5050
51- private final boolean performanceMode ;
52-
5351 public PlayerListener (VMPlugin plugin ) {
5452 this .plugin = plugin ;
55- this .performanceMode = ConfigManager .getBoolean ("look_close_caching" );
5653 }
5754
5855 public void addCancelledPlayer (UUID uuid ) {
@@ -109,7 +106,7 @@ public void playerRightClick(PlayerInteractEntityEvent event) {
109106 @ EventHandler
110107 public void onMove (PlayerMoveEvent event ) {
111108 Player p = event .getPlayer ();
112- for (Entity e : performanceMode ? cachedEntities .values () : plugin . getShopManager (). getEntities ()) {
109+ for (Entity e : cachedEntities .values ()) {
113110 if (p .getWorld ().getName ().equals (e .getWorld ().getName ()) && p .getLocation ().distanceSquared (e .getLocation ()) < 25 ) {
114111 e .teleport (e .getLocation ().setDirection (p .getLocation ().subtract (e .getLocation ()).toVector ()));
115112 }
Original file line number Diff line number Diff line change @@ -312,6 +312,8 @@ public void abandon() {
312312 player .sendMessage (ConfigManager .getMessage ("messages.expired" ));
313313 }
314314
315+ VMPlugin .log .add (new Date () + ": " + offlinePlayer .getName () + " abandoned shop: " + entityUUID .toString ());
316+
315317 storageHolder .clear ();
316318 trustedPlayers .clear ();
317319 shopfrontHolder .closeAll ();
@@ -323,7 +325,6 @@ public void abandon() {
323325 super .timesRented = 0 ;
324326 super .updateMenu (ShopMenu .EDIT_SHOP );
325327
326- VMPlugin .log .add (new Date () + ": " + offlinePlayer .getName () + " abandoned shop: " + entityUUID .toString ());
327328 updateRedstone (false );
328329 }
329330
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ public boolean isBlackListed(Material material) {
242242
243243 /** Thread check if rent time has expired and runs abandon() method */
244244 private void beginExpireThread () {
245- long interval = 20 * ConfigManager .getLong ("expire_check_interval" );
245+ long interval = 20L * ConfigManager .getInt ("expire_check_interval" );
246246
247247 Bukkit .getScheduler ().runTaskTimerAsynchronously (plugin , () -> {
248248 for (VillagerShop villagerShop : shops .values ()) {
@@ -263,16 +263,16 @@ private void beginExpireThread() {
263263 }, 20L , interval );
264264 }
265265
266- public List <Entity > getEntities () {
266+ public List <UUID > geEntityUUIDs () {
267267 return shops .values ().stream ()
268- .map (s -> VMUtils . getEntity ( s . entityUUID ) )
268+ .map (VillagerShop :: getEntityUUID )
269269 .filter (Objects ::nonNull )
270270 .collect (Collectors .toList ());
271271 }
272272
273273 /** Thread updates redstone output for all Villagers */
274274 private void beginRedstoneThread () {
275- long interval = 20 * ConfigManager .getLong ("redstone_update_interval" );
275+ long interval = 20L * ConfigManager .getInt ("redstone_update_interval" );
276276
277277 Bukkit .getScheduler ().scheduleSyncRepeatingTask (plugin , () -> {
278278 for (VillagerShop villagerShop : shops .values ()) {
Original file line number Diff line number Diff line change @@ -35,9 +35,6 @@ per_adminshop_permissions: false
3535buy_shop_permission : false
3636# Will drop spawn egg when a shops created with spawn egg is removed
3737drop_spawn_egg : true
38- # Shops must be interacted with before shopkeeper will look at nearby players
39- # Enable if you are experiencing lag issues on large servers
40- look_close_caching : false
4138# Will disable announcing new updates when joining
4239disable_update_announce : false
4340# Language to use
Original file line number Diff line number Diff line change @@ -35,9 +35,6 @@ per_adminshop_permissions: false
3535buy_shop_permission : false
3636# Will drop spawn egg when a shops created with spawn egg is removed
3737drop_spawn_egg : true
38- # Shops must be interacted with before shopkeeper will look at nearby players
39- # Enable if you are experiencing lag issues on large servers
40- look_close_caching : false
4138# Will disable announcing new updates when joining
4239disable_update_announce : false
4340# Language to use
Original file line number Diff line number Diff line change 11name : VillagerMarket
22main : net.bestemor.villagermarket.VMPlugin
3- version : 1.11.0
3+ version : 1.11.1
44author : Bestem0r
55description : A plugin made by Bestem0r to create Villager Shops
66api-version : 1.13
You can’t perform that action at this time.
0 commit comments