Added keep data recipes, made batteries keep their power, drills keep their upgrades and storage crates keep their content when crafted into further items

This commit is contained in:
Ellpeck 2016-08-04 11:57:35 +02:00
parent f7d52a7178
commit 2a9a8ccbcc
8 changed files with 106 additions and 134 deletions

View file

@ -174,7 +174,7 @@ public final class InitBooklet{
new BookletChapter("itemFilter", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitItems.itemFilter), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeFilter).setNoText()).setImportant();
//RF Using Items
new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, ItemCrafting.recipeDrill).setNoText().setPageStacksWildcard(), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial();
new BookletChapter("drill", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, ItemCrafting.recipeDrill).setNoText(), new PageCrafting(4, ItemCrafting.RECIPES_DRILL_COLORING), new PageCrafting(4, ItemCrafting.recipeDrillCore).setNoText(), new PageCrafting(5, ItemCrafting.recipeDrillSpeedI).setNoText(), new PageCrafting(6, ItemCrafting.recipeDrillSpeedII).setNoText(), new PageCrafting(7, ItemCrafting.recipeDrillSpeedIII).setNoText(), new PageCrafting(8, ItemCrafting.recipeDrillFortuneI).setNoText(), new PageCrafting(9, ItemCrafting.recipeDrillFortuneII).setNoText(), new PageCrafting(10, ItemCrafting.recipeDrillSilk).setNoText(), new PageCrafting(11, ItemCrafting.recipeDrillThree).setNoText(), new PageCrafting(12, ItemCrafting.recipeDrillFive).setNoText(), new PageCrafting(13, ItemCrafting.recipeDrillPlacing).setNoText()).setSpecial();
new BookletChapter("staff", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemTeleStaff), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeStaff).setNoText()).setImportant();
new BookletChapter("magnetRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemMagnetRing), new PageCrafting(1, ItemCrafting.recipeMagnetRing));
new BookletChapter("growthRing", ActuallyAdditionsAPI.entryItemsRF, new ItemStack(InitItems.itemGrowthRing), new PageCrafting(1, ItemCrafting.recipeGrowthRing));

View file

@ -715,14 +715,14 @@ public final class BlockCrafting{
'W', "plankWood"));
recipeCrate = RecipeUtil.lastIRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGiantChestMedium),
GameRegistry.addRecipe(new RecipeKeepDataShaped(new ItemStack(InitBlocks.blockGiantChestMedium), new ItemStack(InitBlocks.blockGiantChest),
"CWC", "WDW", "CWC",
'C', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.COAL.ordinal()),
'D', new ItemStack(InitBlocks.blockGiantChest),
'W', "plankWood"));
recipeCrateMedium = RecipeUtil.lastIRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGiantChestLarge),
GameRegistry.addRecipe(new RecipeKeepDataShaped(new ItemStack(InitBlocks.blockGiantChestLarge), new ItemStack(InitBlocks.blockGiantChestMedium),
"CWC", "WDW", "CWC",
'C', new ItemStack(InitBlocks.blockCrystalEmpowered, 1, TheCrystals.COAL.ordinal()),
'D', new ItemStack(InitBlocks.blockGiantChestMedium),

View file

@ -16,7 +16,6 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.RecipeSorter;
public final class InitCrafting{
@ -33,8 +32,8 @@ public final class InitCrafting{
ActuallyAdditionsAPI.addCompostRecipe(new ItemStack(InitItems.itemMisc, 10, TheMiscItems.MASHED_FOOD.ordinal()), Blocks.LEAVES, new ItemStack(InitItems.itemFertilizer, 10), Blocks.DIRT);
ActuallyAdditionsAPI.addCompostRecipe(new ItemStack(InitItems.itemCanolaSeed, 20), Blocks.DIRT, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BIOMASS.ordinal()), Blocks.SOUL_SAND);
RecipeSorter.register(ModUtil.MOD_ID+":drillColoring", RecipeDrillColor.class, RecipeSorter.Category.SHAPELESS, "");
GameRegistry.addRecipe(new RecipeDrillColor());
RecipeSorter.register(ModUtil.MOD_ID+":recipeKeepDataShaped", RecipeKeepDataShaped.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped");
RecipeSorter.register(ModUtil.MOD_ID+":recipeKeepDataShapeless", RecipeKeepDataShapeless.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
}
}

View file

@ -39,6 +39,7 @@ public final class ItemCrafting{
public static final ArrayList<IRecipe> RECIPES_MASHED_FOOD = new ArrayList<IRecipe>();
public static final ArrayList<IRecipe> RECIPES_POTION_RINGS = new ArrayList<IRecipe>();
public static final ArrayList<IRecipe> RECIPES_DRILL_COLORING = new ArrayList<IRecipe>();
public static IRecipe recipePhantomConnector;
public static IRecipe recipeCoil;
public static IRecipe recipeCoilAdvanced;
@ -236,13 +237,21 @@ public final class ItemCrafting{
//Drill
if(ConfigCrafting.DRILL.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal()),
ItemStack lightBlueDrill = new ItemStack(InitItems.itemDrill, 1, TheColoredLampColors.LIGHT_BLUE.ordinal());
GameRegistry.addRecipe(new ShapedOreRecipe(lightBlueDrill.copy(),
"DDD", "CRC", "III",
'D', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.DIAMOND.ordinal()),
'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()),
'R', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal()),
'I', new ItemStack(InitBlocks.blockCrystal, 1, TheCrystals.IRON.ordinal())));
recipeDrill = RecipeUtil.lastIRecipe();
for(int i = 0; i < 16; i++){
if(i != TheColoredLampColors.LIGHT_BLUE.ordinal()){
GameRegistry.addRecipe(new RecipeKeepDataShapeless(new ItemStack(InitItems.itemDrill, 1, i), new ItemStack(InitItems.itemDrill, 1, Util.WILDCARD), lightBlueDrill.copy(), "dye"+TheColoredLampColors.values()[i].name));
RECIPES_DRILL_COLORING.add(RecipeUtil.lastIRecipe());
}
}
}
//Drill Core
@ -357,7 +366,7 @@ public final class ItemCrafting{
//Double Battery
if(ConfigCrafting.DOUBLE_BATTERY.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemBatteryDouble),
GameRegistry.addRecipe(new RecipeKeepDataShaped(new ItemStack(InitItems.itemBatteryDouble), new ItemStack(InitItems.itemBattery),
" R ", "ICI", "III",
'R', new ItemStack(InitItems.itemBattery),
'I', new ItemStack(InitItems.itemCrystal, 1, TheCrystals.IRON.ordinal()),
@ -398,7 +407,7 @@ public final class ItemCrafting{
//Triple Battery
if(ConfigCrafting.TRIPLE_BATTERY.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemBatteryTriple),
GameRegistry.addRecipe(new RecipeKeepDataShaped(new ItemStack(InitItems.itemBatteryTriple), new ItemStack(InitItems.itemBatteryDouble),
" R ", "ICI", "III",
'R', new ItemStack(InitItems.itemBatteryDouble),
'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()),
@ -408,7 +417,7 @@ public final class ItemCrafting{
//Quadruple Battery
if(ConfigCrafting.QUADRUPLE_BATTERY.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemBatteryQuadruple),
GameRegistry.addRecipe(new RecipeKeepDataShaped(new ItemStack(InitItems.itemBatteryQuadruple), new ItemStack(InitItems.itemBatteryTriple),
" R ", "ICI", "III",
'R', new ItemStack(InitItems.itemBatteryTriple),
'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.IRON.ordinal()),
@ -418,7 +427,7 @@ public final class ItemCrafting{
//Quintuple Battery
if(ConfigCrafting.QUINTUPLE_BATTERY.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemBatteryQuintuple),
GameRegistry.addRecipe(new RecipeKeepDataShaped(new ItemStack(InitItems.itemBatteryQuintuple), new ItemStack(InitItems.itemBatteryQuadruple),
" R ", "ICI", "III",
'R', new ItemStack(InitItems.itemBatteryQuadruple),
'I', new ItemStack(InitItems.itemCrystalEmpowered, 1, TheCrystals.DIAMOND.ordinal()),

View file

@ -1,121 +0,0 @@
/*
* This file ("RecipeDrillColor.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.crafting;
import de.ellpeck.actuallyadditions.mod.blocks.metalists.TheColoredLampColors;
import de.ellpeck.actuallyadditions.mod.items.ItemDrill;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.oredict.OreDictionary;
import javax.annotation.Nullable;
public class RecipeDrillColor implements IRecipe{
@Override
public boolean matches(InventoryCrafting inv, World worldIn){
boolean hasDrill = false;
boolean hasColor = false;
for(int i = 0; i < inv.getSizeInventory(); i++){
ItemStack stack = inv.getStackInSlot(i);
if(stack != null && stack.getItem() != null){
if(stack.getItem() instanceof ItemDrill){
if(!hasDrill){
hasDrill = true;
}
else{
return false;
}
}
else{
int[] ids = OreDictionary.getOreIDs(stack);
if(ids != null){
for(int id : ids){
String name = OreDictionary.getOreName(id);
if(name != null){
TheColoredLampColors color = TheColoredLampColors.getColorFromDyeName(name);
if(color != null){
if(!hasColor){
hasColor = true;
}
else{
return false;
}
}
}
}
}
}
}
}
return hasDrill && hasColor;
}
@Nullable
@Override
public ItemStack getCraftingResult(InventoryCrafting inv){
ItemStack drillStack = null;
ItemStack colorStack = null;
for(int i = 0; i < inv.getSizeInventory(); i++){
ItemStack stack = inv.getStackInSlot(i);
if(stack != null && stack.getItem() != null){
if(stack.getItem() instanceof ItemDrill){
drillStack = stack.copy();
}
else{
colorStack = stack.copy();
}
}
}
if(drillStack != null && colorStack != null){
int[] ids = OreDictionary.getOreIDs(colorStack);
if(ids != null){
for(int id : ids){
String name = OreDictionary.getOreName(id);
if(name != null){
TheColoredLampColors color = TheColoredLampColors.getColorFromDyeName(name);
if(color != null){
if(color.ordinal() != drillStack.getItemDamage()){
drillStack.setItemDamage(color.ordinal());
return drillStack;
}
}
}
}
}
}
return null;
}
@Override
public int getRecipeSize(){
return 2;
}
@Nullable
@Override
public ItemStack getRecipeOutput(){
return null;
}
@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv){
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
}

View file

@ -0,0 +1,42 @@
/*
* This file ("RecipeKeepNBT.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.crafting;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
public class RecipeKeepDataShaped extends ShapedOreRecipe{
private final ItemStack nbtCopyStack;
public RecipeKeepDataShaped(ItemStack result, ItemStack nbtCopyStack, Object... recipe){
super(result, recipe);
this.nbtCopyStack = nbtCopyStack;
}
@Override
public ItemStack getCraftingResult(InventoryCrafting inventory){
ItemStack stack = super.getCraftingResult(inventory);
if(stack != null){
for(int i = 0; i < inventory.getSizeInventory(); i++){
ItemStack input = inventory.getStackInSlot(i);
if(ItemUtil.areItemsEqual(this.nbtCopyStack, input, true)){
stack.setTagCompound(input.getTagCompound());
break;
}
}
}
return stack;
}
}

View file

@ -0,0 +1,42 @@
/*
* This file ("RecipeKeepNBTShapeless.java") is part of the Actually Additions mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://ellpeck.de/actaddlicense
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
* © 2015-2016 Ellpeck
*/
package de.ellpeck.actuallyadditions.mod.crafting;
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class RecipeKeepDataShapeless extends ShapelessOreRecipe{
private final ItemStack nbtCopyStack;
public RecipeKeepDataShapeless(ItemStack result, ItemStack nbtCopyStack, Object... recipe){
super(result, recipe);
this.nbtCopyStack = nbtCopyStack;
}
@Override
public ItemStack getCraftingResult(InventoryCrafting inventory){
ItemStack stack = super.getCraftingResult(inventory);
if(stack != null){
for(int i = 0; i < inventory.getSizeInventory(); i++){
ItemStack input = inventory.getStackInSlot(i);
if(ItemUtil.areItemsEqual(this.nbtCopyStack, input, true)){
stack.setTagCompound(input.getTagCompound());
break;
}
}
}
return stack;
}
}

View file

@ -781,7 +781,7 @@ booklet.actuallyadditions.chapter.compost.text.3=<item>Bio-Mash<r> can be crafte
booklet.actuallyadditions.chapter.crate.name=Storage Crates
booklet.actuallyadditions.chapter.crate.text.1=<item>Storage Crates<r> are big. <imp>Really big<r>. They hold tons of items, more than 4 chests worth of them. <n>Not only that, but they can be <imp>upgraded in size<r>! View the following pages to get information on that and some other items regarding crates!
booklet.actuallyadditions.chapter.crate.text.4=Placing a <item>Storage Crate Keeper<r> inside the Storage Crate before breaking it will cause it to <imp>keep all of its items<r>, however the Keeper will be destroyed in the process. <n>Also note that using a filled crate for crafting will <imp>destroy its contents<r>.
booklet.actuallyadditions.chapter.crate.text.4=Placing a <item>Storage Crate Keeper<r> inside the Storage Crate before breaking it will cause it to <imp>keep all of its items<r>, however the Keeper will be destroyed in the process. <n>Once upgraded via crafting, they will not lose their contents either.
booklet.actuallyadditions.chapter.crate.text.5=The <item>Chest To Storage Crate Upgrade<r> allows you to <imp>convert any chest into a Storage Crate<r>, retaining its items! <n>Just <imp>shift-right-click<r> onto the chest to apply it.
booklet.actuallyadditions.chapter.crate.text.6=Similar to the <item>Chest To Storage Crate Upgrade<r>, the <item>Small To Medium Storage Crate Upgrade<r> will convert any <imp>Small Storage Crate<r> into a <imp>Medium Storage Crate<r> by simply shift-right-clicking it. It will retain its items.
booklet.actuallyadditions.chapter.crate.text.7=Similar to the <item>Chest To Storage Crate Upgrade<r>, the <item>Medium To Large Storage Crate Upgrade<r> will convert any <imp>Medium Storage Crate<r> into a <imp>Large Storage Crate<r> by simply shift-right-clicking it. It will retain its items.
@ -843,7 +843,8 @@ booklet.actuallyadditions.chapter.potionRings.text.1=The <item>Potion Rings<r> h
booklet.actuallyadditions.chapter.drill.name=Drills
booklet.actuallyadditions.chapter.drill.text.1=The <item>Drill<r> works like a Pickaxe and a Shovel. It uses <imp>RF<r> per block. It can be <imp>charged in an Energizer<r> and upgraded by <imp>right-clicking<r> with it in your hand. There is <imp>a lot of upgrades<r>, but here is an explanation of some of them: <n>The <item>Mining Uprgades<r> enlarge the hole which the Drill digs. <n>The <item>Placement Upgrade<r>, after you right-click it in any slot of your hotbar, will make the Drill able to <imp>place a block from that slot by right-clicking<r>. You can also put a <item>Battery<r> inside the Drill to give it more charge.
booklet.actuallyadditions.chapter.drill.text.2=It should be noted that, in fact, the <item>Speed<r>, <item>Mining<r> and <item>Fortune Upgrades<r> <imp>need their previous tiers to be installed<r> for them to work. <n>This means that, if you want Speed III in the Drill, it needs Speed II and Speed I inside it as well. <n><n>Additionally, the <item>Drill<r> can also be <imp>dyed<r> in Minecraft's 16 colors by crafting it together with one. <n>It's only cosmetic and won't have any effect other than it looking different, however.
booklet.actuallyadditions.chapter.drill.text.2=It should be noted that, in fact, the <item>Speed<r>, <item>Mining<r> and <item>Fortune Upgrades<r> <imp>need their previous tiers to be installed<r> for them to work. <n>This means that, if you want Speed III in the Drill, it needs Speed II and Speed I inside it as well.
booklet.actuallyadditions.chapter.drill.text.4=The <item>Drill<r> can also be <imp>dyed<r> in Minecraft's 16 colors. <n>It's only cosmetic and won't have any effect other than it looking different, however.
booklet.actuallyadditions.chapter.staff.name=Staff
booklet.actuallyadditions.chapter.staff.text.1=The <item>Teleport Staff<r>, when charged in an Energizer, can be <imp>right-clicked<r> to <imp>teleport you to where you're looking<r>. When you are looking at a block, it will teleport you there, however, when you aren't looking at a block, you can only be looking upwards up to <imp>5 degrees<r>, otherwise the teleport will fail.