Flywheel/src/main/java/com/jozufozu/flywheel/light/BasicProvider.java
Jozufozu f3c57b4ae4 Reorganize, rename, refactor, 0.4.0
- Move most user facing interfaces to flywheel.api package
 - Refactor InstanceData to have no package private classes
 - Remove 'I' prefix from many interfaces
 - ILightUpdateListener -> LightListener
 - IMultiProgram -> ContextAwareProgram
 - IFlatLight -> FlatLit
 - All materials use the same vertex format: UNLIT_MODEL
2021-12-09 00:42:27 -08:00

23 lines
621 B
Java

package com.jozufozu.flywheel.light;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.LightLayer;
/**
* Wraps a world and minimally lowers the interface.
*/
public class BasicProvider implements LightProvider {
private final BlockAndTintGetter reader;
private final BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos();
public BasicProvider(BlockAndTintGetter reader) {
this.reader = reader;
}
@Override
public int getLight(LightLayer type, int x, int y, int z) {
return reader.getBrightness(type, pos.set(x, y, z));
}
}