Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
NahuLD committed Jul 19, 2023
2 parents 26476cf + 341a9a9 commit 03dabdf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
9 changes: 0 additions & 9 deletions README

This file was deleted.

10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
VanishNoPacket
by Matt Baxter

[![](https://jitpack.io/v/mbax/VanishNoPacket.svg)](https://jitpack.io/#mbax/VanishNoPacket)

For instructions on using this plugin
and to download stable, compiled releases, visit
http://dev.bukkit.org/projects/vanish/

First released Aug 17, 2011
5 changes: 5 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
jdk:
- openjdk17
before_install:
- sdk install java 17.0.2-open
- sdk use java 17.0.2-open
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<packaging>jar</packaging>

<name>VanishNoPacket</name>
<version>3.22-SNAPSHOT</version>
<version>3.22</version>

<url>https://github.com/mbax/VanishNoPacket</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void onPlayerQuit(@NonNull PlayerQuitEvent event) {
event.setQuitMessage(null);
}
this.plugin.chestFakeClose(event.getPlayer().getName());
this.playersAndLastTimeSneaked.remove(player.getUniqueId());
}

@EventHandler(ignoreCancelled = true)
Expand Down Expand Up @@ -214,8 +215,8 @@ public void onPlayerShift(@NonNull PlayerToggleSneakEvent event) {
}
final Player player = event.getPlayer();
final long now = System.currentTimeMillis();
final long lastTime = this.playersAndLastTimeSneaked.computeIfAbsent(player.getUniqueId(), u -> now);
if ((now != lastTime) && (now - lastTime < Settings.getDoubleSneakDuringVanishSwitchesGameModeTimeBetweenSneaksInMS())) {
final Long lastTime = this.playersAndLastTimeSneaked.put(player.getUniqueId(), now);
if ((lastTime != null) && (now - lastTime < Settings.getDoubleSneakDuringVanishSwitchesGameModeTimeBetweenSneaksInMS())) {
if (!Settings.getDoubleSneakDuringVanishSwitchesGameModeMessage().isBlank()) { //In case the user doesn't want a message to be sent at all
player.sendMessage(ChatColor.translateAlternateColorCodes('&', Settings.getDoubleSneakDuringVanishSwitchesGameModeMessage()));
}
Expand Down

0 comments on commit 03dabdf

Please sign in to comment.