reformatted all src files (#141)
This commit is contained in:
@@ -19,82 +19,70 @@
|
||||
package appeng.integration.modules.jei;
|
||||
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import com.google.common.base.Splitter;
|
||||
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.client.config.HoverChecker;
|
||||
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
class CondenserOutputWrapper implements IRecipeWrapper
|
||||
{
|
||||
private final ItemStack outputItem;
|
||||
class CondenserOutputWrapper implements IRecipeWrapper {
|
||||
private final ItemStack outputItem;
|
||||
|
||||
private final CondenserOutput condenserOutput;
|
||||
private final CondenserOutput condenserOutput;
|
||||
|
||||
private final HoverChecker buttonHoverChecker;
|
||||
private final HoverChecker buttonHoverChecker;
|
||||
|
||||
private final IDrawable buttonIcon;
|
||||
private final IDrawable buttonIcon;
|
||||
|
||||
CondenserOutputWrapper( CondenserOutput condenserOutput, ItemStack outputItem, IDrawable buttonIcon )
|
||||
{
|
||||
this.condenserOutput = condenserOutput;
|
||||
this.outputItem = outputItem;
|
||||
this.buttonIcon = buttonIcon;
|
||||
this.buttonHoverChecker = new HoverChecker( 28, 28 + 16, 78, 78 + 16, 0 );
|
||||
}
|
||||
CondenserOutputWrapper(CondenserOutput condenserOutput, ItemStack outputItem, IDrawable buttonIcon) {
|
||||
this.condenserOutput = condenserOutput;
|
||||
this.outputItem = outputItem;
|
||||
this.buttonIcon = buttonIcon;
|
||||
this.buttonHoverChecker = new HoverChecker(28, 28 + 16, 78, 78 + 16, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients( IIngredients ingredients )
|
||||
{
|
||||
ingredients.setOutput( ItemStack.class, this.outputItem );
|
||||
}
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setOutput(ItemStack.class, this.outputItem);
|
||||
}
|
||||
|
||||
public CondenserOutput getCondenserOutput()
|
||||
{
|
||||
return this.condenserOutput;
|
||||
}
|
||||
public CondenserOutput getCondenserOutput() {
|
||||
return this.condenserOutput;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings( int mouseX, int mouseY )
|
||||
{
|
||||
if( this.buttonHoverChecker.checkHover( mouseX, mouseY ) )
|
||||
{
|
||||
String key;
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY) {
|
||||
if (this.buttonHoverChecker.checkHover(mouseX, mouseY)) {
|
||||
String key;
|
||||
|
||||
switch( this.condenserOutput )
|
||||
{
|
||||
case MATTER_BALLS:
|
||||
key = "gui.tooltips.appliedenergistics2.MatterBalls";
|
||||
break;
|
||||
case SINGULARITY:
|
||||
key = "gui.tooltips.appliedenergistics2.Singularity";
|
||||
break;
|
||||
default:
|
||||
return Collections.emptyList();
|
||||
}
|
||||
switch (this.condenserOutput) {
|
||||
case MATTER_BALLS:
|
||||
key = "gui.tooltips.appliedenergistics2.MatterBalls";
|
||||
break;
|
||||
case SINGULARITY:
|
||||
key = "gui.tooltips.appliedenergistics2.Singularity";
|
||||
break;
|
||||
default:
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
return Splitter.on( "\\n" ).splitToList( I18n.format( key, this.condenserOutput.requiredPower ) );
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return Splitter.on("\\n").splitToList(I18n.format(key, this.condenserOutput.requiredPower));
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo( Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY )
|
||||
{
|
||||
this.buttonIcon.draw( minecraft );
|
||||
}
|
||||
@Override
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
this.buttonIcon.draw(minecraft);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user