reformatted all src files (#141)
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
|
||||
package appeng.client.render.model;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Function;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
@@ -15,57 +11,50 @@ import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
/**
|
||||
* Model wrapper for the biometric card item model, which combines a base card layer with a "visual hash" of the player
|
||||
* name
|
||||
*/
|
||||
public class BiometricCardModel implements IModel
|
||||
{
|
||||
public class BiometricCardModel implements IModel {
|
||||
|
||||
private static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "item/biometric_card" );
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation( AppEng.MOD_ID, "items/biometric_card_hash" );
|
||||
private static final ResourceLocation MODEL_BASE = new ResourceLocation(AppEng.MOD_ID, "item/biometric_card");
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation(AppEng.MOD_ID, "items/biometric_card_hash");
|
||||
|
||||
@Override
|
||||
public Collection<ResourceLocation> getDependencies()
|
||||
{
|
||||
return Collections.singletonList( MODEL_BASE );
|
||||
}
|
||||
@Override
|
||||
public Collection<ResourceLocation> getDependencies() {
|
||||
return Collections.singletonList(MODEL_BASE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ResourceLocation> getTextures()
|
||||
{
|
||||
return Collections.singletonList( TEXTURE );
|
||||
}
|
||||
@Override
|
||||
public Collection<ResourceLocation> getTextures() {
|
||||
return Collections.singletonList(TEXTURE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBakedModel bake( IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
|
||||
{
|
||||
TextureAtlasSprite texture = bakedTextureGetter.apply( TEXTURE );
|
||||
@Override
|
||||
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
|
||||
TextureAtlasSprite texture = bakedTextureGetter.apply(TEXTURE);
|
||||
|
||||
IBakedModel baseModel = this.getBaseModel( state, format, bakedTextureGetter );
|
||||
IBakedModel baseModel = this.getBaseModel(state, format, bakedTextureGetter);
|
||||
|
||||
return new BiometricCardBakedModel( format, baseModel, texture );
|
||||
}
|
||||
return new BiometricCardBakedModel(format, baseModel, texture);
|
||||
}
|
||||
|
||||
private IBakedModel getBaseModel( IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
|
||||
{
|
||||
// Load the base model
|
||||
try
|
||||
{
|
||||
return ModelLoaderRegistry.getModel( MODEL_BASE ).bake( state, format, bakedTextureGetter );
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
throw new RuntimeException( e );
|
||||
}
|
||||
}
|
||||
private IBakedModel getBaseModel(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
|
||||
// Load the base model
|
||||
try {
|
||||
return ModelLoaderRegistry.getModel(MODEL_BASE).bake(state, format, bakedTextureGetter);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IModelState getDefaultState()
|
||||
{
|
||||
return TRSRTransformation.identity();
|
||||
}
|
||||
@Override
|
||||
public IModelState getDefaultState() {
|
||||
return TRSRTransformation.identity();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user