Format sourcecode
This commit is contained in:
@@ -74,7 +74,8 @@ class CraftingCubeModel implements IModel
|
||||
@Override
|
||||
public Collection<ResourceLocation> getTextures()
|
||||
{
|
||||
return ImmutableList.of( RING_CORNER, RING_SIDE_HOR, RING_SIDE_VER, UNIT_BASE, LIGHT_BASE, ACCELERATOR_LIGHT, STORAGE_1K_LIGHT, STORAGE_4K_LIGHT, STORAGE_16K_LIGHT, STORAGE_64K_LIGHT, MONITOR_BASE, MONITOR_LIGHT_DARK, MONITOR_LIGHT_MEDIUM, MONITOR_LIGHT_BRIGHT );
|
||||
return ImmutableList.of( RING_CORNER, RING_SIDE_HOR, RING_SIDE_VER, UNIT_BASE, LIGHT_BASE, ACCELERATOR_LIGHT, STORAGE_1K_LIGHT, STORAGE_4K_LIGHT,
|
||||
STORAGE_16K_LIGHT, STORAGE_64K_LIGHT, MONITOR_BASE, MONITOR_LIGHT_DARK, MONITOR_LIGHT_MEDIUM, MONITOR_LIGHT_BRIGHT );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -94,9 +95,12 @@ class CraftingCubeModel implements IModel
|
||||
case STORAGE_4K:
|
||||
case STORAGE_16K:
|
||||
case STORAGE_64K:
|
||||
return new LightBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter.apply( LIGHT_BASE ), getLightTexture( bakedTextureGetter, type ) );
|
||||
return new LightBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter
|
||||
.apply( LIGHT_BASE ), getLightTexture( bakedTextureGetter, type ) );
|
||||
case MONITOR:
|
||||
return new MonitorBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter.apply( UNIT_BASE ), bakedTextureGetter.apply( MONITOR_BASE ), bakedTextureGetter.apply( MONITOR_LIGHT_DARK ), bakedTextureGetter.apply( MONITOR_LIGHT_MEDIUM ), bakedTextureGetter.apply( MONITOR_LIGHT_BRIGHT ) );
|
||||
return new MonitorBakedModel( format, ringCorner, ringSideHor, ringSideVer, bakedTextureGetter.apply( UNIT_BASE ), bakedTextureGetter
|
||||
.apply( MONITOR_BASE ), bakedTextureGetter.apply(
|
||||
MONITOR_LIGHT_DARK ), bakedTextureGetter.apply( MONITOR_LIGHT_MEDIUM ), bakedTextureGetter.apply( MONITOR_LIGHT_BRIGHT ) );
|
||||
default:
|
||||
throw new IllegalArgumentException( "Unsupported crafting unit type: " + type );
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
@@ -31,8 +32,10 @@ import appeng.items.misc.ItemEncodedPattern;
|
||||
|
||||
|
||||
/**
|
||||
* This special model handles switching between rendering the crafting output of an encoded pattern (when shift is being held), and
|
||||
* showing the encoded pattern itself. Matters are further complicated by only wanting to show the crafting output when the pattern is being
|
||||
* This special model handles switching between rendering the crafting output of an encoded pattern (when shift is being
|
||||
* held), and
|
||||
* showing the encoded pattern itself. Matters are further complicated by only wanting to show the crafting output when
|
||||
* the pattern is being
|
||||
* rendered in the GUI, and not anywhere else.
|
||||
*/
|
||||
class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
@@ -105,10 +108,14 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Since the ItemOverrideList handling comes before handling the perspective awareness (which is the first place where we
|
||||
* know how we are being rendered) we need to remember the model of the crafting output, and make the decision on which to render later on.
|
||||
* Sadly, Forge is pretty inconsistent when it will call the handlePerspective method, so some methods are called even on this interim-model.
|
||||
* Usually those methods only matter for rendering on the ground and other cases, where we wouldn't render the crafting output model anyway,
|
||||
* Since the ItemOverrideList handling comes before handling the perspective awareness (which is the first place
|
||||
* where we
|
||||
* know how we are being rendered) we need to remember the model of the crafting output, and make the decision on
|
||||
* which to render later on.
|
||||
* Sadly, Forge is pretty inconsistent when it will call the handlePerspective method, so some methods are called
|
||||
* even on this interim-model.
|
||||
* Usually those methods only matter for rendering on the ground and other cases, where we wouldn't render the
|
||||
* crafting output model anyway,
|
||||
* so in those cases we delegate to the model of the encoded pattern.
|
||||
*/
|
||||
private class ShiftHoldingModelWrapper implements IBakedModel
|
||||
@@ -199,10 +206,11 @@ class ItemEncodedPatternBakedModel implements IBakedModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Item Override Lists are the only point during item rendering where we can access the item stack that is being rendered.
|
||||
* So this is the point where we actually check if shift is being held, and if so, determine the crafting output model.
|
||||
* Item Override Lists are the only point during item rendering where we can access the item stack that is being
|
||||
* rendered.
|
||||
* So this is the point where we actually check if shift is being held, and if so, determine the crafting output
|
||||
* model.
|
||||
*/
|
||||
private class CustomOverrideList extends ItemOverrideList
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
@@ -54,7 +55,7 @@ class ItemEncodedPatternModel implements IModel
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms = PerspectiveMapWrapper.getTransforms(state);
|
||||
ImmutableMap<ItemCameraTransforms.TransformType, TRSRTransformation> transforms = PerspectiveMapWrapper.getTransforms( state );
|
||||
|
||||
return new ItemEncodedPatternBakedModel( baseModel, transforms );
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package appeng.client.render.crafting;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user