diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java index 3c26ee6ab..76d8bbaba 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java @@ -356,6 +356,7 @@ public class GuiBooklet extends GuiScreen{ this.searchField = new GuiTextField(this.fontRendererObj, guiLeft+148, guiTop+162, 66, 10); this.searchField.setMaxStringLength(30); this.searchField.setEnableBackgroundDrawing(false); + this.searchField.setCanLoseFocus(false); this.currentPage = null; this.currentChapter = null; @@ -458,9 +459,9 @@ public class GuiBooklet extends GuiScreen{ @SuppressWarnings("unchecked") public void openIndexEntry(BookletIndexEntry entry, int page, boolean resetTextField){ + this.searchField.setVisible(entry instanceof BookletEntryAllSearch); + this.searchField.setFocused(entry instanceof BookletEntryAllSearch); if(resetTextField){ - this.searchField.setVisible(entry instanceof BookletEntryAllSearch); - this.searchField.setFocused(entry instanceof BookletEntryAllSearch); this.searchField.setText(""); if(entry instanceof BookletEntryAllSearch){ entry.chapters = (ArrayList)((BookletEntryAllSearch)entry).allChapters.clone(); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java index 909a606b8..ae17dda8a 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java @@ -71,6 +71,7 @@ public class InitBooklet{ new BookletChapter("feeder", entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); new BookletChapter("compost", entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemFertilizer)).addTextReplacement("", ConfigIntValues.COMPOST_AMOUNT.getValue()), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageCrafting(3, ItemCrafting.recipesMashedFood)); new BookletChapter("crate", entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate)); + new BookletChapter("rangedCollector", entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.RANGED_COLLECTOR_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); //RF Using Blocks new BookletChapterCoffee("coffeeMachine", entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("", ConfigIntValues.COFFEE_MACHINE_ENERGY_USED.getValue()).addTextReplacement("", ConfigIntValues.COFFEE_CACHE_USED_PER_ITEM.getValue()).addTextReplacement("", ConfigIntValues.COFFEE_MACHINE_WATER_USED.getValue()), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemCoffee)), new PageCrafting(3, BlockCrafting.recipeCoffeeMachine).setNoText(), new PageCrafting(4, ItemCrafting.recipeCup).setNoText()); diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java index 04b4cac1e..bed3e123e 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java @@ -150,7 +150,8 @@ public enum ConfigCrafting{ MAGNET_RING("Magnet Ring", ConfigCategories.ITEMS_CRAFTING), WATER_RING("Water Ring", ConfigCategories.ITEMS_CRAFTING), GROWTH_RING("Growth Ring", ConfigCategories.ITEMS_CRAFTING), - DIRECTIONAL_BREAKER("Long-Range Breaker", ConfigCategories.BLOCKS_CRAFTING); + DIRECTIONAL_BREAKER("Long-Range Breaker", ConfigCategories.BLOCKS_CRAFTING), + RANGED_COLLECTOR("Ranged Collector", ConfigCategories.BLOCKS_CRAFTING); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index 78b394769..6bc86df7a 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -167,7 +167,9 @@ public enum ConfigIntValues{ LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 7, 1, 100, "The radius of a leaf generator"), DIRECTIONAL_BREAKER_RF_PER_BLOCK("Directional Breaker: RF per Block", ConfigCategories.MACHINE_VALUES, 5, 0, 1000, "The amount of RF the Directional Breaker uses to break each block"), - DIRECTIONAL_BREAKER_RANGE("Directional Breaker: Range", ConfigCategories.MACHINE_VALUES, 8, 1, 1000, "The range of the Directional Breaker"); + DIRECTIONAL_BREAKER_RANGE("Directional Breaker: Range", ConfigCategories.MACHINE_VALUES, 8, 1, 1000, "The range of the Directional Breaker"), + + RANGED_COLLECTOR_RANGE("Ranged Collector: Range", ConfigCategories.MACHINE_VALUES, 6, 1, 30, "The range of the Ranged Collector"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index 580e30a4c..65087c57b 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -76,9 +76,20 @@ public class BlockCrafting{ public static IRecipe recipeLeafGen; public static IRecipe recipeDirectionalBreaker; public static IRecipe recipeDropper; + public static IRecipe recipeRangedCollector; public static void init(){ + //Ranged Collector + if(ConfigCrafting.RANGED_COLLECTOR.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockRangedCollector), + "EHE", " C ", + 'E', new ItemStack(Items.ender_pearl), + 'H', new ItemStack(Blocks.hopper), + 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()))); + recipeRangedCollector = Util.GetRecipes.lastIRecipe(); + } + //Directional Breaker if(ConfigCrafting.DIRECTIONAL_BREAKER.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockDirectionalBreaker), diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index eecf2f30d..ef045fffa 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -82,6 +82,7 @@ public class CreativeTab extends CreativeTabs{ add(InitBlocks.blockFishingNet); add(InitBlocks.blockBreaker); add(InitBlocks.blockDirectionalBreaker); + add(InitBlocks.blockRangedCollector); add(InitBlocks.blockPlacer); add(InitBlocks.blockDropper); add(InitBlocks.blockFluidPlacer); diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityRangedCollector.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityRangedCollector.java index 417cab370..cc8175fd7 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityRangedCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityRangedCollector.java @@ -10,6 +10,7 @@ package ellpeck.actuallyadditions.tile; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.network.gui.IButtonReactor; import ellpeck.actuallyadditions.network.sync.IPacketSyncerToClient; import ellpeck.actuallyadditions.network.sync.PacketSyncerToClient; @@ -38,11 +39,11 @@ public class TileEntityRangedCollector extends TileEntityInventoryBase implement public void updateEntity(){ if(!worldObj.isRemote){ if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ - int range = 8; + int range = ConfigIntValues.RANGED_COLLECTOR_RANGE.getValue(); ArrayList items = (ArrayList)this.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(this.xCoord-range, this.yCoord-range, this.zCoord-range, this.xCoord+range, this.yCoord+range, this.zCoord+range)); if(!items.isEmpty()){ for(EntityItem item : items){ - if(item.getEntityItem() != null){ + if(!item.isDead && item.getEntityItem() != null){ ItemStack toAdd = item.getEntityItem().copy(); if(this.checkFilter(toAdd)){ ArrayList checkList = new ArrayList(); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index e3c7014ee..47274a64b 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -104,6 +104,7 @@ tile.actuallyadditions.blockXPSolidifier.name=Experience Solidifier tile.actuallyadditions.blockSmileyCloud.name=Smiley Cloud tile.actuallyadditions.blockLeafGenerator.name=Leaf-Eating Generator tile.actuallyadditions.blockDirectionalBreaker.name=Long-Range Breaker +tile.actuallyadditions.blockRangedCollector.name=Ranged Collector #ESD tile.actuallyadditions.blockInputter.name=ESD @@ -350,6 +351,7 @@ container.actuallyadditions.xpSolidifier.name=Experience Solidifier container.actuallyadditions.oreMagnet.name=Magnetic Miner container.actuallyadditions.cloud.name=Smiley Cloud container.actuallyadditions.directionalBreaker.name=Long-Range Breaker +container.actuallyadditions.rangedCollector.name=Ranged Collector #Update Information info.actuallyadditions.update.generic.desc=[{"text":"There is an "},{"text":"Update ","bold":"true"},{"text":"for ","bold":"false"},{"text":"Actually Additions ","color":"dark_green","bold":"true"},{"text":"available!","color":"none","bold":"false"}] @@ -551,4 +553,7 @@ booklet.actuallyadditions.chapter.longRangeBreaker.text.1=The Long-Range B booklet.actuallyadditions.chapter.longRangeBreaker.text.2=Sequence Breaking booklet.actuallyadditions.chapter.dropper.name=Automatic Precision Dropper -booklet.actuallyadditions.chapter.dropper.text.1=The Automatic Precision Dropper works much like a normal dropper, but it will drop items without needing a Redstone Signal. It also won't spit them out all over the ground, but it will drop them straight into the direction you point it at! It can be turned off with a Redstone Signal. \ No newline at end of file +booklet.actuallyadditions.chapter.dropper.text.1=The Automatic Precision Dropper works much like a normal dropper, but it will drop items without needing a Redstone Signal. It also won't spit them out all over the ground, but it will drop them straight into the direction you point it at! It can be turned off with a Redstone Signal. + +booklet.actuallyadditions.chapter.rangedCollector.name=Ranged Collector +booklet.actuallyadditions.chapter.rangedCollector.text.1=The Ranged Collector works much like a hopper, in that it collects items around it, having the power, however, to pick up items that are in an area of blocks around it. It has a filter that can be set to white- or blacklist. This comes with a disadvantage, however: It doesn't auto-output its items. \ No newline at end of file