|
2 | 2 |
|
3 | 3 | import com.google.common.collect.ImmutableSet; |
4 | 4 | import cpw.mods.fml.common.FMLCommonHandler; |
| 5 | +import java.util.List; |
| 6 | +import java.util.Set; |
5 | 7 | import net.minecraft.entity.Entity; |
6 | 8 | import net.minecraft.entity.EntityList; |
7 | 9 | import net.minecraft.entity.EntityLiving; |
8 | 10 | import net.minecraft.entity.EntityLivingBase; |
9 | 11 | import net.minecraft.entity.player.EntityPlayer; |
10 | | -import net.minecraft.tileentity.TileEntity; |
11 | 12 | import net.minecraft.util.MathHelper; |
12 | 13 | import net.minecraft.world.EnumDifficulty; |
13 | 14 | import net.minecraft.world.World; |
|
23 | 24 | import org.spongepowered.asm.mixin.injection.At; |
24 | 25 | import org.spongepowered.asm.mixin.injection.Inject; |
25 | 26 | import org.spongepowered.asm.mixin.injection.Redirect; |
26 | | -import org.spongepowered.asm.mixin.injection.Slice; |
27 | 27 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
28 | 28 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
29 | 29 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; |
30 | 30 |
|
31 | | -import java.util.*; |
32 | | - |
33 | 31 | @Mixin(World.class) |
34 | 32 | public abstract class MixinWorld { |
35 | 33 | @Shadow public boolean isRemote; |
@@ -142,17 +140,4 @@ private void saveInactiveChunks(CallbackInfo ci) { |
142 | 140 | } |
143 | 141 | } |
144 | 142 | } |
145 | | - |
146 | | - @Redirect(method = "updateEntities", slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/tileentity/TileEntity;onChunkUnload()V", remap = false)), at = @At(value = "INVOKE", target = "Ljava/util/List;removeAll(Ljava/util/Collection;)Z", ordinal = 0)) |
147 | | - private boolean removeInUnloaded(List<TileEntity> instance, Collection<TileEntity> objects) { |
148 | | - if (ArchaicConfig.fixTEUnloadLag) { |
149 | | - // Arbitrary number chosen because contains() will be fast enough on a tiny list |
150 | | - if(objects.size() > 3) { |
151 | | - Set<TileEntity> toRemove = Collections.newSetFromMap(new IdentityHashMap<>(objects.size())); |
152 | | - toRemove.addAll(objects); |
153 | | - objects = toRemove; |
154 | | - } |
155 | | - } |
156 | | - return instance.removeAll(objects); |
157 | | - } |
158 | 143 | } |
0 commit comments