reformatted all src files (#141)
This commit is contained in:
@@ -19,63 +19,53 @@
|
||||
package appeng.parts.p2p;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.api.parts.IPartModel;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.parts.PartModel;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Helper for maintaining the models used for a variant of the P2P bus.
|
||||
*/
|
||||
class P2PModels
|
||||
{
|
||||
class P2PModels {
|
||||
|
||||
public static final ResourceLocation MODEL_STATUS_OFF = new ResourceLocation( AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_off" );
|
||||
public static final ResourceLocation MODEL_STATUS_ON = new ResourceLocation( AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_on" );
|
||||
public static final ResourceLocation MODEL_STATUS_HAS_CHANNEL = new ResourceLocation( AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_has_channel" );
|
||||
public static final ResourceLocation MODEL_FREQUENCY = new ResourceLocation( AppEng.MOD_ID, "part/builtin/p2p_tunnel_frequency" );
|
||||
public static final ResourceLocation MODEL_STATUS_OFF = new ResourceLocation(AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_off");
|
||||
public static final ResourceLocation MODEL_STATUS_ON = new ResourceLocation(AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_on");
|
||||
public static final ResourceLocation MODEL_STATUS_HAS_CHANNEL = new ResourceLocation(AppEng.MOD_ID, "part/p2p/p2p_tunnel_status_has_channel");
|
||||
public static final ResourceLocation MODEL_FREQUENCY = new ResourceLocation(AppEng.MOD_ID, "part/builtin/p2p_tunnel_frequency");
|
||||
|
||||
private final IPartModel modelsOff;
|
||||
private final IPartModel modelsOn;
|
||||
private final IPartModel modelsHasChannel;
|
||||
private final IPartModel modelsOff;
|
||||
private final IPartModel modelsOn;
|
||||
private final IPartModel modelsHasChannel;
|
||||
|
||||
public P2PModels( String frontModelPath )
|
||||
{
|
||||
ResourceLocation frontModel = new ResourceLocation( AppEng.MOD_ID, frontModelPath );
|
||||
public P2PModels(String frontModelPath) {
|
||||
ResourceLocation frontModel = new ResourceLocation(AppEng.MOD_ID, frontModelPath);
|
||||
|
||||
this.modelsOff = new PartModel( MODEL_STATUS_OFF, MODEL_FREQUENCY, frontModel );
|
||||
this.modelsOn = new PartModel( MODEL_STATUS_ON, MODEL_FREQUENCY, frontModel );
|
||||
this.modelsHasChannel = new PartModel( MODEL_STATUS_HAS_CHANNEL, MODEL_FREQUENCY, frontModel );
|
||||
}
|
||||
this.modelsOff = new PartModel(MODEL_STATUS_OFF, MODEL_FREQUENCY, frontModel);
|
||||
this.modelsOn = new PartModel(MODEL_STATUS_ON, MODEL_FREQUENCY, frontModel);
|
||||
this.modelsHasChannel = new PartModel(MODEL_STATUS_HAS_CHANNEL, MODEL_FREQUENCY, frontModel);
|
||||
}
|
||||
|
||||
public IPartModel getModel( boolean hasPower, boolean hasChannel )
|
||||
{
|
||||
if( hasPower && hasChannel )
|
||||
{
|
||||
return this.modelsHasChannel;
|
||||
}
|
||||
else if( hasPower )
|
||||
{
|
||||
return this.modelsOn;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.modelsOff;
|
||||
}
|
||||
}
|
||||
public IPartModel getModel(boolean hasPower, boolean hasChannel) {
|
||||
if (hasPower && hasChannel) {
|
||||
return this.modelsHasChannel;
|
||||
} else if (hasPower) {
|
||||
return this.modelsOn;
|
||||
} else {
|
||||
return this.modelsOff;
|
||||
}
|
||||
}
|
||||
|
||||
public List<IPartModel> getModels()
|
||||
{
|
||||
List<IPartModel> result = new ArrayList<>();
|
||||
result.add( this.modelsOff );
|
||||
result.add( this.modelsOn );
|
||||
result.add( this.modelsHasChannel );
|
||||
return result;
|
||||
}
|
||||
public List<IPartModel> getModels() {
|
||||
List<IPartModel> result = new ArrayList<>();
|
||||
result.add(this.modelsOff);
|
||||
result.add(this.modelsOn);
|
||||
result.add(this.modelsHasChannel);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user