* Fix more warnings and do some small optimizations * Fix more warnings in ValueConversions * Clean up some decompiler names and fix an unnecessary transformation around commands * Use (way) more compact data structure for slot map * Minor tweaks Such as map directly in the collector * I hate vanilla javac Revert map changes in latest commit
29 lines
990 B
Java
29 lines
990 B
Java
package carpet.mixins;
|
|
|
|
import carpet.fakes.SimpleEntityLookupInterface;
|
|
import org.spongepowered.asm.mixin.Final;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.Shadow;
|
|
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import net.minecraft.world.level.ChunkPos;
|
|
import net.minecraft.world.level.entity.EntityAccess;
|
|
import net.minecraft.world.level.entity.EntitySection;
|
|
import net.minecraft.world.level.entity.EntitySectionStorage;
|
|
import net.minecraft.world.level.entity.LevelEntityGetterAdapter;
|
|
|
|
@Mixin(LevelEntityGetterAdapter.class)
|
|
public class LevelEntityGetterAdapter_scarpetMixin<T extends EntityAccess> implements SimpleEntityLookupInterface<T>
|
|
{
|
|
|
|
@Shadow @Final private EntitySectionStorage<T> sectionStorage;
|
|
|
|
@Override
|
|
public List<T> getChunkEntities(ChunkPos chpos) {
|
|
return this.sectionStorage.getExistingSectionsInChunk(chpos.toLong()).flatMap(EntitySection::getEntities).collect(Collectors.toList());
|
|
}
|
|
}
|
|
|
|
|