use of ladysnake.gaspunk.item.ItemGasTube in project Gaspunk by Ladysnake.
the class GasRecipeDeserializer method deserializeRecipe.
private static void deserializeRecipe(JsonObject json, JsonContext context) {
String resultName = JsonUtils.getString(json, "result");
IGas result = ModGases.REGISTRY.getValue(new ResourceLocation(resultName));
if (result == null)
throw new JsonParseException("Unrecognized gas: " + resultName);
JsonObject jsInput = JsonUtils.getJsonObject(json, "input");
ItemStack in;
if (jsInput.has("gas"))
in = getBottle(ModGases.REGISTRY.getValue(new ResourceLocation(JsonUtils.getString(jsInput, "gas"))));
else
in = CraftingHelper.getItemStack(jsInput, context);
JsonObject jsIngredient = JsonUtils.getJsonObject(json, "ingredient");
String type = JsonUtils.getString(jsIngredient, "type", "minecraft:item");
if ("forge:ore_dict".equals(type)) {
String ingredient = JsonUtils.getString(jsIngredient, "ore");
BrewingRecipeRegistry.addRecipe(new GasBrewingOreRecipe(in, ingredient, ((ItemGasTube) ModItems.GAS_TUBE).getItemStackFor(result)));
} else if ("minecraft:item".equals(type)) {
ItemStack ingredient = CraftingHelper.getItemStack(jsIngredient, context);
BrewingRecipeRegistry.addRecipe(new GasBrewingRecipe(in, ingredient, ((ItemGasTube) ModItems.GAS_TUBE).getItemStackFor(result)));
}
}
use of ladysnake.gaspunk.item.ItemGasTube in project Gaspunk by Ladysnake.
the class ThaumcraftCompat method registerGasAspect.
private static void registerGasAspect(IGas gas, AspectList aspects) {
ItemStack gasTube = ((ItemGasTube) ModItems.GAS_TUBE).getItemStackFor(gas);
aspects.add(divide(generateAspectsFromBrewing(gasTube), 1.1));
ThaumcraftApi.registerObjectTag(gasTube, aspects.copy());
ItemStack grenade = ((ItemGrenade) ModItems.GRENADE).getItemStackFor(gas);
// aspects = divide(aspects, 1.2);
aspects.add(divide(AspectHelper.getObjectAspects(new ItemStack(ModItems.GRENADE)), 1.8));
for (GrenadeSkins skin : GrenadeSkins.VALUES) {
// need to register for every skin as thaumcraft counts an itemstack with different nbt as unique
((ItemGrenade) ModItems.GRENADE).setSkin(grenade, skin);
ThaumcraftApi.registerObjectTag(grenade, aspects.copy());
}
}
Aggregations