mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Added default levels for fluid extended properties in fluid model.
This commit is contained in:
1 parent
6b51665c42
commit
e8915b6a55
1 file changed
+4
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user