mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 14:34:16 +01:00
Fix harvester culling
- Make harvester's render box a unit cube - Expose manually animated speed through getter
This commit is contained in:
parent
8d90137b1a
commit
178af2061f
@ -36,7 +36,7 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
|
||||
BlockState blockState = te.getBlockState();
|
||||
SuperByteBuffer superBuffer = PartialBufferer.get(AllBlockPartials.HARVESTER_BLADE, blockState);
|
||||
transform(te.getWorld(), blockState.get(HarvesterBlock.HORIZONTAL_FACING), superBuffer,
|
||||
te.manuallyAnimatedSpeed);
|
||||
te.getAnimatedSpeed());
|
||||
superBuffer.light(light)
|
||||
.renderInto(ms, buffer.getBuffer(RenderType.getCutoutMipped()));
|
||||
}
|
||||
|
@ -3,15 +3,27 @@ package com.simibubi.create.content.contraptions.components.actors;
|
||||
import com.simibubi.create.foundation.tileEntity.SyncedTileEntity;
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
|
||||
public class HarvesterTileEntity extends SyncedTileEntity {
|
||||
|
||||
private static final AxisAlignedBB RENDER_BOX = new AxisAlignedBB(0, 0, 0, 1, 1, 1);
|
||||
|
||||
// For simulations such as Ponder
|
||||
private float manuallyAnimatedSpeed;
|
||||
|
||||
public HarvesterTileEntity(TileEntityType<? extends HarvesterTileEntity> type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
// For simulations such as Ponder
|
||||
float manuallyAnimatedSpeed;
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return RENDER_BOX.offset(pos);
|
||||
}
|
||||
|
||||
public float getAnimatedSpeed() {
|
||||
return manuallyAnimatedSpeed;
|
||||
}
|
||||
|
||||
public void setAnimatedSpeed(float speed) {
|
||||
manuallyAnimatedSpeed = speed;
|
||||
|
Loading…
Reference in New Issue
Block a user