forked from GTNewHorizons/Advanced-Botany
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from EnderProyects/main
Main
- Loading branch information
Showing
37 changed files
with
3,627 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package ab.api.recipe; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.minecraft.inventory.IInventory; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class RecipeFountainAlchemy { | ||
|
||
private ItemStack output; | ||
private int color; | ||
private List<ItemStack> inputs; | ||
|
||
private int mana; | ||
|
||
public RecipeFountainAlchemy(ItemStack output, int mana, int color, ItemStack... inputs2) { | ||
this.output = output; | ||
this.mana = mana; | ||
this.color = color; | ||
List<ItemStack> inputsToSet = new ArrayList(); | ||
for (ItemStack obj : inputs2) inputsToSet.add(obj); | ||
this.inputs = inputsToSet; | ||
} | ||
|
||
public List<ItemStack> getInputs() { | ||
return new ArrayList(this.inputs); | ||
} | ||
|
||
public ItemStack getOutput() { | ||
return this.output; | ||
} | ||
|
||
public int getManaUsage() { | ||
return this.mana; | ||
} | ||
|
||
public int getColor() { | ||
return this.color; | ||
} | ||
|
||
public boolean matches(IInventory inv) { | ||
List<ItemStack> inputsMissing = new ArrayList(this.inputs); | ||
for (int i = 1; i < inv.getSizeInventory(); i++) { | ||
ItemStack stack = inv.getStackInSlot(i); | ||
if (stack == null) break; | ||
int stackIndex = -1; | ||
for (int j = 0; j < inputsMissing.size(); j++) { | ||
ItemStack input = inputsMissing.get(j); | ||
if (input instanceof ItemStack && simpleAreStacksEqual(input.copy(), stack)) { | ||
stackIndex = j; | ||
break; | ||
} | ||
} | ||
if (stackIndex != -1) { | ||
inputsMissing.remove(stackIndex); | ||
} else { | ||
return false; | ||
} | ||
} | ||
return inputsMissing.isEmpty(); | ||
} | ||
|
||
boolean simpleAreStacksEqual(ItemStack input, ItemStack stack) { | ||
if (input.getItemDamage() == 32767) input.setItemDamage(stack.getItemDamage()); | ||
return (input.getItem() == stack.getItem() && input.getItemDamage() == stack.getItemDamage()); | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
src/main/java/ab/api/recipe/RecipeFountainConjuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package ab.api.recipe; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.minecraft.inventory.IInventory; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class RecipeFountainConjuration { | ||
|
||
private ItemStack output; | ||
private int color; | ||
private List<ItemStack> inputs; | ||
private int mana; | ||
|
||
public RecipeFountainConjuration(ItemStack output, int mana, int color, ItemStack... inputs2) { | ||
this.output = output; | ||
this.mana = mana; | ||
this.color = color; | ||
List<ItemStack> inputsToSet = new ArrayList(); | ||
for (ItemStack obj : inputs2) inputsToSet.add(obj); | ||
this.inputs = inputsToSet; | ||
} | ||
|
||
public List<ItemStack> getInputs() { | ||
return new ArrayList(this.inputs); | ||
} | ||
|
||
public ItemStack getOutput() { | ||
return this.output; | ||
} | ||
|
||
public int getManaUsage() { | ||
return this.mana; | ||
} | ||
|
||
public int getColor() { | ||
return this.color; | ||
} | ||
|
||
public boolean matches(IInventory inv) { | ||
List<ItemStack> inputsMissing = new ArrayList(this.inputs); | ||
for (int i = 1; i < inv.getSizeInventory(); i++) { | ||
ItemStack stack = inv.getStackInSlot(i); | ||
if (stack == null) break; | ||
int stackIndex = -1; | ||
for (int j = 0; j < inputsMissing.size(); j++) { | ||
ItemStack input = inputsMissing.get(j); | ||
if (input instanceof ItemStack && simpleAreStacksEqual(input.copy(), stack)) { | ||
stackIndex = j; | ||
break; | ||
} | ||
} | ||
if (stackIndex != -1) { | ||
inputsMissing.remove(stackIndex); | ||
} else { | ||
return false; | ||
} | ||
} | ||
return inputsMissing.isEmpty(); | ||
} | ||
|
||
boolean simpleAreStacksEqual(ItemStack input, ItemStack stack) { | ||
if (input.getItemDamage() == 32767) input.setItemDamage(stack.getItemDamage()); | ||
return (input.getItem() == stack.getItem() && input.getItemDamage() == stack.getItemDamage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package ab.api.recipe; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.minecraft.inventory.IInventory; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class RecipeFountainMana { | ||
|
||
private ItemStack output; | ||
private int color; | ||
private List<ItemStack> inputs; | ||
private int mana; | ||
|
||
public RecipeFountainMana(ItemStack output, int mana, int color, ItemStack... inputs2) { | ||
this.output = output; | ||
this.mana = mana; | ||
this.color = color; | ||
List<ItemStack> inputsToSet = new ArrayList(); | ||
for (ItemStack obj : inputs2) inputsToSet.add(obj); | ||
this.inputs = inputsToSet; | ||
} | ||
|
||
public List<ItemStack> getInputs() { | ||
return new ArrayList(this.inputs); | ||
} | ||
|
||
public ItemStack getOutput() { | ||
return this.output; | ||
} | ||
|
||
public int getManaUsage() { | ||
return this.mana; | ||
} | ||
|
||
public int getColor() { | ||
return this.color; | ||
} | ||
|
||
public boolean matches(IInventory inv) { | ||
List<ItemStack> inputsMissing = new ArrayList(this.inputs); | ||
for (int i = 1; i < inv.getSizeInventory(); i++) { | ||
ItemStack stack = inv.getStackInSlot(i); | ||
if (stack == null) break; | ||
int stackIndex = -1; | ||
for (int j = 0; j < inputsMissing.size(); j++) { | ||
ItemStack input = inputsMissing.get(j); | ||
if (input instanceof ItemStack && simpleAreStacksEqual(input.copy(), stack)) { | ||
stackIndex = j; | ||
break; | ||
} | ||
} | ||
if (stackIndex != -1) { | ||
inputsMissing.remove(stackIndex); | ||
} else { | ||
return false; | ||
} | ||
} | ||
return inputsMissing.isEmpty(); | ||
} | ||
|
||
boolean simpleAreStacksEqual(ItemStack input, ItemStack stack) { | ||
if (input.getItemDamage() == 32767) input.setItemDamage(stack.getItemDamage()); | ||
return (input.getItem() == stack.getItem() && input.getItemDamage() == stack.getItemDamage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package ab.client.model; | ||
|
||
import net.minecraft.client.model.ModelBase; | ||
import net.minecraft.client.model.ModelBox; | ||
import net.minecraft.client.model.ModelRenderer; | ||
|
||
public class ModelFountainAlchemy extends ModelBase { | ||
|
||
private final ModelRenderer bottomAnvil; | ||
private final ModelRenderer topAnvil; | ||
|
||
public ModelFountainAlchemy() { | ||
textureWidth = 48; | ||
textureHeight = 48; | ||
|
||
bottomAnvil = new ModelRenderer(this); | ||
bottomAnvil.setRotationPoint(0.0F, 24.0F, 0.0F); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 32, 26, -3.0F, -1.0F, -4.0F, 6, 1, 1, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 0, 31, -5.0F, -1.0F, -3.0F, 12, 1, 6, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 32, 17, -2.0F, -3.0F, -2.0F, 4, 1, 4, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 0, 8, -4.0F, -2.0F, -3.0F, 8, 1, 6, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 32, 23, -3.0F, -1.0F, 3.0F, 6, 1, 1, 0.0F)); | ||
|
||
topAnvil = new ModelRenderer(this); | ||
topAnvil.setRotationPoint(0.0F, 26.0F, 0.0F); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 23, -6.5F, -11.0F, -3.0F, 12, 2, 6, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 38, -5.5F, -12.0F, -4.0F, 13, 2, 8, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 15, -5.5F, -9.0F, -3.0F, 9, 2, 6, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 17, 0, -4.5F, -11.0F, 2.5F, 7, 3, 1, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 0, -4.5F, -11.0F, -3.5F, 7, 3, 1, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 30, 12, -2.5F, -7.0F, -2.0F, 5, 1, 4, 0.0F)); | ||
} | ||
|
||
public void renderBottom() { | ||
bottomAnvil.render(0.0625f); | ||
} | ||
|
||
public void renderTop() { | ||
topAnvil.render(0.0625f); | ||
} | ||
|
||
public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { | ||
modelRenderer.rotateAngleX = x; | ||
modelRenderer.rotateAngleY = y; | ||
modelRenderer.rotateAngleZ = z; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/ab/client/model/ModelFountainConjuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package ab.client.model; | ||
|
||
import net.minecraft.client.model.ModelBase; | ||
import net.minecraft.client.model.ModelBox; | ||
import net.minecraft.client.model.ModelRenderer; | ||
|
||
public class ModelFountainConjuration extends ModelBase { | ||
|
||
private final ModelRenderer bottomAnvil; | ||
private final ModelRenderer topAnvil; | ||
|
||
public ModelFountainConjuration() { | ||
textureWidth = 48; | ||
textureHeight = 48; | ||
|
||
bottomAnvil = new ModelRenderer(this); | ||
bottomAnvil.setRotationPoint(0.0F, 24.0F, 0.0F); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 32, 26, -3.0F, -1.0F, -4.0F, 6, 1, 1, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 0, 31, -5.0F, -1.0F, -3.0F, 12, 1, 6, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 32, 17, -2.0F, -3.0F, -2.0F, 4, 1, 4, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 0, 8, -4.0F, -2.0F, -3.0F, 8, 1, 6, 0.0F)); | ||
bottomAnvil.cubeList.add(new ModelBox(bottomAnvil, 32, 23, -3.0F, -1.0F, 3.0F, 6, 1, 1, 0.0F)); | ||
|
||
topAnvil = new ModelRenderer(this); | ||
topAnvil.setRotationPoint(0.0F, 26.0F, 0.0F); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 23, -6.5F, -11.0F, -3.0F, 12, 2, 6, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 38, -5.5F, -12.0F, -4.0F, 13, 2, 8, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 15, -5.5F, -9.0F, -3.0F, 9, 2, 6, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 17, 0, -4.5F, -11.0F, 2.5F, 7, 3, 1, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 0, 0, -4.5F, -11.0F, -3.5F, 7, 3, 1, 0.0F)); | ||
topAnvil.cubeList.add(new ModelBox(topAnvil, 30, 12, -2.5F, -7.0F, -2.0F, 5, 1, 4, 0.0F)); | ||
} | ||
|
||
public void renderBottom() { | ||
bottomAnvil.render(0.0625f); | ||
} | ||
|
||
public void renderTop() { | ||
topAnvil.render(0.0625f); | ||
} | ||
|
||
public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) { | ||
modelRenderer.rotateAngleX = x; | ||
modelRenderer.rotateAngleY = y; | ||
modelRenderer.rotateAngleZ = z; | ||
} | ||
} |
Oops, something went wrong.