revert Limit max amount of stacks that can be attracted by magnet at the same time (#28)

This commit is contained in:
Alexdoru authored and GitHub committed 2022-09-17 00:21:23 +02:00
1 parent fc14d0d593
commit d31dde29cf
2 files changed
+1 -11

No files matched your search

@@ -49,7 +49,6 @@ public class ConfigHandler {
public static boolean enableFlight;
private static String[] itemDislocatorBlacklist;
public static Map<String, Integer> itemDislocatorBlacklistMap = new HashMap<String, Integer>();
public static int magnetStackLimit;
// spawner
public static String[] spawnerList;
@@ -294,12 +293,6 @@ public class ConfigHandler {
true,
"Set this to false to disable flight given by draconic armor.")
.getBoolean(true);
magnetStackLimit = config.get(
Configuration.CATEGORY_GENERAL,
"Magnet Stack Limit",
30,
"Limit how much stacks might be attracted at the same time, high values can cause both server and client lag")
.getInt();
// Spawner
spawnerListType = config.get(
@@ -10,7 +10,6 @@ import com.brandon3055.draconicevolution.common.lib.References;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.stream.Collectors;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
@@ -87,12 +86,10 @@ public class Magnet extends ItemDE {
AxisAlignedBB.getBoundingBox(
entity.posX, entity.posY, entity.posZ, entity.posX, entity.posY, entity.posZ)
.expand(range, range, range));
List<EntityItem> nearestItems =
items.stream().limit(ConfigHandler.magnetStackLimit).collect(Collectors.toList());
boolean playSound = false;
for (EntityItem item : nearestItems) {
for (EntityItem item : items) {
if (item.getEntityItem() == null) {
continue;
}