mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Added an option to turn off fishing exploit detection as a band-aid fix until the config update is done
This commit is contained in:
parent
14f900aa83
commit
dece43429d
@ -7,6 +7,12 @@ Key:
|
|||||||
! Change
|
! Change
|
||||||
- Removal
|
- Removal
|
||||||
|
|
||||||
|
Version 2.1.20
|
||||||
|
Players can now fish in the same spot about 3 times before mcMMO will mark the area as being over-fished (over-fishing is to prevent abuse)
|
||||||
|
Added a toggle to turn off the fishing exploit detection to experience.yml "ExploitFix.Fishing"
|
||||||
|
Note: The new config update is coming soon and will use a different setting, putting this out as a band-aid fix for people that don't like the new fishing exploit prevention stuff
|
||||||
|
Added a message to warn players that their next fishing attempt will result in over-fishing (Locale: Fishing.LowResources)
|
||||||
|
|
||||||
Version 2.1.19
|
Version 2.1.19
|
||||||
Greatly Improved Fishing AFK/Exploit 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
|
||||||
|
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</version>
|
<version>2.1.20</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>
|
||||||
|
@ -144,6 +144,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
|
|||||||
/* EXPLOIT TOGGLES */
|
/* EXPLOIT TOGGLES */
|
||||||
public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); }
|
public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); }
|
||||||
|
|
||||||
|
public boolean isFishingExploitingPrevented() { return config.getBoolean("ExploitFix.Fishing", true); }
|
||||||
/* Curve settings */
|
/* Curve settings */
|
||||||
public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); }
|
public FormulaType getFormulaType() { return FormulaType.getFormulaType(config.getString("Experience_Formula.Curve")); }
|
||||||
public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience_Formula.Cumulative_Curve", false); }
|
public boolean getCumulativeCurveEnabled() { return config.getBoolean("Experience_Formula.Cumulative_Curve", false); }
|
||||||
|
@ -324,23 +324,26 @@ public class PlayerListener implements Listener {
|
|||||||
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
FishingManager fishingManager = UserManager.getPlayer(player).getFishingManager();
|
||||||
|
|
||||||
//Track the hook
|
//Track the hook
|
||||||
if(event.getHook().getMetadata(mcMMO.FISH_HOOK_REF_METAKEY).size() == 0)
|
if(ExperienceConfig.getInstance().isFishingExploitingPrevented())
|
||||||
{
|
{
|
||||||
fishingManager.setFishHookReference(event.getHook());
|
if(event.getHook().getMetadata(mcMMO.FISH_HOOK_REF_METAKEY).size() == 0)
|
||||||
}
|
|
||||||
|
|
||||||
//Spam Fishing
|
|
||||||
if(event.getState() == PlayerFishEvent.State.CAUGHT_FISH && fishingManager.isFishingTooOften())
|
|
||||||
{
|
|
||||||
event.setExpToDrop(0);
|
|
||||||
|
|
||||||
if(caught instanceof Item)
|
|
||||||
{
|
{
|
||||||
Item caughtItem = (Item) caught;
|
fishingManager.setFishHookReference(event.getHook());
|
||||||
caughtItem.remove();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
//Spam Fishing
|
||||||
|
if(event.getState() == PlayerFishEvent.State.CAUGHT_FISH && fishingManager.isFishingTooOften())
|
||||||
|
{
|
||||||
|
event.setExpToDrop(0);
|
||||||
|
|
||||||
|
if(caught instanceof Item)
|
||||||
|
{
|
||||||
|
Item caughtItem = (Item) caught;
|
||||||
|
caughtItem.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (event.getState()) {
|
switch (event.getState()) {
|
||||||
@ -351,12 +354,16 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case CAUGHT_FISH:
|
case CAUGHT_FISH:
|
||||||
if(fishingManager.isExploitingFishing(event.getHook().getLocation().toVector()))
|
if(ExperienceConfig.getInstance().isFishingExploitingPrevented())
|
||||||
{
|
{
|
||||||
event.setExpToDrop(0);
|
if(fishingManager.isExploitingFishing(event.getHook().getLocation().toVector()))
|
||||||
Item caughtItem = (Item) caught;
|
{
|
||||||
caughtItem.remove();
|
player.sendMessage(LocaleLoader.getString("Fishing.Scarcity"));
|
||||||
return;
|
event.setExpToDrop(0);
|
||||||
|
Item caughtItem = (Item) caught;
|
||||||
|
caughtItem.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fishingManager.handleFishing((Item) caught);
|
fishingManager.handleFishing((Item) caught);
|
||||||
|
@ -45,6 +45,7 @@ import java.util.*;
|
|||||||
|
|
||||||
public class FishingManager extends SkillManager {
|
public class FishingManager extends SkillManager {
|
||||||
public static final int FISHING_ROD_CAST_CD_MILLISECONDS = 200;
|
public static final int FISHING_ROD_CAST_CD_MILLISECONDS = 200;
|
||||||
|
public static final int OVERFISH_LIMIT = 4;
|
||||||
private final long FISHING_COOLDOWN_SECONDS = 1000L;
|
private final long FISHING_COOLDOWN_SECONDS = 1000L;
|
||||||
|
|
||||||
private long fishingRodCastTimestamp = 0L;
|
private long fishingRodCastTimestamp = 0L;
|
||||||
@ -55,6 +56,7 @@ public class FishingManager extends SkillManager {
|
|||||||
private BoundingBox lastFishingBoundingBox;
|
private BoundingBox lastFishingBoundingBox;
|
||||||
private Item fishingCatch;
|
private Item fishingCatch;
|
||||||
private Location hookLocation;
|
private Location hookLocation;
|
||||||
|
private int fishCaughtCounter = 1;
|
||||||
|
|
||||||
public FishingManager(McMMOPlayer mcMMOPlayer) {
|
public FishingManager(McMMOPlayer mcMMOPlayer) {
|
||||||
super(mcMMOPlayer, PrimarySkillType.FISHING);
|
super(mcMMOPlayer, PrimarySkillType.FISHING);
|
||||||
@ -131,15 +133,21 @@ public class FishingManager extends SkillManager {
|
|||||||
|
|
||||||
boolean sameTarget = lastFishingBoundingBox != null && lastFishingBoundingBox.overlaps(newCastBoundingBox);
|
boolean sameTarget = lastFishingBoundingBox != null && lastFishingBoundingBox.overlaps(newCastBoundingBox);
|
||||||
|
|
||||||
|
if(sameTarget)
|
||||||
|
fishCaughtCounter++;
|
||||||
|
else
|
||||||
|
fishCaughtCounter = 1;
|
||||||
|
|
||||||
|
if(fishCaughtCounter + 1 == OVERFISH_LIMIT)
|
||||||
|
{
|
||||||
|
getPlayer().sendMessage(LocaleLoader.getString("Fishing.LowResources"));
|
||||||
|
}
|
||||||
|
|
||||||
//If the new bounding box does not intersect with the old one, then update our bounding box reference
|
//If the new bounding box does not intersect with the old one, then update our bounding box reference
|
||||||
if(!sameTarget)
|
if(!sameTarget)
|
||||||
lastFishingBoundingBox = newCastBoundingBox;
|
lastFishingBoundingBox = newCastBoundingBox;
|
||||||
else
|
|
||||||
{
|
|
||||||
getPlayer().sendMessage(LocaleLoader.getString("Fishing.Scarcity"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return sameTarget;
|
return sameTarget && fishCaughtCounter >= OVERFISH_LIMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BoundingBox makeBoundingBox(Vector centerOfCastVector) {
|
public static BoundingBox makeBoundingBox(Vector centerOfCastVector) {
|
||||||
|
@ -23,6 +23,8 @@
|
|||||||
#SOLID
|
#SOLID
|
||||||
# The bar is one solid piece
|
# The bar is one solid piece
|
||||||
ExploitFix:
|
ExploitFix:
|
||||||
|
# Prevent many exploits related to fishing
|
||||||
|
Fishing: true
|
||||||
EndermanEndermiteFarms: true
|
EndermanEndermiteFarms: true
|
||||||
Experience_Bars:
|
Experience_Bars:
|
||||||
# Turn this to false if you wanna disable XP bars
|
# Turn this to false if you wanna disable XP bars
|
||||||
|
@ -220,6 +220,7 @@ Excavation.Skills.GigaDrillBreaker.Other.On=[[GREEN]]{0}[[DARK_GREEN]] has used
|
|||||||
Fishing.Scarcity=[[YELLOW]]&oThis area is suffering from overfishing, try fishing in a new area.
|
Fishing.Scarcity=[[YELLOW]]&oThis area is suffering from overfishing, try fishing in a new area.
|
||||||
Fishing.Scared=[[GRAY]]&oChaotic movements will scare fish!
|
Fishing.Scared=[[GRAY]]&oChaotic movements will scare fish!
|
||||||
Fishing.Exhausting=[[RED]]&oImproper use of the fishing rod will cause fatigue and wear out the rod!
|
Fishing.Exhausting=[[RED]]&oImproper use of the fishing rod will cause fatigue and wear out the rod!
|
||||||
|
Fishing.LowResources=[[GRAY]]You sense that there might not be many fish left in this area.
|
||||||
Fishing.Ability.Info=Magic Hunter: [[GRAY]] **Improves With Treasure Hunter Rank**
|
Fishing.Ability.Info=Magic Hunter: [[GRAY]] **Improves With Treasure Hunter Rank**
|
||||||
Fishing.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (SHAKE)
|
Fishing.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (SHAKE)
|
||||||
Fishing.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (ICE FISHING)
|
Fishing.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (ICE FISHING)
|
||||||
|
Loading…
Reference in New Issue
Block a user