mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
2.1.19
This commit is contained in:
parent
bb118607ce
commit
c8d95dc711
@ -8,14 +8,16 @@ Key:
|
|||||||
- Removal
|
- Removal
|
||||||
|
|
||||||
Version 2.1.19
|
Version 2.1.19
|
||||||
Improved Fishing AFK detection
|
Greatly Improved Fishing AFK/Exploit Detection
|
||||||
Fixed a bug where Fishing AFK detection did not work on a new exploit
|
Fixed a bug where Fishing AFK detection did not work on a new exploit
|
||||||
|
Certain exploits for Fishing now result in players losing small amounts of hunger and durability
|
||||||
Players who get detected by Fishing's anti-exploit measures will no longer get vanilla rewards from Minecraft
|
Players who get detected by Fishing's anti-exploit measures will no longer get vanilla rewards from Minecraft
|
||||||
**Note: Previously if mcMMO detected you abusing Fishing it just switched you over to vanilla Minecraft fishing rewards, this change is to help server admins who don't want players to get any kind of reward from AFK fishing
|
**Note: Previously if mcMMO detected you abusing Fishing it just switched you over to vanilla Minecraft fishing rewards, this change is to help server admins who don't want players to get any kind of reward from AFK fishing
|
||||||
Fishing now drops several hints to players if they are triggering the exploit detection
|
Fishing now drops several hints to players if they are triggering the exploit detection
|
||||||
**Note: Not all types of exploit detection will warn players, this is just to prevent legitimate fishers from being confused by the aggressive exploit detection.
|
**Note: Not all types of exploit detection will warn players, this is just to prevent legitimate fishers from being confused by the aggressive exploit detection.
|
||||||
Added messages to warn players about fishing in the same spot
|
Added messages to warn players about fishing in the same spot (Locale: Fishing.Scarcity)
|
||||||
Added messages to warn players about casting too often
|
Added messages to warn players who exploit in order to catch fish unusually fast (Locale: Fishing.Scared)
|
||||||
|
Added messages to warn players about casting the fishing rod too often (Locale: Fishing.Exhausting)
|
||||||
|
|
||||||
Version 2.1.18
|
Version 2.1.18
|
||||||
You will need to add Kelp to your experience.yml file for this fix to be fully functional
|
You will need to add Kelp to your experience.yml file for this fix to be fully functional
|
||||||
|
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||||
<artifactId>mcMMO</artifactId>
|
<artifactId>mcMMO</artifactId>
|
||||||
<version>2.1.19-SNAPSHOT</version>
|
<version>2.1.19</version>
|
||||||
<name>mcMMO</name>
|
<name>mcMMO</name>
|
||||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -25,6 +25,8 @@ import com.gmail.nossr50.util.random.RandomChanceUtil;
|
|||||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||||
import com.gmail.nossr50.util.skills.RankUtils;
|
import com.gmail.nossr50.util.skills.RankUtils;
|
||||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||||
|
import com.gmail.nossr50.util.sounds.SoundManager;
|
||||||
|
import com.gmail.nossr50.util.sounds.SoundType;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -42,11 +44,13 @@ import org.bukkit.util.Vector;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class FishingManager extends SkillManager {
|
public class FishingManager extends SkillManager {
|
||||||
|
public static final int FISHING_ROD_CAST_CD_MILLISECONDS = 200;
|
||||||
private final long FISHING_COOLDOWN_SECONDS = 1000L;
|
private final long FISHING_COOLDOWN_SECONDS = 1000L;
|
||||||
|
|
||||||
private long fishingRodCastTimestamp = 0L;
|
private long fishingRodCastTimestamp = 0L;
|
||||||
private long fishHookSpawnTimestamp = 0L;
|
private long fishHookSpawnTimestamp = 0L;
|
||||||
private long lastWarned = 0L;
|
private long lastWarned = 0L;
|
||||||
|
private long lastWarnedExhaust = 0L;
|
||||||
private FishHook fishHookReference;
|
private FishHook fishHookReference;
|
||||||
private BoundingBox lastFishingBoundingBox;
|
private BoundingBox lastFishingBoundingBox;
|
||||||
private Item fishingCatch;
|
private Item fishingCatch;
|
||||||
@ -66,17 +70,23 @@ public class FishingManager extends SkillManager {
|
|||||||
|
|
||||||
public void setFishingRodCastTimestamp()
|
public void setFishingRodCastTimestamp()
|
||||||
{
|
{
|
||||||
|
long currentTime = System.currentTimeMillis();
|
||||||
//Only track spam casting if the fishing hook is fresh
|
//Only track spam casting if the fishing hook is fresh
|
||||||
if(System.currentTimeMillis() > fishHookSpawnTimestamp + 500)
|
if(currentTime > fishHookSpawnTimestamp + 500)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(System.currentTimeMillis() < fishingRodCastTimestamp + 300)
|
if(currentTime < fishingRodCastTimestamp + FISHING_ROD_CAST_CD_MILLISECONDS)
|
||||||
{
|
{
|
||||||
getPlayer().setFoodLevel(Math.min(getPlayer().getFoodLevel() - 1, 0));
|
getPlayer().setFoodLevel(Math.max(getPlayer().getFoodLevel() - 1, 0));
|
||||||
getPlayer().getInventory().getItemInMainHand().setDurability((short) (getPlayer().getInventory().getItemInMainHand().getDurability() + 5));
|
getPlayer().getInventory().getItemInMainHand().setDurability((short) (getPlayer().getInventory().getItemInMainHand().getDurability() + 5));
|
||||||
getPlayer().updateInventory();
|
getPlayer().updateInventory();
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Fishing.Exhausting"));
|
|
||||||
|
|
||||||
|
if(lastWarnedExhaust + (1000 * 1) < currentTime)
|
||||||
|
{
|
||||||
|
getPlayer().sendMessage(LocaleLoader.getString("Fishing.Exhausting"));
|
||||||
|
lastWarnedExhaust = currentTime;
|
||||||
|
SoundManager.sendSound(getPlayer(), getPlayer().getLocation(), SoundType.TIRED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fishingRodCastTimestamp = System.currentTimeMillis();
|
fishingRodCastTimestamp = System.currentTimeMillis();
|
||||||
|
Loading…
Reference in New Issue
Block a user