Skip to content

Commit

Permalink
Deprecate the redundant drawAnimations methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Nov 3, 2016
1 parent 4ad356a commit c4c03e0
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -5,4 +5,4 @@ curse_project_id=238222

version_major=3
version_minor=13
version_patch=0
version_patch=1
3 changes: 3 additions & 0 deletions src/main/java/mezz/jei/api/recipe/IRecipeCategory.java
Expand Up @@ -50,7 +50,10 @@ public interface IRecipeCategory<T extends IRecipeWrapper> {
*
* @see IDrawableAnimated for a simple class for drawing animated things.
* @see IGuiHelper for useful functions.
* @deprecated since 3.13.1. Move animations into {@link #drawExtras(Minecraft)},
* these are being combined because nobody uses the config option to disable animations.
*/
@Deprecated
void drawAnimations(Minecraft minecraft);

/**
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/mezz/jei/api/recipe/IRecipeWrapper.java
Expand Up @@ -79,7 +79,10 @@ public interface IRecipeWrapper {
*
* @see IDrawableAnimated for a simple class for drawing animated things.
* @see IGuiHelper for useful functions.
* @deprecated since 3.13.1. Move animations into {@link #drawInfo(Minecraft, int, int, int, int)},
* these are being combined because nobody uses the config option to disable animations.
*/
@Deprecated
void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight);

/**
Expand Down
14 changes: 4 additions & 10 deletions src/main/java/mezz/jei/gui/RecipeLayout.java
Expand Up @@ -82,29 +82,23 @@ public <T extends IRecipeWrapper> RecipeLayout(int index, int posX, int posY, IR
}
}

public void draw(Minecraft minecraft, int mouseX, int mouseY) {
public void draw(Minecraft minecraft, final int mouseX, final int mouseY) {
IDrawable background = recipeCategory.getBackground();

GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableLighting();
GlStateManager.enableAlpha();

final int recipeMouseX = mouseX - posX;
final int recipeMouseY = mouseY - posY;

GlStateManager.pushMatrix();
GlStateManager.translate(posX, posY, 0.0F);
{
background.draw(minecraft);
recipeCategory.drawExtras(minecraft);
recipeCategory.drawAnimations(minecraft);
recipeWrapper.drawAnimations(minecraft, background.getWidth(), background.getHeight());
}
GlStateManager.popMatrix();

final int recipeMouseX = mouseX - posX;
final int recipeMouseY = mouseY - posY;

GlStateManager.pushMatrix();
GlStateManager.translate(posX, posY, 0.0F);
{
recipeWrapper.drawInfo(minecraft, background.getWidth(), background.getHeight(), recipeMouseX, recipeMouseY);
}
GlStateManager.popMatrix();
Expand Down
Expand Up @@ -66,10 +66,6 @@ public IDrawable getBackground() {
public void drawExtras(Minecraft minecraft) {
slotDrawable.draw(minecraft, outputSlotX, outputSlotY);
blazeHeat.draw(minecraft, 5, 29);
}

@Override
public void drawAnimations(Minecraft minecraft) {
bubbles.draw(minecraft, 8, 0);
arrow.draw(minecraft, 42, 1);
}
Expand Down
Expand Up @@ -55,12 +55,8 @@ public List<List<ItemStack>> getInputs() {

@Override
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
flame.draw(minecraft, 2, 0);
minecraft.fontRendererObj.drawString(smeltCountString, 24, 8, Color.gray.getRGB());
minecraft.fontRendererObj.drawString(burnTimeString, 24, 18, Color.gray.getRGB());
}

@Override
public void drawAnimations(Minecraft minecraft, int recipeWidth, int recipeHeight) {
flame.draw(minecraft, 2, 0);
}
}
Expand Up @@ -30,7 +30,7 @@ public IDrawable getBackground() {
}

@Override
public void drawAnimations(Minecraft minecraft) {
public void drawExtras(Minecraft minecraft) {
flame.draw(minecraft, 2, 20);
arrow.draw(minecraft, 24, 18);
}
Expand Down

0 comments on commit c4c03e0

Please sign in to comment.