Fixed JavaDoc and CTScrapbox warnings
This commit is contained in:
parent
e2f177b757
commit
779551cf70
4 changed files with 33 additions and 27 deletions
|
@ -28,6 +28,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
|
||||
/**
|
||||
* Created by Mark on 03/04/2016.
|
||||
* @param <T> descendant of BaseRecipe
|
||||
*/
|
||||
public interface ITileRecipeHandler<T extends BaseRecipe> {
|
||||
boolean canCraft(TileEntity tile, T recipe);
|
||||
|
|
|
@ -126,6 +126,7 @@ public class ContainerTileInventoryBuilder {
|
|||
* @param supplier The supplier must supply a variable holding inside a Short, it
|
||||
* will be truncated by force.
|
||||
* @param setter The setter to call when the variable has been updated.
|
||||
* @return ContainerTileInventoryBuilder Inventory which will do the sync
|
||||
*/
|
||||
public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) {
|
||||
this.parent.shortValues.add(Pair.of(supplier, setter));
|
||||
|
@ -136,6 +137,7 @@ public class ContainerTileInventoryBuilder {
|
|||
* @param supplier The supplier it can supply a variable holding in an Integer it
|
||||
* will be split inside multiples shorts.
|
||||
* @param setter The setter to call when the variable has been updated.
|
||||
* @return ContainerTileInventoryBuilder Inventory which will do the sync
|
||||
*/
|
||||
public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) {
|
||||
this.parent.integerValues.add(Pair.of(supplier, setter));
|
||||
|
|
|
@ -56,7 +56,7 @@ public class CTScrapbox {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
ScrapboxList.stacks.remove(output);
|
||||
ScrapboxList.stacks.remove(CraftTweakerCompat.toStack(output));
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
|
|
|
@ -226,41 +226,44 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
|
|||
}
|
||||
|
||||
public boolean make(IRecipe recipe) {
|
||||
if (canMake(recipe)) {
|
||||
if (recipe == null && customRecipe) {
|
||||
IRecipe recipe2 = recipe;
|
||||
if (canMake(recipe2)) {
|
||||
if (recipe2 == null && customRecipe) {
|
||||
if (lastCustomRecipe == null) {
|
||||
return false;
|
||||
}//Should be uptodate as we just set it in canMake
|
||||
recipe = lastCustomRecipe;
|
||||
}
|
||||
for (int i = 0; i < recipe.getIngredients().size(); i++) {
|
||||
Ingredient ingredient = recipe.getIngredients().get(i);
|
||||
//Looks for the best slot to take it from
|
||||
ItemStack bestSlot = inventory.getStackInSlot(i);
|
||||
if (ingredient.apply(bestSlot)) {
|
||||
handleContainerItem(bestSlot);
|
||||
bestSlot.shrink(1);
|
||||
} else {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
ItemStack stack = inventory.getStackInSlot(j);
|
||||
if (ingredient.apply(stack)) {
|
||||
handleContainerItem(stack);
|
||||
stack.shrink(1); //TODO is this right? or do I need to use it as an actull crafting grid
|
||||
break;
|
||||
else if (recipe2 != null) {
|
||||
for (int i = 0; i < recipe2.getIngredients().size(); i++) {
|
||||
Ingredient ingredient = recipe2.getIngredients().get(i);
|
||||
//Looks for the best slot to take it from
|
||||
ItemStack bestSlot = inventory.getStackInSlot(i);
|
||||
if (ingredient.apply(bestSlot)) {
|
||||
handleContainerItem(bestSlot);
|
||||
bestSlot.shrink(1);
|
||||
} else {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
ItemStack stack = inventory.getStackInSlot(j);
|
||||
if (ingredient.apply(stack)) {
|
||||
handleContainerItem(stack);
|
||||
stack.shrink(1); //TODO is this right? or do I need to use it as an actull crafting grid
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemStack output = inventory.getStackInSlot(9);
|
||||
//TODO fire forge recipe event
|
||||
ItemStack ouputStack = recipe2.getCraftingResult(getCraftingInventory());
|
||||
if (output.isEmpty()) {
|
||||
inventory.setInventorySlotContents(9, ouputStack.copy());
|
||||
} else {
|
||||
//TODO use ouputStack in someway?
|
||||
output.grow(recipe2.getRecipeOutput().getCount());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
ItemStack output = inventory.getStackInSlot(9);
|
||||
//TODO fire forge recipe event
|
||||
ItemStack ouputStack = recipe.getCraftingResult(getCraftingInventory());
|
||||
if (output.isEmpty()) {
|
||||
inventory.setInventorySlotContents(9, ouputStack.copy());
|
||||
} else {
|
||||
//TODO use ouputStack in someway?
|
||||
output.grow(recipe.getRecipeOutput().getCount());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue