Added more storage crate upgrades

Closes #186
This commit is contained in:
Ellpeck 2016-08-04 03:14:45 +02:00
parent 5c8fba3d64
commit a907b7e8c5
10 changed files with 57 additions and 12 deletions

View file

@ -125,7 +125,7 @@ public final class InitBooklet{
new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText());
new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText());
new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.RECIPES_MASHED_FOOD)); new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.RECIPES_MASHED_FOOD));
new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, BlockCrafting.recipeCrateMedium).setNoText(), new PageCrafting(3, BlockCrafting.recipeCrateLarge).setNoText(), new PageCrafting(4, ItemCrafting.recipeCrateKeeper), new PageCrafting(5, ItemCrafting.recipeChestToCrateUpgrade)); new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, BlockCrafting.recipeCrateMedium).setNoText(), new PageCrafting(3, BlockCrafting.recipeCrateLarge).setNoText(), new PageCrafting(4, ItemCrafting.recipeCrateKeeper), new PageCrafting(5, ItemCrafting.recipeChestToCrateUpgrade), new PageCrafting(6, ItemCrafting.recipeSmallToMediumCrateUpgrade), new PageCrafting(7, ItemCrafting.recipeMediumToLargeCrateUpgrade));
new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("<range>", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("<range>", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText());
//RF Using Blocks //RF Using Blocks

View file

@ -75,6 +75,8 @@ public final class ItemCrafting{
public static IRecipe recipeLeafBlower; public static IRecipe recipeLeafBlower;
public static IRecipe recipeLeafBlowerAdvanced; public static IRecipe recipeLeafBlowerAdvanced;
public static IRecipe recipeChestToCrateUpgrade; public static IRecipe recipeChestToCrateUpgrade;
public static IRecipe recipeSmallToMediumCrateUpgrade;
public static IRecipe recipeMediumToLargeCrateUpgrade;
public static IRecipe recipeLaserWrench; public static IRecipe recipeLaserWrench;
public static IRecipe recipeDrillCore; public static IRecipe recipeDrillCore;
public static IRecipe recipeBlackDye; public static IRecipe recipeBlackDye;
@ -138,6 +140,18 @@ public final class ItemCrafting{
'C', new ItemStack(InitBlocks.blockGiantChest), 'C', new ItemStack(InitBlocks.blockGiantChest),
'W', "plankWood")); 'W', "plankWood"));
recipeChestToCrateUpgrade = RecipeUtil.lastIRecipe(); recipeChestToCrateUpgrade = RecipeUtil.lastIRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemSmallToMediumCrateUpgrade),
" W ", "WCW", " W ",
'C', new ItemStack(InitBlocks.blockGiantChestMedium),
'W', "plankWood"));
recipeSmallToMediumCrateUpgrade = RecipeUtil.lastIRecipe();
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMediumToLargeCrateUpgrade),
" W ", "WCW", " W ",
'C', new ItemStack(InitBlocks.blockGiantChestLarge),
'W', "plankWood"));
recipeMediumToLargeCrateUpgrade = RecipeUtil.lastIRecipe();
} }
//Disenchanting Lens //Disenchanting Lens

View file

