diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java index 05930161b..e3cfe2fc8 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java @@ -73,10 +73,11 @@ public class InitBooklet{ new BookletChapter("fishingNet", entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); 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("crate", entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, ItemCrafting.recipeChestToCrateUpgrade)); 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 BookletChapter("laserRelays", entryFunctionalRF, new ItemStack(InitBlocks.blockLaserRelay), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.LASER_RELAY_MAX_DISTANCE.getValue()).addTextReplacement("", ConfigIntValues.LASER_RELAY_LOSS.getValue()), new PageCrafting(2, BlockCrafting.recipeLaserRelay).setNoText(), new PageCrafting(3, ItemCrafting.recipeLaserWrench).setNoText()).setImportant(); 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()).setImportant(); new BookletChapter("crusher", entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.GRINDER_ENERGY_USED.getValue()).addTextReplacement("", ConfigIntValues.GRINDER_DOUBLE_ENERGY_USED.getValue()), new PageCrafting(2, BlockCrafting.recipeCrusher).setNoText(), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setNoText(), new PageCrusherRecipe(4, CrusherCrafting.recipeSugar).setNoText(), new PageCrusherRecipe(5, CrusherCrafting.recipeIronHorseArmor).setNoText(), new PageCrusherRecipe(6, CrusherCrafting.recipeGoldHorseArmor).setNoText(), new PageCrusherRecipe(7, CrusherCrafting.recipeDiamondHorseArmor).setNoText()); new BookletChapter("furnaceDouble", entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble), new PageCrafting(1, BlockCrafting.recipeFurnace).addTextReplacement("", ConfigIntValues.FURNACE_ENERGY_USED.getValue())); diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java index 0ee5a67ae..10d447ee9 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java @@ -152,7 +152,11 @@ public enum ConfigCrafting{ WATER_RING("Water Ring", ConfigCategories.ITEMS_CRAFTING), GROWTH_RING("Growth Ring", ConfigCategories.ITEMS_CRAFTING), DIRECTIONAL_BREAKER("Long-Range Breaker", ConfigCategories.BLOCKS_CRAFTING), - RANGED_COLLECTOR("Ranged Collector", ConfigCategories.BLOCKS_CRAFTING); + RANGED_COLLECTOR("Ranged Collector", ConfigCategories.BLOCKS_CRAFTING), + LASER_RELAY("Laser Relay", ConfigCategories.BLOCKS_CRAFTING), + LASER_WRENCH("Laser Wrench", ConfigCategories.ITEMS_CRAFTING), + + CHEST_TO_CRATE_UPGRADE("Chest To Crate Upgrade", ConfigCategories.ITEMS_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 c59cf00b5..be7ebf943 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -171,7 +171,10 @@ public enum ConfigIntValues{ 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"), - RANGED_COLLECTOR_RANGE("Ranged Collector: Range", ConfigCategories.MACHINE_VALUES, 6, 1, 30, "The range of the Ranged Collector"); + RANGED_COLLECTOR_RANGE("Ranged Collector: Range", ConfigCategories.MACHINE_VALUES, 6, 1, 30, "The range of the Ranged Collector"), + + LASER_RELAY_LOSS("Laser Relay: Loss", ConfigCategories.MACHINE_VALUES, 5, 0, 80, "The Energy Loss of the Laser Relay per Transfer in Percent"), + LASER_RELAY_MAX_DISTANCE("Laser Relay: Max Distance", ConfigCategories.MACHINE_VALUES, 10, 3, 80, "The max distance between two connected Laser Relays"); 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 65087c57b..405b1fb02 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -77,9 +77,20 @@ public class BlockCrafting{ public static IRecipe recipeDirectionalBreaker; public static IRecipe recipeDropper; public static IRecipe recipeRangedCollector; + public static IRecipe recipeLaserRelay; public static void init(){ + //Laser Relay + if(ConfigCrafting.LASER_RELAY.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLaserRelay), + "ORO", "RCR", "ORO", + 'O', new ItemStack(Blocks.obsidian), + 'R', new ItemStack(Items.redstone), + 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); + recipeLaserRelay = Util.GetRecipes.lastIRecipe(); + } + //Ranged Collector if(ConfigCrafting.RANGED_COLLECTOR.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockRangedCollector), diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java index d4fd0c062..410d1cc48 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java @@ -71,6 +71,8 @@ public class ItemCrafting{ public static IRecipe recipeLeafBlower; public static IRecipe recipeLeafBlowerAdvanced; public static ArrayList recipesPotionRings = new ArrayList(); + public static IRecipe recipeChestToCrateUpgrade; + public static IRecipe recipeLaserWrench; public static void init(){ @@ -82,6 +84,24 @@ public class ItemCrafting{ GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemLaserWrench), new ItemStack(InitItems.itemLaserWrench)); GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemPhantomConnector), new ItemStack(InitItems.itemPhantomConnector)); + //Chest To Crate Upgrade + if(ConfigCrafting.CHEST_TO_CRATE_UPGRADE.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemChestToCrateUpgrade), + "CWC", "WWW", "CWC", + 'C', new ItemStack(Blocks.chest), + 'W', "plankWood")); + recipeChestToCrateUpgrade = Util.GetRecipes.lastIRecipe(); + } + + //Laser Wrench + if(ConfigCrafting.LASER_WRENCH.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLaserWrench), + "C ", " S ", " S", + 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), + 'S', "ingotIron")); + recipeLaserWrench = Util.GetRecipes.lastIRecipe(); + } + //Rice Stuff if(ConfigCrafting.RICE_GADGETS.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Items.paper, 3), diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemChestToCrateUpgrade.java b/src/main/java/ellpeck/actuallyadditions/items/ItemChestToCrateUpgrade.java index 55c5b3980..f984d0886 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemChestToCrateUpgrade.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemChestToCrateUpgrade.java @@ -16,6 +16,7 @@ import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.tile.TileEntityGiantChest; import ellpeck.actuallyadditions.util.IActAddItemOrBlock; import ellpeck.actuallyadditions.util.ModUtil; +import net.minecraft.block.Block; import net.minecraft.block.BlockChest; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -48,6 +49,7 @@ public class ItemChestToCrateUpgrade extends Item implements IActAddItemOrBlock{ } //Set New Block + world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(world.getBlock(x, y, z))+(world.getBlockMetadata(x, y, z) << 12)); world.setBlock(x, y, z, InitBlocks.blockGiantChest, 0, 2); //Copy Items into new Chest diff --git a/src/main/java/ellpeck/actuallyadditions/misc/LaserRelayConnectionHandler.java b/src/main/java/ellpeck/actuallyadditions/misc/LaserRelayConnectionHandler.java index 37d3823ec..43173472c 100644 --- a/src/main/java/ellpeck/actuallyadditions/misc/LaserRelayConnectionHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/misc/LaserRelayConnectionHandler.java @@ -11,6 +11,7 @@ package ellpeck.actuallyadditions.misc; import cofh.api.energy.IEnergyReceiver; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.tile.TileEntityLaserRelay; import ellpeck.actuallyadditions.util.WorldPos; import ellpeck.actuallyadditions.util.WorldUtil; @@ -19,7 +20,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import java.util.ArrayList; -import java.util.Iterator; public class LaserRelayConnectionHandler{ @@ -84,20 +84,12 @@ public class LaserRelayConnectionHandler{ public void removeRelayFromNetwork(WorldPos relay){ ArrayList network = this.getNetworkFor(relay); if(network != null){ - //Remove the relay from the network - Iterator iterator = network.iterator(); - while(iterator.hasNext()){ - ConnectionPair next = iterator.next(); - if(next.contains(relay)){ - iterator.remove(); - //System.out.println("Removed "+relay.toString()+" from Network "+network.toString()); - } - } - //Setup new network (so that splitting a network will cause it to break into two) this.networks.remove(network); for(ConnectionPair pair : network){ - this.addConnection(pair.firstRelay, pair.secondRelay); + if(!pair.contains(relay)){ + this.addConnection(pair.firstRelay, pair.secondRelay); + } } } WorldData.makeDirty(); @@ -123,7 +115,7 @@ public class LaserRelayConnectionHandler{ */ public boolean addConnection(WorldPos firstRelay, WorldPos secondRelay){ int distance = (int)firstRelay.toVec().distanceTo(secondRelay.toVec()); - if(distance > 15 || firstRelay.isEqual(secondRelay) || firstRelay.getWorld() != secondRelay.getWorld()){ + if(distance > ConfigIntValues.LASER_RELAY_MAX_DISTANCE.getValue() || firstRelay.isEqual(secondRelay) || firstRelay.getWorld() != secondRelay.getWorld()){ return false; } @@ -188,8 +180,13 @@ public class LaserRelayConnectionHandler{ if(tile instanceof IEnergyReceiver && !(tile instanceof TileEntityLaserRelay)){ IEnergyReceiver receiver = (IEnergyReceiver)tile; if(receiver.canConnectEnergy(side.getOpposite())){ - //Transfer the energy - transmitted += ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), maxTransfer-transmitted, simulate); + //Transfer the energy (with the energy loss!) + int theoreticalReceived = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), maxTransfer-transmitted, true); + //The amount of energy lost during a transfer + int deduct = (int)(theoreticalReceived*((double)ConfigIntValues.LASER_RELAY_LOSS.getValue()/100)); + + transmitted+=((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), theoreticalReceived-deduct, simulate); + transmitted+=deduct; } } } diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 4d9a3b662..7592c6447 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -105,6 +105,7 @@ 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 +tile.actuallyadditions.blockLaserRelay.name=Laser Relay #ESD tile.actuallyadditions.blockInputter.name=ESD @@ -276,6 +277,8 @@ item.actuallyadditions.itemChestQuartz.name=Black Quartz Chestplate item.actuallyadditions.itemPantsQuartz.name=Black Quartz Pants item.actuallyadditions.itemBootsQuartz.name=Black Quartz Boots item.actuallyadditions.itemBooklet.name=Actually Additions Manual +item.actuallyadditions.itemLaserWrench.name=Laser Wrench +item.actuallyadditions.itemChestToCrateUpgrade.name=Chest To Storage Crate Upgrade #Tooltips tooltip.actuallyadditions.onSuffix.desc=On @@ -483,6 +486,7 @@ booklet.actuallyadditions.chapter.compost.text.3=Mashed Food can be cra booklet.actuallyadditions.chapter.crate.name=Storage Crates booklet.actuallyadditions.chapter.crate.text.1=Storage Crates are big. Really big. They hold tons of items, more than 4 chests worth of them. "F-in' gigantic" -Some Magazine +booklet.actuallyadditions.chapter.crate.text.2=The Chest To Storage Crate Upgrade allows you to convert any chest into a Storage Crate, retaining its items! Just shift-right-click onto the chest to apply it. booklet.actuallyadditions.chapter.coffeeMachine.name=Coffee Machine booklet.actuallyadditions.chapter.coffeeMachine.text.1=The Coffee Machine is a block used to make Coffee, a potion-like item that gives the user several buffs. To use the coffee machine, you need a Empty Cup, Coffee Beans, which can be found in the wild, harvested and planted on farmland again, RF/t and mB of Water per cup brewed. On the coffee machine recipe pages at the back, to see what the item does, just hover over the Cup of Coffee. @@ -572,4 +576,7 @@ 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. booklet.actuallyadditions.chapter.hairBalls.name=Ball of Fur-s -booklet.actuallyadditions.chapter.hairBalls.text.1=Balls of Fur are an item rarely dropped by cats which have been tamed by the player. Cats are very mysterious creatures as they appear to get everything stuck in their fur. Balls of Fur may seem disgusting at first, but when removing all of the hair by right-clicking, they will reveal some valuable items. Or just some String. FUURRRRRR!! \ No newline at end of file +booklet.actuallyadditions.chapter.hairBalls.text.1=Balls of Fur are an item rarely dropped by cats which have been tamed by the player. Cats are very mysterious creatures as they appear to get everything stuck in their fur. Balls of Fur may seem disgusting at first, but when removing all of the hair by right-clicking, they will reveal some valuable items. Or just some String. FUURRRRRR!! + +booklet.actuallyadditions.chapter.laserRelays.name=Laser Relays +booklet.actuallyadditions.chapter.laserRelays.text.1=The Laser Relay is a block that can wirelessly transfer RF just by being connected with a Laser Wrench, generating a network. When placing a Power Generator or Receiver next to the relay, it can receive Power from any other relay in the network. Two relays can be at most blocks apart. During an energy transfer, they have an Energy Loss of %. \ No newline at end of file