mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-28 16:06:48 +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
2 changed files with 15 additions and 3 deletions
|
@ -36,7 +36,7 @@ public class HarvesterRenderer extends SafeTileEntityRenderer<HarvesterTileEntit
|
||||||
BlockState blockState = te.getBlockState();
|
BlockState blockState = te.getBlockState();
|
||||||
SuperByteBuffer superBuffer = PartialBufferer.get(AllBlockPartials.HARVESTER_BLADE, blockState);
|
SuperByteBuffer superBuffer = PartialBufferer.get(AllBlockPartials.HARVESTER_BLADE, blockState);
|
||||||
transform(te.getWorld(), blockState.get(HarvesterBlock.HORIZONTAL_FACING), superBuffer,
|
transform(te.getWorld(), blockState.get(HarvesterBlock.HORIZONTAL_FACING), superBuffer,
|
||||||
te.manuallyAnimatedSpeed);
|
te.getAnimatedSpeed());
|
||||||
superBuffer.light(light)
|
superBuffer.light(light)
|
||||||
.renderInto(ms, buffer.getBuffer(RenderType.getCutoutMipped()));
|
.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 com.simibubi.create.foundation.tileEntity.SyncedTileEntity;
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
|
||||||
public class HarvesterTileEntity extends SyncedTileEntity {
|
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) {
|
public HarvesterTileEntity(TileEntityType<? extends HarvesterTileEntity> type) {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For simulations such as Ponder
|
@Override
|
||||||
float manuallyAnimatedSpeed;
|
public AxisAlignedBB getRenderBoundingBox() {
|
||||||
|
return RENDER_BOX.offset(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getAnimatedSpeed() {
|
||||||
|
return manuallyAnimatedSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
public void setAnimatedSpeed(float speed) {
|
public void setAnimatedSpeed(float speed) {
|
||||||
manuallyAnimatedSpeed = speed;
|
manuallyAnimatedSpeed = speed;
|
||||||
|
|
Loading…
Reference in a new issue