mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +01:00
fix fan shaft lighting
This commit is contained in:
parent
0ec312340f
commit
d1dccffc67
1 changed files with 18 additions and 1 deletions
|
@ -41,7 +41,24 @@ public class EncasedFanRenderer extends KineticTileEntityRenderer {
|
||||||
InstanceBuffer<RotatingData> fanInner =
|
InstanceBuffer<RotatingData> fanInner =
|
||||||
AllBlockPartials.ENCASED_FAN_INNER.renderOnDirectionalSouthRotating(ctx, te.getBlockState(), direction.getOpposite());
|
AllBlockPartials.ENCASED_FAN_INNER.renderOnDirectionalSouthRotating(ctx, te.getBlockState(), direction.getOpposite());
|
||||||
|
|
||||||
renderRotatingBuffer(ctx, shaftHalf);
|
shaftHalf.setupInstance(data -> {
|
||||||
|
final BlockPos pos = te.getPos();
|
||||||
|
Direction.Axis axis = ((IRotate) te.getBlockState()
|
||||||
|
.getBlock()).getRotationAxis(te.getBlockState());
|
||||||
|
data.setRotationalSpeed(te.getSpeed())
|
||||||
|
.setRotationOffset(getRotationOffsetForPosition(te, pos, axis))
|
||||||
|
.setRotationAxis(Direction.getFacingFromAxis(Direction.AxisDirection.POSITIVE, axis).getUnitVector())
|
||||||
|
.setTileEntity(te);
|
||||||
|
|
||||||
|
if (ctx.checkWorldLight()) {
|
||||||
|
BlockPos behind = te.getPos().offset(direction.getOpposite());
|
||||||
|
int blockLight = te.getWorld().getLightLevel(LightType.BLOCK, behind);
|
||||||
|
int skyLight = te.getWorld().getLightLevel(LightType.SKY, behind);
|
||||||
|
|
||||||
|
data.setBlockLight(blockLight)
|
||||||
|
.setSkyLight(skyLight);
|
||||||
|
}
|
||||||
|
});
|
||||||
fanInner.setupInstance(data -> {
|
fanInner.setupInstance(data -> {
|
||||||
final BlockPos pos = te.getPos();
|
final BlockPos pos = te.getPos();
|
||||||
Direction.Axis axis = ((IRotate) te.getBlockState()
|
Direction.Axis axis = ((IRotate) te.getBlockState()
|
||||||
|
|
Loading…
Reference in a new issue