Added grinder and inscriber recipes. Improved JEI integration.
This commit is contained in:
@@ -1,93 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.api.features;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registration Records for {@link IGrinderRegistry}
|
|
||||||
*/
|
|
||||||
public interface IGrinderRecipe
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* the current input
|
|
||||||
*
|
|
||||||
* @return input that the grinder will accept.
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
ItemStack getInput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gets the current output
|
|
||||||
*
|
|
||||||
* @return output that the grinder will produce
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
ItemStack getOutput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gets the current output
|
|
||||||
*
|
|
||||||
* @return output that the grinder will produce
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
Optional<ItemStack> getOptionalOutput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* gets the current output
|
|
||||||
*
|
|
||||||
* @return output that the grinder will produce
|
|
||||||
*/
|
|
||||||
Optional<ItemStack> getSecondOptionalOutput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
|
||||||
*
|
|
||||||
* @return chance of optional output
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
float getOptionalChance();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 0.0 - 1.0 the chance that the optional output will be generated.
|
|
||||||
*
|
|
||||||
* @return second optional output chance
|
|
||||||
*/
|
|
||||||
float getSecondOptionalChance();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Amount of turns required to process the item.
|
|
||||||
*
|
|
||||||
* @return number of turns it takes to produce the output from the input.
|
|
||||||
*/
|
|
||||||
int getRequiredTurns();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.api.features;
|
|
||||||
|
|
||||||
|
|
||||||
import javax.annotation.Nonnegative;
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Builder for a grinder recipe.
|
|
||||||
*
|
|
||||||
* The only default value provided are turns at a value of 8.
|
|
||||||
*
|
|
||||||
* @author yueh
|
|
||||||
* @version rv5
|
|
||||||
* @since rv5
|
|
||||||
*/
|
|
||||||
public interface IGrinderRecipeBuilder
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an grinder recipe with inputs.
|
|
||||||
* Needs to be invoked.
|
|
||||||
*
|
|
||||||
* @param input new input for the recipe
|
|
||||||
*
|
|
||||||
* @return currently used builder
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IGrinderRecipeBuilder withInput( @Nonnull ItemStack input );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an grinder recipe with output.
|
|
||||||
* Needs to be invoked.
|
|
||||||
*
|
|
||||||
* @param output new output for the recipe
|
|
||||||
*
|
|
||||||
* @return currently used builder
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IGrinderRecipeBuilder withOutput( @Nonnull ItemStack output );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an grinder recipe with the first optional output and its chance.
|
|
||||||
*
|
|
||||||
* @param optional new first optional for the recipe
|
|
||||||
* @param chance chance for the first optional output, must be within 0.0 - 1.0
|
|
||||||
*
|
|
||||||
* @return currently used builder
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IGrinderRecipeBuilder withFirstOptional( @Nonnull ItemStack optional, float chance );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an grinder recipe with the second optional output and its chance.
|
|
||||||
*
|
|
||||||
* @param optional new second optional for the recipe
|
|
||||||
* @param chance chance for the second optional output, must be within 0.0 - 1.0
|
|
||||||
*
|
|
||||||
* @return currently used builder
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IGrinderRecipeBuilder withSecondOptional( @Nonnull ItemStack optional, float chance );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an grinder recipe with the amount of turns as cost.
|
|
||||||
*
|
|
||||||
* Defaults to 8 when not called.
|
|
||||||
*
|
|
||||||
* @param turns new turns for the recipe, must be > 0
|
|
||||||
*
|
|
||||||
* @return currently used builder
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IGrinderRecipeBuilder withTurns( @Nonnegative int turns );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Finalizes the process of making the recipe.
|
|
||||||
* Needs to be invoked to fetch grinder recipe.
|
|
||||||
*
|
|
||||||
* @return valid grinder recipe
|
|
||||||
*
|
|
||||||
* @throws IllegalStateException when input is not defined
|
|
||||||
* @throws IllegalStateException when input has no size
|
|
||||||
* @throws IllegalStateException when output is not defined
|
|
||||||
* @throws IllegalStateException when both optionals are not defined
|
|
||||||
* @throws IllegalStateException when process type is not defined
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IGrinderRecipe build();
|
|
||||||
}
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
/*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013 AlgorithmX2
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.api.features;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lets you manipulate Grinder Recipes, by adding or editing existing ones.
|
|
||||||
*/
|
|
||||||
public interface IGrinderRegistry
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Extensible way to create a grinder recipe.
|
|
||||||
*
|
|
||||||
* @return builder for grinder recipes
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
IGrinderRecipeBuilder builder();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An immutable list of the currently registered recipes.
|
|
||||||
*
|
|
||||||
* @return currentlyRegisteredRecipes
|
|
||||||
*/
|
|
||||||
@Nonnull
|
|
||||||
Collection<IGrinderRecipe> getRecipes();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a new recipe to the registry.
|
|
||||||
*/
|
|
||||||
boolean addRecipe( IGrinderRecipe recipe );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove the specific from the recipe list.
|
|
||||||
*
|
|
||||||
* @param recipe The recipe to be removed.
|
|
||||||
* @return true, if it was removed
|
|
||||||
*/
|
|
||||||
boolean removeRecipe( @Nonnull IGrinderRecipe recipe );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Searches for a recipe for a given input, and returns it.
|
|
||||||
*
|
|
||||||
* @param input The {@link ItemStack} to be grinded.
|
|
||||||
*
|
|
||||||
* @return identified recipe or null
|
|
||||||
*/
|
|
||||||
@Nullable
|
|
||||||
IGrinderRecipe getRecipeForInput( @Nonnull ItemStack input );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allows do add a custom ratio from an ore to dust when being grinded.
|
|
||||||
*
|
|
||||||
* The default ratio is 1 ore to 2 dusts.
|
|
||||||
*
|
|
||||||
* These have to be added before any recipe is registered. Otherwise it will use the default value.
|
|
||||||
*
|
|
||||||
* @param oredictName The name of the ore;
|
|
||||||
* @param ratio The amount, must be > 0;
|
|
||||||
*/
|
|
||||||
void addDustRatio( @Nonnull String oredictName, int ratio );
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove a custom ratio for a specific ore name.
|
|
||||||
*
|
|
||||||
* Will use the default of 2 value afterwards.
|
|
||||||
*
|
|
||||||
* @param oredictName The name of the ore;
|
|
||||||
*/
|
|
||||||
boolean removeDustRatio( @Nonnull String oredictName );
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -67,11 +67,6 @@ public interface IRegistryContainer
|
|||||||
*/
|
*/
|
||||||
ICellRegistry cell();
|
ICellRegistry cell();
|
||||||
|
|
||||||
/**
|
|
||||||
* Manage grinder recipes via API
|
|
||||||
*/
|
|
||||||
IGrinderRegistry grinder();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage inscriber recipes via API
|
* Manage inscriber recipes via API
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,182 @@
|
|||||||
|
package appeng;
|
||||||
|
|
||||||
|
import appeng.api.util.AEColor;
|
||||||
|
import appeng.core.AppEng;
|
||||||
|
import appeng.items.materials.MaterialType;
|
||||||
|
import appeng.items.parts.PartType;
|
||||||
|
import com.google.gson.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.Reader;
|
||||||
|
import java.io.Writer;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.*;
|
||||||
|
import java.nio.file.attribute.BasicFileAttributes;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class FixupIngredients {
|
||||||
|
|
||||||
|
private static Gson gson = new GsonBuilder()
|
||||||
|
.setPrettyPrinting()
|
||||||
|
.create();
|
||||||
|
|
||||||
|
private static JsonObject visitObjProps(JsonObject obj) {
|
||||||
|
for (Map.Entry<String, JsonElement> e : obj.entrySet()) {
|
||||||
|
e.setValue(visitAndReplace(e.getValue()));
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static JsonElement visitAndReplace(JsonElement el) {
|
||||||
|
if (el.isJsonArray()) {
|
||||||
|
JsonArray arr = el.getAsJsonArray();
|
||||||
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
|
arr.set(i, visitAndReplace(arr.get(i)));
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
if (!el.isJsonObject()) {
|
||||||
|
return el;
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonObject obj = el.getAsJsonObject();
|
||||||
|
if (obj.size() != 2 && (obj.size() != 3 || !obj.has("count"))) {
|
||||||
|
return visitObjProps(obj);
|
||||||
|
}
|
||||||
|
Integer count = null;
|
||||||
|
if (obj.has("count")) {
|
||||||
|
count = obj.get("count").getAsInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonPrimitive type = obj.getAsJsonPrimitive("type");
|
||||||
|
|
||||||
|
if (type == null) {
|
||||||
|
return visitObjProps(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("forge:ore_dict".equals(type.getAsString())) {
|
||||||
|
String ore = obj.get("ore").getAsString();
|
||||||
|
JsonObject r = new JsonObject();
|
||||||
|
r.add("tag", new JsonPrimitive(AppEng.MOD_ID + ':' + "ore_" + ore));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!type.getAsString().equals("appliedenergistics2:part")) {
|
||||||
|
return visitObjProps(obj);
|
||||||
|
}
|
||||||
|
String part = obj.getAsJsonPrimitive("part").getAsString();
|
||||||
|
|
||||||
|
String itemName = null;
|
||||||
|
if (part.startsWith("material.")) {
|
||||||
|
String mtName = part.substring(9).toUpperCase();
|
||||||
|
if ("WIRELESS".equals(mtName)) {
|
||||||
|
mtName = "WIRELESS_RECEIVER";
|
||||||
|
}
|
||||||
|
|
||||||
|
itemName = mtName.toLowerCase();
|
||||||
|
} else if (part.startsWith("part.")) {
|
||||||
|
part = part.substring(5);
|
||||||
|
|
||||||
|
if ("fluid_interface".equals(part)) {
|
||||||
|
part = "cable_fluid_interface";
|
||||||
|
} else if ("interface".equals(part)) {
|
||||||
|
part = "cable_interface";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemName == null) {
|
||||||
|
// Handle tags
|
||||||
|
String tagName = null;
|
||||||
|
if ( part.equalsIgnoreCase("cable_glass")) {
|
||||||
|
tagName = "glass_cable";
|
||||||
|
} else if (part.equalsIgnoreCase("cable_covered")) {
|
||||||
|
tagName = "covered_cable";
|
||||||
|
} else if (part.equalsIgnoreCase("cable_smart")) {
|
||||||
|
tagName = "smart_cable";
|
||||||
|
} else if (part.equalsIgnoreCase("cable_dense_covered")) {
|
||||||
|
tagName = "covered_dense_cable";
|
||||||
|
} else if (part.equalsIgnoreCase("cable_dense_smart")) {
|
||||||
|
tagName = "smart_dense_cable";
|
||||||
|
}
|
||||||
|
if (tagName != null) {
|
||||||
|
JsonObject r = new JsonObject();
|
||||||
|
r.add("tag", new JsonPrimitive(AppEng.MOD_ID + ':' + tagName));
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
itemName = part.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (AEColor c : AEColor.values()) {
|
||||||
|
String colorSuffix = '.' + c.registryPrefix;
|
||||||
|
if (itemName.endsWith(colorSuffix)) {
|
||||||
|
String p = itemName.substring(0, itemName.length() - colorSuffix.length());
|
||||||
|
itemName = c.registryPrefix + "_" + p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemName.startsWith("p2p_tunnel_")) {
|
||||||
|
itemName = itemName.substring("p2p_tunnel_".length()) + "_p2p_tunnel";
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonObject r = new JsonObject();
|
||||||
|
r.add("item", new JsonPrimitive(AppEng.MOD_ID + ':' + itemName));
|
||||||
|
if (count != null) {
|
||||||
|
r.add("count", new JsonPrimitive(count));
|
||||||
|
}
|
||||||
|
return r;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws IOException {
|
||||||
|
|
||||||
|
Path p= Paths.get("D:\\Applied-Energistics-2\\src\\main\\resources\\data\\appliedenergistics2");
|
||||||
|
|
||||||
|
Files.walkFileTree(p, new FileVisitor<Path>() {
|
||||||
|
@Override
|
||||||
|
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||||
|
if (!file.getFileName().toString().endsWith(".json")) {
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
if (file.getFileName().toString().contains("_constants")) {
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
if (file.getFileName().toString().contains("_factories")) {
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonElement el;
|
||||||
|
try (Reader r = Files.newBufferedReader(file, StandardCharsets.UTF_8)) {
|
||||||
|
el = visitAndReplace(gson.fromJson(r, JsonElement.class));
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.err.println("Failed to process file " + file);
|
||||||
|
e.printStackTrace();
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
try (Writer w = Files.newBufferedWriter(file, StandardCharsets.UTF_8, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) {
|
||||||
|
gson.toJson(el, w);
|
||||||
|
}
|
||||||
|
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
|
||||||
|
return FileVisitResult.CONTINUE;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
package appeng.container.slot;
|
package appeng.container.slot;
|
||||||
|
|
||||||
|
|
||||||
|
import appeng.recipes.handlers.GrinderRecipes;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.inventory.container.Slot;
|
import net.minecraft.inventory.container.Slot;
|
||||||
@@ -192,7 +193,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
|||||||
case VIEW_CELL:
|
case VIEW_CELL:
|
||||||
return items.viewCell().isSameAs( i );
|
return items.viewCell().isSameAs( i );
|
||||||
case ORE:
|
case ORE:
|
||||||
return AEApi.instance().registries().grinder().getRecipeForInput( i ) != null;
|
return GrinderRecipes.isValidIngredient(p.player.world, i);
|
||||||
case FUEL:
|
case FUEL:
|
||||||
return ForgeHooks.getBurnTime( i ) > 0;
|
return ForgeHooks.getBurnTime( i ) > 0;
|
||||||
case POWERED_TOOL:
|
case POWERED_TOOL:
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public final class AEConfig implements IConfigurableObject, IConfigManagerHost
|
|||||||
// Grindstone
|
// Grindstone
|
||||||
private List<String> grinderOres;
|
private List<String> grinderOres;
|
||||||
private Set<String> grinderBlackList;
|
private Set<String> grinderBlackList;
|
||||||
private double oreDoublePercentage;
|
private float oreDoublePercentage;
|
||||||
|
|
||||||
// Batteries
|
// Batteries
|
||||||
private int wirelessTerminalBattery;
|
private int wirelessTerminalBattery;
|
||||||
@@ -154,7 +154,7 @@ public final class AEConfig implements IConfigurableObject, IConfigManagerHost
|
|||||||
|
|
||||||
this.grinderOres = new ArrayList<>(config.grinderOres.get());
|
this.grinderOres = new ArrayList<>(config.grinderOres.get());
|
||||||
this.grinderBlackList = new HashSet<>(config.grinderBlackList.get());
|
this.grinderBlackList = new HashSet<>(config.grinderBlackList.get());
|
||||||
this.oreDoublePercentage = config.oreDoublePercentage.get();
|
this.oreDoublePercentage = config.oreDoublePercentage.get().floatValue();
|
||||||
|
|
||||||
// FIXME: why is this here exactly???
|
// FIXME: why is this here exactly???
|
||||||
this.settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
this.settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
||||||
@@ -522,7 +522,7 @@ public final class AEConfig implements IConfigurableObject, IConfigManagerHost
|
|||||||
return this.grinderBlackList;
|
return this.grinderBlackList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getOreDoublePercentage()
|
public float getOreDoublePercentage()
|
||||||
{
|
{
|
||||||
return this.oreDoublePercentage;
|
return this.oreDoublePercentage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ import appeng.recipes.conditions.FeaturesEnabled;
|
|||||||
import appeng.recipes.game.DisassembleRecipe;
|
import appeng.recipes.game.DisassembleRecipe;
|
||||||
import appeng.recipes.handlers.GrinderRecipe;
|
import appeng.recipes.handlers.GrinderRecipe;
|
||||||
import appeng.recipes.handlers.GrinderRecipeSerializer;
|
import appeng.recipes.handlers.GrinderRecipeSerializer;
|
||||||
|
import appeng.recipes.handlers.InscriberRecipe;
|
||||||
|
import appeng.recipes.handlers.InscriberRecipeSerializer;
|
||||||
import appeng.server.AECommand;
|
import appeng.server.AECommand;
|
||||||
import appeng.tile.AEBaseTile;
|
import appeng.tile.AEBaseTile;
|
||||||
import net.minecraft.advancements.CriteriaTriggers;
|
import net.minecraft.advancements.CriteriaTriggers;
|
||||||
@@ -587,14 +589,13 @@ final class Registration
|
|||||||
final ApiDefinitions definitions = Api.INSTANCE.definitions();
|
final ApiDefinitions definitions = Api.INSTANCE.definitions();
|
||||||
|
|
||||||
GrinderRecipe.TYPE = new AERecipeType<>(GrinderRecipeSerializer.INSTANCE.getRegistryName());
|
GrinderRecipe.TYPE = new AERecipeType<>(GrinderRecipeSerializer.INSTANCE.getRegistryName());
|
||||||
|
InscriberRecipe.TYPE = new AERecipeType<>(InscriberRecipeSerializer.INSTANCE.getRegistryName());
|
||||||
|
|
||||||
r.registerAll(
|
r.registerAll(
|
||||||
DisassembleRecipe.SERIALIZER,
|
DisassembleRecipe.SERIALIZER,
|
||||||
GrinderRecipeSerializer.INSTANCE
|
GrinderRecipeSerializer.INSTANCE,
|
||||||
|
InscriberRecipeSerializer.INSTANCE
|
||||||
// FacadeRecipe.getSerializer( (ItemFacade) definitions.items().facade().item() ) FIXME reimplement facades
|
// FacadeRecipe.getSerializer( (ItemFacade) definitions.items().facade().item() ) FIXME reimplement facades
|
||||||
// this.factories.put( new ResourceLocation( AppEng.MOD_ID, "inscriber" ), new InscriberHandler() ); FIXME re-implement machine recipes
|
|
||||||
// this.factories.put( new ResourceLocation( AppEng.MOD_ID, "smelt" ), new SmeltingHandler() );
|
|
||||||
// this.factories.put( new ResourceLocation( AppEng.MOD_ID, "grinder" ), new GrinderHandler() );
|
|
||||||
);
|
);
|
||||||
|
|
||||||
CraftingHelper.register( FeaturesEnabled.Serializer.INSTANCE );
|
CraftingHelper.register( FeaturesEnabled.Serializer.INSTANCE );
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package appeng.core.features.registries;
|
|||||||
|
|
||||||
|
|
||||||
import appeng.api.features.IChargerRegistry;
|
import appeng.api.features.IChargerRegistry;
|
||||||
import appeng.api.features.IGrinderRegistry;
|
|
||||||
import appeng.api.features.IInscriberRegistry;
|
import appeng.api.features.IInscriberRegistry;
|
||||||
import appeng.api.features.ILocatableRegistry;
|
import appeng.api.features.ILocatableRegistry;
|
||||||
import appeng.api.features.IMatterCannonAmmoRegistry;
|
import appeng.api.features.IMatterCannonAmmoRegistry;
|
||||||
@@ -37,7 +36,6 @@ import appeng.api.parts.IPartModels;
|
|||||||
import appeng.api.storage.ICellRegistry;
|
import appeng.api.storage.ICellRegistry;
|
||||||
import appeng.core.features.registries.cell.CellRegistry;
|
import appeng.core.features.registries.cell.CellRegistry;
|
||||||
import appeng.core.features.registries.charger.ChargerRegistry;
|
import appeng.core.features.registries.charger.ChargerRegistry;
|
||||||
import appeng.core.features.registries.grinder.GrinderRecipeManager;
|
|
||||||
import appeng.core.features.registries.inscriber.InscriberRegistry;
|
import appeng.core.features.registries.inscriber.InscriberRegistry;
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +50,6 @@ import appeng.core.features.registries.inscriber.InscriberRegistry;
|
|||||||
*/
|
*/
|
||||||
public class RegistryContainer implements IRegistryContainer
|
public class RegistryContainer implements IRegistryContainer
|
||||||
{
|
{
|
||||||
private final IGrinderRegistry grinder = new GrinderRecipeManager();
|
|
||||||
private final IInscriberRegistry inscriber = new InscriberRegistry();
|
private final IInscriberRegistry inscriber = new InscriberRegistry();
|
||||||
private final IChargerRegistry charger = new ChargerRegistry();
|
private final IChargerRegistry charger = new ChargerRegistry();
|
||||||
private final ICellRegistry cell = new CellRegistry();
|
private final ICellRegistry cell = new CellRegistry();
|
||||||
@@ -97,12 +94,6 @@ public class RegistryContainer implements IRegistryContainer
|
|||||||
return this.cell;
|
return this.cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRegistry grinder()
|
|
||||||
{
|
|
||||||
return this.grinder;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IInscriberRegistry inscriber()
|
public IInscriberRegistry inscriber()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of Applied Energistics 2.
|
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.core.features.registries.grinder;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import appeng.api.features.IGrinderRecipe;
|
|
||||||
|
|
||||||
|
|
||||||
public class AppEngGrinderRecipe implements IGrinderRecipe
|
|
||||||
{
|
|
||||||
|
|
||||||
private final ItemStack in;
|
|
||||||
private final ItemStack out;
|
|
||||||
|
|
||||||
private final float optionalChance;
|
|
||||||
private final Optional<ItemStack> optionalOutput;
|
|
||||||
|
|
||||||
private final float optionalChance2;
|
|
||||||
private final Optional<ItemStack> optionalOutput2;
|
|
||||||
|
|
||||||
private final int turns;
|
|
||||||
|
|
||||||
AppEngGrinderRecipe( final ItemStack input, final ItemStack output, final int cost )
|
|
||||||
{
|
|
||||||
this( input, output, null, null, 0, 0, cost );
|
|
||||||
}
|
|
||||||
|
|
||||||
AppEngGrinderRecipe( final ItemStack input, final ItemStack output, final ItemStack optional, final float chance, final int cost )
|
|
||||||
{
|
|
||||||
this( input, output, optional, null, chance, 0, cost );
|
|
||||||
}
|
|
||||||
|
|
||||||
AppEngGrinderRecipe( final ItemStack input, final ItemStack output, final ItemStack optional1, final ItemStack optional2, final float chance1, final float chance2, final int cost )
|
|
||||||
{
|
|
||||||
this.in = input;
|
|
||||||
this.out = output;
|
|
||||||
|
|
||||||
this.optionalOutput = Optional.ofNullable( optional1 );
|
|
||||||
this.optionalChance = chance1;
|
|
||||||
|
|
||||||
this.optionalOutput2 = Optional.ofNullable( optional2 );
|
|
||||||
this.optionalChance2 = chance2;
|
|
||||||
|
|
||||||
this.turns = cost;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getInput()
|
|
||||||
{
|
|
||||||
return this.in;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ItemStack getOutput()
|
|
||||||
{
|
|
||||||
return this.out;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<ItemStack> getOptionalOutput()
|
|
||||||
{
|
|
||||||
return this.optionalOutput;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Optional<ItemStack> getSecondOptionalOutput()
|
|
||||||
{
|
|
||||||
return this.optionalOutput2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getOptionalChance()
|
|
||||||
{
|
|
||||||
return this.optionalChance;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float getSecondOptionalChance()
|
|
||||||
{
|
|
||||||
return this.optionalChance2;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getRequiredTurns()
|
|
||||||
{
|
|
||||||
return this.turns;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,489 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of Applied Energistics 2.
|
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.core.features.registries.grinder;
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import com.google.common.collect.Maps;
|
|
||||||
|
|
||||||
import net.minecraft.block.Blocks;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.item.Items;
|
|
||||||
|
|
||||||
import appeng.api.features.IGrinderRecipe;
|
|
||||||
import appeng.api.features.IGrinderRecipeBuilder;
|
|
||||||
import appeng.api.features.IGrinderRegistry;
|
|
||||||
import appeng.api.features.IInscriberRecipe;
|
|
||||||
import appeng.api.features.IInscriberRecipeBuilder;
|
|
||||||
import appeng.core.AEConfig;
|
|
||||||
import appeng.core.AELog;
|
|
||||||
import appeng.util.Platform;
|
|
||||||
|
|
||||||
|
|
||||||
public final class GrinderRecipeManager implements IGrinderRegistry // FIXME, IOreListener
|
|
||||||
{
|
|
||||||
private final Map<CacheKey, IGrinderRecipe> recipes;
|
|
||||||
private final Map<ItemStack, String> ores;
|
|
||||||
private final Map<ItemStack, String> ingots;
|
|
||||||
private final Map<String, ItemStack> dusts;
|
|
||||||
private final Map<String, Integer> dustToOreRatio;
|
|
||||||
|
|
||||||
public GrinderRecipeManager()
|
|
||||||
{
|
|
||||||
this.recipes = Maps.newHashMap();
|
|
||||||
this.ores = Maps.newHashMap();
|
|
||||||
this.ingots = Maps.newHashMap();
|
|
||||||
this.dusts = Maps.newHashMap();
|
|
||||||
this.dustToOreRatio = Maps.newHashMap();
|
|
||||||
|
|
||||||
this.addDustRatio( "Obsidian", 1 );
|
|
||||||
this.addDustRatio( "Charcoal", 1 );
|
|
||||||
this.addDustRatio( "Coal", 1 );
|
|
||||||
|
|
||||||
this.addOre( "Coal", new ItemStack( Items.COAL ) );
|
|
||||||
this.addOre( "Charcoal", new ItemStack( Items.COAL, 1 ) );
|
|
||||||
|
|
||||||
this.addOre( "NetherQuartz", new ItemStack( Blocks.NETHER_QUARTZ_ORE ) );
|
|
||||||
this.addIngot( "NetherQuartz", new ItemStack( Items.QUARTZ ) );
|
|
||||||
|
|
||||||
this.addOre( "Gold", new ItemStack( Blocks.GOLD_ORE ) );
|
|
||||||
this.addIngot( "Gold", new ItemStack( Items.GOLD_INGOT ) );
|
|
||||||
|
|
||||||
this.addOre( "Iron", new ItemStack( Blocks.IRON_ORE ) );
|
|
||||||
this.addIngot( "Iron", new ItemStack( Items.IRON_INGOT ) );
|
|
||||||
|
|
||||||
this.addOre( "Obsidian", new ItemStack( Blocks.OBSIDIAN ) );
|
|
||||||
|
|
||||||
this.addIngot( "Ender", new ItemStack( Items.ENDER_PEARL ) );
|
|
||||||
this.addIngot( "EnderPearl", new ItemStack( Items.ENDER_PEARL ) );
|
|
||||||
|
|
||||||
this.addIngot( "Wheat", new ItemStack( Items.WHEAT ) );
|
|
||||||
|
|
||||||
// FIXME OreDictionaryHandler.INSTANCE.observe( this );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipeBuilder builder()
|
|
||||||
{
|
|
||||||
return new Builder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean addRecipe( IGrinderRecipe recipe )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( recipe, "Cannot add null as recipe." );
|
|
||||||
|
|
||||||
return this.injectRecipe( recipe );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Collection<IGrinderRecipe> getRecipes()
|
|
||||||
{
|
|
||||||
return Collections.unmodifiableCollection( this.recipes.values() );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean removeRecipe( IGrinderRecipe recipe )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( recipe, "Cannot remove null as recipe." );
|
|
||||||
|
|
||||||
final CacheKey key = new CacheKey( recipe.getInput() );
|
|
||||||
final IGrinderRecipe removedRecipe = this.recipes.remove( key );
|
|
||||||
|
|
||||||
this.log( "Removed Grinding of '%1%s'", Platform.getItemDisplayName( recipe.getInput() ) );
|
|
||||||
|
|
||||||
return removedRecipe != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipe getRecipeForInput( final ItemStack input )
|
|
||||||
{
|
|
||||||
this.log( "Looking up recipe for '%1$s'", Platform.getItemDisplayName( input ) );
|
|
||||||
|
|
||||||
if( input == null )
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
final IGrinderRecipe recipe = this.recipes.get( new CacheKey( input ) );
|
|
||||||
|
|
||||||
if( recipe == null )
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.log( "Recipe for '%1$s' found '%2$s'", input.getTranslationKey(), Platform.getItemDisplayName( recipe.getOutput() ) );
|
|
||||||
return recipe;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addDustRatio( String oredictName, int ratio )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( oredictName );
|
|
||||||
Preconditions.checkArgument( ratio > 0 );
|
|
||||||
|
|
||||||
this.log( "Added ratio for '%1$s' of %2$d", oredictName, ratio );
|
|
||||||
|
|
||||||
this.dustToOreRatio.put( oredictName, ratio );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean removeDustRatio( String oredictName )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( oredictName );
|
|
||||||
|
|
||||||
this.log( "Removed ratio for '%1$s'", oredictName );
|
|
||||||
|
|
||||||
return this.dustToOreRatio.remove( oredictName ) != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME @Override
|
|
||||||
// FIXME public void oreRegistered( final String name, final ItemStack item )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME if( !AEConfig.instance().getGrinderBlackList().contains( name ) && ( name.startsWith( "ore" ) || name.startsWith( "crystal" ) || name
|
|
||||||
// FIXME .startsWith( "gem" ) || name.startsWith( "ingot" ) || name.startsWith( "dust" ) ) )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME for( final String ore : AEConfig.instance().getGrinderOres() )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME if( name.equals( "ore" + ore ) )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME this.addOre( ore, item );
|
|
||||||
// FIXME }
|
|
||||||
// FIXME else if( name.equals( "crystal" + ore ) || name.equals( "ingot" + ore ) || name.equals( "gem" + ore ) )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME this.addIngot( ore, item );
|
|
||||||
// FIXME }
|
|
||||||
// FIXME else if( name.equals( "dust" + ore ) )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME this.addDust( ore, item );
|
|
||||||
// FIXME }
|
|
||||||
// FIXME }
|
|
||||||
// FIXME }
|
|
||||||
// FIXME }
|
|
||||||
|
|
||||||
private boolean injectRecipe( final IGrinderRecipe grinderRecipe )
|
|
||||||
{
|
|
||||||
final CacheKey cacheKey = new CacheKey( grinderRecipe.getInput() );
|
|
||||||
|
|
||||||
if( this.recipes.containsKey( cacheKey ) )
|
|
||||||
{
|
|
||||||
this.log( "Tried to add duplicate recipe for '%1$s'", Platform.getItemDisplayName( grinderRecipe.getInput() ) );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.recipes.put( cacheKey, grinderRecipe );
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getDustToOreRatio( final String name )
|
|
||||||
{
|
|
||||||
return this.dustToOreRatio.getOrDefault( name, 2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addOre( final String name, final ItemStack item )
|
|
||||||
{
|
|
||||||
if( item == null )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.log( "Adding Ore: '%1$s'", Platform.getItemDisplayName( item ) );
|
|
||||||
|
|
||||||
this.ores.put( item, name );
|
|
||||||
|
|
||||||
if( this.dusts.containsKey( name ) )
|
|
||||||
{
|
|
||||||
final ItemStack is = this.dusts.get( name ).copy();
|
|
||||||
final int ratio = this.getDustToOreRatio( name );
|
|
||||||
if( ratio > 1 )
|
|
||||||
{
|
|
||||||
final ItemStack extra = is.copy();
|
|
||||||
extra.setCount( ratio - 1 );
|
|
||||||
|
|
||||||
final IGrinderRecipeBuilder builder = this.builder();
|
|
||||||
IGrinderRecipe grinderRecipe = builder.withInput( item )
|
|
||||||
.withOutput( is )
|
|
||||||
.withFirstOptional( extra, (float) ( AEConfig.instance().getOreDoublePercentage() / 100.0 ) )
|
|
||||||
.withTurns( 8 )
|
|
||||||
.build();
|
|
||||||
|
|
||||||
this.addRecipe( grinderRecipe );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
final IGrinderRecipeBuilder builder = this.builder();
|
|
||||||
IGrinderRecipe grinderRecipe = builder.withInput( item )
|
|
||||||
.withOutput( is )
|
|
||||||
.withTurns( 8 )
|
|
||||||
.build();
|
|
||||||
|
|
||||||
this.addRecipe( grinderRecipe );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addIngot( final String name, final ItemStack item )
|
|
||||||
{
|
|
||||||
if( item == null )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.log( "Adding Ingot: '%1$s'", Platform.getItemDisplayName( item ) );
|
|
||||||
|
|
||||||
this.ingots.put( item, name );
|
|
||||||
|
|
||||||
if( this.dusts.containsKey( name ) )
|
|
||||||
{
|
|
||||||
final IGrinderRecipeBuilder builder = this.builder();
|
|
||||||
IGrinderRecipe grinderRecipe = builder.withInput( item )
|
|
||||||
.withOutput( this.dusts.get( name ) )
|
|
||||||
.withTurns( 4 )
|
|
||||||
.build();
|
|
||||||
|
|
||||||
this.addRecipe( grinderRecipe );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addDust( final String name, final ItemStack item )
|
|
||||||
{
|
|
||||||
if( item == null )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( this.dusts.containsKey( name ) )
|
|
||||||
{
|
|
||||||
this.log( "Rejecting Dust: '%1$s'", Platform.getItemDisplayName( item ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.log( "Adding Dust: '%1$s'", Platform.getItemDisplayName( item ) );
|
|
||||||
|
|
||||||
this.dusts.put( name, item );
|
|
||||||
|
|
||||||
for( final Entry<ItemStack, String> d : this.ores.entrySet() )
|
|
||||||
{
|
|
||||||
if( name.equals( d.getValue() ) )
|
|
||||||
{
|
|
||||||
final ItemStack is = item.copy();
|
|
||||||
is.setCount( 1 );
|
|
||||||
final int ratio = this.getDustToOreRatio( name );
|
|
||||||
if( ratio > 1 )
|
|
||||||
{
|
|
||||||
final ItemStack extra = is.copy();
|
|
||||||
extra.setCount( ratio - 1 );
|
|
||||||
|
|
||||||
final IGrinderRecipeBuilder builder = this.builder();
|
|
||||||
final IGrinderRecipe grinderRecipe = builder.withInput( d.getKey() )
|
|
||||||
.withOutput( is )
|
|
||||||
.withFirstOptional( extra, (float) ( AEConfig.instance().getOreDoublePercentage() / 100.0 ) )
|
|
||||||
.withTurns( 8 )
|
|
||||||
.build();
|
|
||||||
|
|
||||||
this.addRecipe( grinderRecipe );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
final IGrinderRecipeBuilder builder = this.builder();
|
|
||||||
final IGrinderRecipe grinderRecipe = builder.withInput( d.getKey() )
|
|
||||||
.withOutput( is )
|
|
||||||
.withTurns( 8 )
|
|
||||||
.build();
|
|
||||||
|
|
||||||
this.addRecipe( grinderRecipe );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for( final Entry<ItemStack, String> d : this.ingots.entrySet() )
|
|
||||||
{
|
|
||||||
if( name.equals( d.getValue() ) )
|
|
||||||
{
|
|
||||||
final IGrinderRecipeBuilder builder = this.builder();
|
|
||||||
final IGrinderRecipe grinderRecipe = builder.withInput( d.getKey() )
|
|
||||||
.withOutput( item )
|
|
||||||
.withTurns( 4 )
|
|
||||||
.build();
|
|
||||||
|
|
||||||
this.addRecipe( grinderRecipe );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void log( final String o, Object... params )
|
|
||||||
{
|
|
||||||
AELog.grinder( o, params );
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class CacheKey
|
|
||||||
{
|
|
||||||
private final Item item;
|
|
||||||
|
|
||||||
CacheKey( ItemStack input )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( input );
|
|
||||||
Preconditions.checkNotNull( input.getItem() );
|
|
||||||
|
|
||||||
this.item = input.getItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode()
|
|
||||||
{
|
|
||||||
final int prime = 31;
|
|
||||||
int result = 1;
|
|
||||||
result = prime * result + ( ( this.item == null ) ? 0 : this.item.hashCode() );
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals( Object obj )
|
|
||||||
{
|
|
||||||
if( this == obj )
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if( obj == null || this.getClass() != obj.getClass() )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
CacheKey other = (CacheKey) obj;
|
|
||||||
|
|
||||||
if( this.item == null )
|
|
||||||
{
|
|
||||||
if( other.item != null )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if( this.item != other.item )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal {@link IInscriberRecipeBuilder} implementation.
|
|
||||||
* Needs to be adapted to represent a correct {@link IInscriberRecipe}
|
|
||||||
*/
|
|
||||||
private static final class Builder implements IGrinderRecipeBuilder
|
|
||||||
{
|
|
||||||
|
|
||||||
private ItemStack in;
|
|
||||||
private ItemStack out;
|
|
||||||
|
|
||||||
private float optionalChance;
|
|
||||||
private ItemStack optionalOutput;
|
|
||||||
|
|
||||||
private float optionalChance2;
|
|
||||||
private ItemStack optionalOutput2;
|
|
||||||
|
|
||||||
private int turns = 8;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipeBuilder withInput( ItemStack input )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( input );
|
|
||||||
Preconditions.checkArgument( !input.isEmpty(), "Input cannot be empty." );
|
|
||||||
|
|
||||||
this.in = this.copy( input );
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipeBuilder withOutput( ItemStack output )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( output );
|
|
||||||
Preconditions.checkArgument( !output.isEmpty(), "Output cannot be empty." );
|
|
||||||
|
|
||||||
this.out = this.copy( output );
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipeBuilder withFirstOptional( ItemStack optional, float chance )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( optional );
|
|
||||||
Preconditions.checkArgument( !optional.isEmpty(), "Optional cannot be empty." );
|
|
||||||
Preconditions.checkArgument( chance >= 0 && chance <= 1.0 );
|
|
||||||
|
|
||||||
this.optionalOutput = this.copy( optional );
|
|
||||||
this.optionalChance = chance;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipeBuilder withSecondOptional( ItemStack optional, float chance )
|
|
||||||
{
|
|
||||||
Preconditions.checkNotNull( optional );
|
|
||||||
Preconditions.checkArgument( !optional.isEmpty(), "Optional cannot be empty." );
|
|
||||||
Preconditions.checkArgument( chance >= 0 && chance <= 1.0 );
|
|
||||||
|
|
||||||
this.optionalOutput2 = this.copy( optional );
|
|
||||||
this.optionalChance2 = chance;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipeBuilder withTurns( int turns )
|
|
||||||
{
|
|
||||||
Preconditions.checkArgument( turns > 0 );
|
|
||||||
|
|
||||||
this.turns = turns;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
|
||||||
public IGrinderRecipe build()
|
|
||||||
{
|
|
||||||
Preconditions.checkState( this.in != null, "Input itemstack must be defined." );
|
|
||||||
Preconditions.checkState( this.out != null, "Output itemstack must be defined." );
|
|
||||||
|
|
||||||
return new AppEngGrinderRecipe( this.in, this.out, this.optionalOutput, this.optionalOutput2, this.optionalChance, this.optionalChance2, this.turns );
|
|
||||||
}
|
|
||||||
|
|
||||||
private ItemStack copy( final ItemStack is )
|
|
||||||
{
|
|
||||||
if( is != null )
|
|
||||||
{
|
|
||||||
return is.copy();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -53,7 +53,7 @@ class GrinderRecipeCategory implements IRecipeCategory<GrinderRecipe>
|
|||||||
|
|
||||||
public GrinderRecipeCategory( IGuiHelper guiHelper )
|
public GrinderRecipeCategory( IGuiHelper guiHelper )
|
||||||
{
|
{
|
||||||
this.localizedName = I18n.format( "tile.appliedenergistics2.grindstone.name" );
|
this.localizedName = I18n.format( "block.appliedenergistics2.grindstone" );
|
||||||
|
|
||||||
ResourceLocation location = new ResourceLocation( AppEng.MOD_ID, "textures/guis/grinder.png" );
|
ResourceLocation location = new ResourceLocation( AppEng.MOD_ID, "textures/guis/grinder.png" );
|
||||||
this.background = guiHelper.createDrawable( location, 11, 16, 154, 70 );
|
this.background = guiHelper.createDrawable( location, 11, 16, 154, 70 );
|
||||||
|
|||||||
@@ -32,8 +32,12 @@ import mezz.jei.api.helpers.IGuiHelper;
|
|||||||
import mezz.jei.api.ingredients.IIngredients;
|
import mezz.jei.api.ingredients.IIngredients;
|
||||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
class InscriberRecipeCategory implements IRecipeCategory<InscriberRecipe>
|
class InscriberRecipeCategory implements IRecipeCategory<InscriberRecipe>
|
||||||
{
|
{
|
||||||
@@ -57,7 +61,7 @@ class InscriberRecipeCategory implements IRecipeCategory<InscriberRecipe>
|
|||||||
{
|
{
|
||||||
ResourceLocation location = new ResourceLocation( AppEng.MOD_ID, "textures/guis/inscriber.png" );
|
ResourceLocation location = new ResourceLocation( AppEng.MOD_ID, "textures/guis/inscriber.png" );
|
||||||
this.background = guiHelper.createDrawable( location, 44, 15, 97, 64 );
|
this.background = guiHelper.createDrawable( location, 44, 15, 97, 64 );
|
||||||
this.localizedName = I18n.format( "tile.appliedenergistics2.inscriber.name" );
|
this.localizedName = I18n.format( "block.appliedenergistics2.inscriber" );
|
||||||
|
|
||||||
IDrawableStatic progressDrawable = guiHelper.drawableBuilder( location, 135, 177, 6, 18 )
|
IDrawableStatic progressDrawable = guiHelper.drawableBuilder( location, 135, 177, 6, 18 )
|
||||||
.addPadding(24, 0, 91, 0)
|
.addPadding(24, 0, 91, 0)
|
||||||
@@ -110,13 +114,7 @@ class InscriberRecipeCategory implements IRecipeCategory<InscriberRecipe>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setIngredients(InscriberRecipe recipe, IIngredients ingredients) {
|
public void setIngredients(InscriberRecipe recipe, IIngredients ingredients) {
|
||||||
|
ingredients.setInputIngredients(recipe.getIngredients());
|
||||||
// FIXME List<List<ItemStack>> inputSlots = new ArrayList<>( 3 );
|
|
||||||
// FIXME inputSlots.add( Collections.singletonList( recipe.getTopOptional() ) );
|
|
||||||
// FIXME inputSlots.add( recipe.getInputs() );
|
|
||||||
// FIXME inputSlots.add( Collections.singletonList( recipe.getBottomOptional() ) );
|
|
||||||
// FIXME ingredients.setInputLists(VanillaTypes.ITEM, inputSlots );
|
|
||||||
|
|
||||||
ingredients.setOutput( VanillaTypes.ITEM, recipe.getOutput() );
|
ingredients.setOutput( VanillaTypes.ITEM, recipe.getOutput() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import appeng.core.AEConfig;
|
|||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import appeng.core.localization.GuiText;
|
import appeng.core.localization.GuiText;
|
||||||
import appeng.recipes.handlers.GrinderRecipe;
|
import appeng.recipes.handlers.GrinderRecipe;
|
||||||
|
import appeng.recipes.handlers.InscriberRecipe;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import mezz.jei.api.IModPlugin;
|
import mezz.jei.api.IModPlugin;
|
||||||
import mezz.jei.api.JeiPlugin;
|
import mezz.jei.api.JeiPlugin;
|
||||||
@@ -95,90 +96,72 @@ public class JEIPlugin implements IModPlugin
|
|||||||
// FIXME registration.addRecipeRegistryPlugin( new FacadeRegistryPlugin( (ItemFacade) itemFacade.get(), cableAnchor.get() ) );
|
// FIXME registration.addRecipeRegistryPlugin( new FacadeRegistryPlugin( (ItemFacade) itemFacade.get(), cableAnchor.get() ) );
|
||||||
// FIXME }
|
// FIXME }
|
||||||
|
|
||||||
ItemStack condenser = definitions.blocks().condenser().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
|
||||||
if(!condenser.isEmpty()) {
|
|
||||||
ItemStack matterBall = definitions.materials().matterBall().maybeStack(1).orElse(ItemStack.EMPTY);
|
|
||||||
if (!matterBall.isEmpty()) {
|
|
||||||
registration.addRecipes(ImmutableList.of(CondenserOutput.MATTER_BALLS), CondenserCategory.UID);
|
|
||||||
}
|
|
||||||
ItemStack singularity = definitions.materials().singularity().maybeStack(1).orElse(ItemStack.EMPTY);
|
|
||||||
if (!singularity.isEmpty()) {
|
|
||||||
registration.addRecipes(ImmutableList.of(CondenserOutput.SINGULARITY), CondenserCategory.UID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RecipeManager recipeManager = Minecraft.getInstance().world.getRecipeManager();
|
RecipeManager recipeManager = Minecraft.getInstance().world.getRecipeManager();
|
||||||
registration.addRecipes(recipeManager.getRecipes(GrinderRecipe.TYPE).values(), GrinderRecipeCategory.UID);
|
registration.addRecipes(recipeManager.getRecipes(GrinderRecipe.TYPE).values(), GrinderRecipeCategory.UID);
|
||||||
// FIXME registration.addRecipes( recipeManager.getRecipes(InscriberRecipe.TYPE), InscriberRecipeCategory.UID );
|
registration.addRecipes(recipeManager.getRecipes(InscriberRecipe.TYPE).values(), InscriberRecipeCategory.UID );
|
||||||
registration.addRecipes(ImmutableList.of(CondenserOutput.MATTER_BALLS, CondenserOutput.SINGULARITY), CondenserCategory.UID);
|
registration.addRecipes(ImmutableList.of(CondenserOutput.MATTER_BALLS, CondenserOutput.SINGULARITY), CondenserCategory.UID);
|
||||||
|
|
||||||
|
registerDescriptions(definitions, registration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) {
|
public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) {
|
||||||
IDefinitions definitions = AEApi.instance().definitions();
|
IDefinitions definitions = AEApi.instance().definitions();
|
||||||
|
|
||||||
ItemStack grindstone = definitions.blocks().grindstone().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
ItemStack grindstone = definitions.blocks().grindstone().stack(1);
|
||||||
if( !grindstone.isEmpty() )
|
registration.addRecipeCatalyst( grindstone, GrinderRecipeCategory.UID );
|
||||||
{
|
|
||||||
registration.addRecipeCatalyst( grindstone, GrinderRecipeCategory.UID );
|
|
||||||
}
|
|
||||||
|
|
||||||
definitions.blocks().condenser().maybeStack( 1 ).ifPresent(condenser -> {
|
ItemStack condenser = definitions.blocks().condenser().stack(1);
|
||||||
registration.addRecipeCatalyst(condenser, CondenserCategory.UID);
|
registration.addRecipeCatalyst(condenser, CondenserCategory.UID);
|
||||||
});
|
|
||||||
|
|
||||||
// Register the inscriber as the crafting item for the inscription category
|
|
||||||
definitions.blocks().inscriber().maybeStack( 1 ).ifPresent( inscriber ->
|
|
||||||
{
|
|
||||||
registration.addRecipeCatalyst( inscriber, InscriberRecipeCategory.UID );
|
|
||||||
} );
|
|
||||||
|
|
||||||
|
ItemStack inscriber = definitions.blocks().inscriber().stack(1);
|
||||||
|
registration.addRecipeCatalyst( inscriber, InscriberRecipeCategory.UID );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerDescriptions(IDefinitions definitions, IRecipeRegistration registry )
|
private void registerDescriptions(IDefinitions definitions, IRecipeRegistration registry )
|
||||||
{
|
{
|
||||||
IMaterials materials = definitions.materials();
|
IMaterials materials = definitions.materials();
|
||||||
|
|
||||||
final String message;
|
final String[] message;
|
||||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.CERTUS_QUARTZ_WORLD_GEN ) )
|
if( AEConfig.instance().isFeatureEnabled( AEFeature.CERTUS_QUARTZ_WORLD_GEN ) )
|
||||||
{
|
{
|
||||||
message = GuiText.ChargedQuartz.getLocal() + "\n\n" + GuiText.ChargedQuartzFind.getLocal();
|
message = new String[]{GuiText.ChargedQuartz.getTranslationKey(), "", GuiText.ChargedQuartzFind.getTranslationKey()};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
message = GuiText.ChargedQuartzFind.getLocal();
|
message = new String[]{GuiText.ChargedQuartzFind.getTranslationKey()};
|
||||||
}
|
}
|
||||||
this.addDescription( registry, materials.certusQuartzCrystalCharged(), message );
|
this.addDescription( registry, materials.certusQuartzCrystalCharged(), message );
|
||||||
|
|
||||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.METEORITE_WORLD_GEN ) )
|
if( AEConfig.instance().isFeatureEnabled( AEFeature.METEORITE_WORLD_GEN ) )
|
||||||
{
|
{
|
||||||
this.addDescription( registry, materials.logicProcessorPress(), GuiText.inWorldCraftingPresses.getLocal() );
|
this.addDescription( registry, materials.logicProcessorPress(), GuiText.inWorldCraftingPresses.getTranslationKey() );
|
||||||
this.addDescription( registry, materials.calcProcessorPress(), GuiText.inWorldCraftingPresses.getLocal() );
|
this.addDescription( registry, materials.calcProcessorPress(), GuiText.inWorldCraftingPresses.getTranslationKey() );
|
||||||
this.addDescription( registry, materials.engProcessorPress(), GuiText.inWorldCraftingPresses.getLocal() );
|
this.addDescription( registry, materials.engProcessorPress(), GuiText.inWorldCraftingPresses.getTranslationKey() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_FLUIX ) )
|
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_FLUIX ) )
|
||||||
{
|
{
|
||||||
this.addDescription( registry, materials.fluixCrystal(), GuiText.inWorldFluix.getLocal() );
|
this.addDescription( registry, materials.fluixCrystal(), GuiText.inWorldFluix.getTranslationKey() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_SINGULARITY ) )
|
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_SINGULARITY ) )
|
||||||
{
|
{
|
||||||
this.addDescription( registry, materials.qESingularity(), GuiText.inWorldSingularity.getLocal() );
|
this.addDescription( registry, materials.qESingularity(), GuiText.inWorldSingularity.getTranslationKey() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_PURIFICATION ) )
|
if( AEConfig.instance().isFeatureEnabled( AEFeature.IN_WORLD_PURIFICATION ) )
|
||||||
{
|
{
|
||||||
this.addDescription( registry, materials.purifiedCertusQuartzCrystal(), GuiText.inWorldPurificationCertus.getLocal() );
|
this.addDescription( registry, materials.purifiedCertusQuartzCrystal(), GuiText.inWorldPurificationCertus.getTranslationKey() );
|
||||||
this.addDescription( registry, materials.purifiedNetherQuartzCrystal(), GuiText.inWorldPurificationNether.getLocal() );
|
this.addDescription( registry, materials.purifiedNetherQuartzCrystal(), GuiText.inWorldPurificationNether.getTranslationKey() );
|
||||||
this.addDescription( registry, materials.purifiedFluixCrystal(), GuiText.inWorldPurificationFluix.getLocal() );
|
this.addDescription( registry, materials.purifiedFluixCrystal(), GuiText.inWorldPurificationFluix.getTranslationKey() );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addDescription(IRecipeRegistration registry, IItemDefinition itemDefinition, String message )
|
private void addDescription(IRecipeRegistration registry, IItemDefinition itemDefinition, String... message )
|
||||||
{
|
{
|
||||||
itemDefinition.maybeStack( 1 ).ifPresent( itemStack -> registry.addIngredientInfo( itemStack, VanillaTypes.ITEM, message ) );
|
registry.addIngredientInfo( itemDefinition.stack(1), VanillaTypes.ITEM, message );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,196 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of Applied Energistics 2.
|
|
||||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package appeng.recipes;
|
|
||||||
|
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
|
||||||
import appeng.api.definitions.IDefinitions;
|
|
||||||
import appeng.api.definitions.IItems;
|
|
||||||
import appeng.api.definitions.IParts;
|
|
||||||
import appeng.api.recipes.ISubItemResolver;
|
|
||||||
import appeng.api.recipes.ResolverResult;
|
|
||||||
import appeng.api.recipes.ResolverResultSet;
|
|
||||||
import appeng.api.util.AEColor;
|
|
||||||
import appeng.api.util.AEColoredItemDefinition;
|
|
||||||
import appeng.core.AppEng;
|
|
||||||
import appeng.items.materials.ItemMaterial;
|
|
||||||
import appeng.items.materials.MaterialType;
|
|
||||||
import appeng.items.parts.ItemPart;
|
|
||||||
import appeng.items.parts.PartType;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
|
|
||||||
public class AEItemResolver implements ISubItemResolver
|
|
||||||
{
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object resolveItemByName( final String nameSpace, final String itemName )
|
|
||||||
{
|
|
||||||
|
|
||||||
if( nameSpace.equals( AppEng.MOD_ID ) )
|
|
||||||
{
|
|
||||||
final IDefinitions definitions = AEApi.instance().definitions();
|
|
||||||
final IItems items = definitions.items();
|
|
||||||
final IParts parts = definitions.parts();
|
|
||||||
|
|
||||||
if( itemName.startsWith( "paint_ball." ) )
|
|
||||||
{
|
|
||||||
return this.paintBall( items.coloredPaintBall(), itemName.substring( itemName.indexOf( '.' ) + 1 ), false );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "lumen_paint_ball." ) )
|
|
||||||
{
|
|
||||||
return this.paintBall( items.coloredPaintBall(), itemName.substring( itemName.indexOf( '.' ) + 1 ), true );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.equals( "cable_glass" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "cable_glass", parts.cableGlass().allStacks( 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "cable_glass." ) )
|
|
||||||
{
|
|
||||||
return this.cableItem( parts.cableGlass(), itemName.substring( itemName.indexOf( '.' ) + 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.equals( "cable_covered" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "cable_covered", parts.cableCovered().allStacks( 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "cable_covered." ) )
|
|
||||||
{
|
|
||||||
return this.cableItem( parts.cableCovered(), itemName.substring( itemName.indexOf( '.' ) + 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.equals( "cable_smart" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "cable_smart", parts.cableSmart().allStacks( 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "cable_smart." ) )
|
|
||||||
{
|
|
||||||
return this.cableItem( parts.cableSmart(), itemName.substring( itemName.indexOf( '.' ) + 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.equals( "cable_dense_covered" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "cable_dense_covered", parts.cableDenseCovered().allStacks( 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "cable_dense_covered." ) )
|
|
||||||
{
|
|
||||||
return this.cableItem( parts.cableDenseCovered(), itemName.substring( itemName.indexOf( '.' ) + 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.equals( "cable_dense_smart" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "cable_dense_smart", parts.cableDenseSmart().allStacks( 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "cable_dense_smart." ) )
|
|
||||||
{
|
|
||||||
return this.cableItem( parts.cableDenseSmart(), itemName.substring( itemName.indexOf( '.' ) + 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "crystal_seed." ) )
|
|
||||||
{
|
|
||||||
if( itemName.equalsIgnoreCase( "crystal_seed.certus" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "certus_crystal_seed", items.certusCrystalSeed().stack( 1 ) );
|
|
||||||
}
|
|
||||||
if( itemName.equalsIgnoreCase( "crystal_seed.nether" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "nether_crystal_seed", items.netherQuartzSeed().stack( 1 ) );
|
|
||||||
}
|
|
||||||
if( itemName.equalsIgnoreCase( "crystal_seed.fluix" ) )
|
|
||||||
{
|
|
||||||
return new ResolverResultSet( "fluix_crystal_seed", items.fluixCrystalSeed().stack( 1 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( itemName.startsWith( "material." ) )
|
|
||||||
{
|
|
||||||
// FIXME entire class is redundant i think
|
|
||||||
// FIXME final String materialName = itemName.substring( itemName.indexOf( '.' ) + 1 );
|
|
||||||
// FIXME final MaterialType mt = MaterialType.valueOf( materialName.toUpperCase() );
|
|
||||||
// FIXME // itemName = itemName.substring( 0, itemName.indexOf( "." ) );
|
|
||||||
// FIXME if( mt.getItemInstance() == ItemMaterial.instance && mt.getDamageValue() >= 0 && mt.isRegistered() )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME return new ResolverResult( "material", mt.getDamageValue() );
|
|
||||||
// FIXME }
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME if( itemName.startsWith( "part." ) )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME final String partName = itemName.substring( itemName.indexOf( '.' ) + 1 );
|
|
||||||
// FIXME final PartType pt = PartType.valueOf( partName.toUpperCase() );
|
|
||||||
// FIXME // itemName = itemName.substring( 0, itemName.indexOf( "." ) );
|
|
||||||
// FIXME final int dVal = ItemPart.instance.getDamageByType( pt );
|
|
||||||
// FIXME if( dVal >= 0 )
|
|
||||||
// FIXME {
|
|
||||||
// FIXME return new ResolverResult( "part", dVal );
|
|
||||||
// FIXME }
|
|
||||||
// FIXME }
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Object paintBall( final AEColoredItemDefinition partType, final String substring, final boolean lumen )
|
|
||||||
{
|
|
||||||
AEColor col;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
col = AEColor.valueOf( substring.toUpperCase() );
|
|
||||||
}
|
|
||||||
catch( final Throwable t )
|
|
||||||
{
|
|
||||||
col = AEColor.TRANSPARENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( col == AEColor.TRANSPARENT )
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
final ItemStack is = partType.stack( col, 1 );
|
|
||||||
return new ResolverResult( "paint_ball", ( lumen ? 20 : 0 ) + is.getDamage() );
|
|
||||||
}
|
|
||||||
|
|
||||||
private Object cableItem( final AEColoredItemDefinition partType, final String substring )
|
|
||||||
{
|
|
||||||
AEColor col;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
col = AEColor.valueOf( substring.toUpperCase() );
|
|
||||||
}
|
|
||||||
catch( final Throwable t )
|
|
||||||
{
|
|
||||||
col = AEColor.TRANSPARENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
final ItemStack is = partType.stack( col, 1 );
|
|
||||||
return new ResolverResult( "part", is.getDamage() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,18 +20,21 @@ public class GrinderRecipe implements IRecipe<IInventory> {
|
|||||||
private final ResourceLocation id;
|
private final ResourceLocation id;
|
||||||
private final String group;
|
private final String group;
|
||||||
private final Ingredient ingredient;
|
private final Ingredient ingredient;
|
||||||
|
private final int ingredientCount;
|
||||||
private final ItemStack result;
|
private final ItemStack result;
|
||||||
private final List<GrinderOptionalResult> optionalResults;
|
private final List<GrinderOptionalResult> optionalResults;
|
||||||
private final int turns;
|
private final int turns;
|
||||||
|
|
||||||
public GrinderRecipe(ResourceLocation id, String group, Ingredient ingredient, ItemStack result, int turns, List<GrinderOptionalResult> optionalResults) {
|
public GrinderRecipe(ResourceLocation id, String group, Ingredient ingredient, int ingredientCount, ItemStack result, int turns, List<GrinderOptionalResult> optionalResults) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.group = group;
|
this.group = group;
|
||||||
this.ingredient = ingredient;
|
this.ingredient = ingredient;
|
||||||
|
this.ingredientCount = ingredientCount;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.turns = turns;
|
this.turns = turns;
|
||||||
this.optionalResults = ImmutableList.copyOf(optionalResults);
|
this.optionalResults = ImmutableList.copyOf(optionalResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(IInventory inv, World worldIn) {
|
public boolean matches(IInventory inv, World worldIn) {
|
||||||
return this.ingredient.test(inv.getStackInSlot(0));
|
return this.ingredient.test(inv.getStackInSlot(0));
|
||||||
@@ -72,6 +75,14 @@ public class GrinderRecipe implements IRecipe<IInventory> {
|
|||||||
return ingredient;
|
return ingredient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getTurns() {
|
||||||
|
return turns;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getIngredientCount() {
|
||||||
|
return ingredientCount;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NonNullList<Ingredient> getIngredients() {
|
public NonNullList<Ingredient> getIngredients() {
|
||||||
NonNullList<Ingredient> nonnulllist = NonNullList.create();
|
NonNullList<Ingredient> nonnulllist = NonNullList.create();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package appeng.recipes.handlers;
|
package appeng.recipes.handlers;
|
||||||
|
|
||||||
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.AppEng;
|
import appeng.core.AppEng;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
@@ -32,7 +33,12 @@ public class GrinderRecipeSerializer extends ForgeRegistryEntry<IRecipeSerialize
|
|||||||
@Override
|
@Override
|
||||||
public GrinderRecipe read(ResourceLocation recipeId, JsonObject json) {
|
public GrinderRecipe read(ResourceLocation recipeId, JsonObject json) {
|
||||||
String group = JSONUtils.getString(json, "group", "");
|
String group = JSONUtils.getString(json, "group", "");
|
||||||
Ingredient ingredient = Ingredient.deserialize(JSONUtils.getJsonObject(json, "input"));
|
JsonObject inputObj = JSONUtils.getJsonObject(json, "input");
|
||||||
|
Ingredient ingredient = Ingredient.deserialize(inputObj);
|
||||||
|
int ingredientCount = 1;
|
||||||
|
if (inputObj.has("count")) {
|
||||||
|
ingredientCount = inputObj.get("count").getAsInt();
|
||||||
|
}
|
||||||
|
|
||||||
JsonObject result = JSONUtils.getJsonObject(json, "result");
|
JsonObject result = JSONUtils.getJsonObject(json, "result");
|
||||||
ItemStack primaryResult = ShapedRecipe.deserializeItem(JSONUtils.getJsonObject(result, "primary"));
|
ItemStack primaryResult = ShapedRecipe.deserializeItem(JSONUtils.getJsonObject(result, "primary"));
|
||||||
@@ -45,25 +51,28 @@ public class GrinderRecipeSerializer extends ForgeRegistryEntry<IRecipeSerialize
|
|||||||
throw new IllegalStateException("Entry in optional result list should be an object.");
|
throw new IllegalStateException("Entry in optional result list should be an object.");
|
||||||
}
|
}
|
||||||
ItemStack optionalResultItem = ShapedRecipe.deserializeItem(optionalResultJson.getAsJsonObject());
|
ItemStack optionalResultItem = ShapedRecipe.deserializeItem(optionalResultJson.getAsJsonObject());
|
||||||
float optionalChance = JSONUtils.getFloat(optionalResultJson.getAsJsonObject(), "chance", 1.0f);
|
float optionalChance = JSONUtils.getFloat(optionalResultJson.getAsJsonObject(), "percentageChance",
|
||||||
|
AEConfig.instance().getOreDoublePercentage()) / 100.0f;
|
||||||
optionalResults.add(new GrinderOptionalResult(optionalChance, optionalResultItem));
|
optionalResults.add(new GrinderOptionalResult(optionalChance, optionalResultItem));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int turns = JSONUtils.getInt(json, "turns", 8);
|
int turns = JSONUtils.getInt(json, "turns", 8);
|
||||||
|
|
||||||
return new GrinderRecipe(recipeId, group, ingredient, primaryResult, turns, optionalResults);
|
return new GrinderRecipe(recipeId, group, ingredient, ingredientCount, primaryResult, turns, optionalResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public GrinderRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
|
public GrinderRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
|
||||||
return null;
|
// FIXME NOT YET IMPLEMENTED
|
||||||
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(PacketBuffer buffer, GrinderRecipe recipe) {
|
public void write(PacketBuffer buffer, GrinderRecipe recipe) {
|
||||||
|
// FIXME NOT YET IMPLEMENTED
|
||||||
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package appeng.recipes.handlers;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public final class GrinderRecipes {
|
||||||
|
|
||||||
|
private GrinderRecipes() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search all available Grinder recipes for a recipe matching the given input or null;
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
public static GrinderRecipe findForInput(World world, ItemStack input) {
|
||||||
|
for (IRecipe<IInventory> recipe : world.getRecipeManager().getRecipes(GrinderRecipe.TYPE).values()) {
|
||||||
|
GrinderRecipe grinderRecipe = (GrinderRecipe) recipe;
|
||||||
|
if (grinderRecipe.getIngredient().test(input) && input.getCount() >= grinderRecipe.getIngredientCount()) {
|
||||||
|
return grinderRecipe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the given item stack is an ingredient in any grinder recipe, disregarding its current size.
|
||||||
|
*/
|
||||||
|
public static boolean isValidIngredient(World world, ItemStack stack) {
|
||||||
|
for (IRecipe<IInventory> recipe : world.getRecipeManager().getRecipes(GrinderRecipe.TYPE).values()) {
|
||||||
|
GrinderRecipe grinderRecipe = (GrinderRecipe) recipe;
|
||||||
|
if (grinderRecipe.getIngredient().test(stack)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
|
|
||||||
package appeng.recipes.handlers;
|
|
||||||
|
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
|
|
||||||
|
|
||||||
public class InscriberHandler
|
|
||||||
{
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public void register( JsonObject json, JsonContext ctx )
|
|
||||||
// {
|
|
||||||
// ItemStack result = PartRecipeFactory.getResult( json, ctx );
|
|
||||||
// String mode = JSONUtils.getString( json, "mode" );
|
|
||||||
//
|
|
||||||
// JsonObject ingredients = JSONUtils.getJsonObject( json, "ingredients" );
|
|
||||||
//
|
|
||||||
// List<ItemStack> middle = Arrays.asList( CraftingHelper.getIngredient( ingredients.get( "middle" ), ctx ).getMatchingStacks() );
|
|
||||||
// ItemStack[] top = new ItemStack[] { null };
|
|
||||||
// if( ingredients.has( "top" ) )
|
|
||||||
// {
|
|
||||||
// top = CraftingHelper.getIngredient( JSONUtils.getJsonObject( ingredients, "top" ), ctx ).getMatchingStacks();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ItemStack[] bottom = new ItemStack[] { null };
|
|
||||||
// if( ingredients.has( "bottom" ) )
|
|
||||||
// {
|
|
||||||
// bottom = CraftingHelper.getIngredient( JSONUtils.getJsonObject( ingredients, "bottom" ), ctx ).getMatchingStacks();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final IInscriberRegistry reg = AEApi.instance().registries().inscriber();
|
|
||||||
// for( int i = 0; i < top.length; ++i )
|
|
||||||
// {
|
|
||||||
// for( int j = 0; j < bottom.length; ++j )
|
|
||||||
// {
|
|
||||||
// final IInscriberRecipeBuilder builder = reg.builder();
|
|
||||||
// builder.withOutput( result );
|
|
||||||
// builder.withProcessType( "press".equals( mode ) ? InscriberProcessType.PRESS : InscriberProcessType.INSCRIBE );
|
|
||||||
// builder.withInputs( middle );
|
|
||||||
//
|
|
||||||
// if( top[i] != null )
|
|
||||||
// {
|
|
||||||
// builder.withTopOptional( top[i] );
|
|
||||||
// }
|
|
||||||
// if( bottom[j] != null )
|
|
||||||
// {
|
|
||||||
// builder.withBottomOptional( bottom[j] );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// reg.addRecipe( builder.build() );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
}
|
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
package appeng.recipes.handlers;
|
package appeng.recipes.handlers;
|
||||||
|
|
||||||
import appeng.api.features.InscriberProcessType;
|
import appeng.api.features.InscriberProcessType;
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||||
import net.minecraft.item.crafting.IRecipeType;
|
import net.minecraft.item.crafting.IRecipeType;
|
||||||
import net.minecraft.item.crafting.Ingredient;
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.util.NonNullList;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import java.util.List;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
public class InscriberRecipe implements IRecipe<IInventory> {
|
public class InscriberRecipe implements IRecipe<IInventory> {
|
||||||
|
|
||||||
@@ -20,20 +20,20 @@ public class InscriberRecipe implements IRecipe<IInventory> {
|
|||||||
private final ResourceLocation id;
|
private final ResourceLocation id;
|
||||||
private final String group;
|
private final String group;
|
||||||
|
|
||||||
private List<Ingredient> inputs;
|
private Ingredient middleInput;
|
||||||
|
private Ingredient topOptional;
|
||||||
|
private Ingredient bottomOptional;
|
||||||
private ItemStack output;
|
private ItemStack output;
|
||||||
private ItemStack topOptional;
|
private InscriberProcessType processType;
|
||||||
private ItemStack bottomOptional;
|
|
||||||
private InscriberProcessType type;
|
|
||||||
|
|
||||||
public InscriberRecipe(ResourceLocation id, String group, List<Ingredient> inputs, ItemStack output, ItemStack topOptional, ItemStack bottomOptional, InscriberProcessType type) {
|
public InscriberRecipe(ResourceLocation id, String group, Ingredient middleInput, ItemStack output, Ingredient topOptional, Ingredient bottomOptional, InscriberProcessType processType) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.group = group;
|
this.group = group;
|
||||||
this.inputs = inputs;
|
this.middleInput = middleInput;
|
||||||
this.output = output;
|
this.output = output;
|
||||||
this.topOptional = topOptional;
|
this.topOptional = topOptional;
|
||||||
this.bottomOptional = bottomOptional;
|
this.bottomOptional = bottomOptional;
|
||||||
this.type = type;
|
this.processType = processType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -43,27 +43,27 @@ public class InscriberRecipe implements IRecipe<IInventory> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getCraftingResult(IInventory inv) {
|
public ItemStack getCraftingResult(IInventory inv) {
|
||||||
return null;
|
return this.output.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canFit(int width, int height) {
|
public boolean canFit(int width, int height) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getRecipeOutput() {
|
public ItemStack getRecipeOutput() {
|
||||||
return null;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getId() {
|
public ResourceLocation getId() {
|
||||||
return null;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IRecipeSerializer<?> getSerializer() {
|
public IRecipeSerializer<?> getSerializer() {
|
||||||
return null;
|
return GrinderRecipeSerializer.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -71,20 +71,33 @@ public class InscriberRecipe implements IRecipe<IInventory> {
|
|||||||
return TYPE;
|
return TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Ingredient> getInputs() {
|
@Override
|
||||||
return inputs;
|
public NonNullList<Ingredient> getIngredients() {
|
||||||
|
NonNullList<Ingredient> nonnulllist = NonNullList.create();
|
||||||
|
nonnulllist.add(this.topOptional);
|
||||||
|
nonnulllist.add(this.middleInput);
|
||||||
|
nonnulllist.add(this.bottomOptional);
|
||||||
|
return nonnulllist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ingredient getMiddleInput() {
|
||||||
|
return middleInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getOutput() {
|
public ItemStack getOutput() {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getTopOptional() {
|
public Ingredient getTopOptional() {
|
||||||
return topOptional;
|
return topOptional;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getBottomOptional() {
|
public Ingredient getBottomOptional() {
|
||||||
return bottomOptional;
|
return bottomOptional;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InscriberProcessType getProcessType() {
|
||||||
|
return processType;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package appeng.recipes.handlers;
|
||||||
|
|
||||||
|
import appeng.api.features.InscriberProcessType;
|
||||||
|
import appeng.core.AppEng;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||||
|
import net.minecraft.item.crafting.Ingredient;
|
||||||
|
import net.minecraft.item.crafting.ShapedRecipe;
|
||||||
|
import net.minecraft.network.PacketBuffer;
|
||||||
|
import net.minecraft.util.JSONUtils;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraftforge.registries.ForgeRegistryEntry;
|
||||||
|
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
public class InscriberRecipeSerializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<InscriberRecipe> {
|
||||||
|
|
||||||
|
public static final InscriberRecipeSerializer INSTANCE = new InscriberRecipeSerializer();
|
||||||
|
|
||||||
|
static {
|
||||||
|
INSTANCE.setRegistryName(AppEng.MOD_ID, "inscriber");
|
||||||
|
}
|
||||||
|
|
||||||
|
private InscriberRecipeSerializer() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static InscriberProcessType getMode(JsonObject json) {
|
||||||
|
String mode = JSONUtils.getString( json, "mode", "inscribe" );
|
||||||
|
switch (mode) {
|
||||||
|
case "inscribe":
|
||||||
|
return InscriberProcessType.INSCRIBE;
|
||||||
|
case "press":
|
||||||
|
return InscriberProcessType.PRESS;
|
||||||
|
default:
|
||||||
|
throw new IllegalStateException("Unknown mode for inscriber recipe: " + mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InscriberRecipe read(ResourceLocation recipeId, JsonObject json) {
|
||||||
|
|
||||||
|
InscriberProcessType mode = getMode(json);
|
||||||
|
|
||||||
|
String group = JSONUtils.getString(json, "group", "");
|
||||||
|
ItemStack result = ShapedRecipe.deserializeItem(JSONUtils.getJsonObject(json, "result"));
|
||||||
|
|
||||||
|
// Deserialize the three parts of the input
|
||||||
|
JsonObject ingredients = JSONUtils.getJsonObject( json, "ingredients" );
|
||||||
|
Ingredient middle = Ingredient.deserialize( ingredients.get( "middle" ) );
|
||||||
|
Ingredient top = Ingredient.EMPTY;
|
||||||
|
if( ingredients.has( "top" ) )
|
||||||
|
{
|
||||||
|
top = Ingredient.deserialize( ingredients.get( "top" ) );
|
||||||
|
}
|
||||||
|
Ingredient bottom = Ingredient.EMPTY;
|
||||||
|
if( ingredients.has( "bottom" ) )
|
||||||
|
{
|
||||||
|
bottom = Ingredient.deserialize( ingredients.get( "bottom" ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return new InscriberRecipe(recipeId, group, middle, result, top, bottom, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public InscriberRecipe read(ResourceLocation recipeId, PacketBuffer buffer) {
|
||||||
|
// FIXME NOT YET IMPLEMENTED
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void write(PacketBuffer buffer, InscriberRecipe recipe) {
|
||||||
|
// FIXME NOT YET IMPLEMENTED
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,19 +19,10 @@
|
|||||||
package appeng.tile.grindstone;
|
package appeng.tile.grindstone;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.minecraft.block.BlockState;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
|
||||||
import net.minecraft.util.Direction;
|
|
||||||
import net.minecraftforge.items.IItemHandler;
|
|
||||||
import net.minecraftforge.items.wrapper.RangedWrapper;
|
|
||||||
|
|
||||||
import appeng.api.AEApi;
|
|
||||||
import appeng.api.features.IGrinderRecipe;
|
|
||||||
import appeng.api.implementations.tiles.ICrankable;
|
import appeng.api.implementations.tiles.ICrankable;
|
||||||
|
import appeng.recipes.handlers.GrinderOptionalResult;
|
||||||
|
import appeng.recipes.handlers.GrinderRecipe;
|
||||||
|
import appeng.recipes.handlers.GrinderRecipes;
|
||||||
import appeng.tile.AEBaseInvTile;
|
import appeng.tile.AEBaseInvTile;
|
||||||
import appeng.tile.inventory.AppEngInternalInventory;
|
import appeng.tile.inventory.AppEngInternalInventory;
|
||||||
import appeng.util.InventoryAdaptor;
|
import appeng.util.InventoryAdaptor;
|
||||||
@@ -40,10 +31,21 @@ import appeng.util.inv.AdaptorItemHandler;
|
|||||||
import appeng.util.inv.InvOperation;
|
import appeng.util.inv.InvOperation;
|
||||||
import appeng.util.inv.WrapperFilteredItemHandler;
|
import appeng.util.inv.WrapperFilteredItemHandler;
|
||||||
import appeng.util.inv.filter.IAEItemFilter;
|
import appeng.util.inv.filter.IAEItemFilter;
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
import net.minecraft.util.Direction;
|
||||||
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
import net.minecraftforge.items.wrapper.RangedWrapper;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class TileGrinder extends AEBaseInvTile implements ICrankable
|
public class TileGrinder extends AEBaseInvTile implements ICrankable
|
||||||
{
|
{
|
||||||
|
private static final int SLOT_PROCESSING = 6;
|
||||||
|
|
||||||
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 7 );
|
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 7 );
|
||||||
private final IItemHandler invExt = new WrapperFilteredItemHandler( this.inv, new GrinderFilter() );
|
private final IItemHandler invExt = new WrapperFilteredItemHandler( this.inv, new GrinderFilter() );
|
||||||
private int points;
|
private int points;
|
||||||
@@ -96,24 +98,21 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final IGrinderRecipe r = AEApi.instance().registries().grinder().getRecipeForInput( item );
|
GrinderRecipe r = GrinderRecipes.findForInput(world, item);
|
||||||
if( r != null )
|
if( r != null )
|
||||||
{
|
{
|
||||||
if( item.getCount() >= r.getInput().getCount() )
|
final ItemStack ais = item.copy();
|
||||||
|
ais.setCount( r.getIngredientCount() );
|
||||||
|
item.shrink( r.getIngredientCount() );
|
||||||
|
|
||||||
|
if( item.getCount() <= 0 )
|
||||||
{
|
{
|
||||||
final ItemStack ais = item.copy();
|
item = ItemStack.EMPTY;
|
||||||
ais.setCount( r.getInput().getCount() );
|
|
||||||
item.shrink( r.getInput().getCount() );
|
|
||||||
|
|
||||||
if( item.getCount() <= 0 )
|
|
||||||
{
|
|
||||||
item = ItemStack.EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inv.setStackInSlot( x, item );
|
|
||||||
this.inv.setStackInSlot( 6, ais );
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.inv.setStackInSlot( x, item );
|
||||||
|
this.inv.setStackInSlot( 6, ais );
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -131,11 +130,11 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
|
|||||||
|
|
||||||
this.points++;
|
this.points++;
|
||||||
|
|
||||||
final ItemStack processing = this.inv.getStackInSlot( 6 );
|
final ItemStack processing = this.inv.getStackInSlot(SLOT_PROCESSING);
|
||||||
final IGrinderRecipe r = AEApi.instance().registries().grinder().getRecipeForInput( processing );
|
GrinderRecipe r = GrinderRecipes.findForInput(world, processing);
|
||||||
if( r != null )
|
if( r != null )
|
||||||
{
|
{
|
||||||
if( r.getRequiredTurns() > this.points )
|
if( r.getTurns() > this.points )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -143,27 +142,16 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
|
|||||||
this.points = 0;
|
this.points = 0;
|
||||||
final InventoryAdaptor sia = new AdaptorItemHandler( new RangedWrapper( this.inv, 3, 6 ) );
|
final InventoryAdaptor sia = new AdaptorItemHandler( new RangedWrapper( this.inv, 3, 6 ) );
|
||||||
|
|
||||||
this.addItem( sia, r.getOutput() );
|
this.addItem( sia, r.getRecipeOutput());
|
||||||
|
|
||||||
r.getOptionalOutput().ifPresent( itemStack ->
|
for (GrinderOptionalResult optionalResult : r.getOptionalResults()) {
|
||||||
{
|
|
||||||
final float chance = ( Platform.getRandomInt() % 2000 ) / 2000.0f;
|
final float chance = ( Platform.getRandomInt() % 2000 ) / 2000.0f;
|
||||||
|
|
||||||
if( chance <= r.getOptionalChance() )
|
if( chance <= optionalResult.getChance() )
|
||||||
{
|
{
|
||||||
this.addItem( sia, itemStack );
|
this.addItem( sia, optionalResult.getResult() );
|
||||||
}
|
}
|
||||||
} );
|
}
|
||||||
|
|
||||||
r.getSecondOptionalOutput().ifPresent( itemStack ->
|
|
||||||
{
|
|
||||||
final float chance = ( Platform.getRandomInt() % 2000 ) / 2000.0f;
|
|
||||||
|
|
||||||
if( chance <= r.getSecondOptionalChance() )
|
|
||||||
{
|
|
||||||
this.addItem( sia, itemStack );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
this.inv.setStackInSlot( 6, ItemStack.EMPTY );
|
this.inv.setStackInSlot( 6, ItemStack.EMPTY );
|
||||||
}
|
}
|
||||||
@@ -203,7 +191,7 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
|
|||||||
@Override
|
@Override
|
||||||
public boolean allowInsert( IItemHandler inv, int slotIndex, ItemStack stack )
|
public boolean allowInsert( IItemHandler inv, int slotIndex, ItemStack stack )
|
||||||
{
|
{
|
||||||
if( AEApi.instance().registries().grinder().getRecipeForInput( stack ) == null )
|
if( !GrinderRecipes.isValidIngredient(world, stack) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:gems/certus_quartz"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:certus_quartz_dust"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"turns": 4
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:ores/certus_quartz"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:certus_quartz_dust"
|
||||||
|
},
|
||||||
|
"optional": [
|
||||||
|
{
|
||||||
|
"item": "appliedenergistics2:certus_quartz_dust"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"turns": 8
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:ender_pearls"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:ender_dust"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"turns": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:crops/wheat"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:flour"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"turns": 4
|
||||||
|
}
|
||||||
@@ -8,5 +8,5 @@
|
|||||||
"item": "appliedenergistics2:fluix_dust"
|
"item": "appliedenergistics2:fluix_dust"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"turns": 8
|
"turns": 4
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:ingots/gold"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:gold_dust"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"turns": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:ores/gold"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:gold_dust"
|
||||||
|
},
|
||||||
|
"optional": [
|
||||||
|
{
|
||||||
|
"item": "appliedenergistics2:gold_dust"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"turns": 8
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:ingots/iron"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:iron_dust"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"turns": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:ores/iron"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:iron_dust"
|
||||||
|
},
|
||||||
|
"optional": [
|
||||||
|
{
|
||||||
|
"item": "appliedenergistics2:iron_dust"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"turns": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:gems/quartz"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:nether_quartz_dust"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"turns": 4
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"type": "appliedenergistics2:grinder",
|
||||||
|
"input": {
|
||||||
|
"tag": "forge:ores/quartz"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"primary": {
|
||||||
|
"item": "appliedenergistics2:nether_quartz_dust"
|
||||||
|
},
|
||||||
|
"optional": [
|
||||||
|
{
|
||||||
|
"item": "appliedenergistics2:nether_quartz_dust"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"turns": 8
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"result": {
|
"result": {
|
||||||
"item": "appliedenergistics2:nether_crystal_seed",
|
"item": "appliedenergistics2:nether_quartz_seed",
|
||||||
"count": 2
|
"count": 2
|
||||||
},
|
},
|
||||||
"type": "minecraft:crafting_shapeless",
|
"type": "minecraft:crafting_shapeless",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"tag": "appliedenergistics2:dusts/fluix"
|
"tag": "appliedenergistics2:dusts/fluix"
|
||||||
},
|
},
|
||||||
"c": {
|
"c": {
|
||||||
"tag": "appliedenergistics2:dusts/ender"
|
"tag": "appliedenergistics2:dusts/ender_pearl"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"type": "appliedenergistics2:smelt",
|
"type": "minecraft:smelting",
|
||||||
"result": {
|
"result": {
|
||||||
"item": "minecraft:bread"
|
"item": "minecraft:bread"
|
||||||
},
|
},
|
||||||
"input": {
|
"ingredient": {
|
||||||
"item": "appliedenergistics2:flour"
|
"item": "appliedenergistics2:flour"
|
||||||
},
|
},
|
||||||
"xp": 0.0
|
"experience": 0.0
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"type": "appliedenergistics2:smelt",
|
"type": "minecraft:smelting",
|
||||||
"result": {
|
"result": {
|
||||||
"item": "minecraft:gold_ingot"
|
"item": "minecraft:gold_ingot"
|
||||||
},
|
},
|
||||||
"input": {
|
"ingredient": {
|
||||||
"tag": "forge:dusts/gold"
|
"tag": "forge:dusts/gold"
|
||||||
},
|
},
|
||||||
"xp": 0.0
|
"experience": 0.0
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"type": "appliedenergistics2:smelt",
|
"type": "minecraft:smelting",
|
||||||
"result": {
|
"result": {
|
||||||
"item": "minecraft:iron_ingot"
|
"item": "minecraft:iron_ingot"
|
||||||
},
|
},
|
||||||
"input": {
|
"ingredient": {
|
||||||
"tag": "forge:dusts/iron"
|
"tag": "forge:dusts/iron"
|
||||||
},
|
},
|
||||||
"xp": 0.0
|
"experience": 0.0
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"type": "appliedenergistics2:smelt",
|
"type": "minecraft:smelting",
|
||||||
"result": {
|
"result": {
|
||||||
"item": "appliedenergistics2:silicon"
|
"item": "appliedenergistics2:silicon"
|
||||||
},
|
},
|
||||||
"input": [
|
"ingredient": [
|
||||||
{
|
{
|
||||||
"tag": "appliedenergistics2:dusts/nether_quartz"
|
"tag": "appliedenergistics2:dusts/nether_quartz"
|
||||||
},
|
},
|
||||||
@@ -11,5 +11,5 @@
|
|||||||
"tag": "appliedenergistics2:dusts/certus_quartz"
|
"tag": "appliedenergistics2:dusts/certus_quartz"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"xp": 0.0
|
"experience": 0.0
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"type": "appliedenergistics2:smelt",
|
"type": "minecraft:smelting",
|
||||||
"result": {
|
"result": {
|
||||||
"item": "appliedenergistics2:smooth_sky_stone_block"
|
"item": "appliedenergistics2:smooth_sky_stone_block"
|
||||||
},
|
},
|
||||||
"input": {
|
"ingredient": {
|
||||||
"item": "appliedenergistics2:sky_stone_block"
|
"item": "appliedenergistics2:sky_stone_block"
|
||||||
},
|
},
|
||||||
"xp": 0.0
|
"experience": 0.0
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"values": []
|
"values": ["appliedenergistics2:ender_dust"]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"appliedenergistics2:gold_dust"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"appliedenergistics2:iron_dust"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"appliedenergistics2:certus_quartz_crystal",
|
||||||
|
"appliedenergistics2:charged_certus_quartz_crystal"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"values": [
|
||||||
|
"appliedenergistics2:quartz_ore",
|
||||||
|
"appliedenergistics2:charged_quartz_ore"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user