use of crazypants.enderio.base.config.recipes.InvalidRecipeConfigException in project EnderIO by SleepyTrousers.
the class Output method readResolve.
@Override
public Object readResolve() throws InvalidRecipeConfigException {
super.readResolve();
if (item == null) {
throw new InvalidRecipeConfigException("Missing name in <output>");
}
if (isValid()) {
if (amount < 0) {
throw new InvalidRecipeConfigException("Invalid negative amount in <output>");
}
if (amount > item.getItemStack().getMaxStackSize()) {
throw new InvalidRecipeConfigException("Invalid amount in <output>, bigger than maximum stack size");
}
if (amount == 0) {
amount = 1;
}
}
item.getThing().setSize(amount);
final String nbt_nullchecked = nbt;
if (nbt_nullchecked != null) {
if (!nbt_nullchecked.trim().isEmpty()) {
try {
item.getThing().setNbt(JsonToNBT.getTagFromJson(nbt_nullchecked));
} catch (NBTException e) {
throw new InvalidRecipeConfigException(nbt_nullchecked + " is not valid NBT json.");
}
}
}
return this;
}
use of crazypants.enderio.base.config.recipes.InvalidRecipeConfigException in project EnderIO by SleepyTrousers.
the class Sagmilling method readResolve.
@Override
public Object readResolve() throws InvalidRecipeConfigException {
try {
super.readResolve();
if (input == null) {
throw new InvalidRecipeConfigException("Missing <input>");
}
if (energy < 0) {
throw new InvalidRecipeConfigException("Invalid negative value for 'energy'");
}
valid = valid && input.isValid();
} catch (InvalidRecipeConfigException e) {
throw new InvalidRecipeConfigException(e, "in <alloying>");
}
return this;
}
use of crazypants.enderio.base.config.recipes.InvalidRecipeConfigException in project EnderIO by SleepyTrousers.
the class Fermenting method readResolve.
@Override
public Object readResolve() throws InvalidRecipeConfigException {
try {
super.readResolve();
if (inputgroup.size() < 1 || inputgroup.size() > 2) {
throw new InvalidRecipeConfigException("Wrong number of <inputgroup>");
}
if (energy < 0) {
throw new InvalidRecipeConfigException("Invalid negative value for 'energy'");
}
valid = inputfluid.isValid() && outputfluid.isValid();
for (Inputgroup input : inputgroup) {
valid = valid && input.isValid();
}
} catch (InvalidRecipeConfigException e) {
throw new InvalidRecipeConfigException(e, "in <fermenting>");
}
return this;
}
use of crazypants.enderio.base.config.recipes.InvalidRecipeConfigException in project EnderIO by SleepyTrousers.
the class Casting method readResolve.
@Override
public Object readResolve() throws InvalidRecipeConfigException {
try {
super.readResolve();
if (input == null) {
throw new InvalidRecipeConfigException("Missing <input>");
}
valid = valid && input.isValid() && (cast == null ? true : cast.isValid());
} catch (InvalidRecipeConfigException e) {
throw new InvalidRecipeConfigException(e, "in <casting>");
}
return this;
}
use of crazypants.enderio.base.config.recipes.InvalidRecipeConfigException in project EnderIO by SleepyTrousers.
the class Enchanting method readResolve.
@Override
public Object readResolve() throws InvalidRecipeConfigException {
try {
super.readResolve();
if (input == null) {
throw new InvalidRecipeConfigException("Missing <input>");
}
if (enchantment == null) {
throw new InvalidRecipeConfigException("Missing <enchantment>");
}
valid = input.isValid() && enchantment.isValid();
} catch (InvalidRecipeConfigException e) {
throw new InvalidRecipeConfigException(e, "in <enchanting>");
}
return this;
}
Aggregations