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.
|
* 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);
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -226,15 +226,17 @@ 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++) {
|
||||||
|
Ingredient ingredient = recipe2.getIngredients().get(i);
|
||||||
//Looks for the best slot to take it from
|
//Looks for the best slot to take it from
|
||||||
ItemStack bestSlot = inventory.getStackInSlot(i);
|
ItemStack bestSlot = inventory.getStackInSlot(i);
|
||||||
if (ingredient.apply(bestSlot)) {
|
if (ingredient.apply(bestSlot)) {
|
||||||
|
@ -253,15 +255,16 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
|
||||||
}
|
}
|
||||||
ItemStack output = inventory.getStackInSlot(9);
|
ItemStack output = inventory.getStackInSlot(9);
|
||||||
//TODO fire forge recipe event
|
//TODO fire forge recipe event
|
||||||
ItemStack ouputStack = recipe.getCraftingResult(getCraftingInventory());
|
ItemStack ouputStack = recipe2.getCraftingResult(getCraftingInventory());
|
||||||
if (output.isEmpty()) {
|
if (output.isEmpty()) {
|
||||||
inventory.setInventorySlotContents(9, ouputStack.copy());
|
inventory.setInventorySlotContents(9, ouputStack.copy());
|
||||||
} else {
|
} else {
|
||||||
//TODO use ouputStack in someway?
|
//TODO use ouputStack in someway?
|
||||||
output.grow(recipe.getRecipeOutput().getCount());
|
output.grow(recipe2.getRecipeOutput().getCount());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue