Skip to content

Commit

Permalink
Merge pull request #2 from EnderProyects/main
Browse files Browse the repository at this point in the history
Main
  • Loading branch information
EnderProyects authored Oct 21, 2024
2 parents aebb3b0 + 63159ba commit 753cf47
Show file tree
Hide file tree
Showing 37 changed files with 3,627 additions and 268 deletions.
Binary file added README.md
Binary file not shown.
1 change: 0 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dependencies {
api('com.github.GTNewHorizons:Botania:1.9.16-GTNH:dev')
api('com.github.GTNewHorizons:Botanic-horizons:1.0.15-GTNH:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
compileOnly("com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev")
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/ab/api/AdvancedBotanyAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@

import ab.api.recipe.RecipeAdvancedPlate;
import ab.api.recipe.RecipeAncientAlphirine;
import ab.api.recipe.RecipeFountainAlchemy;
import ab.api.recipe.RecipeFountainConjuration;
import ab.api.recipe.RecipeFountainMana;
import ab.common.core.handler.ConfigABHandler;

public class AdvancedBotanyAPI {

public static List<RecipeAdvancedPlate> advancedPlateRecipes = new ArrayList<RecipeAdvancedPlate>();
public static List<RecipeFountainMana> FountainManaRecipes = new ArrayList<RecipeFountainMana>();
public static List<RecipeFountainAlchemy> FountainAlchemyRecipes = new ArrayList<RecipeFountainAlchemy>();
public static List<RecipeFountainConjuration> FountainConjurationRecipes = new ArrayList<RecipeFountainConjuration>();
public static List<RecipeAncientAlphirine> alphirineRecipes = new ArrayList<RecipeAncientAlphirine>();
public static List<TerraFarmlandList> farmlandList = new ArrayList<TerraFarmlandList>();
public static List<Achievement> achievements = new ArrayList<Achievement>();
Expand Down Expand Up @@ -47,6 +53,27 @@ public static RecipeAdvancedPlate registerAdvancedPlateRecipe(ItemStack output,
return recipe;
}

public static RecipeFountainMana registerFountainManaRecipe(ItemStack output, ItemStack inputs, int mana,
int color) {
RecipeFountainMana recipe = new RecipeFountainMana(output, mana, color, inputs);
FountainManaRecipes.add(recipe);
return recipe;
}

public static RecipeFountainConjuration registerFountainConjurationRecipe(ItemStack output, ItemStack inputs,
int mana, int color) {
RecipeFountainConjuration recipe = new RecipeFountainConjuration(output, mana, color, inputs);
FountainConjurationRecipes.add(recipe);
return recipe;
}

public static RecipeFountainAlchemy registerFountainAlchemyRecipe(ItemStack output, ItemStack inputs, int mana,
int color) {
RecipeFountainAlchemy recipe = new RecipeFountainAlchemy(output, mana, color, inputs);
FountainAlchemyRecipes.add(recipe);
return recipe;
}

public static RecipeAncientAlphirine registerAlphirineRecipe(ItemStack output, ItemStack input, int chance) {
RecipeAncientAlphirine recipe = new RecipeAncientAlphirine(output, input, chance);
alphirineRecipes.add(recipe);
Expand All @@ -58,4 +85,5 @@ public static TerraFarmlandList registerFarmlandSeed(Block block, int meta) {
farmlandList.add(seed);
return seed;
}

}
68 changes: 68 additions & 0 deletions src/main/java/ab/api/recipe/RecipeFountainAlchemy.java
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 src/main/java/ab/api/recipe/RecipeFountainConjuration.java
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());
}
}
67 changes: 67 additions & 0 deletions src/main/java/ab/api/recipe/RecipeFountainMana.java
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());
}
}
10 changes: 10 additions & 0 deletions src/main/java/ab/client/core/proxy/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public void init(FMLInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new BoundRenderHandler());

ClientRegistry.bindTileEntitySpecialRenderer(TileNidavellirForge.class, new RenderTileNidavellirForge());
ClientRegistry.bindTileEntitySpecialRenderer(TileFountainMana.class, new RenderTileFountainMana());
ClientRegistry.bindTileEntitySpecialRenderer(TileFountainAlchemy.class, new RenderTileFountainAlchemy());
ClientRegistry
.bindTileEntitySpecialRenderer(TileFountainConjuration.class, new RenderTileFountainConjuration());
ClientRegistry.bindTileEntitySpecialRenderer(TileABSpreader.class, new RenderTileABSpreader());
ClientRegistry.bindTileEntitySpecialRenderer(TileManaContainer.class, new RenderTileManaContainer());
ClientRegistry.bindTileEntitySpecialRenderer(TileManaCrystalCube.class, new RenderTileManaCrystalCube());
Expand All @@ -58,13 +62,19 @@ public void init(FMLInitializationEvent event) {
BlockListAB.blockManaChargerRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockEngineerHopperRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockABPlateRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockABFountainRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockABAlchemyRI = RenderingRegistry.getNextAvailableRenderId();
BlockListAB.blockABConjurationRI = RenderingRegistry.getNextAvailableRenderId();

RenderingRegistry.registerBlockHandler(new RenderBlockABSpreader());
RenderingRegistry.registerBlockHandler(new RenderBlockManaContainer());
RenderingRegistry.registerBlockHandler(new RenderBlockManaCrystalCube());
RenderingRegistry.registerBlockHandler(new RenderBlockManaCharger());
RenderingRegistry.registerBlockHandler(new RenderBlockEngineerHopper());
RenderingRegistry.registerBlockHandler(new RenderBlockNidavellirForge());
RenderingRegistry.registerBlockHandler(new RenderBlockFountainMana());
RenderingRegistry.registerBlockHandler(new RenderBlockFountainAlchemy());
RenderingRegistry.registerBlockHandler(new RenderBlockFountainConjuration());

RenderingRegistry.registerEntityRenderingHandler(EntityAdvancedSpark.class, new RenderEntityAdvancedSpark());
RenderingRegistry.registerEntityRenderingHandler(EntityNebulaBlaze.class, new EntityNullRender());
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/ab/client/model/ModelFountainAlchemy.java
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 src/main/java/ab/client/model/ModelFountainConjuration.java
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;
}
}
Loading

0 comments on commit 753cf47

Please sign in to comment.