Removal of lots of fixmes.
Removed InvTweaks sort order (mod indicates it wont update, suggested replacement cpw sorting mod only sorts by count and reg-id). Reactivated dissassemble special recipe. Removed leftovers from cable bus non-tesr tile. Added JEI facade recipes back in. Removed superflous datagen for quartz tools.
This commit is contained in:
@@ -7,9 +7,7 @@ import net.minecraftforge.fml.event.lifecycle.GatherDataEvent;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import appeng.forge.data.providers.loot.BlockDropProvider;
|
||||
import appeng.forge.data.providers.recipes.QuartzToolRecipes;
|
||||
import appeng.forge.data.providers.recipes.SlabStairRecipes;
|
||||
import appeng.forge.data.providers.recipes.SpecialRecipes;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = AppEng.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class AE2DataGenerators {
|
||||
@@ -20,8 +18,6 @@ public class AE2DataGenerators {
|
||||
if (dataEvent.includeServer()) {
|
||||
generator.addProvider(new BlockDropProvider(dataEvent));
|
||||
generator.addProvider(new SlabStairRecipes(generator));
|
||||
generator.addProvider(new QuartzToolRecipes(generator));
|
||||
generator.addProvider(new SpecialRecipes(generator));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package appeng.forge.data.providers.recipes;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.IFinishedRecipe;
|
||||
import net.minecraft.data.RecipeProvider;
|
||||
import net.minecraft.data.ShapedRecipeBuilder;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.common.crafting.ConditionalRecipe;
|
||||
|
||||
import it.unimi.dsi.fastutil.chars.Char2ObjectArrayMap;
|
||||
import it.unimi.dsi.fastutil.chars.Char2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.chars.CharOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.chars.CharSet;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.forge.data.providers.IAE2DataProvider;
|
||||
import appeng.recipes.conditions.FeaturesEnabled;
|
||||
|
||||
public class QuartzToolRecipes extends RecipeProvider implements IAE2DataProvider {
|
||||
|
||||
private Map<net.minecraft.tags.Tag<Item>, IItemDefinition[]> items = ImmutableMap.of(Tags.Items.GEMS_QUARTZ,
|
||||
new IItemDefinition[] { ITEMS.netherQuartzAxe(), ITEMS.netherQuartzHoe(), ITEMS.netherQuartzShovel(),
|
||||
ITEMS.netherQuartzPick(), ITEMS.netherQuartzSword(), ITEMS.netherQuartzWrench(),
|
||||
ITEMS.netherQuartzKnife() }
|
||||
// FIXME certus quartz
|
||||
);
|
||||
|
||||
private String[][] patterns = { { "XX ", "X/ ", " / " }, { "XX ", " / ", " / " }, { " X ", " / ", " / " },
|
||||
{ "XXX", " / ", " / " }, { " X ", " X ", " / " }, { "X X", " X ", "X X" }, { " /", "I/ ", "XX " } };
|
||||
|
||||
private Char2ObjectMap<Tag<Item>> keys = new Char2ObjectArrayMap<>(new char[] { 'I', '/' },
|
||||
new Tag[] { Tags.Items.INGOTS_IRON, Tags.Items.RODS_WOODEN });
|
||||
|
||||
public QuartzToolRecipes(DataGenerator generatorIn) {
|
||||
super(generatorIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes(@Nonnull Consumer<IFinishedRecipe> consumer) {
|
||||
for (Map.Entry<Tag<Item>, IItemDefinition[]> entry : items.entrySet()) {
|
||||
Tag<Item> tag = entry.getKey();
|
||||
IItemDefinition[] tools = entry.getValue();
|
||||
|
||||
for (int i = 0; i < tools.length; i++) {
|
||||
CharSet keySet = new CharOpenHashSet(new char[] { 'X', ' ' });
|
||||
|
||||
ShapedRecipeBuilder shapedBuilder = ShapedRecipeBuilder.shapedRecipe(tools[i].item());
|
||||
for (String s : patterns[i]) {
|
||||
shapedBuilder.patternLine(s);
|
||||
|
||||
for (int j = 0; j < s.length(); j++) {
|
||||
char c = s.charAt(j);
|
||||
if (!keySet.contains(c)) {
|
||||
keySet.add(c);
|
||||
shapedBuilder.key(c, keys.get(c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
shapedBuilder.key('X', tag).addCriterion("has_" + tag.getId(), hasItem(tag));
|
||||
|
||||
ConditionalRecipe.builder().addCondition(new FeaturesEnabled(tools[i].features()))
|
||||
.addRecipe(shapedBuilder::build)
|
||||
.build(consumer, AppEng.MOD_ID, "tools/" + tools[i].identifier());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return AppEng.MOD_NAME + " Quartz Tools";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
package appeng.forge.data.providers.recipes;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.data.IFinishedRecipe;
|
||||
import net.minecraft.data.RecipeProvider;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
import appeng.forge.data.providers.IAE2DataProvider;
|
||||
|
||||
public class SpecialRecipes extends RecipeProvider implements IAE2DataProvider {
|
||||
|
||||
public SpecialRecipes(DataGenerator generatorIn) {
|
||||
super(generatorIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes(@Nonnull Consumer<IFinishedRecipe> consumer) {
|
||||
// ConditionalRecipe.builder() FIXME this works, but NPEs at runtime
|
||||
// .addCondition( new FeaturesEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING ) )
|
||||
// .addRecipe( new FinishedRecipe( DisassembleRecipe.SERIALIZER ) )
|
||||
// .build( consumer, AppEng.MOD_ID, "special/disassemble" );
|
||||
|
||||
// ConditionalRecipe.builder() FIXME re-implement facades
|
||||
// .addCondition( new FeaturesEnabled( AEFeature.ENABLE_FACADE_CRAFTING ) )
|
||||
// .addRecipe( new FinishedRecipe( FacadeRecipe.SERIALIZER ) )
|
||||
// .build( consumer, AppEng.MOD_ID, "special/facade" );
|
||||
}
|
||||
|
||||
private static class FinishedRecipe implements IFinishedRecipe {
|
||||
|
||||
private final IRecipeSerializer<?> serializer;
|
||||
|
||||
public FinishedRecipe(IRecipeSerializer<?> serializer) {
|
||||
this.serializer = serializer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(@Nonnull JsonObject json) {
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getID() {
|
||||
return Objects.requireNonNull(serializer.getRegistryName());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return serializer;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public JsonObject getAdvancementJson() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getAdvancementID() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getName() {
|
||||
return AppEng.MOD_NAME + " Special Crafting Recipes";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user