Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Jan 18, 2024
1 parent fb3d48f commit 0df880d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ public PreventAllEntitiesInPortals() {
shouldEnable();
this.plugin = AnarchyExploitFixes.getInstance();
AnarchyExploitFixes.getConfiguration().addComment("preventions.portals.prevent-all-entities-in-portals", """
CAUTION: Will kill the entity on folia due to broken portal event. There is sadly no other efficient way.
Only enable if you must. Does not affect players.
""");
CAUTION: Will kill the entity on folia due to broken portal event. There is sadly no other efficient way.\s
Only enable if you must. Does not affect players.""");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.moomoo.anarchyexploitfixes.modules.preventions.portals;

import me.moomoo.anarchyexploitfixes.AnarchyExploitFixes;
import me.moomoo.anarchyexploitfixes.config.Config;
import me.moomoo.anarchyexploitfixes.modules.AnarchyExploitFixesModule;
import me.moomoo.anarchyexploitfixes.utils.LogUtil;
import org.bukkit.entity.EntityType;
Expand All @@ -24,7 +25,10 @@ public class PreventSpecificEntitiesInPortals implements AnarchyExploitFixesModu
public PreventSpecificEntitiesInPortals() {
shouldEnable();
this.plugin = AnarchyExploitFixes.getInstance();
AnarchyExploitFixes.getConfiguration().getList(
Config config = AnarchyExploitFixes.getConfiguration();
config.addComment("preventions.portals.prevent-specific-types.entities",
"CAUTION: Will kill the entity on folia due to broken portal event. There is sadly no other efficient way.");
config.getList(
"preventions.portals.prevent-specific-types.entities",
List.of("DROPPED_ITEM", "FIREWORK", "PRIMED_TNT", "THROWN_EXP_BOTTLE", "EXPERIENCE_ORB", "ARMOR_STAND"),
"Defaults prevent common lag methods."
Expand Down Expand Up @@ -74,7 +78,7 @@ private void onPortalUse(EntityPortalEvent event) { // Does not fire on folia du
private void onPortalEnter(EntityPortalEnterEvent event) { // Only portal event that can be listened to on folia
if (!AnarchyExploitFixes.isServerFolia()) return; // Avoid fallback logic on non-folia

if (forbiddenTypes.contains(event.getEntityType())) {
if (forbiddenTypes.contains(event.getEntityType()) && event.getEntityType() != EntityType.PLAYER) {
event.getEntity().getScheduler().run(plugin, kill -> event.getEntity().remove(), null);
}
}
Expand Down

0 comments on commit 0df880d

Please sign in to comment.