Skip to content

Commit

Permalink
+ 解决 #10
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlimiter committed Dec 24, 2023
1 parent 2e4a3e3 commit 3157fe8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/nova/committee/atom/sweep/core/Sweeper.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import lombok.val;
import net.minecraft.network.chat.Component;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
Expand Down Expand Up @@ -151,7 +152,16 @@ private int cleanupEntity(ServerLevel world, Predicate<Entity> type, Predicate<E
.filter(additionalPredicate)
.forEach(
entity -> {
entity.kill();
if (ModConfig.INSTANCE.getMob().isExpOn()) {
entity.kill();
} else {
//#if MC >= 11800
entity.discard();
//#else
//$$ entity.kill();
//#endif
}

if (entity instanceof ItemEntity) {
amount.getAndAdd(((ItemEntity) entity).getItem().getCount());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
public class MobsConfig extends AutoLoadTomlConfig {
@TableField(rightComment = "生物实体清理功能(最高优先级)")
private boolean isMobEntityCleanupEnable = true;
@TableField(rightComment = "生物清理是否掉落经验")
private boolean isExpOn = false;
@TableField(rightComment = "动物实体清理功能(次级)")
private boolean isAnimalEntitiesCleanupEnable = true;
@TableField(rightComment = "怪物实体清理功能(次级)")
Expand Down Expand Up @@ -56,6 +58,14 @@ public void setMobEntityCleanupEnable(boolean mobEntityCleanupEnable) {
isMobEntityCleanupEnable = mobEntityCleanupEnable;
}

public boolean isExpOn() {
return isExpOn;
}

public void setExpOn(boolean expOn) {
isExpOn = expOn;
}

public boolean isMobBlackMode() {
return mobBlackMode;
}
Expand Down

1 comment on commit 3157fe8

@cnlimiter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以尝试一下新构建的 #10

Please sign in to comment.