@ -162,6 +162,8 @@ public class CreativeTab extends CreativeTabs{
this.add(InitItems.itemLaserWrench); this.add(InitItems.itemLaserWrench);
this.add(InitItems.itemCrateKeeper); this.add(InitItems.itemCrateKeeper);
this.add(InitItems.itemChestToCrateUpgrade); this.add(InitItems.itemChestToCrateUpgrade);
this.add(InitItems.itemSmallToMediumCrateUpgrade);
this.add(InitItems.itemMediumToLargeCrateUpgrade);
this.add(InitItems.itemSpawnerChanger); this.add(InitItems.itemSpawnerChanger);
this.add(InitItems.itemWaterBowl); this.add(InitItems.itemWaterBowl);

View file

@ -19,6 +19,8 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods;
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials; import de.ellpeck.actuallyadditions.mod.material.InitArmorMaterials;
import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials; import de.ellpeck.actuallyadditions.mod.material.InitToolMaterials;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChestMedium;
import de.ellpeck.actuallyadditions.mod.util.ModUtil; import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import de.ellpeck.actuallyadditions.mod.util.Util; import de.ellpeck.actuallyadditions.mod.util.Util;
import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil; import de.ellpeck.actuallyadditions.mod.util.compat.CompatUtil;
@ -29,6 +31,7 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntityChest;
public final class InitItems{ public final class InitItems{
@ -129,6 +132,8 @@ public final class InitItems{
public static Item itemWaterRemovalRing; public static Item itemWaterRemovalRing;
public static Item itemChestToCrateUpgrade; public static Item itemChestToCrateUpgrade;
public static Item itemSmallToMediumCrateUpgrade;
public static Item itemMediumToLargeCrateUpgrade;
public static Item itemCrateKeeper; public static Item itemCrateKeeper;
public static Item itemSpawnerChanger; public static Item itemSpawnerChanger;
@ -234,7 +239,9 @@ public final class InitItems{
itemCrystal = new ItemCrystal("itemCrystal", false); itemCrystal = new ItemCrystal("itemCrystal", false);
itemCrystalEmpowered = new ItemCrystal("itemCrystalEmpowered", true); itemCrystalEmpowered = new ItemCrystal("itemCrystalEmpowered", true);
itemLaserWrench = new ItemLaserWrench("itemLaserWrench"); itemLaserWrench = new ItemLaserWrench("itemLaserWrench");
itemChestToCrateUpgrade = new ItemChestToCrateUpgrade("itemChestToCrateUpgrade"); itemChestToCrateUpgrade = new ItemChestToCrateUpgrade("itemChestToCrateUpgrade", TileEntityChest.class, InitBlocks.blockGiantChest.getDefaultState());
itemSmallToMediumCrateUpgrade = new ItemChestToCrateUpgrade("itemSmallToMediumCrateUpgrade", TileEntityGiantChest.class, InitBlocks.blockGiantChestMedium.getDefaultState());
itemMediumToLargeCrateUpgrade = new ItemChestToCrateUpgrade("itemMediumToLargeCrateUpgrade", TileEntityGiantChestMedium.class, InitBlocks.blockGiantChestLarge.getDefaultState());
itemBooklet = new ItemBooklet("itemBooklet"); itemBooklet = new ItemBooklet("itemBooklet");
itemGrowthRing = new ItemGrowthRing("itemGrowthRing"); itemGrowthRing = new ItemGrowthRing("itemGrowthRing");
itemMagnetRing = new ItemMagnetRing("itemSuctionRing"); itemMagnetRing = new ItemMagnetRing("itemSuctionRing");

View file

@ -10,13 +10,16 @@
package de.ellpeck.actuallyadditions.mod.items; package de.ellpeck.actuallyadditions.mod.items;
import de.ellpeck.actuallyadditions.mod.blocks.BlockGiantChest;
import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks;
import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues; import de.ellpeck.actuallyadditions.mod.config.values.ConfigBoolValues;
import de.ellpeck.actuallyadditions.mod.items.base.ItemBase; import de.ellpeck.actuallyadditions.mod.items.base.ItemBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest; import de.ellpeck.actuallyadditions.mod.tile.TileEntityGiantChest;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockChest; import net.minecraft.block.BlockChest;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.EnumRarity; import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
@ -29,21 +32,24 @@ import net.minecraft.world.World;
public class ItemChestToCrateUpgrade extends ItemBase{ public class ItemChestToCrateUpgrade extends ItemBase{
public ItemChestToCrateUpgrade(String name){ private final Class<? extends IInventory> start;
super(name); private final IBlockState end;
}
public ItemChestToCrateUpgrade(String name, Class<? extends IInventory> start, IBlockState end){
super(name);
this.start = start;
this.end = end;
}
@Override @Override
public EnumActionResult onItemUse(ItemStack heldStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float par8, float par9, float par10){ public EnumActionResult onItemUse(ItemStack heldStack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float par8, float par9, float par10){
if(player.isSneaking()){ if(player.isSneaking()){
TileEntity tileHit = world.getTileEntity(pos); TileEntity tileHit = world.getTileEntity(pos);
Block block = world.getBlockState(pos).getBlock(); if(tileHit.getClass() == this.start){
if(block instanceof BlockChest && tileHit instanceof TileEntityChest){
if(!world.isRemote){ if(!world.isRemote){
TileEntityChest chest = (TileEntityChest)tileHit;
//Copy Slots //Copy Slots
IInventory chest = (IInventory)tileHit;
ItemStack[] stacks = new ItemStack[chest.getSizeInventory()]; ItemStack[] stacks = new ItemStack[chest.getSizeInventory()];
for(int i = 0; i < stacks.length; i++){ for(int i = 0; i < stacks.length; i++){
ItemStack aStack = chest.getStackInSlot(i); ItemStack aStack = chest.getStackInSlot(i);
@ -57,12 +63,12 @@ public class ItemChestToCrateUpgrade extends ItemBase{
if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){ if(!ConfigBoolValues.LESS_BLOCK_BREAKING_EFFECTS.isEnabled()){
world.playEvent(2001, pos, Block.getStateId(world.getBlockState(pos))); world.playEvent(2001, pos, Block.getStateId(world.getBlockState(pos)));
} }
world.setBlockState(pos, InitBlocks.blockGiantChest.getDefaultState(), 2); world.setBlockState(pos, this.end, 2);
//Copy Items into new Chest //Copy Items into new Chest
TileEntity newTileHit = world.getTileEntity(pos); TileEntity newTileHit = world.getTileEntity(pos);
if(newTileHit instanceof TileEntityGiantChest){ if(newTileHit instanceof IInventory){
TileEntityGiantChest newChest = (TileEntityGiantChest)newTileHit; IInventory newChest = (IInventory)newTileHit;
for(int i = 0; i < stacks.length; i++){ for(int i = 0; i < stacks.length; i++){
if(stacks[i] != null){ if(stacks[i] != null){
if(newChest.getSizeInventory() > i){ if(newChest.getSizeInventory() > i){

View file

@ -425,6 +425,8 @@ item.actuallyadditions.itemBooklet.name=Actually Additions Manual
item.actuallyadditions.itemRarmorModuleReconstructor.name=Reconstruction Module item.actuallyadditions.itemRarmorModuleReconstructor.name=Reconstruction Module
item.actuallyadditions.itemLaserWrench.name=Laser Wrench item.actuallyadditions.itemLaserWrench.name=Laser Wrench
item.actuallyadditions.itemChestToCrateUpgrade.name=Chest To Storage Crate Upgrade item.actuallyadditions.itemChestToCrateUpgrade.name=Chest To Storage Crate Upgrade
item.actuallyadditions.itemSmallToMediumCrateUpgrade.name=Small To Medium Storage Crate Upgrade
item.actuallyadditions.itemMediumToLargeCrateUpgrade.name=Medium To Large Storage Crate Upgrade
item.actuallyadditions.itemMiscDrillCore.name=Drill Core item.actuallyadditions.itemMiscDrillCore.name=Drill Core
item.actuallyadditions.itemMiscBlackDye.name=Black Dye item.actuallyadditions.itemMiscBlackDye.name=Black Dye
item.actuallyadditions.itemCrystalRed.name=Restonia Crystal item.actuallyadditions.itemCrystalRed.name=Restonia Crystal
@ -779,8 +781,10 @@ booklet.actuallyadditions.chapter.compost.text.3=<item>Bio-Mash<r> can be crafte
booklet.actuallyadditions.chapter.crate.name=Storage Crates 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.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 upon placing the Crate back down. 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.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.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.
booklet.actuallyadditions.chapter.coffeeMachine.name=Coffee Maker booklet.actuallyadditions.chapter.coffeeMachine.name=Coffee Maker
booklet.actuallyadditions.chapter.coffeeMachine.text.1=The <item>Coffee Maker<r> is a block used to make <item>Coffee<r>, a <imp>potion-like<r> item that gives the user several buffs. <n>To use the coffee maker, you need a <item>Empty Cup<r>, <coffee> <item>Coffee Beans<r>, which can be found in the wild, harvested and <imp>planted on farmland<r> again, <rf> RF/t and <water>mB of Water per cup brewed. <n>On the coffee maker recipe pages at the back, to see what the item does, just hover over the Cup of Coffee. booklet.actuallyadditions.chapter.coffeeMachine.text.1=The <item>Coffee Maker<r> is a block used to make <item>Coffee<r>, a <imp>potion-like<r> item that gives the user several buffs. <n>To use the coffee maker, you need a <item>Empty Cup<r>, <coffee> <item>Coffee Beans<r>, which can be found in the wild, harvested and <imp>planted on farmland<r> again, <rf> RF/t and <water>mB of Water per cup brewed. <n>On the coffee maker recipe pages at the back, to see what the item does, just hover over the Cup of Coffee.

View file

@ -0,0 +1,6 @@
{
"parent": "actuallyadditions:item/standardItem",
"textures": {
"layer0": "actuallyadditions:items/itemMediumToLargeCrateUpgrade"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "actuallyadditions:item/standardItem",
"textures": {
"layer0": "actuallyadditions:items/itemSmallToMediumCrateUpgrade"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B