Fixed JavaDoc and CTScrapbox warnings

This commit is contained in:
drcrazy 2017-11-27 17:55:01 +03:00
parent e2f177b757
commit 779551cf70
4 changed files with 33 additions and 27 deletions

View file

@ -28,6 +28,7 @@ import net.minecraft.tileentity.TileEntity;
/** /**
* Created by Mark on 03/04/2016. * Created by Mark on 03/04/2016.
* @param <T> descendant of BaseRecipe
*/ */
public interface ITileRecipeHandler<T extends BaseRecipe> { public interface ITileRecipeHandler<T extends BaseRecipe> {
boolean canCraft(TileEntity tile, T recipe); boolean canCraft(TileEntity tile, T recipe);

View file

@ -126,6 +126,7 @@ public class ContainerTileInventoryBuilder {
* @param supplier The supplier must supply a variable holding inside a Short, it * @param supplier The supplier must supply a variable holding inside a Short, it
* will be truncated by force. * will be truncated by force.
* @param setter The setter to call when the variable has been updated. * @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) { public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.shortValues.add(Pair.of(supplier, 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 * @param supplier The supplier it can supply a variable holding in an Integer it
* will be split inside multiples shorts. * will be split inside multiples shorts.
* @param setter The setter to call when the variable has been updated. * @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) { public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) {
this.parent.integerValues.add(Pair.of(supplier, setter)); this.parent.integerValues.add(Pair.of(supplier, setter));

View file

@ -56,7 +56,7 @@ public class CTScrapbox {
@ZenMethod @ZenMethod
public static void removeRecipe(IItemStack output) { public static void removeRecipe(IItemStack output) {
ScrapboxList.stacks.remove(output); ScrapboxList.stacks.remove(CraftTweakerCompat.toStack(output));
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName())); CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
} }

View file

@ -226,41 +226,44 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
} }
public boolean make(IRecipe recipe) { public boolean make(IRecipe recipe) {
if (canMake(recipe)) { IRecipe recipe2 = recipe;
if (recipe == null && customRecipe) { if (canMake(recipe2)) {
if (recipe2 == null && customRecipe) {
if (lastCustomRecipe == null) { if (lastCustomRecipe == null) {
return false; return false;
}//Should be uptodate as we just set it in canMake }//Should be uptodate as we just set it in canMake
recipe = lastCustomRecipe; recipe = lastCustomRecipe;
} }
for (int i = 0; i < recipe.getIngredients().size(); i++) { else if (recipe2 != null) {
Ingredient ingredient = recipe.getIngredients().get(i); for (int i = 0; i < recipe2.getIngredients().size(); i++) {
//Looks for the best slot to take it from Ingredient ingredient = recipe2.getIngredients().get(i);
ItemStack bestSlot = inventory.getStackInSlot(i); //Looks for the best slot to take it from
if (ingredient.apply(bestSlot)) { ItemStack bestSlot = inventory.getStackInSlot(i);
handleContainerItem(bestSlot); if (ingredient.apply(bestSlot)) {
bestSlot.shrink(1); handleContainerItem(bestSlot);
} else { bestSlot.shrink(1);
for (int j = 0; j < 9; j++) { } else {
ItemStack stack = inventory.getStackInSlot(j); for (int j = 0; j < 9; j++) {
if (ingredient.apply(stack)) { ItemStack stack = inventory.getStackInSlot(j);
handleContainerItem(stack); if (ingredient.apply(stack)) {
stack.shrink(1); //TODO is this right? or do I need to use it as an actull crafting grid handleContainerItem(stack);
break; 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; return false;
} }