Skip to content

Commit

Permalink
1.23.0 - Prevent new firework lag exploit
Browse files Browse the repository at this point in the history
  • Loading branch information
moom0o committed Mar 14, 2022
1 parent 7a8a0d2 commit 8eca4e5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ alongside AEF to patch the majority of exploits.
**All features listed here can be disabled or enabled in the config.**

* Prevent NoCom exploit. - Prevent the 'NoCom' coordinate exploit
* Prevent a new lag exploit where fireworks can bring tps down to single digits.
* Prevent BowBomb exploit. - Prevent an exploit where bows can instantly kill a player.
* Prevent burrow hack - Where you step inside a block so crystals can't do any damage.
* Prevent boatfly exploit - Prevent the futureclient/rusherhack boatfly exploit.
Expand Down Expand Up @@ -157,6 +158,7 @@ NoComMaxDistance: 64 # Recommended not to increase
PreventEndGatewayCrashExploit: true
PreventDispenserCrashExploit: true
PreventSnowBallExploit: true
PreventFireworksInPortals: true # Patches lag exploit
ProjectilesMaxPerTime: 3
ProjectileTimeTicks: 10 # 3 projectiles can be sent every 10 ticks (0.5 seconds)
PreventCraftingRecipeLagExploit: true
Expand Down Expand Up @@ -340,6 +342,13 @@ ElytraBurstOldChunkTPS: 18
ElytraBurstNewChunkSpeed: 3.12 # 223km/h
ElytraBurstNewChunkTPS: 19

# Spawn elytra settings
ElytraAtSpawn:
Enabled: false
SpeedOldChunks: 1.0
SpeedNewChunks: 0.8
Radius: 3000

LimitRenderDistanceBasedOnTPS: false # Recommended not to use, papers render distance changer is laggy? Try at your own will.
# Radius for chunks when the server is below your tps amount
NewChunkRadius: 3
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.moomoo</groupId>
<artifactId>anarchyexploitfixes</artifactId>
<version>1.22.0</version>
<version>1.23.0</version>
<packaging>jar</packaging>

<name>AnarchyExploitFixes</name>
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/me/moomoo/anarchyexploitfixes/patches/Elytra.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,22 @@ public void onPlayerMove(PlayerMoveEvent evt) {
}

boolean atSpawn = false;
if(plugin.getConfig().getBoolean("ElytraAtSpawn.Enabled")){
if (plugin.getConfig().getBoolean("ElytraAtSpawn.Enabled")) {
atSpawn = isAtSpawnRadius(evt.getPlayer().getLocation());
if(atSpawn){
if (atSpawn) {
max_speed = plugin.getConfig().getDouble("ElytraAtSpawn.SpeedNewChunks");
}
}

if (finalValue > (max_speed + 0.02) && !evt.getPlayer().isOp()) {
evt.setCancelled(true);
if(atSpawn){
if (atSpawn) {
if (evt.getPlayer().getLocale().startsWith("es")) {
evt.getPlayer().sendActionBar(ChatColor.RED + "Baja la configuración de tu élitro, la velocidad está restringida en nuevos spawn chunks.");
} else {
evt.getPlayer().sendActionBar(ChatColor.RED + "Turn down your elytra settings, speed is restricted in new spawn chunks.");
}
}else{
} else {
if (evt.getPlayer().getLocale().startsWith("es")) {
evt.getPlayer().sendActionBar(ChatColor.RED + "Baja la configuración de tu élitro, la velocidad está restringida en nuevos chunks.");
} else {
Expand All @@ -130,22 +130,22 @@ public void onPlayerMove(PlayerMoveEvent evt) {
}

boolean atSpawn = false;
if(plugin.getConfig().getConfigurationSection("ElytraAtSpawn").getBoolean("Enabled")){
if (plugin.getConfig().getConfigurationSection("ElytraAtSpawn").getBoolean("Enabled")) {
atSpawn = isAtSpawnRadius(evt.getPlayer().getLocation());
if(atSpawn){
if (atSpawn) {
max_speed = plugin.getConfig().getDouble("ElytraAtSpawn.SpeedOldChunks");
}
}

if (finalValue > (max_speed + 0.02) && !evt.getPlayer().isOp()) {
evt.setCancelled(true);
if(atSpawn){
if (atSpawn) {
if (evt.getPlayer().getLocale().startsWith("es")) {
evt.getPlayer().sendActionBar(ChatColor.RED + "Baja la configuración de tu élitro, la velocidad está restringida en spawn chunks.");
} else {
evt.getPlayer().sendActionBar(ChatColor.RED + "Turn down your elytra settings, speed is restricted in spawn chunks.");
}
}else{
} else {
if (evt.getPlayer().getLocale().startsWith("es")) {
evt.getPlayer().sendActionBar(ChatColor.RED + "Baja la configuración de tu elytra, vas demasiado rápido.");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPortalEvent;
import org.bukkit.event.player.PlayerPortalEvent;

@RequiredArgsConstructor
public class NetherPortals implements Listener {
private final Main plugin;

@EventHandler
private void onPortal(EntityPortalEvent evt) {
if (plugin.getConfig().getBoolean("PreventFireworksInPortals")) {
if (evt.getEntity().getType().equals(EntityType.FIREWORK)) {
evt.setCancelled(true);
}
}
}

@EventHandler
private void onPortal(PlayerPortalEvent evt) {
if (plugin.getConfig().getBoolean("PreventPortalTraps")) {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ NoComMaxDistance: 64 # Recommended not to increase
PreventEndGatewayCrashExploit: true
PreventDispenserCrashExploit: true
PreventSnowBallExploit: true
PreventFireworksInPortals: true # Patches lag exploit
ProjectilesMaxPerTime: 3
ProjectileTimeTicks: 10 # 3 projectiles can be sent every 10 ticks (0.5 seconds)
PreventCraftingRecipeLagExploit: true
Expand Down

0 comments on commit 8eca4e5

Please sign in to comment.