Added default levels for fluid extended properties in fluid model.
This commit is contained in:
parent
6b51665c42
commit
e8915b6a55
1 changed files with 4 additions and 2 deletions
|
@ -149,7 +149,8 @@ public class ModelFluid implements IModelCustomData<ModelFluid>
|
|||
IExtendedBlockState state = stateOption.get();
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
cornerRound[i] = Math.round(state.getValue(BlockFluidBase.LEVEL_CORNERS[i]) * 768);
|
||||
Float level = state.getValue(BlockFluidBase.LEVEL_CORNERS[i]);
|
||||
cornerRound[i] = Math.round((level == null ? 7f / 8 : level) * 768);
|
||||
}
|
||||
}
|
||||
return cornerRound;
|
||||
|
@ -157,10 +158,11 @@ public class ModelFluid implements IModelCustomData<ModelFluid>
|
|||
|
||||
private static int getFlow(Optional<IExtendedBlockState> stateOption)
|
||||
{
|
||||
float flow = -1000;
|
||||
Float flow = -1000f;
|
||||
if(stateOption.isPresent())
|
||||
{
|
||||
flow = stateOption.get().getValue(BlockFluidBase.FLOW_DIRECTION);
|
||||
if(flow == null) flow = -1000f;
|
||||
}
|
||||
int flowRound = (int)Math.round(Math.toDegrees(flow));
|
||||
flowRound = MathHelper.clamp_int(flowRound, -1000, 1000);
|
||||
|
|
Loading…
Reference in a new issue