From 015e5121e202368a82f88754913c7255cb00bd05 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 11 Sep 2016 13:33:47 +0200 Subject: [PATCH] item distributor recipe and doc --- .../mod/blocks/BlockDistributorItem.java | 6 +++++ .../mod/booklet/InitBooklet.java | 3 ++- .../mod/config/values/ConfigCrafting.java | 25 ++----------------- .../mod/crafting/BlockCrafting.java | 11 ++++++++ .../mod/tile/TileEntityDistributorItem.java | 4 +-- .../assets/actuallyadditions/lang/en_US.lang | 6 ++++- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java index f23a264fd..10b7d31f7 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockDistributorItem.java @@ -21,6 +21,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; @@ -68,4 +69,9 @@ public class BlockDistributorItem extends BlockContainerBase implements IHudDisp minecraft.fontRendererObj.drawStringWithShadow(TextFormatting.YELLOW+""+TextFormatting.ITALIC+strg, resolution.getScaledWidth()/2+35, resolution.getScaledHeight()/2-15, StringUtil.DECIMAL_COLOR_WHITE); } } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.UNCOMMON; + } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index c6df1177b..fd929be48 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -125,7 +125,8 @@ public final class InitBooklet{ new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomRedstoneface), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText()); new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText()); new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); - new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setSpecial(); + new BookletChapter("distributorItem", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockDistributorItem), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDistributorItem).setNoText()).setSpecial(); + new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).setStacks(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setImportant(); new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); 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()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java index de0f6bb47..7a523a231 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/values/ConfigCrafting.java @@ -29,13 +29,11 @@ public enum ConfigCrafting{ DOUBLE_FURNACE("Double Furnace", ConfigCategories.BLOCKS_CRAFTING), FEEDER("Feeder", ConfigCategories.BLOCKS_CRAFTING), GIANT_CHEST("Storage Crate", ConfigCategories.BLOCKS_CRAFTING), - GREENHOUSE_GLASS("Greenhouse Glass", ConfigCategories.BLOCKS_CRAFTING), BREAKER("Breaker", ConfigCategories.BLOCKS_CRAFTING), PLACER("Placer", ConfigCategories.BLOCKS_CRAFTING), DROPPER("Dropper", ConfigCategories.BLOCKS_CRAFTING), SPEED_UPGRADE("Speed Upgrade", ConfigCategories.BLOCKS_CRAFTING), - BAGUETTE("Baguette", ConfigCategories.FOOD_CRAFTING), PIZZA("Pizza", ConfigCategories.FOOD_CRAFTING), HAMBURGER("Hamburger", ConfigCategories.FOOD_CRAFTING), @@ -53,7 +51,6 @@ public enum ConfigCrafting{ CHOCOLATE_CAKE("Chocolate Cake", ConfigCategories.FOOD_CRAFTING), TOAST("Toast", ConfigCategories.FOOD_CRAFTING), CHOCOLATE_TOAST("Chocolate Toast", ConfigCategories.FOOD_CRAFTING), - LEAF_BLOWER("Leaf Blower", ConfigCategories.ITEMS_CRAFTING), LEAF_BLOWER_ADVANCED("Advanced Leaf Blower", ConfigCategories.ITEMS_CRAFTING), COIL("Coil", ConfigCategories.ITEMS_CRAFTING), @@ -62,7 +59,6 @@ public enum ConfigCrafting{ STICK_CRAFTER("Crafting Table On A Stick", ConfigCategories.ITEMS_CRAFTING), MASHED_FOOD("Mashed Food", ConfigCategories.ITEMS_CRAFTING), RARMOR_RECONSTRUCTOR_MODULE("Rarmor Reconstructor Module", ConfigCategories.ITEMS_CRAFTING), - RING_SPEED("Speed Ring", ConfigCategories.POTION_RING_CRAFTING), RING_HASTE("Haste Ring", ConfigCategories.POTION_RING_CRAFTING), RING_STRENGTH("Strength Ring", ConfigCategories.POTION_RING_CRAFTING), @@ -73,12 +69,10 @@ public enum ConfigCrafting{ RING_WATER_BREATHING("Water Breathing Ring", ConfigCategories.POTION_RING_CRAFTING), RING_INVISIBILITY("Invisibility Ring", ConfigCategories.POTION_RING_CRAFTING), RING_NIGHT_VISION("Night Vision Ring", ConfigCategories.POTION_RING_CRAFTING), - DOUGH("Dough", ConfigCategories.ITEMS_CRAFTING), PAPER_CONE("Paper Cone", ConfigCategories.ITEMS_CRAFTING), KNIFE_HANDLE("Knife Handle", ConfigCategories.ITEMS_CRAFTING), KNIFE_BLADE("Knife Blade", ConfigCategories.ITEMS_CRAFTING), - TOOL_EMERALD("Emerald Tools", ConfigCategories.ITEMS_CRAFTING), TOOL_OBSIDIAN("Obsidian Tools", ConfigCategories.ITEMS_CRAFTING), TOOL_QUARTZ("Quartz Tools", ConfigCategories.ITEMS_CRAFTING), @@ -86,10 +80,8 @@ public enum ConfigCrafting{ RICE_BREAD("Rice Bread", ConfigCategories.FOOD_CRAFTING), RICE_DOUGH("Rice Dough", ConfigCategories.FOOD_CRAFTING), BACON("Bacon", ConfigCategories.FOOD_CRAFTING), - RICE_GADGETS("Rice Gadgets", ConfigCategories.ITEMS_CRAFTING), RESONANT_RICE("Resonant Rice", ConfigCategories.ITEMS_CRAFTING), - CANOLA_PRESS("Canola Press", ConfigCategories.BLOCKS_CRAFTING), FERMENTING_BARREL("Fermenting Barrel", ConfigCategories.BLOCKS_CRAFTING), COAL_GENERATOR("Coal Generator", ConfigCategories.BLOCKS_CRAFTING), @@ -99,7 +91,6 @@ public enum ConfigCrafting{ PHANTOM_CONNECTOR("Phantom Connector", ConfigCategories.ITEMS_CRAFTING), PLAYER_INTERFACE("Player Interface", ConfigCategories.BLOCKS_CRAFTING), PLAYER_PROBE("Player Probe", ConfigCategories.ITEMS_CRAFTING), - PHANTOM_ENERGYFACE("Phantom Energyface", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_REDSTONEFACE("Phantom Redstoneface", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_LIQUIFACE("Phantom Liquiface", ConfigCategories.BLOCKS_CRAFTING), @@ -107,16 +98,12 @@ public enum ConfigCrafting{ PHANTOM_BREAKER("Phantom Breaker", ConfigCategories.BLOCKS_CRAFTING), LIQUID_PLACER("Liquid Placer", ConfigCategories.BLOCKS_CRAFTING), LIQUID_BREAKER("Liquid Collector", ConfigCategories.BLOCKS_CRAFTING), - CUP("Cup", ConfigCategories.ITEMS_CRAFTING), PAXELS("Paxels", ConfigCategories.ITEMS_CRAFTING), - - ENDER_CASING("Ender Casing", ConfigCategories.BLOCKS_CRAFTING), PHANTOM_BOOSTER("Phantom Booster", ConfigCategories.BLOCKS_CRAFTING), COFFEE_MACHINE("Coffee Machine", ConfigCategories.BLOCKS_CRAFTING), LAVA_FACTORY("Lava Factory", ConfigCategories.BLOCKS_CRAFTING), - DRILL("Drill", ConfigCategories.ITEMS_CRAFTING), DRILL_SPEED("Drill Speed Upgrades", ConfigCategories.ITEMS_CRAFTING), DRILL_FORTUNE("Drill Fortune Upgrades", ConfigCategories.ITEMS_CRAFTING), @@ -129,21 +116,15 @@ public enum ConfigCrafting{ QUADRUPLE_BATTERY("Quadruple Battery", ConfigCategories.ITEMS_CRAFTING), QUINTUPLE_BATTERY("Quintuple Battery", ConfigCategories.ITEMS_CRAFTING), BAT_WINGS("Wings Of The Bats", ConfigCategories.ITEMS_CRAFTING), - ENERGIZER("Energizer", ConfigCategories.BLOCKS_CRAFTING), ENERVATOR("Enervator", ConfigCategories.BLOCKS_CRAFTING), - QUARTZ("Black Quartz in a Crafting Table", ConfigCategories.ITEMS_CRAFTING), LAMPS("Lamps", ConfigCategories.BLOCKS_CRAFTING), - HORSE_ARMORS("Horse Armor -> Raw Materials (Crusher)", ConfigCategories.OTHER), - RECONSTRUCTOR_MISC("Misc. Recipes like Soul Sand (Reconstructor)", ConfigCategories.OTHER), RECONSTRUCTOR_EXPLOSION_LENS("Lens of Detonation (Reconstructor)", ConfigCategories.OTHER), - TELE_STAFF("Tele Staff", ConfigCategories.ITEMS_CRAFTING), CASING("Casing", ConfigCategories.BLOCKS_CRAFTING), - MAGNET_RING("Magnet Ring", ConfigCategories.ITEMS_CRAFTING), WATER_RING("Water Ring", ConfigCategories.ITEMS_CRAFTING), GROWTH_RING("Growth Ring", ConfigCategories.ITEMS_CRAFTING), @@ -154,7 +135,6 @@ public enum ConfigCrafting{ LASER_RELAY_ITEM_WHITELIST("Advanced Item Laser Relay", ConfigCategories.BLOCKS_CRAFTING), LASER_WRENCH("Laser Wrench", ConfigCategories.ITEMS_CRAFTING), LASER_RELAY_FLUIDS("Fluid Laser Relay", ConfigCategories.BLOCKS_CRAFTING), - CHEST_TO_CRATE_UPGRADE("Chest To Crate Upgrade", ConfigCategories.ITEMS_CRAFTING), DISENCHANTING_LENS("Disenchanting Lens", ConfigCategories.ITEMS_CRAFTING), CRATE_KEEPER("Crate Keeper", ConfigCategories.ITEMS_CRAFTING), @@ -168,13 +148,12 @@ public enum ConfigCrafting{ ITEM_INTERFACE("Item Interface", ConfigCategories.BLOCKS_CRAFTING), DISPLAY_STAND("Display Stand", ConfigCategories.BLOCKS_CRAFTING), FILTER("Item Filter", ConfigCategories.ITEMS_CRAFTING), - CHARCOAL_BLOCK("Charcoal Block", ConfigCategories.BLOCKS_CRAFTING), TINY_COAL("Tiny Coal", ConfigCategories.ITEMS_CRAFTING), - BAG("Bag", ConfigCategories.ITEMS_CRAFTING), VOID_BAG("Void Bag", ConfigCategories.ITEMS_CRAFTING), - EMPOWERER("Empowerer", ConfigCategories.BLOCKS_CRAFTING); + EMPOWERER("Empowerer", ConfigCategories.BLOCKS_CRAFTING), + DISTRIBUTOR_ITEM("Item Distributor", ConfigCategories.BLOCKS_CRAFTING); public final String name; public final String category; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java index 8c90493ea..15fb578e5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/crafting/BlockCrafting.java @@ -96,6 +96,7 @@ public final class BlockCrafting{ public static IRecipe recipeEmpowerer; public static IRecipe[] recipesTinyTorch = new IRecipe[2]; public static IRecipe recipeFluidLaser; + public static IRecipe recipeDistributorItem; public static void init(){ @@ -134,6 +135,16 @@ public final class BlockCrafting{ recipeFireworkBox = RecipeUtil.lastIRecipe(); } + //Item Distributor + if(ConfigCrafting.DISTRIBUTOR_ITEM.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockDistributorItem), + "WHW", "HCH", "WHW", + 'W', "plankWood", + 'H', new ItemStack(Blocks.HOPPER), + 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()))); + recipeDistributorItem = RecipeUtil.lastIRecipe(); + } + //Shock Suppressor if(ConfigCrafting.SHOCK_SUPPRESSOR.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockShockSuppressor), diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java index b2d479fd2..f1aeabd93 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityDistributorItem.java @@ -41,9 +41,9 @@ public class TileEntityDistributorItem extends TileEntityInventoryBase{ if(handlerUp != null){ for(int i = 0; i < handlerUp.getSlots(); i++){ - ItemStack pullable = handlerUp.extractItem(i, Integer.MAX_VALUE, true); + ItemStack pullable = handlerUp.extractItem(i, 1, true); if(pullable != null && (this.slots[0] == null || ItemUtil.canBeStacked(this.slots[0], pullable))){ - ItemStack pulled = handlerUp.extractItem(i, this.slots[0] != null ? this.slots[0].getMaxStackSize()-this.slots[0].stackSize : Integer.MAX_VALUE, false); + ItemStack pulled = handlerUp.extractItem(i, 1, false); if(pulled != null){ if(this.slots[0] == null){ this.slots[0] = pulled.copy(); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index b93b7a28d..366b1d52a 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -227,6 +227,7 @@ tile.actuallyadditions.blockDisplayStand.name=Display Stand tile.actuallyadditions.blockShockSuppressor.name=Shock Absorber tile.actuallyadditions.blockTinyTorch.name=Tiny Torch tile.actuallyadditions.blockEmpowerer.name=Empowerer +tile.actuallyadditions.blockDistributorItem.name=Item Distributor #ESD tile.actuallyadditions.blockInputter.name=ESD @@ -1016,4 +1017,7 @@ booklet.actuallyadditions.chapter.empowerer.text.3=Because every mod booklet.actuallyadditions.chapter.empowerer.text.4=The Display Stand can also be used for other things! See the Blocks that use RF section for more info about it! booklet.actuallyadditions.chapter.fluidLaser.name=Fluid Laser Relays -booklet.actuallyadditions.chapter.fluidLaser.text.1=The Fluid Laser Relays work much in the same way that normal Laser Relays do, so if you want to know anything about them, visit the Blocks that use RF section of the manual. The thing that makes the Fluid Laser Relay different from the Energy Laser Relay, however, is that it transfers fluids from internal tanks of blocks into other blocks. \ No newline at end of file +booklet.actuallyadditions.chapter.fluidLaser.text.1=The Fluid Laser Relays work much in the same way that normal Laser Relays do, so if you want to know anything about them, visit the Blocks that use RF section of the manual. The thing that makes the Fluid Laser Relay different from the Energy Laser Relay, however, is that it transfers fluids from internal tanks of blocks into other blocks. + +booklet.actuallyadditions.chapter.distributorItem.name=Item Distributor +booklet.actuallyadditions.chapter.distributorItem.text.1=The Item Distributor is a simple way to split up items and make them go in different directions. The distributor will pull items into it from the top by itself, and then split them up and put them out into inventories connected to all of the other sides of it. It tries to do split the items equally, however this works best when inputting one item at a time, which its pulling feature does automatically. \ No newline at end of file