-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/chunklimits/DroppedItemLimit.java # AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/lagpreventions/agelimits/CustomAgeLimits.java # AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/preventions/withers/RemoveSkullsOnChunkload.java # AnarchyExploitFixesLegacy/src/main/java/me/xginko/aef/modules/preventions/withers/RemoveSkullsOnChunkload.java # shared/src/main/java/me/xginko/aef/utils/ChunkUtil.java
- Loading branch information
Showing
13 changed files
with
193 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...yExploitFixesFolia/src/main/java/me/xginko/aef/modules/dupepreventions/BookTitleDupe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package me.xginko.aef.modules.dupepreventions; | ||
|
||
import com.github.retrooper.packetevents.event.PacketListenerPriority; | ||
import com.github.retrooper.packetevents.event.PacketReceiveEvent; | ||
import com.github.retrooper.packetevents.protocol.packettype.PacketType; | ||
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientEditBook; | ||
import me.xginko.aef.modules.packets.PacketModule; | ||
import me.xginko.aef.utils.PlatformUtil; | ||
|
||
public class BookTitleDupe extends PacketModule { | ||
|
||
private final int maxTitleChars; | ||
|
||
public BookTitleDupe() { | ||
super("dupe-preventions.book-title-dupe", PacketListenerPriority.HIGHEST); | ||
config.addComment(configPath + ".enable", """ | ||
Relevant for 1.20.6 - 1.21: | ||
Will prevent players from sending book packets with a too large title, | ||
to get disconnected and their inventories restored."""); | ||
this.maxTitleChars = config.getInt(configPath + ".max-title-charlength", 20, """ | ||
Normal ascii like charlimit in vanilla is 15, you could need a bit more | ||
if you want to support languages with special characters."""); | ||
} | ||
|
||
@Override | ||
public boolean shouldEnable() { | ||
return config.getBoolean(configPath + ".enable", PlatformUtil.getMinecraftPatchVersion() > 19); | ||
} | ||
|
||
@Override | ||
public void onPacketReceive(PacketReceiveEvent event) { | ||
if (event.getPacketType() != PacketType.Play.Client.EDIT_BOOK) return; | ||
|
||
WrapperPlayClientEditBook packet = new WrapperPlayClientEditBook(event); | ||
if (packet.getTitle() == null) return; | ||
|
||
if (packet.getTitle().length() > maxTitleChars) { | ||
event.setCancelled(true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 0 additions & 141 deletions
141
AnarchyExploitFixesFolia/src/main/java/me/xginko/aef/modules/patches/PearlPhase.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.